import{a as k,r as B,D as W,p as u,e as n,u as g,bS as D,w as p,j as I,S as N,U as x,E as A,bT as C,B as P,aN as h,ac as E,g as b,h as _,b as f,M as v,W as w,R as V,a_ as q,a$ as $}from"./jwt-decode.esm-CQm3LY6y.js";import{S as L}from"./Steps-CCzu7Q5O.js";import{W as F}from"./PlayerConfigProvider-Qduvuc1g.js";import"./index-BXlweqZj.js";import"./colorHelpers-DpdYunNI.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]="59fffc9a-c7b4-4a7e-992e-c55c04654573",t._sentryDebugIdIdentifier="sentry-dbid-59fffc9a-c7b4-4a7e-992e-c55c04654573")}catch{}})();const K=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(g(D),null,{default:p(()=>[I(g(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:p(()=>[N(x(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=h(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},R={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=E(),c=B([]);function i(e){return q[e]||$[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(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","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),_("div",O,[_("div",R,[(n(!0),f(v,null,w(m(),(a,S)=>(n(),f("div",{key:S,class:"widget"},[(n(),u(V(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(v,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}))}}),Q=h(z,[["__scopeId","data-v-d3d01da6"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview-DSDxyue5.js.map
