import{ct as e,i as t}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import"./main-D5maKxU_.js";import{n}from"./GxUIComponents-BnC57H2P.js";import"./nprogress-jiVtd4l-.js";import{Ar as r,Bt as i,Hi as a,yt as o}from"./stores-BWYw2E2w.js";import{n as s,t as c}from"./stores-CPzLVPi9.js";import{a as l,i as u,n as d,r as f,t as p}from"./create-route-main-page-Da3gsQTk.js";import"./design-main-BgRLU7Hr.js";import{a as m,i as h,r as g}from"./vue-i18n-CZh6OFWi.js";/* empty css             */import{r as _}from"./runtime-location-B9gQKML3.js";import{t as v}from"./postmate.es-CpN3TS1S.js";var{updateActiveAccessPortal:y}=r(),{updateControllerThemeActiveAccessPortal:b}=i(),x=async t=>{let n=s(),r=a(),i=o(),{app:c,router:l}=t;window.router=l;let u=e=>{console.log(`initApp`,e),e&&(y(e.accessPortalObId||``,i.zxlPrdId),b(e.accessPortalObId||``,i.zxlPrdId),n.setActiveApp(e))},d=e=>{if(console.log(`here updateRouteForm - options: `,e),!e)return;let{formUuid:t,rawXmlObj:n}=e,i=r.getOpenedTabFormObjItem(t);i?.updateLocalXmlObj&&i?.updateLocalXmlObj(n||null)};window.updateRouteForm=d,S();let f=await new v.Model({height:()=>document.body.offsetHeight,time:new Date().getTime(),initApp:u,updateRouteForm:d});f&&(n.setPostmateInstance(f),l.afterEach((e,t)=>{f.emit(`router-afterEach`,{to:e.fullPath,from:t.fullPath})}),e(()=>n.curActiveApp,(e,t)=>{if(!e)return;let n=e.zxlPrdId,r=e.uuid,a=t?.uuid!==r;i.setZxlPrdId(n),i.setFormMode(`preview`);let o=e.baseInfo?.router||[],s=new Date().getTime(),c=``;o.forEach((e,t)=>{let n=e.name;if(t===0&&(c=n),!n)return;let r={path:_(e.url||`/${s}-${t}`),name:n,component:p(e),meta:{title:e.meta?.title,relatedId:e.meta?.relatedId,configTabBarItemId:e.meta?.configTabBarItemId,name:e.meta?.name}};l.addRoute(r),l.removeRoute});let u=e.baseInfo?.defaultRouteName||c;t?a||(u=g(n,r)||u):m(n,r,``),u&&l.push({name:u,query:{ignoreFrom:a?`1`:`0`}}),h.push(...o.filter(e=>e.meta?.isApplyTarbar).map(e=>e.name))}))};function S(){!window.postMessage||!window.parent||window.parent.postMessage({postmate:`handshake-request`})}var C=t(u);n(C),C.use(f),C.use(c),C.use(d),C.component(`VanTabbar`,l),C.mount(`#app`),x({app:C,router:f,i18n:d,pinia:c});