import{e as k,r as B,$ as S,n as u,g as n,p as g,bU as x,w as f,q as I,R as P,S as V,x as A,bV as C,B as D,ar as W,V as N,j as b,k as v,f as p,W as _,X as w,aP as q,aK as E,aL as L}from"./jwt-decode.esm-B1xmpboS.js";import{S as $}from"./Steps-nu8O8JtS.js";import{W as K}from"./PlayerConfigProvider-3S3BtF5y.js";import"./index-URXbJcJb.js";import"./colorHelpers-DAgQ40oE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="de3230ed-7cbd-4445-b480-4850d193d102",t._sentryDebugIdIdentifier="sentry-dbid-de3230ed-7cbd-4445-b480-4850d193d102")}catch{}})();const F=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const d=t,i=B(null);S(()=>{i.value&&d.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(g(x),null,{default:f(()=>[I(g(D),{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]=C(c=>l("click"),["enter"]))},{default:f(()=>[P(V(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=W(F,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},R={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=N(),d=B([]);function i(e){return E[e]||L[e]||null}function l(e){try{const r=JSON.parse(e);if(r.component=i(r.type),!r.component)throw new Error(`Widget ${r.type} not found`);return r.component?r:null}catch{return null}}function m(){const e=s.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function o(){return s.query.steps==="true"}function c(){const e=s.query.button;return e?Array.isArray(e)?e:[e]:[]}const y=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,r)=>(n(),u(K,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:f(()=>[o()?(n(),u($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):b("",!0),v("div",O,[v("div",R,[(n(!0),p(_,null,w(m(),(a,h)=>(n(),p("div",{key:h,class:"widget"},[(n(),u(q(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),c().length?(n(),p("div",j,[(n(!0),p(_,null,w(c(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}}),Q=W(z,[["__scopeId","data-v-ee9ec43e"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview-hjNZ677O.js.map
