import{d as k,e as B,Z as A,o as n,c as l,w as f,b as D,ar as C,ez as I,ex as P,f5 as S,u as y,bG as N,fa as q,R as h,eA as x,ev as g,a as b,et as c,eC as v,eD as V,aD as w,q as E,t as L}from"./vue-router.9c189215.js";import{S as $}from"./Steps.df2e5de2.js";import{W as F}from"./WidgetsFrame.196bc760.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]="cb4a0c66-00f0-4513-8850-1615e56178b4",o._sentryDebugIdIdentifier="sentry-dbid-cb4a0c66-00f0-4513-8850-1615e56178b4")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const d=o,u=B(null);return A(()=>{u.value&&d.action.setElement(u.value)}),(r,i)=>(n(),l(y(q),null,{default:f(()=>[D(y(N),{ref_key:"element",ref:u,class:P(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=S(p=>t("click"),["enter"]))},{default:f(()=>[C(I(r.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const z=h(K,[["__scopeId","data-v-aea27bb7"]]),M={class:"form"},O={class:"form-wrapper"},R={key:0,class:"buttons"},G=k({__name:"WidgetPreview",setup(o){const t=x(),d=B([]);function u(e){return E[e]||L[e]||null}function r(e){try{const s=JSON.parse(e);if(s.component=u(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(),l(F,{"main-color":"#d14056",class:"preview",theme:"#fbfbfb","font-family":"Inter"},{default:f(()=>[p()?(n(),l($,{key:0,"steps-info":{current:2,total:3}})):g("",!0),b("div",M,[b("div",O,[(n(!0),c(w,null,v(i(),(a,W)=>(n(),c("div",{key:W,class:"widget"},[(n(),l(V(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),_().length?(n(),c("div",R,[(n(!0),c(w,null,v(_(),a=>(n(),l(z,{key:a,"display-name":m(a).name,action:m(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const H=h(G,[["__scopeId","data-v-d8094416"]]);export{H as default};
//# sourceMappingURL=WidgetPreview.867381b8.js.map
