import{e as k,r as B,Z as C,n as u,g as n,p as g,bT as I,B as p,w as S,Q as q,R as x,q as A,bU as D,C as N,aq as W,U as P,j as b,k as v,f,V as _,W as w,aO as V,aJ as E,aK as K}from"./jwt-decode.esm-cMnpfgdw.js";import{S as L}from"./Steps-BJ0hIXfk.js";import{W as $}from"./PlayerConfigProvider-CJ7b86m4.js";import"./index-C0olcWg6.js";import"./colorHelpers-CPrTu2hh.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="fa5aeb02-973d-4909-a60f-2aa5d83a9b21",t._sentryDebugIdIdentifier="sentry-dbid-fa5aeb02-973d-4909-a60f-2aa5d83a9b21")}catch{}})();const F=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:a}){const d=t,i=B(null);C(()=>{i.value&&d.action.setElement(i.value)});const l=a;return(m,o)=>(n(),u(g(I),null,{default:p(()=>[S(g(N),{ref_key:"element",ref:i,class:A(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=c=>l("click")),onKeydown:o[1]||(o[1]=D(c=>l("click"),["enter"]))},{default:p(()=>[q(x(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),O=W(F,[["__scopeId","data-v-aea27bb7"]]),J={class:"form"},M={class:"form-wrapper"},R={key:0,class:"buttons"},U=k({__name:"WidgetPreview",setup(t){const a=P(),d=B([]);function i(e){return E[e]||K[e]||null}function l(e){try{const s=JSON.parse(e);if(s.component=i(s.type),!s.component)throw new Error(`Widget ${s.type} not found`);return s.component?s:null}catch{return null}}function m(){const e=a.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function o(){return a.query.steps==="true"}function c(){const e=a.query.button;return e?Array.isArray(e)?e:[e]:[]}const y=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),u($,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u(L,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):b("",!0),v("div",J,[v("div",M,[(n(!0),f(_,null,w(m(),(r,h)=>(n(),f("div",{key:h,class:"widget"},[(n(),u(V(r.component),{"user-props":r.userProps,value:r.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),c().length?(n(),f("div",R,[(n(!0),f(_,null,w(c(),r=>(n(),u(O,{key:r,"display-name":y(r).name,action:y(r)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}}),G=W(U,[["__scopeId","data-v-ee9ec43e"]]);export{G as default};
//# sourceMappingURL=WidgetPreview-BN58m31K.js.map
