import{e as k,r as B,n as S,q as u,g as n,s as g,bT as x,C as p,x as C,S as D,T as I,t as P,bU as A,D as N,ar as W,V,j as b,k as v,f,W as _,X as w,aP as q,aK as E,aL as L}from"./jwt-decode.esm-hjaWXwux.js";import{S as K}from"./Steps-BocchZmV.js";import{W as $}from"./PlayerConfigProvider-Bz9VXaMB.js";import"./index-Dqh6yN2o.js";import"./colorHelpers-am_R58n2.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]="537f5909-a552-411f-ab2f-bf7336050eba",t._sentryDebugIdIdentifier="sentry-dbid-537f5909-a552-411f-ab2f-bf7336050eba")}catch{}})();const F=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const c=t,i=B(null);S(()=>{i.value&&c.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(g(x),null,{default:p(()=>[C(g(N),{ref_key:"element",ref:i,class:P(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=d=>l("click")),onKeydown:o[1]||(o[1]=A(d=>l("click"),["enter"]))},{default:p(()=>[D(I(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=W(F,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},T={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=V(),c=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 d(){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($,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u(K,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):b("",!0),v("div",O,[v("div",T,[(n(!0),f(_,null,w(m(),(a,h)=>(n(),f("div",{key:h,class:"widget"},[(n(),u(q(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:c.value},null,8,["user-props","value","errors"]))]))),128))]),d().length?(n(),f("div",j,[(n(!0),f(_,null,w(d(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}}),H=W(z,[["__scopeId","data-v-ee9ec43e"]]);export{H as default};
//# sourceMappingURL=WidgetPreview-7CE0Vs_X.js.map
