import{d as k,e as B,X as h,o as n,c as u,w as f,b as A,aG as I,e9 as P,ed as C,eT as D,u as y,bT as N,eS as q,a0 as S,ea as V,S as g,a as b,Y as d,eb as v,ec as x,aS as w,q as E,t as L}from"./index.ea15e788.js";import{S as $}from"./Steps.6840c53c.js";import{W as F}from"./PlayerConfigProvider.16cb12f9.js";import"./index.329f3ce2.js";import"./colorHelpers.d0003e86.js";import"./index.1ed51f05.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]="928a032e-cbca-45e9-afc8-6979965c54a7",o._sentryDebugIdIdentifier="sentry-dbid-928a032e-cbca-45e9-afc8-6979965c54a7")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const c=o,l=B(null);return h(()=>{l.value&&c.action.setElement(l.value)}),(a,i)=>(n(),u(y(q),null,{default:f(()=>[A(y(N),{ref_key:"element",ref:l,class:C(["next-button",a.disabled?"disabled":""]),loading:a.loading,disabled:a.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=D(p=>t("click"),["enter"]))},{default:f(()=>[I(P(a.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const M=S(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},T={class:"form-wrapper"},z={key:0,class:"buttons"},G=k({__name:"WidgetPreview",setup(o){const t=V(),c=B([]);function l(e){return E[e]||L[e]||null}function a(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(a).filter(Boolean):[a(e)]}function p(){return t.query.steps==="true"}function m(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const _=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}})):g("",!0),b("div",O,[b("div",T,[(n(!0),d(w,null,v(i(),(r,W)=>(n(),d("div",{key:W,class:"widget"},[(n(),u(x(r.component),{"user-props":r.userProps,value:r.userProps.value,errors:c.value},null,8,["user-props","value","errors"]))]))),128))]),m().length?(n(),d("div",z,[(n(!0),d(w,null,v(m(),r=>(n(),u(M,{key:r,"display-name":_(r).name,action:_(r)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=S(G,[["__scopeId","data-v-0c6cef1d"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.d9fd8d3d.js.map
