@vtj/renderer 0.16.19 → 0.16.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("@vtj/core"),p=require("@vtj/utils"),b=require("vue"),Ee=require("vue-router");function at(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const V=at(b);/**!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("@vtj/core"),f=require("@vtj/utils"),b=require("vue"),we=require("vue-router");function rt(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const V=rt(b);/**!
2
2
  * Copyright (c) 2026, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.16.19
5
+ * @version 0.16.20
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const F="0.16.19";var S=(n=>(n.Runtime="Runtime",n.Design="Design",n.Raw="Raw",n.VNode="VNode",n))(S||{});const oe=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],ct=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],$e=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"],be={String,Number,Boolean,Array,Object,Function,Date},k="VtjPage",L="VtjHomepage",le="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(","),je="component,slot".split(","),lt=["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o"].join(""),ut={auth:["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o","/","a","u","t","h",".","h","t","m","l"].join(""),storageKey:["R","R","O","_","I","D","E","_","A","C","C","E","S","S","_","S","T","O","R","A","G","E","_","_"].join(""),privateKey:"MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"};function H(n,e){return n.map(t=>p.isUrl(t)||t.startsWith("/")?t:`${e}${t}`)}function B(n){return/\.css$/.test(n)}function q(n){return/\.js$/.test(n)}function Ce(n){return/\.json$/.test(n)}function ft(n){return n.map(e=>`<script src="${p.url.append(e,{v:F})}"><\/script>`).join("")}function pt(n=[]){return n.map(e=>`<link rel="stylesheet" href="${p.url.append(e,{v:F})}" />`).join("")}function Re(n,e=!1){return e&&n.endsWith(".prod.js")?n.replace(".prod.js",".js"):n}function Pe(n,e,t=!1){const s=n.filter(d=>!!d.enabled),r=[],o=[],i=[],a=[],u={},c={},l=[],f={};return s.forEach(({urls:d,assetsUrl:h,library:g,assetsLibrary:m,localeLibrary:v})=>{d?.forEach(y=>{q(y)&&r.push(Re(y,t)),B(y)&&o.push(y)}),g&&(a.push(g),u[g]=H(d||[],e),v&&(c[g]=v)),h&&i.push(h),m&&l.push(m),g&&m&&(f[m]=g)}),{scripts:H(r,e),css:H(o,e),materials:H(i,e),libraryExports:a,materialExports:p.dedupArray(l),materialMapLibrary:f,libraryMap:u,libraryLocaleMap:c}}function Ae(n,e){const{name:t,parent:s,alias:r}=n;return s?e[s]?.[r||t]:e[r||t]}function Ie(n=[]){const e=n.filter(s=>B(s)),t=n.filter(s=>q(s));return{css:e,js:t}}function Te(n,e){const t=c=>{const l=[];let f=0;for(;f<c.length;){if(/\s/.test(c[f])){f++;continue}if(c.substring(f,f+2)==="/*"){const y=c.indexOf("*/",f+2);if(y!==-1){f=y+2;continue}}if(c[f]==="@"){const y=f;for(;f<c.length&&c[f]!=="{"&&c[f]!==";";)f++;const w=c.substring(y,f).trim(),_=w.includes("@keyframes");if(c[f]===";")l.push({type:"simple-at-rule",content:c.substring(y,f+1)}),f++;else if(c[f]==="{"){const E=f+1;let I=1;for(f++;f<c.length&&I>0;)c[f]==="{"?I++:c[f]==="}"&&I--,f++;const X=c.substring(y,f),A=c.substring(E,f-1);l.push({type:_?"keyframes":"at-rule",rule:w,content:X,inner:A})}continue}const d=f;for(;f<c.length&&c[f]!=="{";)f++;if(f>=c.length)break;const h=c.substring(d,f).trim();if(!h){f++;continue}const g=f+1;let m=1;for(f++;f<c.length&&m>0;)c[f]==="{"?m++:c[f]==="}"&&m--,f++;const v=c.substring(g,f-1);l.push({type:"rule",selector:h,content:v.trim()})}return l},s=c=>{const l=c.trim();return/^(from|to|\d+(\.\d+)?%)$/.test(l)},r=c=>c.replace(/::v-deep\(/g,":deep(").replace(/::v-deep\s+/g,":deep(").replace(/\/deep\//g," ").replace(/>>>/g," ").replace(/(.*?):deep\(([^)]+)\)/g,(l,f,d)=>{const h=f.trim(),g=d.trim();return h?`${h}[${e}] ${g}`:g}),o=c=>{const l=c.trim();if(!l||l.includes(`[${e}]`)||/^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l)||s(l))return l;const f=l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);if(f){const[,d,h=""]=f,g=d.trim();return g?`${g}[${e}]${h}`:l}return`${l}[${e}]`},i=c=>r(c).split(",").map(f=>o(f)).filter(f=>f.trim()).join(", "),a=c=>c.map(l=>{switch(l.type){case"simple-at-rule":return l.content;case"keyframes":return l.content;case"at-rule":try{const d=t(l.inner),h=a(d);return`${l.rule} { ${h} }`}catch{return l.content}case"rule":if(!l.selector||!l.content)return"";const f=i(l.selector);return f.trim()?`${f} { ${l.content} }`:"";default:return""}}).filter(l=>l.trim()).join(" "),u=c=>c.replace(/\s*{\s*/g," { ").replace(/\s*}\s*/g," } ").replace(/\s*;\s*/g,"; ").replace(/\s*,\s*/g,", ").replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").replace(/\s*}\s*}/g," } }").trim();try{const c=n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g,"").replace(/^\s+|\s+$/gm,"").replace(/\n\s*\n/g,`
8
- `),l=t(c),f=a(l);return u(f)}catch(c){return console.error("CSS scoping failed:",c),console.error("Input CSS:",n),n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,l=>l).replace(/([^{}@]+)(?=\s*{)/g,l=>{const f=l.trim();return!f||f.startsWith("@")||f.includes(`[${e}]`)||s(f)?l:`${f}[${e}]`})}}const dt=750;function Oe(n,e,t){let s;typeof n<"u"?s=n.innerWidth||n.document.documentElement.clientWidth:(console.warn("无法获取屏幕宽度,使用默认值375"),s=375);const r=t||dt;return e*s/r}function Me(n,e){let t=!1,s=!1,r=!1,o="";for(let i=0;i<e.length;i++){const a=e[i];if(a==="'"&&!s&&!r?t=!t:a==='"'&&!t&&!r?s=!s:e.substr(i,4).toLowerCase()==="url("&&!t&&!s?r=!0:a===")"&&r&&(r=!1),!t&&!s&&!r){const u=e.substr(i).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);if(u){const c=u[1],l=parseFloat(c),d=`${Oe(n,l).toFixed(6).replace(/\.?0+$/,"")}px`;o+=d,i+=u[0].length-1;continue}}o+=a}return o}function ue(n){return p.isString(n)?n:JSON.stringify(n)}function z(n,e,t,s=!1){const r=n.CSSStyleSheet,o=s?`data-v-${e}`:e,i=n.__uniConfig?Me(n,t):t,a=s?Te(i,o):i,u=!!n.__uniConfig;if(r.prototype.replaceSync&&!u){const c=new r;c.id=e,c.replaceSync(a);const l=n.document,f=l.adoptedStyleSheets,d=Array.from(f).filter(h=>h.id!==e);l.adoptedStyleSheets=[...d,c]}else{const c=n.document;let l=c.getElementById(e);l?l.innerHTML=a:(l=c.createElement("style"),l.id=e,l.innerHTML=a,c.head.appendChild(l))}}function ht(n){const e=n.adoptedStyleSheets||[];let t="";if(e.forEach(s=>{try{for(const r of s.cssRules)t+=r.cssText+`
9
- `}catch(r){console.error("Failed to read cssRules from adopted stylesheet:",r)}}),t){const s=n.createElement("style");s.textContent=t,n.head.appendChild(s)}}async function Fe(n,e){const t=await window.fetch(e).then(s=>s.text()).catch(()=>"");t&&z(window,n,t)}function fe(n,e=window){const t=e.document,s=e.document.head;for(const r of n)if(!t.getElementById(r)){const i=t.createElement("link");i.rel="stylesheet",i.id=r,i.href=r,s.appendChild(i)}}async function pe(n,e,t=window){const s=t.document,r=t.document.head;let o=t[e];return o?o.default||o:new Promise((i,a)=>{for(const u of n){const c=s.createElement("script");c.src=u,c.onload=()=>{o=t[e],o?i(o.default||o):a(null)},c.onerror=l=>{a(l)},r.appendChild(c)}})}function ke(n){return p.isFunction(n)&&Object.getOwnPropertyNames(n.prototype||{}).length===0||p.isFunction(n?.install)}function De(n){return je.includes(n)}function xe(n){return le.includes(n)}function D(n=window){const e=window?.Mock;if(e)return e;const t=n?.Mock;if(t&&window)return window.Mock=t,t}function mt(n,e,t){Object.assign(e.meta,t.meta);const s=n?._container;t?.type==="page"&&s.classList.add("is-page"),t?.pure&&s.classList.add("is-pure")}function He(n={},e={}){const t=Object.entries(n),s=Object.entries(e);if(t.length!==s.length)return!1;for(const[r,o]of t)if(!p.isFunction(o)&&!p.isEqual(o,e[r]))return!1;return!0}function x(n,e,t=!1,s=!1,r=!1){try{const o=['"use strict";',"var __self = arguments[0];"];o.push("return ");let i=(n.value||"").trim();r||(i=i.replace(/this(\W|$)/g,(u,c)=>`__self${c}`)),i=o.join(`
7
+ */const k="0.16.20";var S=(n=>(n.Runtime="Runtime",n.Design="Design",n.Raw="Raw",n.VNode="VNode",n))(S||{});const oe=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],ot=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],Ee=["vIf","vElseIf","vElse","vShow","vModel","vFor","vBind","vHtml"],$e={String,Number,Boolean,Array,Object,Function,Date},D="VtjPage",U="VtjHomepage",ce="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(","),be="component,slot".split(","),it=["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o"].join(""),at={auth:["h","t","t","p","s",":","/","/","a","p","p",".","v","t","j",".","p","r","o","/","a","u","t","h",".","h","t","m","l"].join(""),storageKey:["R","R","O","_","I","D","E","_","A","C","C","E","S","S","_","S","T","O","R","A","G","E","_","_"].join(""),privateKey:"MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"};function N(n,e){return n.map(t=>f.isUrl(t)||t.startsWith("/")?t:`${e}${t}`)}function q(n){return/\.css$/.test(n)}function J(n){return/\.js$/.test(n)}function je(n){return/\.json$/.test(n)}function ct(n){return n.map(e=>`<script src="${f.url.append(e,{v:k})}"><\/script>`).join("")}function lt(n=[]){return n.map(e=>`<link rel="stylesheet" href="${f.url.append(e,{v:k})}" />`).join("")}function Ce(n,e=!1){return e&&n.endsWith(".prod.js")?n.replace(".prod.js",".js"):n}function Re(n,e,t=!1){const s=n.filter(d=>!!d.enabled),r=[],o=[],i=[],a=[],u={},c={},l=[],p={};return s.forEach(({urls:d,assetsUrl:h,library:g,assetsLibrary:m,localeLibrary:_})=>{d?.forEach(v=>{J(v)&&r.push(Ce(v,t)),q(v)&&o.push(v)}),g&&(a.push(g),u[g]=N(d||[],e),_&&(c[g]=_)),h&&i.push(h),m&&l.push(m),g&&m&&(p[m]=g)}),{scripts:N(r,e),css:N(o,e),materials:N(i,e),libraryExports:a,materialExports:f.dedupArray(l),materialMapLibrary:p,libraryMap:u,libraryLocaleMap:c}}function Pe(n,e){const{name:t,parent:s,alias:r}=n;return s?e[s]?.[r||t]:e[r||t]}function Ae(n=[]){const e=n.filter(s=>q(s)),t=n.filter(s=>J(s));return{css:e,js:t}}function Ie(n,e){const t=c=>{const l=[];let p=0;for(;p<c.length;){if(/\s/.test(c[p])){p++;continue}if(c.substring(p,p+2)==="/*"){const v=c.indexOf("*/",p+2);if(v!==-1){p=v+2;continue}}if(c[p]==="@"){const v=p;for(;p<c.length&&c[p]!=="{"&&c[p]!==";";)p++;const w=c.substring(v,p).trim(),y=w.includes("@keyframes");if(c[p]===";")l.push({type:"simple-at-rule",content:c.substring(v,p+1)}),p++;else if(c[p]==="{"){const E=p+1;let T=1;for(p++;p<c.length&&T>0;)c[p]==="{"?T++:c[p]==="}"&&T--,p++;const X=c.substring(v,p),A=c.substring(E,p-1);l.push({type:y?"keyframes":"at-rule",rule:w,content:X,inner:A})}continue}const d=p;for(;p<c.length&&c[p]!=="{";)p++;if(p>=c.length)break;const h=c.substring(d,p).trim();if(!h){p++;continue}const g=p+1;let m=1;for(p++;p<c.length&&m>0;)c[p]==="{"?m++:c[p]==="}"&&m--,p++;const _=c.substring(g,p-1);l.push({type:"rule",selector:h,content:_.trim()})}return l},s=c=>{const l=c.trim();return/^(from|to|\d+(\.\d+)?%)$/.test(l)},r=c=>c.replace(/::v-deep\(/g,":deep(").replace(/::v-deep\s+/g,":deep(").replace(/\/deep\//g," ").replace(/>>>/g," ").replace(/(.*?):deep\(([^)]+)\)/g,(l,p,d)=>{const h=p.trim(),g=d.trim();return h?`${h}[${e}] ${g}`:g}),o=c=>{const l=c.trim();if(!l||l.includes(`[${e}]`)||/^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l)||s(l))return l;const p=l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);if(p){const[,d,h=""]=p,g=d.trim();return g?`${g}[${e}]${h}`:l}return`${l}[${e}]`},i=c=>r(c).split(",").map(p=>o(p)).filter(p=>p.trim()).join(", "),a=c=>c.map(l=>{switch(l.type){case"simple-at-rule":return l.content;case"keyframes":return l.content;case"at-rule":try{const d=t(l.inner),h=a(d);return`${l.rule} { ${h} }`}catch{return l.content}case"rule":if(!l.selector||!l.content)return"";const p=i(l.selector);return p.trim()?`${p} { ${l.content} }`:"";default:return""}}).filter(l=>l.trim()).join(" "),u=c=>c.replace(/\s*{\s*/g," { ").replace(/\s*}\s*/g," } ").replace(/\s*;\s*/g,"; ").replace(/\s*,\s*/g,", ").replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").replace(/\s*}\s*}/g," } }").trim();try{const c=n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g,"").replace(/^\s+|\s+$/gm,"").replace(/\n\s*\n/g,`
8
+ `),l=t(c),p=a(l);return u(p)}catch(c){return console.error("CSS scoping failed:",c),console.error("Input CSS:",n),n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,l=>l).replace(/([^{}@]+)(?=\s*{)/g,l=>{const p=l.trim();return!p||p.startsWith("@")||p.includes(`[${e}]`)||s(p)?l:`${p}[${e}]`})}}const ut=750;function Te(n,e,t){let s;typeof n<"u"?s=n.innerWidth||n.document.documentElement.clientWidth:(console.warn("无法获取屏幕宽度,使用默认值375"),s=375);const r=t||ut;return e*s/r}function Me(n,e){let t=!1,s=!1,r=!1,o="";for(let i=0;i<e.length;i++){const a=e[i];if(a==="'"&&!s&&!r?t=!t:a==='"'&&!t&&!r?s=!s:e.substr(i,4).toLowerCase()==="url("&&!t&&!s?r=!0:a===")"&&r&&(r=!1),!t&&!s&&!r){const u=e.substr(i).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);if(u){const c=u[1],l=parseFloat(c),d=`${Te(n,l).toFixed(6).replace(/\.?0+$/,"")}px`;o+=d,i+=u[0].length-1;continue}}o+=a}return o}function le(n){return f.isString(n)?n:JSON.stringify(n)}function W(n,e,t,s=!1){const r=n.CSSStyleSheet,o=s?`data-v-${e}`:e,i=n.__uniConfig?Me(n,t):t,a=s?Ie(i,o):i,u=!!n.__uniConfig;if(r.prototype.replaceSync&&!u){const c=new r;c.id=e,c.replaceSync(a);const l=n.document,p=l.adoptedStyleSheets,d=Array.from(p).filter(h=>h.id!==e);l.adoptedStyleSheets=[...d,c]}else{const c=n.document;let l=c.getElementById(e);l?l.innerHTML=a:(l=c.createElement("style"),l.id=e,l.innerHTML=a,c.head.appendChild(l))}}function pt(n){const e=n.adoptedStyleSheets||[];let t="";if(e.forEach(s=>{try{for(const r of s.cssRules)t+=r.cssText+`
9
+ `}catch(r){console.error("Failed to read cssRules from adopted stylesheet:",r)}}),t){const s=n.createElement("style");s.textContent=t,n.head.appendChild(s)}}async function Oe(n,e){const t=await window.fetch(e).then(s=>s.text()).catch(()=>"");t&&W(window,n,t)}function ue(n,e=window){const t=e.document,s=e.document.head;for(const r of n)if(!t.getElementById(r)){const i=t.createElement("link");i.rel="stylesheet",i.id=r,i.href=r,s.appendChild(i)}}async function pe(n,e,t=window){const s=t.document,r=t.document.head;let o=t[e];return o?o.default||o:new Promise((i,a)=>{for(const u of n){const c=s.createElement("script");c.src=u,c.onload=()=>{o=t[e],o?i(o.default||o):a(null)},c.onerror=l=>{a(l)},r.appendChild(c)}})}function Fe(n){return f.isFunction(n)&&Object.getOwnPropertyNames(n.prototype||{}).length===0||f.isFunction(n?.install)}function ke(n){return be.includes(n)}function De(n){return ce.includes(n)}function x(n=window){const e=window?.Mock;if(e)return e;const t=n?.Mock;if(t&&window)return window.Mock=t,t}function ft(n,e,t){Object.assign(e.meta,t.meta);const s=n?._container;t?.type==="page"&&s.classList.add("is-page"),t?.pure&&s.classList.add("is-pure")}function H(n,e,t=!1,s=!1,r=!1){try{const o=['"use strict";',"var __self = arguments[0];"];o.push("return ");let i=(n.value||"").trim();r||(i=i.replace(/this(\W|$)/g,(u,c)=>`__self${c}`)),i=o.join(`
10
10
  `)+i;const a=r?`
11
11
  ${i}
12
- `:`with(${t?"{}":"$scope || {}"}) { ${i} }`;return new Function("$scope",a)(e)}catch(o){if(p.logger.error("parseExpression.error",o,n,e?.__self??e),s)throw o}}function R(n,e,t=!1,s=!1,r=!1){const o=x(n,e,t,s,r);if(typeof o!="function"&&(p.logger.error("parseFunction.error","not a function",n,e?.__self??e),s))throw new Error(`"${n.value}" not a function`);return o}function C(n){return n&&n.type==="JSExpression"}function j(n){return typeof n=="object"&&n&&n.type==="JSFunction"}function Ne(n){return C(n)||j(n)}function gt(n){return Ne(n)?n.value:JSON.stringify(n)}const vt={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},de=Symbol("access");class W{options;data=null;mode=S.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},vt,e),this.loadData()}enableIntercept(){this.interceptResponse=!0}disableIntercept(){this.interceptResponse=!1}connect(e){const{mode:t,router:s,request:r}=e;this.mode=t,s&&this.mode!==S.Design&&this.setGuard(s),r&&this.setRequest(r)}login(e){const{storageKey:t,storagePrefix:s,session:r,authKey:o}=this.options;this.setData(e),this.data&&(p.storage.save(t,e,{type:"local",prefix:s}),r&&p.cookie.set(o,this.data.token))}clear(){const{storageKey:e,storagePrefix:t,session:s,authKey:r}=this.options;this.data=null,p.storage.remove(e,{type:"local",prefix:t}),s&&p.cookie.remove(r)}logout(){this.clear(),this.toLogin()}getData(){return this.data?this.data:(this.loadData(),this.data)}getToken(){return this.data||this.loadData(),this.data?.token}can(e){const{appName:t}=this.options,{permissions:s={}}=this.data||{};return typeof e=="function"?e(s):p.toArray(e).every(o=>s[o]||s[t+"."+o])}some(e){const{appName:t}=this.options,{permissions:s={}}=this.data||{};return p.toArray(e).some(o=>s[o]||s[t+"."+o])}install(e){e.config.globalProperties.$access=this,e.provide(de,this)}isAuthPath(e){const{auth:t,isAuth:s}=this.options;if(s)return s(e);if(e.path&&typeof t=="string"){const r=t.split("#")[1]||t;return e.path===r}return!1}toLogin(){const{auth:e,redirectParam:t}=this.options;if(!e)return;const s=t?`?${t}=${encodeURIComponent(location.href)}`:"";typeof e=="function"?e(s):location.href=t?`${e}${s}`:e}setData(e){const{privateKey:t}=this.options;if(Array.isArray(e)&&t){const s=e.map(r=>p.unRSA(r,t));try{this.data=JSON.parse(s.join(""))}catch(r){console.warn(r)}return}if(typeof e=="string")try{const s=t?p.unRSA(e,t):e;s?this.data=JSON.parse(s):console.warn("RSA解密失败或登录信息缺失")}catch(s){console.warn(s)}else this.data=e}loadData(){const{storageKey:e,storagePrefix:t}=this.options,s=p.storage.get(e,{type:"local",prefix:t});this.setData(s||null)}isLogined(){const{session:e,authKey:t}=this.options;return e&&t?!!p.cookie.get(t):!!this.getToken()}hasRoutePermission(e){if(e.name===k){const t=e.params.id;return t&&this.can(t)}return e.meta.__vtj__?this.can(e.meta.__vtj__):e.meta.permission?this.can(e.meta.permission):!0}setGuard(e){e.beforeEach((t,s,r)=>this.guard(t,r))}async guard(e,t){if(this.isWhiteList(e)||this.isAuthPath(e))return t();if(this.isLogined()){if(this.hasRoutePermission(e))return t();{const{noPermissionMessage:s="无权限访问",unauthorized:r=!1}=this.options;return await this.showTip(s),p.isFunction(r)?(r(),t(!1)):p.isString(r)?t(r):t(!1)}}t(!1),await p.delay(0),this.toLogin()}isWhiteList(e){const{whiteList:t}=this.options;return t?Array.isArray(t)?t.some(s=>e.fullPath.startsWith(s)):t(e):!1}isUnauthorized(e){const{unauthorizedCode:t=401,statusKey:s="code"}=this.options;return e.status===t||e.data?.[s]===t}async showUnauthorizedAlert(e){const{unauthorizedMessage:t="登录已失效"}=this.options;this.isUnauthorized(e)&&await this.showTip(t)&&this.toLogin()}async showTip(e){const{alert:t}=this.options;return this.isTipShowing?!1:t?(this.isTipShowing=!0,await p.delay(150),await t(e,{title:"提示",type:"warning"})?.catch(()=>!0)?.finally(()=>{this.isTipShowing=!1})):(window.alert(e),!0)}setRequest(e){e.useRequest(t=>(this.data?.token&&(t.headers[this.options.authKey]=this.data?.token),t)),e.useResponse(async t=>(this.interceptResponse&&await this.showUnauthorizedAlert(t),t),async t=>{if(!this.interceptResponse)return Promise.reject(t);const s=t.response||t||{};return await this.showUnauthorizedAlert(s),Promise.reject(t)})}}function Le(){return b.inject(de,null)}function yt(n={}){const{notify:e,loading:t,settings:s={},Startup:r,access:o,useTitle:i,alert:a}=n;let u=null;return{request:p.createRequest({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:l=>l.data?.code===0||!!l.data?.success,failMessage:!0,showError:l=>{e&&e(l||"未知错误")},showLoading:()=>{u&&u.close(),t&&(u=t())},hideLoading:()=>{u&&(u.close(),u=null)},...s}}),jsonp:p.jsonp,notify:e,loading:t,useTitle:i,alert:a,startupComponent:r,access:o?new W({alert:a,...o}):void 0}}function _t(n={}){return new W(n)}function Ue(n,e){const{jsonp:t,request:s}=e;if(n.method==="jsonp")return(r={})=>t(n.url,{...n.jsonpOptions,query:r});{const r=n.headers?x(n.headers,{},!0):void 0,o={url:n.url,method:n.method,settings:{...n.settings,headers:r}};return(i,a)=>(delete o.data,s.send(p.merge(o,a||{},{data:i})))}}function Be(n,e){const{metaQuery:t}=e;if(!t)return;const{code:s,queryCode:r}=n;return(o,i)=>{if(!t){console.warn("adapter.metaQuery is not defined!");return}return t(s,r,o,i)}}function qe(n=[],e=[],t){const s={};for(const r of n){const o=Ue(r,t);s[r.id]=o,s[r.name]=o}for(const r of e)s[r.id]=Be(r,t);return s}async function Je(n=[],e=window){const t=D(e);t&&(he(e),n.forEach(s=>Ge(t,s)))}function Ke(n,e=window){const t=j(n.mockTemplate)&&n.mockTemplate.value?R(n.mockTemplate,{},!0):void 0,s=D(e);return async(...r)=>{let o={};if(t)try{o=await t.apply(t,r)}catch(i){p.logger.warn("模拟数据模版异常",i)}return s?.mock(o)}}function Ge(n,e){if(!e.mock)return;const{url:t,mockTemplate:s}=e;if(t&&s)try{const r=p.isUrl(t)?new URL(t).pathname:t,o=p.pathToRegexp(`(.*)${r}(.*)`),i=p.pathToRegexpMatch(r,{decode:decodeURIComponent}),a=x(s,{},!0);n.mock(o,u=>{const c=p.url.parse(u.url)||{},l=u.body instanceof FormData?p.formDataToJson(u.body):u.body,f=p.isUrl(u.url)?new URL(u.url).pathname:u.url.split("?")[0],d=i(f)?.params;Object.assign(u,{data:l,params:d,query:c});try{return n.mock(a(u))}catch(h){return console.warn("[mockApi]",o,u,h),null}})}catch(r){console.warn("mockApi",r)}}function he(n=window){const e=D(n);e&&(e._mocked={})}class Ve{__id=null;__mode;__instance=null;__contextRefs={};__refs={};__refCaches={};context={};state={};props={};$props={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};$provider=null;__transform={};constructor(e){const{mode:t,dsl:s,attrs:r}=e;this.__mode=t,s&&(this.__id=s.id||null,this.__transform=s.transform||{}),r&&Object.assign(this,r)}setup(e,t=V){const s=t.getCurrentInstance();if(!s)return;this.__refs={},this.__refCaches={},this.$refs={},this.context={},this.__contextRefs={},this.__instance=s.proxy;const r=s.appContext.config.globalProperties;Object.assign(this,r),Object.assign(this,e||{}),this.__proxy(),t.onMounted(()=>{this.__proxy()}),t.onUnmounted(()=>{this.__cleanup()}),t.onBeforeUpdate(()=>{this.__reset()})}__proxy(){this.__instance&&oe.forEach(e=>{this[e]=this.__instance?.[e]})}__cleanup(){oe.forEach(e=>{this[e]=null}),this.__reset()}__reset(){this.__refs={},this.__refCaches={},this.$refs={},this.__contextRefs={},this.context={}}__parseFunction(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:s}=e,r=t?this.__transform[t]??e.value:e.value;return R({type:s,value:r},this)}else return R(e,this)}__parseExpression(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:s}=e,r=t?this.__transform[t]??e.value:e.value;return x({type:s,value:r},this)}else return x(e,this)}__ref(e=null,t){if(this.__mode===S.VNode)return;e&&e!==this.__id&&(this.__contextRefs[e]=this);let s=e?this.__refCaches[e]:null;return s||(s=async r=>{await p.delay(0);let o=r?.$vtjEl||r?.$el||r?._?.vnode?.el||r;if(!o){typeof t=="string"&&(delete this.$refs[t],e&&delete this.__refs[e]);return}return o.nodeType===3&&o.nextSibling&&(o=o.nextSibling),o.__vtj__=e,S.Design===this.__mode&&(o.__context__=this,o.draggable=!0),e&&(this.__refs[e]=this.__getRefEl(this.__refs,e,r)),typeof t=="function"?t(r):t&&(this.$refs[t]=this.__getRefEl(this.$refs,t,r)),r},e&&(this.__refCaches[e]=s),s)}__getRefEl(e,t,s){const r=e[t];if(r&&s!==r){const o=new Set([].concat(r,s));return Array.from(o)}else return s}__clone(e={}){const t={...this.context,...e},s={...t,context:t};return s.context.__proto__=this.context,s.__proto__=this,s}}function K(n){const{Vue:e=V,mode:t=S.Runtime,components:s={},libs:r={},apis:o={},loader:i}=n,a=e.computed(()=>n.dsl),u={$components:s,$libs:r,$apis:o},c=new Ve({mode:t,dsl:a.value,attrs:u}),l=e.defineComponent({name:a.value.name,__scopeId:a.value.id?`data-v-${a.value.id}`:void 0,props:{...wt(a.value.props??[],c)},async setup(f){c.$props=f,c.props=f,a.value.id&&z(n.window||window,a.value.id,a.value.css||"",!0),c.state=Et(e,a.value.state??{},c);const d=$t(e,a.value.computed??{},c),h=bt(a.value.methods??{},c),g=jt(e,a.value.inject,c);for(const[y,w]of Object.entries(g||{}))g[y]=e.inject(y,w);const m=ze(a.value.dataSources||{},c),v={...g,...d,...h,...m};return c.setup(v,e),Ct(e,a.value.watch??[],c),{vtj:c,state:c.state,...d,...h}},emits:St(a.value.emits),expose:["vtj",...a.value.expose||[]],render(){if(!a.value.nodes)return null;const f=a.value.nodes||[];if(f.length===1)return M(f[0],c,e,i,f);{const d=f.map(h=>M(h,c,e,i,f));return e.createVNode("div",{},d)}},...Rt(a.value.lifeCycles??{},c)});return{renderer:e.markRaw(l),context:c}}function St(n=[]){return n.map(e=>p.isString(e)?e:e.name)}function wt(n=[],e){const t=s=>s?(Array.isArray(s)?s:[s]).map(o=>be[o]):void 0;return n.map(s=>p.isString(s)?{name:s}:{name:s.name,type:s.type,required:s.required,default:C(s.default)?e.__parseExpression(s.default):s.default}).reduce((s,r)=>(s[r.name]={type:t(r.type),required:r.required,default:r.default},s),{})}function Et(n,e,t){return n.reactive(Object.keys(e||{}).reduce((s,r)=>{let o=e[r];return C(o)?o=t.__parseExpression(o):j(o)&&(o=t.__parseFunction(o)),s[r]=o,s},{}))}function $t(n,e,t){return Object.entries(e??{}).reduce((s,[r,o])=>(s[r]=n.computed(t.__parseFunction(o)),s),{})}function bt(n,e){return Object.entries(n??{}).reduce((t,[s,r])=>(t[s]=e.__parseFunction(r),t),{})}function jt(n,e=[],t){return e.reduce((s,r)=>{const{name:o,from:i}=r||{};r.default;const a=C(i)?t.__parseExpression(i)||o:i??o,u=C(r.default)?t.__parseExpression(r.default):r.default??null;return s[o]=n.inject(a,u),s},{})}function ze(n,e){return Object.keys(n).reduce((t,s)=>{const r=n[s];if(r.type==="mock")t[s]=Ke(r);else if(r.ref){const o=e.$apis[r.ref],i=j(r.transform)?r.transform.value?e.__parseFunction(r.transform):void 0:r.transform;t[s]=async(...a)=>{const u=await o.apply(e,a);return i?i(u):u}}return t},{})}function Ct(n,e=[],t){e.forEach(s=>{n.watch(t.__parseExpression(s.source),t.__parseFunction(s.handler),{deep:s.deep,immediate:s.immediate})})}function Rt(n,e){return Object.entries(n??{}).reduce((t,[s,r])=>{const o=e.__parseFunction(r);return t[s]=async()=>{p.isFunction(o)&&(await p.delay(0),await o())},t},{})}const We=new p.Queue;let se=[],O={},N={},Q={};const Qe=(n,e)=>e;async function me(n,e=window){const{urls:t=[],library:s}=n,r=t.filter(a=>q(a));if(r.length===0||!s)return null;const o=t.filter(a=>B(a));return o.length&&fe(o,e),await pe(r,s,e).catch(a=>(console.warn("loadScriptUrl error",r,s,a),null))}function G(n){const{getDsl:e,getDslByUrl:t,options:s}=n;return s.window&&(se.forEach(r=>{delete s.window[r]}),se=[]),(r,o,i,a=V)=>{if(!i||typeof i=="string")return o;let u="";if(i.type==="Schema"&&i.id)return u=i.id+"_"+r,N[u]||(N[u]=a.defineAsyncComponent(async()=>{const c=O[i.id]||await We.add(i.id,()=>e(i.id));return c&&(c.name=o,O[i.id]=c),c?K({Vue:a,mode:S.Runtime,...s,dsl:p.cloneDeep(c),loader:G(n)}).renderer:null}));if(i.type==="UrlSchema"&&i.url)return u=i.url+"_"+r,N[u]||(N[u]=a.defineAsyncComponent(async()=>{const c=O[i.url]||await t(i.url);return c&&(c.name=o,O[i.url]=c),c?K({...s,Vue:a,dsl:p.cloneDeep(c),mode:S.Runtime,loader:G(n)}).renderer:null}));if(i.type==="Plugin"){let c=i.library?O[i.library]:null;return c||(i.library&&se.push(i.library),c=O[i.library||Symbol()]=a.defineAsyncComponent(async()=>{const l=await me(i,s.window);return l||(console.warn("getPlugin result is null",i),null)}),c)}return o}}function Pt(){O={},N={},Q={},We.clearAllCache()}function Ye(n,e){Q[n]=e}function ie(n){return Q[n]}function At(){Q={}}function M(n,e,t=V,s=Qe,r=[],o=!1){if(!n||!n.name||n.invisible)return null;const i=t.getCurrentInstance()?.appContext,{id:a=null,directives:u=[]}=n,{vIf:c,vElseIf:l,vElse:f,vFor:d,vShow:h,vModels:g,vBind:m,vHtml:v,others:y}=Xe(u);if(!o&&(l||f))return null;if(c&&!Tt(c,e))return Dt(n,e,t,s,r);const w=(_,E=0)=>{const I=_.$components,X=(()=>{if(n.name==="component")return Ot(_,n.props?.is);if(n.name==="slot")return n.name;const P=s(`${n.id}_${E}`,n.name,n.from,t);return p.isString(P)?De(P)||xe(P)?P:I[P]??i?.app?.component(P)??P:P})(),A=Mt(a,n.props??{},_),nt=kt(t,n.events??{},_);if(n.name==="slot")return xt(t,n,A,_,s);m&&Object.assign(A,_.__parseExpression(m.value)),h&&(A.style=Object.assign(A.style??{},Nt(h,_))),v&&Object.assign(A,Lt(v,_)),g.forEach(P=>{le.includes(n.name)?Object.assign(A,Ut(P,_)):Object.assign(A,Bt(t,P,_))});const rt=qt(t,n.children??[],_,s,n),Se=_?.__id?`data-v-${_.__id}`:void 0,ot=Se?{[Se]:""}:{},it=_.__mode===S.Design?{"data-vtj":a}:{},Z=`${a}_${E}`,ee={key:`${a}_${E}`,...ot,...it,...A,...nt};He(ee,ie(Z))||Ye(Z,ee);let te=t.createVNode(X,ie(Z)||ee||{},rt);const we=i?It(i,y,_):[];return we.length&&(te=t.withDirectives(te,we)),te};return d?Gt(d,w,e):w(e)}function It(n,e,t){const s=n.app;return e.map(r=>{const o=typeof r.name=="string"?s.directive(r.name):t.__parseExpression(r.name);if(!o)return null;const i=[o];return r.value&&i.push(t.__parseExpression(r.value)),r.arg&&i.push(r.arg),r.modifiers&&i.push(r.modifiers),i}).filter(r=>!!r)}function Xe(n=[]){const e=n.find(l=>p.camelCase(l.name)==="vIf"),t=n.find(l=>p.camelCase(l.name)==="vElseIf"),s=n.find(l=>p.camelCase(l.name)==="vElse"),r=n.find(l=>p.camelCase(l.name)==="vFor"),o=n.find(l=>p.camelCase(l.name)==="vShow"),i=n.find(l=>p.camelCase(l.name)==="vBind"),a=n.find(l=>p.camelCase(l.name)==="vHtml"),u=n.filter(l=>p.camelCase(l.name)==="vModel"),c=n.filter(l=>!$e.includes(p.camelCase(l.name)));return{vIf:e,vElseIf:t,vElse:s,vFor:r,vShow:o,vModels:u,vBind:i,others:c,vHtml:a}}function Tt(n,e){return!!e.__parseExpression(n.value)}function Ot(n,e){return e?C(e)?n.__parseExpression(e):e:"div"}function Mt(n,e,t){const s=ae(e,t);return s.ref=t.__ref(n,s.ref),s}function ae(n,e){return C(n)?e.__parseExpression(n):j(n)?e.__parseFunction(n):Array.isArray(n)?n.map(t=>ae(t,e)):typeof n=="object"?Object.keys(n||{}).reduce((t,s)=>{let r=n[s];return t[s]=ae(r,e),t},{}):n}function Ft(n,e){return t=>{t?.key?.toLowerCase()===e.toLowerCase()&&n(t)}}function kt(n,e,t){const s=["passive","capture","once"],r={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(e||{}).reduce((o,i)=>{const a=e[i],u=ge(a.modifiers),c=u.find(d=>s.includes(d)),l="on"+p.upperFirstCamelCase(i)+(c&&r[c]||""),f=t.__parseFunction(a.handler);return f&&(o[l]=n.withModifiers(u.includes("enter")?Ft(f,"enter"):f,u)),o},{})}function Dt(n,e,t,s,r=[]){let o=r.findIndex(i=>i.id===n.id);for(let i=++o;i<r.length;i++){const{directives:a=[]}=r[i],{vElseIf:u,vElse:c}=Xe(a);if(u){if(e.__parseExpression(u.value))return M(r[i],e,t,s,r,!0);continue}if(c)return M(r[i],e,t,s,r,!0)}return null}function ge(n={},e=!1){const t=Object.keys(n);return e?t.map(s=>"."+s):t}function xt(n,e,t,s,r){const{children:o}=e,i=Ht(e,s),a=s.$slots?.[i.name];return a?a(t):o?p.isString(o)?n.createTextVNode(o):C(o)?n.createTextVNode(ue(s.__parseExpression(o))):Array.isArray(o)?o.map(u=>M(u,s,n,r,o)):null:null}function Ht(n,e){const{props:t}=n,s=t?.name||"default";return{name:C(s)?e.__parseExpression(s):s,params:[]}}function Nt(n,e){return e.__parseExpression(n.value)?{}:{display:"none"}}function Lt(n,e){return{innerHTML:e.__parseExpression(n.value)||""}}function Ut(n,e){const t={type:"JSFunction",value:n.value?.value?`(v) => {
12
+ `:`with(${t?"{}":"$scope || {}"}) { ${i} }`;return new Function("$scope",a)(e)}catch(o){if(f.logger.error("parseExpression.error",o,n,e?.__self??e),s)throw o}}function R(n,e,t=!1,s=!1,r=!1){const o=H(n,e,t,s,r);if(typeof o!="function"&&(f.logger.error("parseFunction.error","not a function",n,e?.__self??e),s))throw new Error(`"${n.value}" not a function`);return o}function C(n){return n&&n.type==="JSExpression"}function j(n){return typeof n=="object"&&n&&n.type==="JSFunction"}function xe(n){return C(n)||j(n)}function dt(n){return xe(n)?n.value:JSON.stringify(n)}const ht={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:void 0,auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面",appName:"",statusKey:"code"},fe=Symbol("access");class Q{options;data=null;mode=S.Raw;interceptResponse=!0;isTipShowing=!1;constructor(e){this.options=Object.assign({},ht,e),this.loadData()}enableIntercept(){this.interceptResponse=!0}disableIntercept(){this.interceptResponse=!1}connect(e){const{mode:t,router:s,request:r}=e;this.mode=t,s&&this.mode!==S.Design&&this.setGuard(s),r&&this.setRequest(r)}login(e){const{storageKey:t,storagePrefix:s,session:r,authKey:o}=this.options;this.setData(e),this.data&&(f.storage.save(t,e,{type:"local",prefix:s}),r&&f.cookie.set(o,this.data.token))}clear(){const{storageKey:e,storagePrefix:t,session:s,authKey:r}=this.options;this.data=null,f.storage.remove(e,{type:"local",prefix:t}),s&&f.cookie.remove(r)}logout(){this.clear(),this.toLogin()}getData(){return this.data?this.data:(this.loadData(),this.data)}getToken(){return this.data||this.loadData(),this.data?.token}can(e){const{appName:t}=this.options,{permissions:s={}}=this.data||{};return typeof e=="function"?e(s):f.toArray(e).every(o=>s[o]||s[t+"."+o])}some(e){const{appName:t}=this.options,{permissions:s={}}=this.data||{};return f.toArray(e).some(o=>s[o]||s[t+"."+o])}install(e){e.config.globalProperties.$access=this,e.provide(fe,this)}isAuthPath(e){const{auth:t,isAuth:s}=this.options;if(s)return s(e);if(e.path&&typeof t=="string"){const r=t.split("#")[1]||t;return e.path===r}return!1}toLogin(){const{auth:e,redirectParam:t}=this.options;if(!e)return;const s=t?`?${t}=${encodeURIComponent(location.href)}`:"";typeof e=="function"?e(s):location.href=t?`${e}${s}`:e}setData(e){const{privateKey:t}=this.options;if(Array.isArray(e)&&t){const s=e.map(r=>f.unRSA(r,t));try{this.data=JSON.parse(s.join(""))}catch(r){console.warn(r)}return}if(typeof e=="string")try{const s=t?f.unRSA(e,t):e;s?this.data=JSON.parse(s):console.warn("RSA解密失败或登录信息缺失")}catch(s){console.warn(s)}else this.data=e}loadData(){const{storageKey:e,storagePrefix:t}=this.options,s=f.storage.get(e,{type:"local",prefix:t});this.setData(s||null)}isLogined(){const{session:e,authKey:t}=this.options;return e&&t?!!f.cookie.get(t):!!this.getToken()}hasRoutePermission(e){if(e.name===D){const t=e.params.id;return t&&this.can(t)}return e.meta.__vtj__?this.can(e.meta.__vtj__):e.meta.permission?this.can(e.meta.permission):!0}setGuard(e){e.beforeEach((t,s,r)=>this.guard(t,r))}async guard(e,t){if(this.isWhiteList(e)||this.isAuthPath(e))return t();if(this.isLogined()){if(this.hasRoutePermission(e))return t();{const{noPermissionMessage:s="无权限访问",unauthorized:r=!1}=this.options;return await this.showTip(s),f.isFunction(r)?(r(),t(!1)):f.isString(r)?t(r):t(!1)}}t(!1),await f.delay(0),this.toLogin()}isWhiteList(e){const{whiteList:t}=this.options;return t?Array.isArray(t)?t.some(s=>e.fullPath.startsWith(s)):t(e):!1}isUnauthorized(e){const{unauthorizedCode:t=401,statusKey:s="code"}=this.options;return e.status===t||e.data?.[s]===t}async showUnauthorizedAlert(e){const{unauthorizedMessage:t="登录已失效"}=this.options;this.isUnauthorized(e)&&await this.showTip(t)&&this.toLogin()}async showTip(e){const{alert:t}=this.options;return this.isTipShowing?!1:t?(this.isTipShowing=!0,await f.delay(150),await t(e,{title:"提示",type:"warning"})?.catch(()=>!0)?.finally(()=>{this.isTipShowing=!1})):(window.alert(e),!0)}setRequest(e){e.useRequest(t=>(this.data?.token&&(t.headers[this.options.authKey]=this.data?.token),t)),e.useResponse(async t=>(this.interceptResponse&&await this.showUnauthorizedAlert(t),t),async t=>{if(!this.interceptResponse)return Promise.reject(t);const s=t.response||t||{};return await this.showUnauthorizedAlert(s),Promise.reject(t)})}}function He(){return b.inject(fe,null)}function mt(n={}){const{notify:e,loading:t,settings:s={},Startup:r,access:o,useTitle:i,alert:a}=n;let u=null;return{request:f.createRequest({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:l=>l.data?.code===0||!!l.data?.success,failMessage:!0,showError:l=>{e&&e(l||"未知错误")},showLoading:()=>{u&&u.close(),t&&(u=t())},hideLoading:()=>{u&&(u.close(),u=null)},...s}}),jsonp:f.jsonp,notify:e,loading:t,useTitle:i,alert:a,startupComponent:r,access:o?new Q({alert:a,...o}):void 0}}function gt(n={}){return new Q(n)}function Ne(n,e){const{jsonp:t,request:s}=e;if(n.method==="jsonp")return(r={})=>t(n.url,{...n.jsonpOptions,query:r});{const r=n.headers?H(n.headers,{},!0):void 0,o={url:n.url,method:n.method,settings:{...n.settings,headers:r}};return(i,a)=>(delete o.data,s.send(f.merge(o,a||{},{data:i})))}}function Le(n,e){const{metaQuery:t}=e;if(!t)return;const{code:s,queryCode:r}=n;return(o,i)=>{if(!t){console.warn("adapter.metaQuery is not defined!");return}return t(s,r,o,i)}}function Ue(n=[],e=[],t){const s={};for(const r of n){const o=Ne(r,t);s[r.id]=o,s[r.name]=o}for(const r of e)s[r.id]=Le(r,t);return s}async function Be(n=[],e=window){const t=x(e);t&&(de(e),n.forEach(s=>Je(t,s)))}function qe(n,e=window){const t=j(n.mockTemplate)&&n.mockTemplate.value?R(n.mockTemplate,{},!0):void 0,s=x(e);return async(...r)=>{let o={};if(t)try{o=await t.apply(t,r)}catch(i){f.logger.warn("模拟数据模版异常",i)}return s?.mock(o)}}function Je(n,e){if(!e.mock)return;const{url:t,mockTemplate:s}=e;if(t&&s)try{const r=f.isUrl(t)?new URL(t).pathname:t,o=f.pathToRegexp(`(.*)${r}(.*)`),i=f.pathToRegexpMatch(r,{decode:decodeURIComponent}),a=H(s,{},!0);n.mock(o,u=>{const c=f.url.parse(u.url)||{},l=u.body instanceof FormData?f.formDataToJson(u.body):u.body,p=f.isUrl(u.url)?new URL(u.url).pathname:u.url.split("?")[0],d=i(p)?.params;Object.assign(u,{data:l,params:d,query:c});try{return n.mock(a(u))}catch(h){return console.warn("[mockApi]",o,u,h),null}})}catch(r){console.warn("mockApi",r)}}function de(n=window){const e=x(n);e&&(e._mocked={})}class Ke{__id=null;__mode;__instance=null;__contextRefs={};__refs={};__refCaches={};context={};state={};props={};$props={};$refs={};$el=null;$emit=null;$nextTick=null;$parent=null;$root=null;$attrs=null;$slots=null;$watch=null;$options=null;$forceUpdate=null;$components={};$libs={};$apis={};$provider=null;__transform={};constructor(e){const{mode:t,dsl:s,attrs:r}=e;this.__mode=t,s&&(this.__id=s.id||null,this.__transform=s.transform||{}),r&&Object.assign(this,r)}setup(e,t=V){const s=t.getCurrentInstance();if(!s)return;this.__refs={},this.__refCaches={},this.$refs={},this.context={},this.__contextRefs={},this.__instance=s.proxy;const r=s.appContext.config.globalProperties;Object.assign(this,r),Object.assign(this,e||{}),this.__proxy(),t.onMounted(()=>{this.__proxy()}),t.onUnmounted(()=>{this.__cleanup()}),t.onBeforeUpdate(()=>{this.__reset()})}__proxy(){this.__instance&&oe.forEach(e=>{this[e]=this.__instance?.[e]})}__cleanup(){oe.forEach(e=>{this[e]=null}),this.__reset()}__reset(){this.__refs={},this.__refCaches={},this.$refs={},this.__contextRefs={},this.context={}}__parseFunction(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:s}=e,r=t?this.__transform[t]??e.value:e.value;return R({type:s,value:r},this)}else return R(e,this)}__parseExpression(e){if(e)if(this.__mode===S.Runtime){const{id:t,type:s}=e,r=t?this.__transform[t]??e.value:e.value;return H({type:s,value:r},this)}else return H(e,this)}__ref(e=null,t){if(this.__mode===S.VNode)return;e&&e!==this.__id&&(this.__contextRefs[e]=this);let s=e?this.__refCaches[e]:null;return s||(s=async r=>{await f.delay(0);let o=r?.$vtjEl||r?.$el||r?._?.vnode?.el||r;if(!o){typeof t=="string"&&(delete this.$refs[t],e&&delete this.__refs[e]);return}return o.nodeType===3&&o.nextSibling&&(o=o.nextSibling),o.__vtj__=e,S.Design===this.__mode&&(o.__context__=this,o.draggable=!0),e&&(this.__refs[e]=this.__getRefEl(this.__refs,e,r)),typeof t=="function"?t(r):t&&(this.$refs[t]=this.__getRefEl(this.$refs,t,r)),r},e&&(this.__refCaches[e]=s),s)}__getRefEl(e,t,s){const r=e[t];if(r&&s!==r){const o=new Set([].concat(r,s));return Array.from(o)}else return s}__clone(e={}){const t={...this.context,...e},s={...t,context:t};return s.context.__proto__=this.context,s.__proto__=this,s}}function G(n){const{Vue:e=V,mode:t=S.Runtime,components:s={},libs:r={},apis:o={},loader:i}=n,a=e.computed(()=>n.dsl),u={$components:s,$libs:r,$apis:o},c=new Ke({mode:t,dsl:a.value,attrs:u}),l=e.defineComponent({name:a.value.name,__scopeId:a.value.id?`data-v-${a.value.id}`:void 0,props:{...vt(a.value.props??[],c)},async setup(p){c.$props=p,c.props=p,a.value.id&&W(n.window||window,a.value.id,a.value.css||"",!0),c.state=yt(e,a.value.state??{},c);const d=St(e,a.value.computed??{},c),h=wt(a.value.methods??{},c),g=Et(e,a.value.inject,c);for(const[v,w]of Object.entries(g||{}))g[v]=e.inject(v,w);const m=Ge(a.value.dataSources||{},c),_={...g,...d,...h,...m};return c.setup(_,e),$t(e,a.value.watch??[],c),{vtj:c,state:c.state,...d,...h}},emits:_t(a.value.emits),expose:["vtj",...a.value.expose||[]],render(){if(!a.value.nodes)return null;const p=a.value.nodes||[];if(p.length===1)return F(p[0],c,e,i,p);{const d=p.map(h=>F(h,c,e,i,p));return e.createVNode("div",{},d)}},...bt(a.value.lifeCycles??{},c)});return{renderer:e.markRaw(l),context:c}}function _t(n=[]){return n.map(e=>f.isString(e)?e:e.name)}function vt(n=[],e){const t=s=>s?(Array.isArray(s)?s:[s]).map(o=>$e[o]):void 0;return n.map(s=>f.isString(s)?{name:s}:{name:s.name,type:s.type,required:s.required,default:C(s.default)?e.__parseExpression(s.default):s.default}).reduce((s,r)=>(s[r.name]={type:t(r.type),required:r.required,default:r.default},s),{})}function yt(n,e,t){return n.reactive(Object.keys(e||{}).reduce((s,r)=>{let o=e[r];return C(o)?o=t.__parseExpression(o):j(o)&&(o=t.__parseFunction(o)),s[r]=o,s},{}))}function St(n,e,t){return Object.entries(e??{}).reduce((s,[r,o])=>(s[r]=n.computed(t.__parseFunction(o)),s),{})}function wt(n,e){return Object.entries(n??{}).reduce((t,[s,r])=>(t[s]=e.__parseFunction(r),t),{})}function Et(n,e=[],t){return e.reduce((s,r)=>{const{name:o,from:i}=r||{};r.default;const a=C(i)?t.__parseExpression(i)||o:i??o,u=C(r.default)?t.__parseExpression(r.default):r.default??null;return s[o]=n.inject(a,u),s},{})}function Ge(n,e){return Object.keys(n).reduce((t,s)=>{const r=n[s];if(r.type==="mock")t[s]=qe(r);else if(r.ref){const o=e.$apis[r.ref],i=j(r.transform)?r.transform.value?e.__parseFunction(r.transform):void 0:r.transform;t[s]=async(...a)=>{const u=await o.apply(e,a);return i?i(u):u}}return t},{})}function $t(n,e=[],t){e.forEach(s=>{n.watch(t.__parseExpression(s.source),t.__parseFunction(s.handler),{deep:s.deep,immediate:s.immediate})})}function bt(n,e){return Object.entries(n??{}).reduce((t,[s,r])=>{const o=e.__parseFunction(r);return t[s]=async()=>{f.isFunction(o)&&(await f.delay(0),await o())},t},{})}class jt{__props={};__events={};__nodes={};constructor(){}setProps(e,t){this.__props[e]=t}getProps(e){return this.__props[e]}setEvents(e,t){}getEvents(e){return this.__events[e]}setNode(e,t){this.__nodes[e]=t}getNode(e){return this.__nodes[e]}isEqual(e,t){return f.isEqual(e,t)}clear(){this.__props={},this.__events={},this.__nodes={}}}const I=new jt,ze=new f.Queue;let se=[],O={},L={};const Ve=(n,e)=>e;async function he(n,e=window){const{urls:t=[],library:s}=n,r=t.filter(a=>J(a));if(r.length===0||!s)return null;const o=t.filter(a=>q(a));return o.length&&ue(o,e),await pe(r,s,e).catch(a=>(console.warn("loadScriptUrl error",r,s,a),null))}function z(n){const{getDsl:e,getDslByUrl:t,options:s}=n;return s.window&&(se.forEach(r=>{delete s.window[r]}),se=[]),(r,o,i,a=V)=>{if(!i||typeof i=="string")return o;let u="";if(i.type==="Schema"&&i.id)return u=i.id+"_"+r,L[u]||(L[u]=a.defineAsyncComponent(async()=>{const c=O[i.id]||await ze.add(i.id,()=>e(i.id));return c&&(c.name=o,O[i.id]=c),c?G({Vue:a,mode:S.Runtime,...s,dsl:f.cloneDeep(c),loader:z(n)}).renderer:null}));if(i.type==="UrlSchema"&&i.url)return u=i.url+"_"+r,L[u]||(L[u]=a.defineAsyncComponent(async()=>{const c=O[i.url]||await t(i.url);return c&&(c.name=o,O[i.url]=c),c?G({...s,Vue:a,dsl:f.cloneDeep(c),mode:S.Runtime,loader:z(n)}).renderer:null}));if(i.type==="Plugin"){let c=i.library?O[i.library]:null;return c||(i.library&&se.push(i.library),c=O[i.library||Symbol()]=a.defineAsyncComponent(async()=>{const l=await he(i,s.window);return l||(console.warn("getPlugin result is null",i),null)}),c)}return o}}function Ct(){O={},L={},ze.clearAllCache(),I.clear()}function F(n,e,t=V,s=Ve,r=[],o=!1){if(!n||!n.name||n.invisible)return null;const i=t.getCurrentInstance()?.appContext,{id:a=null,directives:u=[]}=n,{vIf:c,vElseIf:l,vElse:p,vFor:d,vShow:h,vModels:g,vBind:m,vHtml:_,others:v}=We(u);if(!o&&(l||p))return null;if(c&&!Pt(c,e))return Ot(n,e,t,s,r);const w=(y,E=0)=>{const T=y.$components,X=(()=>{if(n.name==="component")return At(y,n.props?.is);if(n.name==="slot")return n.name;const P=s(`${n.id}_${E}`,n.name,n.from,t);return f.isString(P)?ke(P)||De(P)?P:T[P]??i?.app?.component(P)??P:P})(),A=It(a,n.props??{},y),et=Mt(t,n.id,n.events??{},y);if(n.name==="slot")return Ft(t,n,A,y,s);m&&Object.assign(A,y.__parseExpression(m.value)),h&&(A.style=Object.assign(A.style??{},Dt(h,y))),_&&Object.assign(A,xt(_,y)),g.forEach(P=>{ce.includes(n.name)?Object.assign(A,Ht(P,y)):Object.assign(A,Nt(t,P,y))});const tt=Lt(t,n.children??[],y,s,n),ye=y?.__id?`data-v-${y.__id}`:void 0,st=ye?{[ye]:""}:{},nt=y.__mode===S.Design?{"data-vtj":a}:{},Z=`${a}_${E}`,ee={key:`${a}_${E}`,...st,...nt,...A,...et};I.isEqual(ee,I.getNode(Z))||I.setNode(Z,ee);let te=t.createVNode(X,I.getNode(Z)||ee||{},tt);const Se=i?Rt(i,v,y):[];return Se.length&&(te=t.withDirectives(te,Se)),te};return d?qt(d,w,e):w(e)}function Rt(n,e,t){const s=n.app;return e.map(r=>{const o=typeof r.name=="string"?s.directive(r.name):t.__parseExpression(r.name);if(!o)return null;const i=[o];return r.value&&i.push(t.__parseExpression(r.value)),r.arg&&i.push(r.arg),r.modifiers&&i.push(r.modifiers),i}).filter(r=>!!r)}function We(n=[]){const e=n.find(l=>f.camelCase(l.name)==="vIf"),t=n.find(l=>f.camelCase(l.name)==="vElseIf"),s=n.find(l=>f.camelCase(l.name)==="vElse"),r=n.find(l=>f.camelCase(l.name)==="vFor"),o=n.find(l=>f.camelCase(l.name)==="vShow"),i=n.find(l=>f.camelCase(l.name)==="vBind"),a=n.find(l=>f.camelCase(l.name)==="vHtml"),u=n.filter(l=>f.camelCase(l.name)==="vModel"),c=n.filter(l=>!Ee.includes(f.camelCase(l.name)));return{vIf:e,vElseIf:t,vElse:s,vFor:r,vShow:o,vModels:u,vBind:i,others:c,vHtml:a}}function Pt(n,e){return!!e.__parseExpression(n.value)}function At(n,e){return e?C(e)?n.__parseExpression(e):e:"div"}function It(n,e,t){const s=n?I.getProps(n):null;if(s)return s;const r=ie(e,t);return r.ref=t.__ref(n,r.ref),n&&I.setProps(n,r),r}function ie(n,e){return C(n)?e.__parseExpression(n):j(n)?e.__parseFunction(n):Array.isArray(n)?n.map(t=>ie(t,e)):typeof n=="object"?Object.keys(n||{}).reduce((t,s)=>{let r=n[s];return t[s]=ie(r,e),t},{}):n}function Tt(n,e){return t=>{t?.key?.toLowerCase()===e.toLowerCase()&&n(t)}}function Mt(n,e,t,s){const r=e?I.getEvents(e):null;if(r)return r;const o=["passive","capture","once"],i={capture:"Capture",once:"Once",passive:"OnceCapture"},a=Object.keys(t||{}).reduce((u,c)=>{const l=t[c],p=me(l.modifiers),d=p.find(m=>o.includes(m)),h="on"+f.upperFirstCamelCase(c)+(d&&i[d]||""),g=s.__parseFunction(l.handler);return g&&(u[h]=n.withModifiers(p.includes("enter")?Tt(g,"enter"):g,p)),u},{});return e&&I.setEvents(e,a),a}function Ot(n,e,t,s,r=[]){let o=r.findIndex(i=>i.id===n.id);for(let i=++o;i<r.length;i++){const{directives:a=[]}=r[i],{vElseIf:u,vElse:c}=We(a);if(u){if(e.__parseExpression(u.value))return F(r[i],e,t,s,r,!0);continue}if(c)return F(r[i],e,t,s,r,!0)}return null}function me(n={},e=!1){const t=Object.keys(n);return e?t.map(s=>"."+s):t}function Ft(n,e,t,s,r){const{children:o}=e,i=kt(e,s),a=s.$slots?.[i.name];return a?a(t):o?f.isString(o)?n.createTextVNode(o):C(o)?n.createTextVNode(le(s.__parseExpression(o))):Array.isArray(o)?o.map(u=>F(u,s,n,r,o)):null:null}function kt(n,e){const{props:t}=n,s=t?.name||"default";return{name:C(s)?e.__parseExpression(s):s,params:[]}}function Dt(n,e){return e.__parseExpression(n.value)?{}:{display:"none"}}function xt(n,e){return{innerHTML:e.__parseExpression(n.value)||""}}function Ht(n,e){const t={type:"JSFunction",value:n.value?.value?`(v) => {
13
13
  ${n.value.value} = v?.target.value;
14
- }`:"(v) => {}"};return{[C(n.arg)?e.__parseExpression(n.arg):n.arg||"value"]:e.__parseExpression(n.value),onInput:e.__parseFunction(t)}}function Bt(n,e,t){const s={type:"JSFunction",value:e.value?.value?`(v) => {
14
+ }`:"(v) => {}"};return{[C(n.arg)?e.__parseExpression(n.arg):n.arg||"value"]:e.__parseExpression(n.value),onInput:e.__parseFunction(t)}}function Nt(n,e,t){const s={type:"JSFunction",value:e.value?.value?`(v) => {
15
15
  ${e.value.value} = v;
16
- }`:"(v) => {}"},r=t.__parseFunction(s),o=ge(C(e.modifiers)?t.__parseExpression(e.modifiers):e.modifiers),i=C(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[i]:t.__parseExpression(e.value),[`onUpdate:${i}`]:o.length&&r?n.withModifiers(r,o):r}}function qt(n,e,t,s,r){if(!e)return null;if(p.isString(e))return{default:()=>e};if(C(e))return{default:()=>ue(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const o=Jt(e),i=(a,u)=>!a||!r?{}:r?.id&&Object.keys(a).length?u?{[u]:a}:{[`scope_${r.id}`]:a}:u?{[u]:Object.create(null)}:{};return Object.entries(o).reduce((a,[u,{nodes:c,params:l,scope:f}])=>(a[u]=d=>{const h=l.length?p.pick(d??{},l):i(d,f);return c.map(g=>M(g,t.__clone(h),n,s,c))},a),{})}return null}function Jt(n){const e={};for(const t of n){const s=Kt(t.slot),r=s.name;e[r]?(e[r].nodes.push(t),e[r].params=e[r].params.concat(s.params),e[r].scope=s.scope||""):e[r]={nodes:[t],params:s.params,scope:s.scope||""}}return e}function Kt(n="default"){return p.isString(n)?{name:n,params:[],scope:""}:{params:[],scope:"",...n}}function Gt(n,e,t){const{value:s,iterator:r}=n,{item:o="item",index:i="index"}=r||{};let a=t.__parseExpression(s)||[];return Number.isInteger(a)&&(a=new Array(a).fill(!0).map((u,c)=>c+1)),Array.isArray(a)?a.map((u,c)=>e(t.__clone({[o]:u,[i]:c}),c)):(console.warn("[vForRender]:",`${s?.value} is not a Arrary`),[])}const ne=b.defineComponent({name:"VtjPageContainer",async setup(){const n=_e(),e=Ee.useRoute(),t=e.meta.__vtj__||e.params.id,s=t?n.getPage(t):n.getHomepage(),r=s?await n.getRenderComponent(s.id):null,o=b.ref(Symbol());if(s){Object.assign(e.meta,s.meta||{},{cache:s.cache});const{useTitle:i}=n?.adapter;if(i){const a=e.meta.title||s.title||"VTJ.PRO";i(a)}}return{provider:n,component:r,file:s,query:e.query,meta:e.meta,sid:o,route:e}},render(){const{component:n,query:e,sid:t}=this;return n?b.h(n,{...e,key:t}):b.h("div",{style:{padding:"10px"}},"找不到组件,组件不存在或未发布!")},activated(){this.meta.cache===!1&&(this.sid=Symbol())}}),Vt=b.defineComponent({name:"VtjStartupContainer",render(){return b.h("div","page not found!")}});function U(n,e,t=[]){const s=[];for(const r of t){const{id:o,title:i,icon:a,children:u,hidden:c,layout:l}=r;if(l){const f=U(n,e,u||[]);s.push(...f)}else{const f={id:o,title:i,icon:a,hidden:c,url:`${n}/${e}/${o}`,children:u&&u.length?U(n,e,u):void 0};s.push(f)}}return s}function ve(n,e){if(!e)return n;let t=[];for(const s of n)if(s.children&&s.children.length){const r=ve(s.children,e);r.length&&(s.children=r,t.push(s))}else e.can(s.id.toString())&&t.push(s);return t}function zt(n){const{menuPathPrefix:e="",pageRouteName:t="page",disableMenusFilter:s=!1}=n||{},r=_e(),o=Ee.useRoute(),i=Le(),a=b.ref(!1),u=b.ref(!1),c=r.project,l=(h,g)=>{a.value=!h?.mask,u.value=g?.pure??!!h?.pure};b.watchEffect(()=>{const{name:h,params:g,meta:m}=o;if(h===k){const v=r.getPage(g.id);l(v,m)}else if(h===L){const v=r.getHomepage();l(v,m)}else{const v=m.__vtj__;if(v){const y=r.getPage(v);l(y,m)}else a.value=!m.mask,u.value=!!m.pure}});const f=U(e,t,c?.pages),d=c?.config;return{disabled:a,logo:d?.logo,themeSwitchable:d?.themeSwitchable,title:d?.title||c?.description||c?.name||"VTJ App",menus:s?f:ve(f,i),pure:u}}function re(n,e){const{id:t,title:s,meta:r}=n,{name:o="page",prefix:i="",component:a,routeMeta:u}=e;return{name:t,path:`${i}${o}/${t}`,component:a,meta:{title:s,...u,...r,__vtj__:t}}}function ce(n){const{name:e="page",prefix:t="",pages:s=[],component:r,loader:o,routeMeta:i,homepage:a}=n,u=[];for(const c of s){const{id:l,title:f,dir:d,layout:h,children:g,meta:m}=c;if(d){const v=ce({name:e,prefix:t,component:r,routeMeta:i,homepage:a,loader:o,pages:g||[]});u.push(...v)}else if(h){const v=ce({name:e,prefix:t,component:r,routeMeta:i,homepage:a,loader:o,pages:g||[]}),y={name:`layout_${l}`,path:t,component:()=>o(l),meta:{title:f,...i,...m,__vtj__:l},children:v};u.push(y),u.push(re(c,n))}else if(u.push(re(c,n)),a===l){const v=re(c,n);v.path="",v.name=`home_${l}`,u.push(v)}}return u}function Wt(n={},e){const{css:t,store:s,enhance:r}=n,{window:o,app:i,library:a={},adapter:u,mode:c}=e,{Pinia:l}=a;i.config.globalProperties.$libs=a,z(o,"global-css",t||""),l&&s&&Qt(s,i,l),Xt(i,u,n),!u.access&&n.access&&Yt(n.access,i,c,u),Zt(i,n),r&&es(r,i,a)}function Qt(n,e,t){const s=t.createPinia();if(e.use(s),j(n)&&n.value){const r=R(n,{},!1,!1,!0),o=t.defineStore("$store",r(e)||{});e.config.globalProperties.$store=o()}}function Yt(n,e,t,s){if(j(n)&&n.value){const r=R(n,{},!1,!1,!0),{alert:o,request:i}=s,a=new W({alert:o,storagePrefix:"__VTJ_APP_",...r(e)}),u=e.config.globalProperties.$router;a.connect({mode:t,router:u,request:i}),e.use(a)}}function Xt(n,e,t){if(!e.request)return;const{axios:s,request:r,response:o}=t;if(s&&j(s)&&s.value){const i=R(s,{},!1,!1,!0);e.request.setConfig(i(n))}if(r&&j(r)&&r.value){const i=R(r,{},!1,!1,!0),a=e.request;a.__unReq&&a.__unReq(),a.__unReq=e.request.useRequest(u=>i(u,n))}if(o&&j(o)&&o.value){const i=R(o,{},!1,!1,!0),a=e.request;a.__unRes&&a.__unRes(),a.__unRes=e.request.useResponse(u=>i(u,n))}}function Zt(n,e){const{beforeEach:t,afterEach:s}=e,r=n.config.globalProperties.$router;if(t&&j(t)&&t.value){const o=R(t,{},!1,!1,!0);r&&r.beforeEach((i,a,u)=>o(i,a,u,n))}if(s&&j(s)&&s.value){const o=R(s,{},!1,!1,!0);r&&r.afterEach((i,a,u)=>o(i,a,u,n))}}function es(n,e,t={}){j(n)&&n.value&&R(n,{},!1,!1,!0)(e,t)}function ts(n,e,t){if(!n||!e||!t)return;const{VueI18n:s}=e;if(s){const{locale:r,fallbackLocale:o,messages:i=[]}=t,a={};for(let c of i){const l=Object.keys(c).filter(f=>f!=="key");for(const f of l)a[f]||(a[f]={}),a[f][c.key]=c[f]}const u=s.createI18n({legacy:!1,locale:r,fallbackLocale:o,messages:a});n.use(u)}}const ye=Symbol("Provider");var Ze=(n=>(n.Production="production",n.Development="development",n))(Ze||{});class et extends T.Base{constructor(e){super(),this.options=e;const{service:t,mode:s=S.Raw,dependencies:r,materials:o,project:i={},adapter:a={},globals:u={},modules:c={},router:l=null,materialPath:f="./",nodeEnv:d="development"}=e;this.mode=s,this.modules=c,this.service=t,this.router=l,this.materialPath=f,this.nodeEnv=d,r&&(this.dependencies=r),o&&(this.materials=o),Object.assign(this.globals,u),Object.assign(this.adapter,a);const{access:h,request:g}=this.adapter;h&&h.connect({mode:s,router:l,request:g}),i&&s!==S.Design?this.load(i):this.project=i}mode;globals={};modules={};adapter={request:p.request,jsonp:p.jsonp};apis={};dependencies={};materials={};library={};libraryLocales={};libraryLocaleMap={};service;project=null;components={};nodeEnv="development";env={};router=null;materialPath="./";urlDslCaches={};errorHandler=null;createMock(e){return async(...t)=>{let s={};if(e)try{s=await e.apply(e,t)}catch(o){p.logger.warn("模拟数据模版异常",o)}return D()?.mock(s)}}async load(e){const{vtjDir:t=".vtj"}=this.options,s=this.modules[`${t}/projects/${e.id}.json`]||this.modules[`/src/${t}/projects/${e.id}.json`];if(this.project=s?await s():await this.service.init(e),!this.project)throw new Error("project is null");const{apis:r=[],meta:o=[],env:i=[]}=this.project,a=window;a&&(a.CKEDITOR_VERSION=void 0),this.initEnv(i),this.mode===S.Raw?await this.loadDependencies(a):await this.loadAssets(a),this.initMock(a),this.apis=qe(r,o,this.adapter),he(a),Je(r,a),e.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const t=D(e);t&&t.setup({timeout:"50-500"})}async loadDependencies(e={}){const t=Object.entries(this.dependencies);for(const[s,r]of t)e[s]||(e[s]=this.library[s]=await r())}async loadAssets(e={}){const{dependencies:t=[]}=this.project,{dependencies:s,library:r,components:o,materialPath:i,nodeEnv:a,libraryLocales:u}=this,{libraryExports:c,libraryMap:l,materials:f,materialExports:d,materialMapLibrary:h,libraryLocaleMap:g}=Pe(t,i,a==="development");Object.assign(this.libraryLocaleMap,g);for(const m of c){const v=s[m],y=e[m];if(y)r[m]=y;else if(v)e[m]=r[m]=await v();else{const _=l[m]||[];for(const E of _)B(E)&&await Fe(E,p.url.append(E,{v:F})),q(E)&&await p.loadScript(p.url.append(E,{v:F}));r[m]=e[m]}const w=g[m];if(w){const _=s[w];u[w]=_?await _():e[w]}}if(a==="development"){for(const v of f)await p.loadScript(p.url.append(v,{v:F}));const m=this.materials||{};for(const v of d){const y=e[h[v]],w=y?.default||y,_=T.BUILT_IN_COMPONENTS[v];if(_)w&&_.forEach(E=>{o[E]=w[E]});else{const E=m[v]?(await m[v]()).default:e[v];E&&w&&(E.components||[]).forEach(I=>{o[I.name]=Ae(I,w)})}}}}initRouter(){const{router:e,project:t,options:s,adapter:r}=this;if(!e)return;const o=t?.platform==="uniapp"?"pages":"page",{routeAppendTo:i,pageRouteName:a=o,routeMeta:u}=s,c=i?"":"/",l={path:`${c}${a}/:id`,name:k,component:ne},f=this.getHomepage(),d={path:c,name:L,component:f?ne:r.startupComponent||Vt,meta:u};if(e.hasRoute(k)&&e.removeRoute(k),e.hasRoute(L)&&e.removeRoute(L),s.enableStaticRoute){const h=t?.pages||[];ce({name:a,prefix:c,pages:h,component:ne,loader:this.getRenderComponent.bind(this),homepage:f?.id}).forEach(m=>{i?e.addRoute(i,m):e.addRoute(m)}),f||(i?e.addRoute(i,d):e.addRoute(d))}else i?(e.addRoute(i,l),e.addRoute(i,d)):(e.addRoute(l),e.addRoute(d))}setErrorHandler(e){e.config.errorHandler=p.debounce((t,s,r)=>{const o=s?.$options.name,i=typeof t=="string"?t:t?.message||t?.msg||"未知错误",a=`[ ${o} ] ${i} ${r}`;["getComputedStyle","ResizeObserver"].some(c=>a.includes(c))||(console.error("[VTJ Error]:",{err:t,instance:s,info:r},t?.stack),this.errorHandler&&this.errorHandler(t),this.adapter.notify&&this.adapter.notify(a,"组件渲染错误","error"))},300)}install(e){const{libraryLocaleMap:t,libraryLocales:s}=this,{libraryOptions:r={}}=this.options,o=e.config.globalProperties.installed||{};for(const[i,a]of Object.entries(this.library))if(!o[i]&&ke(a)){const c={locale:s[t[i]]},l=r[i]||{},f={...c,...l};e.use(a,f),o[i]=!0}e.provide(ye,this),e.config.globalProperties.$provider=this,e.config.globalProperties.$request=this.adapter?.request,this.options.install&&e.use(this.options.install),this.adapter.access&&e.use(this.adapter.access),this.project?.platform!=="uniapp"&&this.mode!==S.Design&&this.initGlobals(this.project?.globals||{},{app:e,window,adapter:this.adapter,library:this.library,mode:this.mode}),this.mode!==S.Design&&this.project?.i18n&&this.initI18n(e,this.library,this.project.i18n),this.options.enhance&&e.use(this.options.enhance,this),this.mode===S.Design&&this.setErrorHandler(e),e.config.globalProperties.installed=o}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(s=>s.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},s=(r,o=[])=>{for(const i of o){if(i.id===r)return i;if(i.children&&i.children.length){const a=s(r,i.children);if(a)return a}}};return s(e,t)||null}getFirstPage(){const{pages:e=[]}=this.project||{};if(!e.length)return null;const t=(s=[])=>{for(const r of s){if(r.type==="page"&&!r.dir&&!r.layout)return r;if(r.children&&r.children.length){const o=t(r.children);if(o)return o}}};return t(e)||null}getMenus(e="page",t=""){return U(t,e,this.project?.pages||[])}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):this.getFirstPage()}async getDsl(e){const{vtjDir:t=".vtj"}=this.options,s=this.modules[`${t}/files/${e}.json`]||this.modules[`/src/${t}/files/${e}.json`];return s?await s():this.service.getFile(e,this.project||void 0).catch(()=>null)}async getDslByUrl(e){const t=this.urlDslCaches[e];return t||(this.adapter.request?this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(s=>s.data).catch(()=>null):null)}createDslRenderer(e,t={}){const{library:s,components:r,mode:o,apis:i}=this,a={mode:o,Vue:s.Vue,components:r,libs:s,apis:i,window,...t},u=G({getDsl:async c=>await this.getDsl(c)||null,getDslByUrl:async c=>await this.getDslByUrl(c)||null,options:a});return K({...a,dsl:e,loader:u})}async getRenderComponent(e,t){const s=this.getFile(e);if(!s)return p.logger.warn(`Can not find file: ${e}`),null;if(t&&t(s),this.mode===S.Raw){const{vtjRawDir:o=".vtj/vue"}=this.options,i=`${o}/${e}.vue`,a=this.modules[i]||this.modules[`/src/pages/${e}.vue`];return a?(await a())?.default:this.nodeEnv==="development"&&this.adapter.startupComponent||null}const r=await this.getDsl(s.id);return r?this.createDslRenderer(r).renderer:(p.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,t){return b.defineAsyncComponent(async()=>{const s=await this.getDslByUrl(e);return s?(s.name=t||s.name,this.createDslRenderer(s).renderer):null})}definePluginComponent(e){return b.defineAsyncComponent(async()=>await me(e,window))}initGlobals(e,t){const s=Object.assign({adapter:this.adapter,window},t);Wt(e,s)}initI18n(e,t,s){ts(e,t,s)}initEnv(e=[]){this.env=e.reduce((t,s)=>(t[s.name]=s[this.nodeEnv],t),{})}}function ss(n){const e=new et(n);return{provider:e,onReady:s=>e.ready(s)}}function _e(n={}){const e=b.inject(ye,null);if(!e)throw new Error("Can not find provider");if(e.nodeEnv==="development"){const{id:t,version:s}=n;t&&s&&(async()=>{const r=await e.getDsl(t);r?.__VERSION__!==s&&e.adapter.notify&&e.adapter.notify(`[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,"版本不一致","warning")})()}return e}async function ns(n,e=""){const{name:t,urls:s=[]}=n||{},r=s.map(a=>e+a),{css:o,js:i}=Ie(r);if(o.length&&fe(o),i.length)return await pe(i,t).catch(()=>{})}const tt={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:n=>n.data?.code===0},rs=(n,e="/__vtj__/api/:type.json")=>(t,s,r)=>n.send({url:e,method:"post",params:{type:t},query:r,data:{type:t,data:s},settings:tt}),os=(n,e="/__vtj__/api/uploader.json")=>async(t,s)=>await n.send({url:e,method:"post",data:{files:t,projectId:s},settings:{...tt,type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);function is(n){return p.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{n&&n(e||"未知错误")}}})}class Y{constructor(e=p.request){this.req=e,this.api=rs(e),this.uploader=os(e)}api;pluginCaches={};uploader;async getExtension(){console.log("BaseService.getExtension")}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e,t){return!!await this.api("saveProject",e,{type:t}).catch(()=>!1)}async saveMaterials(e,t){return console.log("BaseService.saveMaterials",e,t),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,t){return console.log("BaseService.getHistoryItem",e,t),{}}async saveHistoryItem(e,t){return console.log("BaseService.saveHistoryItem",e,t),!1}async removeHistoryItem(e,t){return console.log("BaseService.removeHistoryItem",e,t),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,t){return!!await this.api("publishFile",{project:e,file:t}).catch(()=>!1)}async genVueContent(e,t){return await this.api("genVueContent",{project:e,dsl:t}).catch(()=>"")}async parseVue(e,t){return await this.api("parseVue",{project:e,...t})}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,t){return await this.uploader(e,t).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,t){return await this.api("removeStaticFile",{name:e,projectId:t}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:t=[]}=e,s=t.filter(o=>Ce(o))[0];if(!s)return null;const r=this.pluginCaches[s];return r||(this.pluginCaches[s]=p.request.send({url:s,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(o=>o.data).catch(()=>null))}async genSource(e){return console.log("BaseService.genSource",e),""}}const $=new p.Storage({type:"local",expired:0,prefix:"__VTJ_"});class as extends Y{init(e){const t=new T.ProjectModel(e),s=$.get(`project_${t.id}`),r=Object.assign(t.toDsl(),s||{});return $.save(`project_${t.id}`,r),Promise.resolve(r)}saveProject(e){const t=new T.ProjectModel(e);return $.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return $.save(`materials_${e.id}`,p.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return $.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=$.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return $.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return $.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=$.get(`history_${e}`);if(t){const r=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,r),$.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=$.get(`history_${e}`),s=new T.HistoryModel(t||{id:e});return Promise.resolve(s.toDsl())}getHistoryItem(e,t){const s=$.get(`history_${e}_${t}`);return Promise.resolve(s)}saveHistoryItem(e,t){return $.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{$.remove(`history_${e}_${s}`)}),Promise.resolve(!0)}}class st extends Y{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new T.ProjectModel(e),s=this.projects[t.id]||{},r=Object.assign(t.toDsl(),s);return this.projects[r.id]=r,Promise.resolve(r)}saveProject(e){const t=new T.ProjectModel(e);return this.projects[t.id]=t.toDsl(),Promise.resolve(!0)}saveMaterials(e,t){return e.id&&(this.materials[e.id]=p.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const t=this.files[e];return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const t=this.histories[e];if(t){const r=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,r),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],s=new T.HistoryModel(t||{id:e});return Promise.resolve(s)}getHistoryItem(e,t){const s=`${e}_${t}`,r=this.historyItems[s]||{};return Promise.resolve(r)}saveHistoryItem(e,t){const s=`${e}_${t.id}`;return this.historyItems[s]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{const r=`${e}_${s}`;delete this.historyItems[r]}),Promise.resolve(!0)}}let J=null;function cs(){return J||(J=new st,J)}class ls extends Y{getFileCaches={};async getExtension(){return await this.api("getExtension",{}).catch(()=>{})}async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e,t){return!!await this.api("saveProject",e,{type:t}).catch(()=>!1)}async saveMaterials(e,t){return!!await this.api("saveMaterials",{project:e,materials:p.mapToObject(t)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const t=this.getFileCaches[e];return t||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,t){return await this.api("getHistoryItem",{fId:e,id:t}).catch(()=>null)||{}}async saveHistoryItem(e,t){return!!await this.api("saveHistoryItem",{fId:e,item:t}).catch(()=>!1)}async removeHistoryItem(e,t){return!!await this.api("removeHistoryItem",{fId:e,ids:t}).catch(()=>!1)}}exports.ACCESS=ut;exports.ACCESS_KEY=de;exports.Access=W;exports.BUILD_IN_TAGS=je;exports.BUILT_IN_DIRECTIVES=$e;exports.BaseService=Y;exports.CONTEXT_HOST=oe;exports.Context=Ve;exports.ContextMode=S;exports.DATA_TYPES=be;exports.HOMEPAGE_ROUTE_NAME=L;exports.HTML_TAGS=le;exports.JSCodeToString=gt;exports.LIFE_CYCLES_LIST=ct;exports.LocalService=ls;exports.MemoryService=st;exports.NodeEnv=Ze;exports.PAGE_ROUTE_NAME=k;exports.Provider=et;exports.REMOTE=lt;exports.StorageService=as;exports.VTJ_RENDERER_VERSION=F;exports.adoptStylesToInline=ht;exports.adoptedStyleSheets=z;exports.clearLoaderCache=Pt;exports.clearNodeCache=At;exports.compileScopedCSS=Te;exports.convertCssRpx=Me;exports.createAccess=_t;exports.createAdapter=yt;exports.createAssetScripts=ft;exports.createAssetsCss=pt;exports.createDataSources=ze;exports.createLoader=G;exports.createMemoryService=cs;exports.createMenus=U;exports.createMetaApi=Be;exports.createMock=Ke;exports.createProvider=ss;exports.createRenderer=K;exports.createSchemaApi=Ue;exports.createSchemaApis=qe;exports.createServiceRequest=is;exports.defaultLoader=Qe;exports.fillBasePath=H;exports.getMock=D;exports.getModifiers=ge;exports.getNodeCache=ie;exports.getPlugin=me;exports.getRawComponent=Ae;exports.isBuiltInTag=De;exports.isCSSUrl=B;exports.isEqualValue=He;exports.isJSCode=Ne;exports.isJSExpression=C;exports.isJSFunction=j;exports.isJSON=Ce;exports.isJSUrl=q;exports.isNativeTag=xe;exports.isVuePlugin=ke;exports.loadCss=Fe;exports.loadCssUrl=fe;exports.loadEnhance=ns;exports.loadScriptUrl=pe;exports.menusFilter=ve;exports.mockApi=Ge;exports.mockApis=Je;exports.mockCleanup=he;exports.nodeRender=M;exports.parseDeps=Pe;exports.parseExpression=x;exports.parseFunction=R;exports.parseUrls=Ie;exports.providerKey=ye;exports.removeProdFlag=Re;exports.rpxToPx=Oe;exports.setNodeCache=Ye;exports.setupPageSetting=mt;exports.toString=ue;exports.useAccess=Le;exports.useMask=zt;exports.useProvider=_e;
16
+ }`:"(v) => {}"},r=t.__parseFunction(s),o=me(C(e.modifiers)?t.__parseExpression(e.modifiers):e.modifiers),i=C(e.arg)?t.__parseExpression(e.arg):e.arg||"modelValue";return{[i]:t.__parseExpression(e.value),[`onUpdate:${i}`]:o.length&&r?n.withModifiers(r,o):r}}function Lt(n,e,t,s,r){if(!e)return null;if(f.isString(e))return{default:()=>e};if(C(e))return{default:()=>le(t.__parseExpression(e))};if(Array.isArray(e)&&e.length>0){const o=Ut(e),i=(a,u)=>!a||!r?{}:r?.id&&Object.keys(a).length?u?{[u]:a}:{[`scope_${r.id}`]:a}:u?{[u]:Object.create(null)}:{};return Object.entries(o).reduce((a,[u,{nodes:c,params:l,scope:p}])=>(a[u]=d=>{const h=l.length?f.pick(d??{},l):i(d,p);return c.map(g=>F(g,t.__clone(h),n,s,c))},a),{})}return null}function Ut(n){const e={};for(const t of n){const s=Bt(t.slot),r=s.name;e[r]?(e[r].nodes.push(t),e[r].params=e[r].params.concat(s.params),e[r].scope=s.scope||""):e[r]={nodes:[t],params:s.params,scope:s.scope||""}}return e}function Bt(n="default"){return f.isString(n)?{name:n,params:[],scope:""}:{params:[],scope:"",...n}}function qt(n,e,t){const{value:s,iterator:r}=n,{item:o="item",index:i="index"}=r||{};let a=t.__parseExpression(s)||[];return Number.isInteger(a)&&(a=new Array(a).fill(!0).map((u,c)=>c+1)),Array.isArray(a)?a.map((u,c)=>e(t.__clone({[o]:u,[i]:c}),c)):(console.warn("[vForRender]:",`${s?.value} is not a Arrary`),[])}const ne=b.defineComponent({name:"VtjPageContainer",async setup(){const n=ve(),e=we.useRoute(),t=e.meta.__vtj__||e.params.id,s=t?n.getPage(t):n.getHomepage(),r=s?await n.getRenderComponent(s.id):null,o=b.ref(Symbol());if(s){Object.assign(e.meta,s.meta||{},{cache:s.cache});const{useTitle:i}=n?.adapter;if(i){const a=e.meta.title||s.title||"VTJ.PRO";i(a)}}return{provider:n,component:r,file:s,query:e.query,meta:e.meta,sid:o,route:e}},render(){const{component:n,query:e,sid:t}=this;return n?b.h(n,{...e,key:t}):b.h("div",{style:{padding:"10px"}},"找不到组件,组件不存在或未发布!")},activated(){this.meta.cache===!1&&(this.sid=Symbol())}}),Jt=b.defineComponent({name:"VtjStartupContainer",render(){return b.h("div","page not found!")}});function B(n,e,t=[]){const s=[];for(const r of t){const{id:o,title:i,icon:a,children:u,hidden:c,layout:l}=r;if(l){const p=B(n,e,u||[]);s.push(...p)}else{const p={id:o,title:i,icon:a,hidden:c,url:`${n}/${e}/${o}`,children:u&&u.length?B(n,e,u):void 0};s.push(p)}}return s}function ge(n,e){if(!e)return n;let t=[];for(const s of n)if(s.children&&s.children.length){const r=ge(s.children,e);r.length&&(s.children=r,t.push(s))}else e.can(s.id.toString())&&t.push(s);return t}function Kt(n){const{menuPathPrefix:e="",pageRouteName:t="page",disableMenusFilter:s=!1}=n||{},r=ve(),o=we.useRoute(),i=He(),a=b.ref(!1),u=b.ref(!1),c=r.project,l=(h,g)=>{a.value=!h?.mask,u.value=g?.pure??!!h?.pure};b.watchEffect(()=>{const{name:h,params:g,meta:m}=o;if(h===D){const _=r.getPage(g.id);l(_,m)}else if(h===U){const _=r.getHomepage();l(_,m)}else{const _=m.__vtj__;if(_){const v=r.getPage(_);l(v,m)}else a.value=!m.mask,u.value=!!m.pure}});const p=B(e,t,c?.pages),d=c?.config;return{disabled:a,logo:d?.logo,themeSwitchable:d?.themeSwitchable,title:d?.title||c?.description||c?.name||"VTJ App",menus:s?p:ge(p,i),pure:u}}function re(n,e){const{id:t,title:s,meta:r}=n,{name:o="page",prefix:i="",component:a,routeMeta:u}=e;return{name:t,path:`${i}${o}/${t}`,component:a,meta:{title:s,...u,...r,__vtj__:t}}}function ae(n){const{name:e="page",prefix:t="",pages:s=[],component:r,loader:o,routeMeta:i,homepage:a}=n,u=[];for(const c of s){const{id:l,title:p,dir:d,layout:h,children:g,meta:m}=c;if(d){const _=ae({name:e,prefix:t,component:r,routeMeta:i,homepage:a,loader:o,pages:g||[]});u.push(..._)}else if(h){const _=ae({name:e,prefix:t,component:r,routeMeta:i,homepage:a,loader:o,pages:g||[]}),v={name:`layout_${l}`,path:t,component:()=>o(l),meta:{title:p,...i,...m,__vtj__:l},children:_};u.push(v),u.push(re(c,n))}else if(u.push(re(c,n)),a===l){const _=re(c,n);_.path="",_.name=`home_${l}`,u.push(_)}}return u}function Gt(n={},e){const{css:t,store:s,enhance:r}=n,{window:o,app:i,library:a={},adapter:u,mode:c}=e,{Pinia:l}=a;i.config.globalProperties.$libs=a,W(o,"global-css",t||""),l&&s&&zt(s,i,l),Wt(i,u,n),!u.access&&n.access&&Vt(n.access,i,c,u),Qt(i,n),r&&Yt(r,i,a)}function zt(n,e,t){const s=t.createPinia();if(e.use(s),j(n)&&n.value){const r=R(n,{},!1,!1,!0),o=t.defineStore("$store",r(e)||{});e.config.globalProperties.$store=o()}}function Vt(n,e,t,s){if(j(n)&&n.value){const r=R(n,{},!1,!1,!0),{alert:o,request:i}=s,a=new Q({alert:o,storagePrefix:"__VTJ_APP_",...r(e)}),u=e.config.globalProperties.$router;a.connect({mode:t,router:u,request:i}),e.use(a)}}function Wt(n,e,t){if(!e.request)return;const{axios:s,request:r,response:o}=t;if(s&&j(s)&&s.value){const i=R(s,{},!1,!1,!0);e.request.setConfig(i(n))}if(r&&j(r)&&r.value){const i=R(r,{},!1,!1,!0),a=e.request;a.__unReq&&a.__unReq(),a.__unReq=e.request.useRequest(u=>i(u,n))}if(o&&j(o)&&o.value){const i=R(o,{},!1,!1,!0),a=e.request;a.__unRes&&a.__unRes(),a.__unRes=e.request.useResponse(u=>i(u,n))}}function Qt(n,e){const{beforeEach:t,afterEach:s}=e,r=n.config.globalProperties.$router;if(t&&j(t)&&t.value){const o=R(t,{},!1,!1,!0);r&&r.beforeEach((i,a,u)=>o(i,a,u,n))}if(s&&j(s)&&s.value){const o=R(s,{},!1,!1,!0);r&&r.afterEach((i,a,u)=>o(i,a,u,n))}}function Yt(n,e,t={}){j(n)&&n.value&&R(n,{},!1,!1,!0)(e,t)}function Xt(n,e,t){if(!n||!e||!t)return;const{VueI18n:s}=e;if(s){const{locale:r,fallbackLocale:o,messages:i=[]}=t,a={};for(let c of i){const l=Object.keys(c).filter(p=>p!=="key");for(const p of l)a[p]||(a[p]={}),a[p][c.key]=c[p]}const u=s.createI18n({legacy:!1,locale:r,fallbackLocale:o,messages:a});n.use(u)}}const _e=Symbol("Provider");var Qe=(n=>(n.Production="production",n.Development="development",n))(Qe||{});class Ye extends M.Base{constructor(e){super(),this.options=e;const{service:t,mode:s=S.Raw,dependencies:r,materials:o,project:i={},adapter:a={},globals:u={},modules:c={},router:l=null,materialPath:p="./",nodeEnv:d="development"}=e;this.mode=s,this.modules=c,this.service=t,this.router=l,this.materialPath=p,this.nodeEnv=d,r&&(this.dependencies=r),o&&(this.materials=o),Object.assign(this.globals,u),Object.assign(this.adapter,a);const{access:h,request:g}=this.adapter;h&&h.connect({mode:s,router:l,request:g}),i&&s!==S.Design?this.load(i):this.project=i}mode;globals={};modules={};adapter={request:f.request,jsonp:f.jsonp};apis={};dependencies={};materials={};library={};libraryLocales={};libraryLocaleMap={};service;project=null;components={};nodeEnv="development";env={};router=null;materialPath="./";urlDslCaches={};errorHandler=null;createMock(e){return async(...t)=>{let s={};if(e)try{s=await e.apply(e,t)}catch(o){f.logger.warn("模拟数据模版异常",o)}return x()?.mock(s)}}async load(e){const{vtjDir:t=".vtj"}=this.options,s=this.modules[`${t}/projects/${e.id}.json`]||this.modules[`/src/${t}/projects/${e.id}.json`];if(this.project=s?await s():await this.service.init(e),!this.project)throw new Error("project is null");const{apis:r=[],meta:o=[],env:i=[]}=this.project,a=window;a&&(a.CKEDITOR_VERSION=void 0),this.initEnv(i),this.mode===S.Raw?await this.loadDependencies(a):await this.loadAssets(a),this.initMock(a),this.apis=Ue(r,o,this.adapter),de(a),Be(r,a),e.platform!=="uniapp"&&this.initRouter(),this.triggerReady()}initMock(e){const t=x(e);t&&t.setup({timeout:"50-500"})}async loadDependencies(e={}){const t=Object.entries(this.dependencies);for(const[s,r]of t)e[s]||(e[s]=this.library[s]=await r())}async loadAssets(e={}){const{dependencies:t=[]}=this.project,{dependencies:s,library:r,components:o,materialPath:i,nodeEnv:a,libraryLocales:u}=this,{libraryExports:c,libraryMap:l,materials:p,materialExports:d,materialMapLibrary:h,libraryLocaleMap:g}=Re(t,i,a==="development");Object.assign(this.libraryLocaleMap,g);for(const m of c){const _=s[m],v=e[m];if(v)r[m]=v;else if(_)e[m]=r[m]=await _();else{const y=l[m]||[];for(const E of y)q(E)&&await Oe(E,f.url.append(E,{v:k})),J(E)&&await f.loadScript(f.url.append(E,{v:k}));r[m]=e[m]}const w=g[m];if(w){const y=s[w];u[w]=y?await y():e[w]}}if(a==="development"){for(const _ of p)await f.loadScript(f.url.append(_,{v:k}));const m=this.materials||{};for(const _ of d){const v=e[h[_]],w=v?.default||v,y=M.BUILT_IN_COMPONENTS[_];if(y)w&&y.forEach(E=>{o[E]=w[E]});else{const E=m[_]?(await m[_]()).default:e[_];E&&w&&(E.components||[]).forEach(T=>{o[T.name]=Pe(T,w)})}}}}initRouter(){const{router:e,project:t,options:s,adapter:r}=this;if(!e)return;const o=t?.platform==="uniapp"?"pages":"page",{routeAppendTo:i,pageRouteName:a=o,routeMeta:u}=s,c=i?"":"/",l={path:`${c}${a}/:id`,name:D,component:ne},p=this.getHomepage(),d={path:c,name:U,component:p?ne:r.startupComponent||Jt,meta:u};if(e.hasRoute(D)&&e.removeRoute(D),e.hasRoute(U)&&e.removeRoute(U),s.enableStaticRoute){const h=t?.pages||[];ae({name:a,prefix:c,pages:h,component:ne,loader:this.getRenderComponent.bind(this),homepage:p?.id}).forEach(m=>{i?e.addRoute(i,m):e.addRoute(m)}),p||(i?e.addRoute(i,d):e.addRoute(d))}else i?(e.addRoute(i,l),e.addRoute(i,d)):(e.addRoute(l),e.addRoute(d))}setErrorHandler(e){e.config.errorHandler=f.debounce((t,s,r)=>{const o=s?.$options.name,i=typeof t=="string"?t:t?.message||t?.msg||"未知错误",a=`[ ${o} ] ${i} ${r}`;["getComputedStyle","ResizeObserver"].some(c=>a.includes(c))||(console.error("[VTJ Error]:",{err:t,instance:s,info:r},t?.stack),this.errorHandler&&this.errorHandler(t),this.adapter.notify&&this.adapter.notify(a,"组件渲染错误","error"))},300)}install(e){const{libraryLocaleMap:t,libraryLocales:s}=this,{libraryOptions:r={}}=this.options,o=e.config.globalProperties.installed||{};for(const[i,a]of Object.entries(this.library))if(!o[i]&&Fe(a)){const c={locale:s[t[i]]},l=r[i]||{},p={...c,...l};e.use(a,p),o[i]=!0}e.provide(_e,this),e.config.globalProperties.$provider=this,e.config.globalProperties.$request=this.adapter?.request,this.options.install&&e.use(this.options.install),this.adapter.access&&e.use(this.adapter.access),this.project?.platform!=="uniapp"&&this.mode!==S.Design&&this.initGlobals(this.project?.globals||{},{app:e,window,adapter:this.adapter,library:this.library,mode:this.mode}),this.mode!==S.Design&&this.project?.i18n&&this.initI18n(e,this.library,this.project.i18n),this.options.enhance&&e.use(this.options.enhance,this),this.mode===S.Design&&this.setErrorHandler(e),e.config.globalProperties.installed=o}getFile(e){const{blocks:t=[]}=this.project||{};return this.getPage(e)||t.find(s=>s.id===e)||null}getPage(e){const{pages:t=[]}=this.project||{},s=(r,o=[])=>{for(const i of o){if(i.id===r)return i;if(i.children&&i.children.length){const a=s(r,i.children);if(a)return a}}};return s(e,t)||null}getFirstPage(){const{pages:e=[]}=this.project||{};if(!e.length)return null;const t=(s=[])=>{for(const r of s){if(r.type==="page"&&!r.dir&&!r.layout)return r;if(r.children&&r.children.length){const o=t(r.children);if(o)return o}}};return t(e)||null}getMenus(e="page",t=""){return B(t,e,this.project?.pages||[])}getHomepage(){const{homepage:e}=this.project||{};return e?this.getPage(e):this.getFirstPage()}async getDsl(e){const{vtjDir:t=".vtj"}=this.options,s=this.modules[`${t}/files/${e}.json`]||this.modules[`/src/${t}/files/${e}.json`];return s?await s():this.service.getFile(e,this.project||void 0).catch(()=>null)}async getDslByUrl(e){const t=this.urlDslCaches[e];return t||(this.adapter.request?this.urlDslCaches[e]=this.adapter.request.send({url:e,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(s=>s.data).catch(()=>null):null)}createDslRenderer(e,t={}){const{library:s,components:r,mode:o,apis:i}=this,a={mode:o,Vue:s.Vue,components:r,libs:s,apis:i,window,...t},u=z({getDsl:async c=>await this.getDsl(c)||null,getDslByUrl:async c=>await this.getDslByUrl(c)||null,options:a});return G({...a,dsl:e,loader:u})}async getRenderComponent(e,t){const s=this.getFile(e);if(!s)return f.logger.warn(`Can not find file: ${e}`),null;if(t&&t(s),this.mode===S.Raw){const{vtjRawDir:o=".vtj/vue"}=this.options,i=`${o}/${e}.vue`,a=this.modules[i]||this.modules[`/src/pages/${e}.vue`];return a?(await a())?.default:this.nodeEnv==="development"&&this.adapter.startupComponent||null}const r=await this.getDsl(s.id);return r?this.createDslRenderer(r).renderer:(f.logger.warn(`Can not find dsl: ${e}`),null)}defineUrlSchemaComponent(e,t){return b.defineAsyncComponent(async()=>{const s=await this.getDslByUrl(e);return s?(s.name=t||s.name,this.createDslRenderer(s).renderer):null})}definePluginComponent(e){return b.defineAsyncComponent(async()=>await he(e,window))}initGlobals(e,t){const s=Object.assign({adapter:this.adapter,window},t);Gt(e,s)}initI18n(e,t,s){Xt(e,t,s)}initEnv(e=[]){this.env=e.reduce((t,s)=>(t[s.name]=s[this.nodeEnv],t),{})}}function Zt(n){const e=new Ye(n);return{provider:e,onReady:s=>e.ready(s)}}function ve(n={}){const e=b.inject(_e,null);if(!e)throw new Error("Can not find provider");if(e.nodeEnv==="development"){const{id:t,version:s}=n;t&&s&&(async()=>{const r=await e.getDsl(t);r?.__VERSION__!==s&&e.adapter.notify&&e.adapter.notify(`[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,"版本不一致","warning")})()}return e}async function es(n,e=""){const{name:t,urls:s=[]}=n||{},r=s.map(a=>e+a),{css:o,js:i}=Ae(r);if(o.length&&ue(o),i.length)return await pe(i,t).catch(()=>{})}const Xe={type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:n=>n.data?.code===0},ts=(n,e="/__vtj__/api/:type.json")=>(t,s,r)=>n.send({url:e,method:"post",params:{type:t},query:r,data:{type:t,data:s},settings:Xe}),ss=(n,e="/__vtj__/api/uploader.json")=>async(t,s)=>await n.send({url:e,method:"post",data:{files:t,projectId:s},settings:{...Xe,type:"data"}}).then(r=>r&&r[0]?r[0]:null).catch(()=>null);function ns(n){return f.createRequest({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>e.data?.code===0,showError:e=>{n&&n(e||"未知错误")}}})}class Y{constructor(e=f.request){this.req=e,this.api=ts(e),this.uploader=ss(e)}api;pluginCaches={};uploader;async getExtension(){console.log("BaseService.getExtension")}async init(e){return console.log("BaseService.init",e),{}}async saveProject(e,t){return!!await this.api("saveProject",e,{type:t}).catch(()=>!1)}async saveMaterials(e,t){return console.log("BaseService.saveMaterials",e,t),!1}async saveFile(e){return console.log("BaseService.saveFile",e),!1}async getFile(e){return console.log("BaseService.getFile",e),{}}async removeFile(e){return console.log("BaseService.removeFile",e),!1}async saveHistory(e){return console.log("BaseService.saveHistory",e),!1}async removeHistory(e){return console.log("BaseService.removeHistory",e),!1}async getHistory(e){return console.log("BaseService.getHistory",e),{}}async getHistoryItem(e,t){return console.log("BaseService.getHistoryItem",e,t),{}}async saveHistoryItem(e,t){return console.log("BaseService.saveHistoryItem",e,t),!1}async removeHistoryItem(e,t){return console.log("BaseService.removeHistoryItem",e,t),!1}async publish(e){return!!await this.api("publish",e).catch(()=>!1)}async publishFile(e,t){return!!await this.api("publishFile",{project:e,file:t}).catch(()=>!1)}async genVueContent(e,t){return await this.api("genVueContent",{project:e,dsl:t}).catch(()=>"")}async parseVue(e,t){return await this.api("parseVue",{project:e,...t})}async createRawPage(e){return await this.api("createRawPage",e).catch(()=>"")}async removeRawPage(e){return await this.api("removeRawPage",e).catch(()=>"")}async uploadStaticFile(e,t){return await this.uploader(e,t).catch(()=>null)}async getStaticFiles(e){return await this.api("getStaticFiles",e).catch(()=>[])}async removeStaticFile(e,t){return await this.api("removeStaticFile",{name:e,projectId:t}).catch(()=>"")}async clearStaticFiles(e){return await this.api("clearStaticFiles",e).catch(()=>"")}async getPluginMaterial(e){const{urls:t=[]}=e,s=t.filter(o=>je(o))[0];if(!s)return null;const r=this.pluginCaches[s];return r||(this.pluginCaches[s]=f.request.send({url:s,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(o=>o.data).catch(()=>null))}async genSource(e){return console.log("BaseService.genSource",e),""}}const $=new f.Storage({type:"local",expired:0,prefix:"__VTJ_"});class rs extends Y{init(e){const t=new M.ProjectModel(e),s=$.get(`project_${t.id}`),r=Object.assign(t.toDsl(),s||{});return $.save(`project_${t.id}`,r),Promise.resolve(r)}saveProject(e){const t=new M.ProjectModel(e);return $.save(`project_${t.id}`,t.toDsl()),Promise.resolve(!0)}saveMaterials(e,t){return $.save(`materials_${e.id}`,f.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return $.save(`file_${e.id}`,e),Promise.resolve(!0)}getFile(e){const t=$.get(`file_${e}`);return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return $.remove(`file_${e}`),Promise.resolve(!0)}saveHistory(e){return $.save(`history_${e.id}`,e),Promise.resolve(!0)}removeHistory(e){const t=$.get(`history_${e}`);if(t){const r=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,r),$.remove(`history_${e}`)}return Promise.resolve(!0)}getHistory(e){const t=$.get(`history_${e}`),s=new M.HistoryModel(t||{id:e});return Promise.resolve(s.toDsl())}getHistoryItem(e,t){const s=$.get(`history_${e}_${t}`);return Promise.resolve(s)}saveHistoryItem(e,t){return $.save(`history_${e}_${t.id}`,t),Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{$.remove(`history_${e}_${s}`)}),Promise.resolve(!0)}}class Ze extends Y{projects={};materials={};files={};histories={};historyItems={};init(e){const t=new M.ProjectModel(e),s=this.projects[t.id]||{},r=Object.assign(t.toDsl(),s);return this.projects[r.id]=r,Promise.resolve(r)}saveProject(e){const t=new M.ProjectModel(e);return this.projects[t.id]=t.toDsl(),Promise.resolve(!0)}saveMaterials(e,t){return e.id&&(this.materials[e.id]=f.mapToObject(t)),Promise.resolve(!0)}saveFile(e){return this.files[e.id]=e,Promise.resolve(!0)}getFile(e){const t=this.files[e];return t?Promise.resolve(t):Promise.reject(null)}removeFile(e){return delete this.files[e],Promise.resolve(!0)}saveHistory(e){return this.histories[e.id]=e,Promise.resolve(!0)}removeHistory(e){const t=this.histories[e];if(t){const r=(t.items||[]).map(o=>o.id);this.removeHistoryItem(e,r),delete this.historyItems[e]}return Promise.resolve(!0)}getHistory(e){const t=this.histories[e],s=new M.HistoryModel(t||{id:e});return Promise.resolve(s)}getHistoryItem(e,t){const s=`${e}_${t}`,r=this.historyItems[s]||{};return Promise.resolve(r)}saveHistoryItem(e,t){const s=`${e}_${t.id}`;return this.historyItems[s]=t,Promise.resolve(!0)}removeHistoryItem(e,t){return t.forEach(s=>{const r=`${e}_${s}`;delete this.historyItems[r]}),Promise.resolve(!0)}}let K=null;function os(){return K||(K=new Ze,K)}class is extends Y{getFileCaches={};async getExtension(){return await this.api("getExtension",{}).catch(()=>{})}async init(e){return await this.api("init",e).catch(()=>null)||{}}async saveProject(e,t){return!!await this.api("saveProject",e,{type:t}).catch(()=>!1)}async saveMaterials(e,t){return!!await this.api("saveMaterials",{project:e,materials:f.mapToObject(t)}).catch(()=>!1)}async saveFile(e){return!!await this.api("saveFile",e).catch(()=>!1)}async getFile(e){const t=this.getFileCaches[e];return t||(this.getFileCaches[e]=this.api("getFile",e).catch(()=>null)).finally(()=>{delete this.getFileCaches[e]})}async removeFile(e){return!!await this.api("removeFile",e).catch(()=>!1)}async saveHistory(e){return!!await this.api("saveHistory",e).catch(()=>!1)}async removeHistory(e){return!!await this.api("removeHistory",e).catch(()=>!1)}async getHistory(e){return await this.api("getHistory",e).catch(()=>null)||{}}async getHistoryItem(e,t){return await this.api("getHistoryItem",{fId:e,id:t}).catch(()=>null)||{}}async saveHistoryItem(e,t){return!!await this.api("saveHistoryItem",{fId:e,item:t}).catch(()=>!1)}async removeHistoryItem(e,t){return!!await this.api("removeHistoryItem",{fId:e,ids:t}).catch(()=>!1)}}exports.ACCESS=at;exports.ACCESS_KEY=fe;exports.Access=Q;exports.BUILD_IN_TAGS=be;exports.BUILT_IN_DIRECTIVES=Ee;exports.BaseService=Y;exports.CONTEXT_HOST=oe;exports.Context=Ke;exports.ContextMode=S;exports.DATA_TYPES=$e;exports.HOMEPAGE_ROUTE_NAME=U;exports.HTML_TAGS=ce;exports.JSCodeToString=dt;exports.LIFE_CYCLES_LIST=ot;exports.LocalService=is;exports.MemoryService=Ze;exports.NodeEnv=Qe;exports.PAGE_ROUTE_NAME=D;exports.Provider=Ye;exports.REMOTE=it;exports.StorageService=rs;exports.VTJ_RENDERER_VERSION=k;exports.adoptStylesToInline=pt;exports.adoptedStyleSheets=W;exports.clearLoaderCache=Ct;exports.compileScopedCSS=Ie;exports.convertCssRpx=Me;exports.createAccess=gt;exports.createAdapter=mt;exports.createAssetScripts=ct;exports.createAssetsCss=lt;exports.createDataSources=Ge;exports.createLoader=z;exports.createMemoryService=os;exports.createMenus=B;exports.createMetaApi=Le;exports.createMock=qe;exports.createProvider=Zt;exports.createRenderer=G;exports.createSchemaApi=Ne;exports.createSchemaApis=Ue;exports.createServiceRequest=ns;exports.defaultLoader=Ve;exports.fillBasePath=N;exports.getMock=x;exports.getModifiers=me;exports.getPlugin=he;exports.getRawComponent=Pe;exports.isBuiltInTag=ke;exports.isCSSUrl=q;exports.isJSCode=xe;exports.isJSExpression=C;exports.isJSFunction=j;exports.isJSON=je;exports.isJSUrl=J;exports.isNativeTag=De;exports.isVuePlugin=Fe;exports.loadCss=Oe;exports.loadCssUrl=ue;exports.loadEnhance=es;exports.loadScriptUrl=pe;exports.menusFilter=ge;exports.mockApi=Je;exports.mockApis=Be;exports.mockCleanup=de;exports.nodeCache=I;exports.nodeRender=F;exports.parseDeps=Re;exports.parseExpression=H;exports.parseFunction=R;exports.parseUrls=Ae;exports.providerKey=_e;exports.removeProdFlag=Ce;exports.rpxToPx=Te;exports.setupPageSetting=ft;exports.toString=le;exports.useAccess=He;exports.useMask=Kt;exports.useProvider=ve;