var k=Object.defineProperty;var C=(r,n,l)=>n in r?k(r,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[n]=l;var m=(r,n,l)=>(C(r,typeof n!="symbol"?n+"":n,l),l);import{c as w,a as D,d as v}from"./FormRunner.77ae6b88.js";import{a as F}from"./asyncComputed.6b1d4165.js";import{u as g}from"./uuid.ba72b934.js";import{L as x}from"./CircularLoading.f21c2905.js";import{W as I}from"./PlayerConfigProvider.4862e88a.js";import{d as S,e4 as A,a6 as U,f as W,h as E,u as t,K as R,b as T,c as y,w as B,F as V,o as f,Q as q}from"./index.e310aebb.js";import"./userStore.e6231111.js";import"./Login.vue_vue_type_script_setup_true_lang.558db144.js";import"./Logo.afdc4154.js";import"./string.a01d17aa.js";import"./index.1acd89cf.js";import"./Steps.32c7dd17.js";import"./index.3752b014.js";import"./Watermark.8ab5e319.js";import"./colorHelpers.0fc16894.js";import"./index.f0e26865.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[n]="e20972a0-21bf-4ef3-b77b-37bc10783977",r._sentryDebugIdIdentifier="sentry-dbid-e20972a0-21bf-4ef3-b77b-37bc10783977")}catch{}})();const K={key:0,class:"loading"},N=S({__name:"MockForm",setup(r){const n=A(),l=U({playerKey:g()}),d=W(null);E(n,()=>{n.name==="form"&&M()});class b extends v{constructor(e){super("mock","editor",{});m(this,"onMessage",null);m(this,"onOpen",null);this.renderMessage=e,this.onMessage=null}async newConnection(){var e;(e=this.onOpen)==null||e.call(this)}async send(e){var s,u;const i="seq"in e?e.seq:0;e.type==="execution:start"&&((s=this.onMessage)==null||s.call(this,{type:"execution:started",executionId:"1234"})),(u=this.onMessage)==null||u.call(this,{...this.renderMessage,seq:i})}async close(e){}isEditorConnection(){return!1}}function _(a){for(a=a.replace(/-/g,"+").replace(/_/g,"/");a.length%4;)a+="=";const c=atob(a),e=Uint8Array.from(c,s=>s.charCodeAt(0)),i=new TextDecoder().decode(e);return JSON.parse(i)}const{loading:p,result:o,error:h,refetch:M}=F(async()=>{l.playerKey=g();const a={isLocal:!1,runtimeType:"form",allowRestart:!1,autoStart:!0,endMessage:null,errorMessage:null,id:"b9980b87-9eaf-456b-a449-11df261a0840",isInitial:!0,path:"public-form",restartButtonText:null,startButtonText:null,startMessage:null,timeoutMessage:null,title:"Public form",welcomeTitle:null,brandName:"Abstra Project",fontFamily:"Inter",language:"en",logoUrl:null,mainColor:"#d14056",sidebar:[],theme:"#fcf0f2"},c=_(n.query.msg);console.log("renderMessage",c);const e=new w({formRunnerData:a,logService:null,connectionManager:new b(c),onRedirect:()=>null,onFormStart:()=>null,onFormEnd:()=>null,onStackTraceUpdate:null,onStateUpdate:s=>d.value=s}),i=e.getState();return d.value=i.formState,{runnerData:a,controller:e}});return(a,c)=>t(p)?(f(),R("div",K,[T(x)])):t(o)&&t(o).runnerData&&d.value&&!t(h)&&!t(p)?(f(),y(I,{key:1,style:{height:"100vh"},"main-color":t(o).runnerData.mainColor,background:t(o).runnerData.theme,"font-family":t(o).runnerData.fontFamily,locale:t(o).runnerData.language,"logo-url":t(o).runnerData.logoUrl},{default:B(()=>{var e,i,s,u;return[(f(),y(D,{key:l.playerKey,"form-runner-data":t(o).runnerData,"form-state":d.value,"is-preview":!1,"user-email":null,onRedirect:()=>null,onActionClicked:(e=t(o))==null?void 0:e.controller.handleActionClick,onUpdateWidgetErrors:(i=t(o))==null?void 0:i.controller.updateWidgetFrontendErrors,onUpdateWidgetValue:(s=t(o))==null?void 0:s.controller.updateWidgetValue,onAuthComplete:(u=t(o))==null?void 0:u.controller.handleAuthComplete},null,8,["form-runner-data","form-state","onActionClicked","onUpdateWidgetErrors","onUpdateWidgetValue","onAuthComplete"]))]}),_:1},8,["main-color","background","font-family","locale","logo-url"])):V("",!0)}});const re=q(N,[["__scopeId","data-v-1f2a95c6"]]);export{re as default};
//# sourceMappingURL=MockForm.2edd2ef1.js.map
