import{e as k,r as B,N as W,f as u,h as n,j as b,bM as D,w as f,m as I,k as S,t as x,O as A,bN as C,B as P,aO as h,an as V,g,D as v,y as p,V as _,a2 as w,a0 as q,b0 as E,b1 as L}from"./jwt-decode.esm-BJTSBhUK.js";import{S as O}from"./Steps-C0OQzrYd.js";import{W as $}from"./PlayerConfigProvider-CUyQXD4o.js";import"./index-C7dxzsX-.js";import"./colorHelpers-CjEM1kZB.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]="b23953c9-7234-46b2-a4e4-8bd60b61e279",t._sentryDebugIdIdentifier="sentry-dbid-b23953c9-7234-46b2-a4e4-8bd60b61e279")}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);W(()=>{i.value&&c.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(b(D),null,{default:f(()=>[I(b(P),{ref_key:"element",ref:i,class:A(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=d=>l("click")),onKeydown:o[1]||(o[1]=C(d=>l("click"),["enter"]))},{default:f(()=>[S(x(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),K=h(F,[["__scopeId","data-v-aea27bb7"]]),M={class:"form"},j={class:"form-wrapper"},z={key:0,class:"buttons"},J=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:f(()=>[o()?(n(),u(O,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),v("div",M,[v("div",j,[(n(!0),p(_,null,w(m(),(a,N)=>(n(),p("div",{key:N,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(),p("div",z,[(n(!0),p(_,null,w(d(),a=>(n(),u(K,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}}),U=h(J,[["__scopeId","data-v-ee9ec43e"]]);export{U as default};
//# sourceMappingURL=WidgetPreview-NZgMPcVY.js.map
