import{d as k,r as B,U as A,o as n,a as u,b as f,f as I,g as N,t as P,eh as S,eM as C,u as y,bY as D,f0 as V,_ as h,ei as q,h as g,e as b,ac as c,ej as v,el as x,aY as w,L as E,N as L}from"./jwt-decode.esm.c9c37cdc.js";import{S as $}from"./Steps.687763a5.js";import{W as F}from"./PlayerConfigProvider.00af5968.js";import"./index.71eb83f3.js";import"./colorHelpers.8ba18214.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="b2ab1d3b-152c-4f76-8976-8dc4a98a741e",o._sentryDebugIdIdentifier="sentry-dbid-b2ab1d3b-152c-4f76-8976-8dc4a98a741e")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const d=o,l=B(null);return A(()=>{l.value&&d.action.setElement(l.value)}),(r,i)=>(n(),u(y(V),null,{default:f(()=>[I(y(D),{ref_key:"element",ref:l,class:S(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=C(p=>t("click"),["enter"]))},{default:f(()=>[N(P(r.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const M=h(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},Y={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(o){const t=q(),d=B([]);function l(e){return E[e]||L[e]||null}function r(e){try{const s=JSON.parse(e);if(s.component=l(s.type),!s.component)throw new Error(`Widget ${s.type} not found`);return s.component?s:null}catch{return null}}function i(){const e=t.query.widget;return Array.isArray(e)?e.map(r).filter(Boolean):[r(e)]}function p(){return t.query.steps==="true"}function _(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const m=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),u(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:f(()=>[p()?(n(),u($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),b("div",O,[b("div",Y,[(n(!0),c(w,null,v(i(),(a,W)=>(n(),c("div",{key:W,class:"widget"},[(n(),u(x(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),_().length?(n(),c("div",j,[(n(!0),c(w,null,v(_(),a=>(n(),u(M,{key:a,"display-name":m(a).name,action:m(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=h(z,[["__scopeId","data-v-d3d01da6"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.88a4f27f.js.map
