@vtj/pro 0.9.0-alpha.0 → 0.9.0-alpha.2
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/@vtj/materials/assets/antdv/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/charts/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/element/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/ui/index.umd.js +2 -2
- package/dist/@vtj/materials/assets/vant/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/ui/index.umd.js +2 -2
- package/dist/@vtj/materials/deps/@vtj/utils/index.umd.js +2 -2
- package/dist/assets/{auth-BTiGpIv5.js → auth-DwOvqdPT.js} +1 -1
- package/dist/assets/{extension-Do5N4471.js → extension-CrajlLQB.js} +7 -7
- package/dist/assets/{index-jVlS6cmy.js → index-BRvb6BFi.js} +1 -1
- package/dist/assets/{index-DEnKX8DW.js → index-CB3vT47S.js} +8 -8
- package/dist/assets/{preview-B7UFOWBt.js → preview-D0Efiuc4.js} +1 -1
- package/dist/entry/inject-devtools.js +2 -1
- package/dist/entry/link.js +4 -1
- package/dist/index.html +3 -3
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
var B=Object.defineProperty,P=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var x=(n,e,t)=>e in n?B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,u=(n,e)=>{for(var t in e||(e={}))C.call(e,t)&&x(n,t,e[t]);if(w)for(var t of w(e))F.call(e,t)&&x(n,t,e[t]);return n},g=(n,e)=>P(n,A(e));var v=(n,e,t)=>new Promise((p,r)=>{var m=o=>{try{c(t.next(o))}catch(s){r(s)}},i=o=>{try{c(t.throw(o))}catch(s){r(s)}},c=o=>o.done?p(o.value):Promise.resolve(o.value).then(m,i);c((t=t.apply(n,e)).next())});import{useRoute as I}from"./vue-router-DVXkXLMI.js";import{c as q}from"./element-plus-DxszZ-Od.js";import"./vxe-CHtaO4Up.js";import{E as D,I as y,D as S}from"./extension-
|
|
1
|
+
var B=Object.defineProperty,P=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var x=(n,e,t)=>e in n?B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,u=(n,e)=>{for(var t in e||(e={}))C.call(e,t)&&x(n,t,e[t]);if(w)for(var t of w(e))F.call(e,t)&&x(n,t,e[t]);return n},g=(n,e)=>P(n,A(e));var v=(n,e,t)=>new Promise((p,r)=>{var m=o=>{try{c(t.next(o))}catch(s){r(s)}},i=o=>{try{c(t.throw(o))}catch(s){r(s)}},c=o=>o.done?p(o.value):Promise.resolve(o.value).then(m,i);c((t=t.apply(n,e)).next())});import{useRoute as I}from"./vue-router-DVXkXLMI.js";import{c as q}from"./element-plus-DxszZ-Od.js";import"./vxe-CHtaO4Up.js";import{E as D,I as y,D as S}from"./extension-CrajlLQB.js";import{x as T,$ as j}from"./index-CB3vT47S.js";import{d as z,r as H,az as $,i as J,o as M,c as O}from"./vue-BvlBnlDq.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-es-D4Nl9glD.js";import"./@vueuse-Boef7d6G.js";import"./@element-plus-icons-vue-Br0k9_nr.js";import"./shared-CuSW-11R.js";import"./dayjs-DzmFq6fg.js";import"./monaco-editor-B5_fO_Um.js";import"./mockjs-BKNhwXuJ.js";const R=z({__name:"index",setup(n){return v(this,null,function*(){let e,t;const p=I(),r=H(),m=new T,i=([e,t]=$(()=>m.getExtension().catch(()=>null)),e=yield e,t(),e),{options:c,adapters:o}=i?([e,t]=$(()=>new D(i).load()),e=yield e,t(),e):{},{__BASE_PATH__:s="/"}=i||{},h=o==null?void 0:o.access,E=o==null?void 0:o.remote,k=h?new j(g(u({},h),{alert:q.alert})):void 0;y.set("Switcher",{props:{onClick:a=>{const _=location.pathname;let d=_===`${s}__vtj__/`?s:_;const l=a.currentFile;l&&l.type==="page"&&a.homepage!==l.id&&(d=`${d}#/page/${l.id}`),window.open(d,"VTJProject")}}}),y.set("Previewer",{props:{path:a=>`${location.pathname}#/preview/${a.id}`}});const f=new S(u({container:r,service:m,materialPath:s,adapter:{access:k,remote:E}},c));return f.ready(()=>{f.openFile(p.query.id)}),J(()=>p.query.id,a=>{f.openFile(a)}),(a,_)=>(M(),O("div",{class:"designer",ref_key:"container",ref:r},null,512))})}}),se=Q(R,[["__scopeId","data-v-963f5a16"]]);export{se as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mockjs-BKNhwXuJ.js","./dayjs-DzmFq6fg.js","./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mockjs-BKNhwXuJ.js","./dayjs-DzmFq6fg.js","./index-BRvb6BFi.js","./vue-router-DVXkXLMI.js","./vue-BvlBnlDq.js","./element-plus-DxszZ-Od.js","./lodash-es-D4Nl9glD.js","./@vueuse-Boef7d6G.js","./@element-plus-icons-vue-Br0k9_nr.js","./shared-CuSW-11R.js","./element-plus-scCP8u-T.css","./vxe-CHtaO4Up.js","./vxe-4SVuCx0-.css","./extension-CrajlLQB.js","./monaco-editor-B5_fO_Um.js","./monaco-editor-Cpw7ccEV.css","./extension-C2CZeBWs.css","./_plugin-vue_export-helper-DlAUqK2U.js","./index-DRDipTZ2.css","./preview-D0Efiuc4.js","./auth-DwOvqdPT.js","./auth-uyRSZatW.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Gu=Object.defineProperty,Zu=Object.defineProperties;var Qu=Object.getOwnPropertyDescriptors;var ur=Object.getOwnPropertySymbols;var ls=Object.prototype.hasOwnProperty,hs=Object.prototype.propertyIsEnumerable;var fn=(e,t,r)=>t in e?Gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K=(e,t)=>{for(var r in t||(t={}))ls.call(t,r)&&fn(e,r,t[r]);if(ur)for(var r of ur(t))hs.call(t,r)&&fn(e,r,t[r]);return e},xt=(e,t)=>Zu(e,Qu(t));var fs=(e,t)=>{var r={};for(var n in e)ls.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ur)for(var n of ur(e))t.indexOf(n)<0&&hs.call(e,n)&&(r[n]=e[n]);return r};var j=(e,t,r)=>fn(e,typeof t!="symbol"?t+"":t,r);var H=(e,t,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(e,t)).next())});import{aw as Ur,d as zr,I as Pn,G as Io,m as Xu,e as tl,j as el,r as Nr,i as Mo,u as Cn,f as Fo,E as rl,o as Nn,c as nl,a as ae,Y as pn,ax as ps,w as il,h as sl,k as Lo,g as ol,b as al,ai as cl,R as ds,S as ms,ay as ul,Z as ll,at as hl}from"./vue-BvlBnlDq.js";import{_ as wr}from"./monaco-editor-B5_fO_Um.js";import{useRoute as Vo,createRouter as fl,createWebHashHistory as pl}from"./vue-router-DVXkXLMI.js";import{E as dl,a as qr,z as ml,b as gl}from"./element-plus-DxszZ-Od.js";import"./lodash-es-D4Nl9glD.js";import"./@vueuse-Boef7d6G.js";import"./@element-plus-icons-vue-Br0k9_nr.js";import"./shared-CuSW-11R.js";import"./dayjs-DzmFq6fg.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var vl={ENV_TYPE:"live",NODE_ENV:"production"},yl=typeof global=="object"&&global&&global.Object===Object&&global;const Ho=yl;var bl=typeof self=="object"&&self&&self.Object===Object&&self,_l=Ho||bl||Function("return this")();const $t=_l;var wl=$t.Symbol;const jt=wl;var Uo=Object.prototype,El=Uo.hasOwnProperty,Sl=Uo.toString,Pe=jt?jt.toStringTag:void 0;function xl(e){var t=El.call(e,Pe),r=e[Pe];try{e[Pe]=void 0;var n=!0}catch(s){}var i=Sl.call(e);return n&&(t?e[Pe]=r:delete e[Pe]),i}var Tl=Object.prototype,Ol=Tl.toString;function $l(e){return Ol.call(e)}var Al="[object Null]",jl="[object Undefined]",gs=jt?jt.toStringTag:void 0;function gt(e){return e==null?e===void 0?jl:Al:gs&&gs in Object(e)?xl(e):$l(e)}function st(e){return e!=null&&typeof e=="object"}var Rl="[object Symbol]";function Xe(e){return typeof e=="symbol"||st(e)&>(e)==Rl}function zo(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Dl=Array.isArray;const ht=Dl;var Pl=1/0,vs=jt?jt.prototype:void 0,ys=vs?vs.toString:void 0;function qo(e){if(typeof e=="string")return e;if(ht(e))return zo(e,qo)+"";if(Xe(e))return ys?ys.call(e):"";var t=e+"";return t=="0"&&1/e==-Pl?"-0":t}var Cl=/\s/;function Nl(e){for(var t=e.length;t--&&Cl.test(e.charAt(t)););return t}var Bl=/^\s+/;function kl(e){return e&&e.slice(0,Nl(e)+1).replace(Bl,"")}function ot(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bs=NaN,Il=/^[-+]0x[0-9a-f]+$/i,Ml=/^0b[01]+$/i,Fl=/^0o[0-7]+$/i,Ll=parseInt;function _s(e){if(typeof e=="number")return e;if(Xe(e))return bs;if(ot(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ot(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=kl(e);var r=Ml.test(e);return r||Fl.test(e)?Ll(e.slice(2),r?2:8):Il.test(e)?bs:+e}function vi(e){return e}var Vl="[object AsyncFunction]",Hl="[object Function]",Ul="[object GeneratorFunction]",zl="[object Proxy]";function _e(e){if(!ot(e))return!1;var t=gt(e);return t==Hl||t==Ul||t==Vl||t==zl}var ql=$t["__core-js_shared__"];const dn=ql;var ws=function(){var e=/[^.]+$/.exec(dn&&dn.keys&&dn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Kl(e){return!!ws&&ws in e}var Jl=Function.prototype,Wl=Jl.toString;function ne(e){if(e!=null){try{return Wl.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Yl=/[\\^$.*+?()[\]{}|]/g,Gl=/^\[object .+?Constructor\]$/,Zl=Function.prototype,Ql=Object.prototype,Xl=Zl.toString,th=Ql.hasOwnProperty,eh=RegExp("^"+Xl.call(th).replace(Yl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rh(e){if(!ot(e)||Kl(e))return!1;var t=_e(e)?eh:Gl;return t.test(ne(e))}function nh(e,t){return e==null?void 0:e[t]}function ie(e,t){var r=nh(e,t);return rh(r)?r:void 0}var ih=ie($t,"WeakMap");const Bn=ih;var Es=Object.create,sh=function(){function e(){}return function(t){if(!ot(t))return{};if(Es)return Es(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const oh=sh;function Ko(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function ah(){}function ch(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var uh=800,lh=16,hh=Date.now;function fh(e){var t=0,r=0;return function(){var n=hh(),i=lh-(n-r);if(r=n,i>0){if(++t>=uh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ph(e){return function(){return e}}var dh=function(){try{var e=ie(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();const Br=dh;var mh=Br?function(e,t){return Br(e,"toString",{configurable:!0,enumerable:!1,value:ph(t),writable:!0})}:vi;const gh=mh;var vh=fh(gh);const yh=vh;function bh(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var _h=9007199254740991,wh=/^(?:0|[1-9]\d*)$/;function Kr(e,t){var r=typeof e;return t=t!=null?t:_h,!!t&&(r=="number"||r!="symbol"&&wh.test(e))&&e>-1&&e%1==0&&e<t}function Jr(e,t,r){t=="__proto__"&&Br?Br(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function $e(e,t){return e===t||e!==e&&t!==t}var Eh=Object.prototype,Sh=Eh.hasOwnProperty;function yi(e,t,r){var n=e[t];(!(Sh.call(e,t)&&$e(n,r))||r===void 0&&!(t in e))&&Jr(e,t,r)}function Jo(e,t,r,n){var i=!r;r||(r={});for(var s=-1,o=t.length;++s<o;){var a=t[s],u=n?n(r[a],e[a],a,r,e):void 0;u===void 0&&(u=e[a]),i?Jr(r,a,u):yi(r,a,u)}return r}var Ss=Math.max;function xh(e,t,r){return t=Ss(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Ss(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),Ko(e,this,a)}}function Wo(e,t){return yh(xh(e,t,vi),e+"")}var Th=9007199254740991;function bi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Th}function tr(e){return e!=null&&bi(e.length)&&!_e(e)}function Yo(e,t,r){if(!ot(r))return!1;var n=typeof t;return(n=="number"?tr(r)&&Kr(t,r.length):n=="string"&&t in r)?$e(r[t],e):!1}function Go(e){return Wo(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,o&&Yo(r[0],r[1],o)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var a=r[n];a&&e(t,a,n,s)}return t})}var Oh=Object.prototype;function _i(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Oh;return e===r}function $h(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Ah="[object Arguments]";function xs(e){return st(e)&>(e)==Ah}var Zo=Object.prototype,jh=Zo.hasOwnProperty,Rh=Zo.propertyIsEnumerable,Dh=xs(function(){return arguments}())?xs:function(e){return st(e)&&jh.call(e,"callee")&&!Rh.call(e,"callee")};const kr=Dh;function Ph(){return!1}var Qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ts=Qo&&typeof module=="object"&&module&&!module.nodeType&&module,Ch=Ts&&Ts.exports===Qo,Os=Ch?$t.Buffer:void 0,Nh=Os?Os.isBuffer:void 0,Bh=Nh||Ph;const we=Bh;var kh="[object Arguments]",Ih="[object Array]",Mh="[object Boolean]",Fh="[object Date]",Lh="[object Error]",Vh="[object Function]",Hh="[object Map]",Uh="[object Number]",zh="[object Object]",qh="[object RegExp]",Kh="[object Set]",Jh="[object String]",Wh="[object WeakMap]",Yh="[object ArrayBuffer]",Gh="[object DataView]",Zh="[object Float32Array]",Qh="[object Float64Array]",Xh="[object Int8Array]",tf="[object Int16Array]",ef="[object Int32Array]",rf="[object Uint8Array]",nf="[object Uint8ClampedArray]",sf="[object Uint16Array]",of="[object Uint32Array]",X={};X[Zh]=X[Qh]=X[Xh]=X[tf]=X[ef]=X[rf]=X[nf]=X[sf]=X[of]=!0,X[kh]=X[Ih]=X[Yh]=X[Mh]=X[Gh]=X[Fh]=X[Lh]=X[Vh]=X[Hh]=X[Uh]=X[zh]=X[qh]=X[Kh]=X[Jh]=X[Wh]=!1;function af(e){return st(e)&&bi(e.length)&&!!X[gt(e)]}function er(e){return function(t){return e(t)}}var Xo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ve=Xo&&typeof module=="object"&&module&&!module.nodeType&&module,cf=Ve&&Ve.exports===Xo,mn=cf&&Ho.process,uf=function(){try{var e=Ve&&Ve.require&&Ve.require("util").types;return e||mn&&mn.binding&&mn.binding("util")}catch(t){}}();const Rt=uf;var $s=Rt&&Rt.isTypedArray,lf=$s?er($s):af;const wi=lf;var hf=Object.prototype,ff=hf.hasOwnProperty;function ta(e,t){var r=ht(e),n=!r&&kr(e),i=!r&&!n&&we(e),s=!r&&!n&&!i&&wi(e),o=r||n||i||s,a=o?$h(e.length,String):[],u=a.length;for(var c in e)(t||ff.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Kr(c,u)))&&a.push(c);return a}function ea(e,t){return function(r){return e(t(r))}}var pf=ea(Object.keys,Object);const df=pf;var mf=Object.prototype,gf=mf.hasOwnProperty;function vf(e){if(!_i(e))return df(e);var t=[];for(var r in Object(e))gf.call(e,r)&&r!="constructor"&&t.push(r);return t}function Wr(e){return tr(e)?ta(e):vf(e)}function yf(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var bf=Object.prototype,_f=bf.hasOwnProperty;function wf(e){if(!ot(e))return yf(e);var t=_i(e),r=[];for(var n in e)n=="constructor"&&(t||!_f.call(e,n))||r.push(n);return r}function Ei(e){return tr(e)?ta(e,!0):wf(e)}var Ef=Go(function(e,t,r,n){Jo(t,Ei(t),e,n)});const As=Ef;var Sf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function Si(e,t){if(ht(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Xe(e)?!0:xf.test(e)||!Sf.test(e)||t!=null&&e in Object(t)}var Tf=ie(Object,"create");const ze=Tf;function Of(){this.__data__=ze?ze(null):{},this.size=0}function $f(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Af="__lodash_hash_undefined__",jf=Object.prototype,Rf=jf.hasOwnProperty;function Df(e){var t=this.__data__;if(ze){var r=t[e];return r===Af?void 0:r}return Rf.call(t,e)?t[e]:void 0}var Pf=Object.prototype,Cf=Pf.hasOwnProperty;function Nf(e){var t=this.__data__;return ze?t[e]!==void 0:Cf.call(t,e)}var Bf="__lodash_hash_undefined__";function kf(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ze&&t===void 0?Bf:t,this}function Xt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xt.prototype.clear=Of,Xt.prototype.delete=$f,Xt.prototype.get=Df,Xt.prototype.has=Nf,Xt.prototype.set=kf;function If(){this.__data__=[],this.size=0}function Yr(e,t){for(var r=e.length;r--;)if($e(e[r][0],t))return r;return-1}var Mf=Array.prototype,Ff=Mf.splice;function Lf(e){var t=this.__data__,r=Yr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ff.call(t,r,1),--this.size,!0}function Vf(e){var t=this.__data__,r=Yr(t,e);return r<0?void 0:t[r][1]}function Hf(e){return Yr(this.__data__,e)>-1}function Uf(e,t){var r=this.__data__,n=Yr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Nt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Nt.prototype.clear=If,Nt.prototype.delete=Lf,Nt.prototype.get=Vf,Nt.prototype.has=Hf,Nt.prototype.set=Uf;var zf=ie($t,"Map");const qe=zf;function qf(){this.size=0,this.__data__={hash:new Xt,map:new(qe||Nt),string:new Xt}}function Kf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Gr(e,t){var r=e.__data__;return Kf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Jf(e){var t=Gr(this,e).delete(e);return this.size-=t?1:0,t}function Wf(e){return Gr(this,e).get(e)}function Yf(e){return Gr(this,e).has(e)}function Gf(e,t){var r=Gr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Bt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Bt.prototype.clear=qf,Bt.prototype.delete=Jf,Bt.prototype.get=Wf,Bt.prototype.has=Yf,Bt.prototype.set=Gf;var Zf="Expected a function";function xi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Zf);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(xi.Cache||Bt),r}xi.Cache=Bt;var Qf=500;function Xf(e){var t=xi(e,function(n){return r.size===Qf&&r.clear(),n}),r=t.cache;return t}var tp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ep=/\\(\\)?/g,rp=Xf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tp,function(r,n,i,s){t.push(i?s.replace(ep,"$1"):n||r)}),t});const np=rp;function se(e){return e==null?"":qo(e)}function Ti(e,t){return ht(e)?e:Si(e,t)?[e]:np(se(e))}var ip=1/0;function rr(e){if(typeof e=="string"||Xe(e))return e;var t=e+"";return t=="0"&&1/e==-ip?"-0":t}function ra(e,t){t=Ti(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[rr(t[r++])];return r&&r==n?e:void 0}function na(e,t,r){var n=e==null?void 0:ra(e,t);return n===void 0?r:n}function sp(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var op=ea(Object.getPrototypeOf,Object);const ia=op;var ap="[object Object]",cp=Function.prototype,up=Object.prototype,sa=cp.toString,lp=up.hasOwnProperty,hp=sa.call(Object);function Oi(e){if(!st(e)||gt(e)!=ap)return!1;var t=ia(e);if(t===null)return!0;var r=lp.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&sa.call(r)==hp}var fp="[object DOMException]",pp="[object Error]";function oa(e){if(!st(e))return!1;var t=gt(e);return t==pp||t==fp||typeof e.message=="string"&&typeof e.name=="string"&&!Oi(e)}var dp=Wo(function(e,t){try{return Ko(e,void 0,t)}catch(r){return oa(r)?r:new Error(r)}});const mp=dp;function gp(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}function vp(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:gp(e,t,r)}var yp="\\ud800-\\udfff",bp="\\u0300-\\u036f",_p="\\ufe20-\\ufe2f",wp="\\u20d0-\\u20ff",Ep=bp+_p+wp,Sp="\\ufe0e\\ufe0f",xp="\\u200d",Tp=RegExp("["+xp+yp+Ep+Sp+"]");function aa(e){return Tp.test(e)}function Op(e){return e.split("")}var ca="\\ud800-\\udfff",$p="\\u0300-\\u036f",Ap="\\ufe20-\\ufe2f",jp="\\u20d0-\\u20ff",Rp=$p+Ap+jp,Dp="\\ufe0e\\ufe0f",Pp="["+ca+"]",kn="["+Rp+"]",In="\\ud83c[\\udffb-\\udfff]",Cp="(?:"+kn+"|"+In+")",ua="[^"+ca+"]",la="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",Np="\\u200d",fa=Cp+"?",pa="["+Dp+"]?",Bp="(?:"+Np+"(?:"+[ua,la,ha].join("|")+")"+pa+fa+")*",kp=pa+fa+Bp,Ip="(?:"+[ua+kn+"?",kn,la,ha,Pp].join("|")+")",Mp=RegExp(In+"(?="+In+")|"+Ip+kp,"g");function Fp(e){return e.match(Mp)||[]}function Lp(e){return aa(e)?Fp(e):Op(e)}function da(e){return function(t){t=se(t);var r=aa(t)?Lp(t):void 0,n=r?r[0]:t.charAt(0),i=r?vp(r,1).join(""):t.slice(1);return n[e]()+i}}var Vp=da("toUpperCase");const Zr=Vp;function Hp(e){return Zr(se(e).toLowerCase())}function Up(e,t,r,n){var i=-1,s=e==null?0:e.length;for(n;++i<s;)r=t(r,e[i],i,e);return r}function ma(e){return function(t){return e==null?void 0:e[t]}}var zp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qp=ma(zp);const Kp=qp;var Jp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wp="\\u0300-\\u036f",Yp="\\ufe20-\\ufe2f",Gp="\\u20d0-\\u20ff",Zp=Wp+Yp+Gp,Qp="["+Zp+"]",Xp=RegExp(Qp,"g");function td(e){return e=se(e),e&&e.replace(Jp,Kp).replace(Xp,"")}var ed=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function rd(e){return e.match(ed)||[]}var nd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function id(e){return nd.test(e)}var ga="\\ud800-\\udfff",sd="\\u0300-\\u036f",od="\\ufe20-\\ufe2f",ad="\\u20d0-\\u20ff",cd=sd+od+ad,va="\\u2700-\\u27bf",ya="a-z\\xdf-\\xf6\\xf8-\\xff",ud="\\xac\\xb1\\xd7\\xf7",ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hd="\\u2000-\\u206f",fd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",pd="\\ufe0e\\ufe0f",_a=ud+ld+hd+fd,wa="['’]",js="["+_a+"]",dd="["+cd+"]",Ea="\\d+",md="["+va+"]",Sa="["+ya+"]",xa="[^"+ga+_a+Ea+va+ya+ba+"]",gd="\\ud83c[\\udffb-\\udfff]",vd="(?:"+dd+"|"+gd+")",yd="[^"+ga+"]",Ta="(?:\\ud83c[\\udde6-\\uddff]){2}",Oa="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="["+ba+"]",bd="\\u200d",Rs="(?:"+Sa+"|"+xa+")",_d="(?:"+fe+"|"+xa+")",Ds="(?:"+wa+"(?:d|ll|m|re|s|t|ve))?",Ps="(?:"+wa+"(?:D|LL|M|RE|S|T|VE))?",$a=vd+"?",Aa="["+pd+"]?",wd="(?:"+bd+"(?:"+[yd,Ta,Oa].join("|")+")"+Aa+$a+")*",Ed="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xd=Aa+$a+wd,Td="(?:"+[md,Ta,Oa].join("|")+")"+xd,Od=RegExp([fe+"?"+Sa+"+"+Ds+"(?="+[js,fe,"$"].join("|")+")",_d+"+"+Ps+"(?="+[js,fe+Rs,"$"].join("|")+")",fe+"?"+Rs+"+"+Ds,fe+"+"+Ps,Sd,Ed,Ea,Td].join("|"),"g");function $d(e){return e.match(Od)||[]}function Ad(e,t,r){return e=se(e),t=t,t===void 0?id(e)?$d(e):rd(e):e.match(t)||[]}var jd="['’]",Rd=RegExp(jd,"g");function $i(e){return function(t){return Up(Ad(td(t).replace(Rd,"")),e,"")}}var Dd=$i(function(e,t,r){return t=t.toLowerCase(),e+(r?Hp(t):t)});const Lt=Dd;function Pd(){this.__data__=new Nt,this.size=0}function Cd(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Nd(e){return this.__data__.get(e)}function Bd(e){return this.__data__.has(e)}var kd=200;function Id(e,t){var r=this.__data__;if(r instanceof Nt){var n=r.__data__;if(!qe||n.length<kd-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Bt(n)}return r.set(e,t),this.size=r.size,this}function Ot(e){var t=this.__data__=new Nt(e);this.size=t.size}Ot.prototype.clear=Pd,Ot.prototype.delete=Cd,Ot.prototype.get=Nd,Ot.prototype.has=Bd,Ot.prototype.set=Id;var ja=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cs=ja&&typeof module=="object"&&module&&!module.nodeType&&module,Md=Cs&&Cs.exports===ja,Ns=Md?$t.Buffer:void 0,Bs=Ns?Ns.allocUnsafe:void 0;function Ra(e,t){if(t)return e.slice();var r=e.length,n=Bs?Bs(r):new e.constructor(r);return e.copy(n),n}function Fd(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function Ld(){return[]}var Vd=Object.prototype,Hd=Vd.propertyIsEnumerable,ks=Object.getOwnPropertySymbols,Ud=ks?function(e){return e==null?[]:(e=Object(e),Fd(ks(e),function(t){return Hd.call(e,t)}))}:Ld;const zd=Ud;function qd(e,t,r){var n=t(e);return ht(e)?n:sp(n,r(e))}function Mn(e){return qd(e,Wr,zd)}var Kd=ie($t,"DataView");const Fn=Kd;var Jd=ie($t,"Promise");const Ln=Jd;var Wd=ie($t,"Set");const Vn=Wd;var Is="[object Map]",Yd="[object Object]",Ms="[object Promise]",Fs="[object Set]",Ls="[object WeakMap]",Vs="[object DataView]",Gd=ne(Fn),Zd=ne(qe),Qd=ne(Ln),Xd=ne(Vn),tm=ne(Bn),Qt=gt;(Fn&&Qt(new Fn(new ArrayBuffer(1)))!=Vs||qe&&Qt(new qe)!=Is||Ln&&Qt(Ln.resolve())!=Ms||Vn&&Qt(new Vn)!=Fs||Bn&&Qt(new Bn)!=Ls)&&(Qt=function(e){var t=gt(e),r=t==Yd?e.constructor:void 0,n=r?ne(r):"";if(n)switch(n){case Gd:return Vs;case Zd:return Is;case Qd:return Ms;case Xd:return Fs;case tm:return Ls}return t});const Ke=Qt;var em=Object.prototype,rm=em.hasOwnProperty;function nm(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&rm.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var im=$t.Uint8Array;const Ir=im;function Ai(e){var t=new e.constructor(e.byteLength);return new Ir(t).set(new Ir(e)),t}function sm(e,t){var r=Ai(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var om=/\w*$/;function am(e){var t=new e.constructor(e.source,om.exec(e));return t.lastIndex=e.lastIndex,t}var Hs=jt?jt.prototype:void 0,Us=Hs?Hs.valueOf:void 0;function cm(e){return Us?Object(Us.call(e)):{}}function Da(e,t){var r=t?Ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var um="[object Boolean]",lm="[object Date]",hm="[object Map]",fm="[object Number]",pm="[object RegExp]",dm="[object Set]",mm="[object String]",gm="[object Symbol]",vm="[object ArrayBuffer]",ym="[object DataView]",bm="[object Float32Array]",_m="[object Float64Array]",wm="[object Int8Array]",Em="[object Int16Array]",Sm="[object Int32Array]",xm="[object Uint8Array]",Tm="[object Uint8ClampedArray]",Om="[object Uint16Array]",$m="[object Uint32Array]";function Am(e,t,r){var n=e.constructor;switch(t){case vm:return Ai(e);case um:case lm:return new n(+e);case ym:return sm(e);case bm:case _m:case wm:case Em:case Sm:case xm:case Tm:case Om:case $m:return Da(e,r);case hm:return new n;case fm:case mm:return new n(e);case pm:return am(e);case dm:return new n;case gm:return cm(e)}}function Pa(e){return typeof e.constructor=="function"&&!_i(e)?oh(ia(e)):{}}var jm="[object Map]";function Rm(e){return st(e)&&Ke(e)==jm}var zs=Rt&&Rt.isMap,Dm=zs?er(zs):Rm;const Pm=Dm;var Cm="[object Set]";function Nm(e){return st(e)&&Ke(e)==Cm}var qs=Rt&&Rt.isSet,Bm=qs?er(qs):Nm;const km=Bm;var Im=1,Ca="[object Arguments]",Mm="[object Array]",Fm="[object Boolean]",Lm="[object Date]",Vm="[object Error]",Na="[object Function]",Hm="[object GeneratorFunction]",Um="[object Map]",zm="[object Number]",Ba="[object Object]",qm="[object RegExp]",Km="[object Set]",Jm="[object String]",Wm="[object Symbol]",Ym="[object WeakMap]",Gm="[object ArrayBuffer]",Zm="[object DataView]",Qm="[object Float32Array]",Xm="[object Float64Array]",t1="[object Int8Array]",e1="[object Int16Array]",r1="[object Int32Array]",n1="[object Uint8Array]",i1="[object Uint8ClampedArray]",s1="[object Uint16Array]",o1="[object Uint32Array]",Q={};Q[Ca]=Q[Mm]=Q[Gm]=Q[Zm]=Q[Fm]=Q[Lm]=Q[Qm]=Q[Xm]=Q[t1]=Q[e1]=Q[r1]=Q[Um]=Q[zm]=Q[Ba]=Q[qm]=Q[Km]=Q[Jm]=Q[Wm]=Q[n1]=Q[i1]=Q[s1]=Q[o1]=!0,Q[Vm]=Q[Na]=Q[Ym]=!1;function Er(e,t,r,n,i,s){var o,a=tℑif(o!==void 0)return o;if(!ot(e))return e;var u=ht(e);if(u)o=nm(e);else{var c=Ke(e),l=c==Na||c==Hm;if(we(e))return Ra(e,a);if(c==Ba||c==Ca||l&&!i)o=l?{}:Pa(e);else{if(!Q[c])return i?e:{};o=Am(e,c,a)}}s||(s=new Ot);var h=s.get(e);if(h)return h;s.set(e,o),km(e)?e.forEach(function(d){o.add(Er(d,t,r,d,e,s))}):Pm(e)&&e.forEach(function(d,m){o.set(m,Er(d,t,r,m,e,s))});var f=Mn,p=u?void 0:f(e);return bh(p||e,function(d,m){p&&(m=d,d=e[m]),yi(o,m,Er(d,t,r,m,e,s))}),o}var a1=1,c1=4;function ji(e){return Er(e,a1|c1)}var u1="__lodash_hash_undefined__";function l1(e){return this.__data__.set(e,u1),this}function h1(e){return this.__data__.has(e)}function Sr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Bt;++t<r;)this.add(e[t])}Sr.prototype.add=Sr.prototype.push=l1,Sr.prototype.has=h1;function f1(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function p1(e,t){return e.has(t)}var d1=1,m1=2;function ka(e,t,r,n,i,s){var o=r&d1,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(e),l=s.get(t);if(c&&l)return c==t&&l==e;var h=-1,f=!0,p=r&m1?new Sr:void 0;for(s.set(e,t),s.set(t,e);++h<a;){var d=e[h],m=t[h];if(n)var b=o?n(m,d,h,t,e,s):n(d,m,h,e,t,s);if(b!==void 0){if(b)continue;f=!1;break}if(p){if(!f1(t,function(S,v){if(!p1(p,v)&&(d===S||i(d,S,r,n,s)))return p.push(v)})){f=!1;break}}else if(!(d===m||i(d,m,r,n,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function g1(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function v1(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var y1=1,b1=2,_1="[object Boolean]",w1="[object Date]",E1="[object Error]",S1="[object Map]",x1="[object Number]",T1="[object RegExp]",O1="[object Set]",$1="[object String]",A1="[object Symbol]",j1="[object ArrayBuffer]",R1="[object DataView]",Ks=jt?jt.prototype:void 0,gn=Ks?Ks.valueOf:void 0;function D1(e,t,r,n,i,s,o){switch(r){case R1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j1:return!(e.byteLength!=t.byteLength||!s(new Ir(e),new Ir(t)));case _1:case w1:case x1:return $e(+e,+t);case E1:return e.name==t.name&&e.message==t.message;case T1:case $1:return e==t+"";case S1:var a=g1;case O1:var u=n&y1;if(a||(a=v1),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;n|=b1,o.set(e,t);var l=ka(a(e),a(t),n,i,s,o);return o.delete(e),l;case A1:if(gn)return gn.call(e)==gn.call(t)}return!1}var P1=1,C1=Object.prototype,N1=C1.hasOwnProperty;function B1(e,t,r,n,i,s){var o=r&P1,a=Mn(e),u=a.length,c=Mn(t),l=c.length;if(u!=l&&!o)return!1;for(var h=u;h--;){var f=a[h];if(!(o?f in t:N1.call(t,f)))return!1}var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var m=!0;s.set(e,t),s.set(t,e);for(var b=o;++h<u;){f=a[h];var S=e[f],v=t[f];if(n)var y=o?n(v,S,f,t,e,s):n(S,v,f,e,t,s);if(!(y===void 0?S===v||i(S,v,r,n,s):y)){m=!1;break}b||(b=f=="constructor")}if(m&&!b){var _=e.constructor,E=t.constructor;_!=E&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof E=="function"&&E instanceof E)&&(m=!1)}return s.delete(e),s.delete(t),m}var k1=1,Js="[object Arguments]",Ws="[object Array]",lr="[object Object]",I1=Object.prototype,Ys=I1.hasOwnProperty;function M1(e,t,r,n,i,s){var o=ht(e),a=ht(t),u=o?Ws:Ke(e),c=a?Ws:Ke(t);u=u==Js?lr:u,c=c==Js?lr:c;var l=u==lr,h=c==lr,f=u==c;if(f&&we(e)){if(!we(t))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new Ot),o||wi(e)?ka(e,t,r,n,i,s):D1(e,t,u,r,n,i,s);if(!(r&k1)){var p=l&&Ys.call(e,"__wrapped__"),d=h&&Ys.call(t,"__wrapped__");if(p||d){var m=p?e.value():e,b=d?t.value():t;return s||(s=new Ot),i(m,b,r,n,s)}}return f?(s||(s=new Ot),B1(e,t,r,n,i,s)):!1}function Qr(e,t,r,n,i){return e===t?!0:e==null||t==null||!st(e)&&!st(t)?e!==e&&t!==t:M1(e,t,r,n,Qr,i)}var F1=1,L1=2;function V1(e,t,r,n){var i=r.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var o=r[i];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=r[i];var a=o[0],u=e[a],c=o[1];if(o[2]){if(u===void 0&&!(a in e))return!1}else{var l=new Ot,h;if(!(h===void 0?Qr(c,u,F1|L1,n,l):h))return!1}}return!0}function Ia(e){return e===e&&!ot(e)}function H1(e){for(var t=Wr(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ia(i)]}return t}function Ma(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function U1(e){var t=H1(e);return t.length==1&&t[0][2]?Ma(t[0][0],t[0][1]):function(r){return r===e||V1(r,e,t)}}function z1(e,t){return e!=null&&t in Object(e)}function q1(e,t,r){t=Ti(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=rr(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&bi(i)&&Kr(o,i)&&(ht(e)||kr(e)))}function K1(e,t){return e!=null&&q1(e,t,z1)}var J1=1,W1=2;function Y1(e,t){return Si(e)&&Ia(t)?Ma(rr(e),t):function(r){var n=na(r,e);return n===void 0&&n===t?K1(r,e):Qr(t,n,J1|W1)}}function G1(e){return function(t){return t==null?void 0:t[e]}}function Z1(e){return function(t){return ra(t,e)}}function Q1(e){return Si(e)?G1(rr(e)):Z1(e)}function X1(e){return typeof e=="function"?e:e==null?vi:typeof e=="object"?ht(e)?Y1(e[0],e[1]):U1(e):Q1(e)}function tg(e,t,r,n){for(var i=-1,s=e==null?0:e.length;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function eg(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),a=o.length;a--;){var u=o[++i];if(r(s[u],u,s)===!1)break}return t}}var rg=eg();const Fa=rg;function ng(e,t){return e&&Fa(e,t,Wr)}function ig(e,t){return function(r,n){if(r==null)return r;if(!tr(r))return e(r,n);for(var i=r.length,s=-1,o=Object(r);++s<i&&n(o[s],s,o)!==!1;);return r}}var sg=ig(ng);const og=sg;function ag(e,t,r,n){return og(e,function(i,s,o){t(n,i,r(i),o)}),n}function cg(e,t){return function(r,n){var i=ht(r)?tg:ag,s={};return i(r,e,X1(n),s)}}var ug=function(){return $t.Date.now()};const vn=ug;var lg="Expected a function",hg=Math.max,fg=Math.min;function Ri(e,t,r){var n,i,s,o,a,u,c=0,l=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(lg);t=_s(t)||0,ot(r)&&(l=!!r.leading,h="maxWait"in r,s=h?hg(_s(r.maxWait)||0,t):s,f="trailing"in r?!!r.trailing:f);function p(g){var x=n,O=i;return n=i=void 0,c=g,o=e.apply(O,x),o}function d(g){return c=g,a=setTimeout(S,t),l?p(g):o}function m(g){var x=g-u,O=g-c,V=t-x;return h?fg(V,s-O):V}function b(g){var x=g-u,O=g-c;return u===void 0||x>=t||x<0||h&&O>=s}function S(){var g=vn();if(b(g))return v(g);a=setTimeout(S,m(g))}function v(g){return a=void 0,f&&n?p(g):(n=i=void 0,o)}function y(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function _(){return a===void 0?o:v(vn())}function E(){var g=vn(),x=b(g);if(n=arguments,i=this,u=g,x){if(a===void 0)return d(u);if(h)return clearTimeout(a),a=setTimeout(S,t),p(u)}return a===void 0&&(a=setTimeout(S,t)),o}return E.cancel=y,E.flush=_,E}function Hn(e,t,r){(r!==void 0&&!$e(e[t],r)||r===void 0&&!(t in e))&&Jr(e,t,r)}function pg(e){return st(e)&&tr(e)}function Un(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function dg(e){return Jo(e,Ei(e))}function mg(e,t,r,n,i,s,o){var a=Un(e,r),u=Un(t,r),c=o.get(u);if(c){Hn(e,r,c);return}var l=s?s(a,u,r+"",e,t,o):void 0,h=l===void 0;if(h){var f=ht(u),p=!f&&we(u),d=!f&&!p&&wi(u);l=u,f||p||d?ht(a)?l=a:pg(a)?l=ch(a):p?(h=!1,l=Ra(u,!0)):d?(h=!1,l=Da(u,!0)):l=[]:Oi(u)||kr(u)?(l=a,kr(a)?l=dg(a):(!ot(a)||_e(a))&&(l=Pa(u))):h=!1}h&&(o.set(u,l),i(l,u,n,s,o),o.delete(u)),Hn(e,r,l)}function La(e,t,r,n,i){e!==t&&Fa(t,function(s,o){if(i||(i=new Ot),ot(s))mg(e,t,o,r,La,n,i);else{var a=n?n(Un(e,o),s,o+"",e,t,i):void 0;a===void 0&&(a=s),Hn(e,o,a)}},Ei)}var gg={"&":"&","<":"<",">":">",'"':""","'":"'"},vg=ma(gg);const yg=vg;var Va=/[&<>"']/g,bg=RegExp(Va.source);function _g(e){return e=se(e),e&&bg.test(e)?e.replace(Va,yg):e}var wg=Object.prototype,Eg=wg.hasOwnProperty,Sg=cg(function(e,t,r){Eg.call(e,r)?e[r].push(t):Jr(e,r,[t])});const xg=Sg;var Tg="[object String]";function bt(e){return typeof e=="string"||!ht(e)&&st(e)&>(e)==Tg}function Og(e,t){return zo(t,function(r){return e[r]})}var $g="[object ArrayBuffer]";function Ag(e){return st(e)&>(e)==$g}var Gs=Rt&&Rt.isArrayBuffer,jg=Gs?er(Gs):Ag;const Rg=jg;var Dg="[object Boolean]";function Pg(e){return e===!0||e===!1||st(e)&>(e)==Dg}var Cg="[object Date]";function Ng(e){return st(e)&>(e)==Cg}var Zs=Rt&&Rt.isDate,Bg=Zs?er(Zs):Ng;const kg=Bg;function Ig(e,t){return Qr(e,t)}var Mg="[object Number]";function Ha(e){return typeof e=="number"||st(e)&>(e)==Mg}function Fg(e){return Ha(e)&&e!=+e}function Lg(e){return e===null}function Vg(e){return e===void 0}var Hg=$i(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});const Ug=Hg;var zg=da("toLowerCase");const qg=zg;var Kg=Go(function(e,t,r){La(e,t,r)});const kt=Kg;function Jg(e,t,r,n){if(!ot(e))return e;t=Ti(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var u=rr(t[i]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var l=a[u];c=void 0,c===void 0&&(c=ot(l)?l:Kr(t[i+1])?[]:{})}yi(a,u,c),a=a[u]}return e}function Wg(e,t,r){return e==null?e:Jg(e,t,r)}var Yg=$i(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});const Gg=Yg;var Ua=Object.prototype,Zg=Ua.hasOwnProperty;function Qs(e,t,r,n){return e===void 0||$e(e,Ua[r])&&!Zg.call(n,r)?t:e}var Qg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Xg(e){return"\\"+Qg[e]}var t0=/<%=([\s\S]+?)%>/g;const za=t0;var e0=/<%-([\s\S]+?)%>/g;const r0=e0;var n0=/<%([\s\S]+?)%>/g;const i0=n0;var s0={escape:r0,evaluate:i0,interpolate:za,variable:"",imports:{_:{escape:_g}}};const Xs=s0;var o0="Invalid `variable` option passed into `_.template`",a0=/\b__p \+= '';/g,c0=/\b(__p \+=) '' \+/g,u0=/(__e\(.*?\)|\b__t\)) \+\n'';/g,l0=/[()=,{}\[\]\/\s]/,h0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hr=/($^)/,f0=/['\n\r\u2028\u2029\\]/g,p0=Object.prototype,to=p0.hasOwnProperty;function qa(e,t,r){var n=Xs.imports._.templateSettings||Xs;r&&Yo(e,t,r)&&(t=void 0),e=se(e),t=As({},t,n,Qs);var i=As({},t.imports,n.imports,Qs),s=Wr(i),o=Og(i,s),a,u,c=0,l=t.interpolate||hr,h="__p += '",f=RegExp((t.escape||hr).source+"|"+l.source+"|"+(l===za?h0:hr).source+"|"+(t.evaluate||hr).source+"|$","g"),p=to.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+`
|
|
3
3
|
`:"";e.replace(f,function(b,S,v,y,_,E){return v||(v=y),h+=e.slice(c,E).replace(f0,Xg),S&&(a=!0,h+=`' +
|
|
4
4
|
__e(`+S+`) +
|
|
@@ -51,15 +51,15 @@ version: 2.9.0
|
|
|
51
51
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
52
52
|
* @name @vtj/core
|
|
53
53
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
54
|
-
* @version 0.9.0-alpha.
|
|
54
|
+
* @version 0.9.0-alpha.2
|
|
55
55
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
56
|
-
*/const $v="0.9.0-alpha.0",Av="BuiltIn",ki="VueMaterial",Ii="VueRouterMaterial",jv=[ki,Ii],Rv={vue:"Vue","vue-router":"VueRouter"},Oc={[ki]:["Transition","TransitionGroup","KeepAlive","Teleport","Suspense"],[Ii]:["RouterView","RouterLink"]},Dv=["slot","template","component","img","div","p","h1","h2","h3","span","a"];let Pv=class{},$c=class{constructor(){j(this,"listeners",[]);j(this,"isReady",!1)}triggerReady(){this.isReady=!0;for(const t of this.listeners)t();this.listeners=[]}ready(t){this.isReady?t():this.listeners.push(t)}resetReady(){this.isReady=!1}},Or=class Ac{constructor(t,r,n){j(this,"isUnset",!1);this.name=t,this.value=r,this.defaultValue=n,this.setValue(r)}setValue(t){this.value=t,this.isUnset=this.value===this.defaultValue}getValue(){var t;return(t=this.value)!=null?t:this.defaultValue}static toDsl(t={}){return Object.entries(t).reduce((r,[n,i])=>(i.isUnset||(r[n]=i.getValue()),r),{})}static parse(t={}){return Object.entries(t).reduce((r,[n,i])=>(r[n]=new Ac(n,i),r),{})}},$r=class jc{constructor(t){j(this,"name");j(this,"handler");j(this,"modifiers",{});this.schema=t;const{name:r,handler:n}=this.schema;this.name=r,this.handler=n,this.update(t)}update(t){Object.assign(this.schema,t);const{handler:r,modifiers:n={}}=this.schema;this.handler=r,this.modifiers=n}static toDsl(t){return Object.entries(t).reduce((r,[n,i])=>{const{handler:s,modifiers:o}=i;return r[n]={name:n,handler:s,modifiers:o},r},{})}static parse(t={}){return Object.entries(t).reduce((r,[n,i])=>(r[n]=new jc(i),r),{})}},ke=class Rc{constructor(t){j(this,"id");j(this,"name","");j(this,"arg");j(this,"modifiers");j(this,"value");j(this,"iterator");this.schema=t,this.id=t.id||mt(),this.update(t)}update(t){Object.assign(this.schema,t);const{name:r,arg:n,modifiers:i,value:s,iterator:o}=this.schema;this.name=r,this.arg=n,this.modifiers=i,this.value=s,this.iterator=o}static parse(t=[]){return t.map(r=>new Rc(r))}static toDsl(t=[]){return t.map(r=>{const{name:n,arg:i,modifiers:s,value:o,iterator:a,id:u}=r;return{id:u,name:n,arg:i,modifiers:s,value:o,iterator:a}})}};const nt="EVENT_NODE_CHANGE";var It;let Fr=(It=class{constructor(t,r=null){j(this,"__VTJ_NODE__",!0);j(this,"locked",!1);j(this,"id");j(this,"name");j(this,"from");j(this,"invisible",!1);j(this,"children","");j(this,"slot");j(this,"props",{});j(this,"events",{});j(this,"directives",[]);j(this,"disposed",!1);this.parent=r;const{id:n=mt(),name:i,from:s=""}=t;this.id=n,this.name=i,this.from=s,this.update(t,!0),It.nodes[this.id]=this}update(t,r=!1){const{invisible:n=!1,locked:i=!1,children:s=[],slot:o,props:a={},events:u={},directives:c=[]}=t;this.invisible=n,this.locked=i,this.setChildren(s,!0),this.setSlot(o,!0),this.props=Or.parse(a),this.events=$r.parse(u),this.directives=ke.parse(c),r||M.emit(nt,this)}setChildren(t="",r=!1){Array.isArray(t)?this.children=t.map(n=>new It(n,this)):this.children=t,r||M.emit(nt,this)}setSlot(t,r=!1){this.slot=typeof t=="string"?{name:t,params:[]}:t,r||M.emit(nt,this)}setProp(t,r,n,i=!1){const s=this.props[t];s?s.setValue(r):this.props[t]=new Or(t,r,n),i||M.emit(nt,this)}removeProp(t,r=!1){delete this.props[t],r||M.emit(nt,this)}getPropValue(t){const r=this.props[t];if(r)return r.getValue()}setEvent(t,r=!1){const n=this.events[t.name];n?n.update(t):this.events[t.name]=new $r(t),r||M.emit(nt,this)}removeEvent(t,r=!1){delete this.events[t],r||M.emit(nt,this)}setDirective(t,r=!1){const n=this.directives.findIndex(i=>i.id===t.id);n>=0?this.directives.splice(n,1,new ke(t)):this.directives.push(new ke(t)),r||M.emit(nt,this)}removeDirective(t,r=!1){const n=this.directives.findIndex(i=>i===t||i.id===t.id);n>=0&&this.directives.splice(n,1),r||M.emit(nt,this)}removeChild(t,r=!1){const{children:n,disposed:i}=this;if(i||!Array.isArray(n))return;const s=n.findIndex(o=>o===t);t.parent=null,n.splice(s,1),r||M.emit(nt,this)}appendChild(t,r=!1){const{children:n,disposed:i}=this;i||(t.parent=this,Array.isArray(n)?n.push(t):this.children=[t],r||M.emit(nt,this))}insertAfter(t,r=!1){if(!this.parent)return;const n=this.parent.children;if(Array.isArray(n)){t.parent=this.parent;const i=n.indexOf(this);n.splice(i+1,0,t),r||M.emit(nt,this.parent)}}insertBefore(t,r=!1){if(!this.parent)return;const n=this.parent.children;if(Array.isArray(n)){t.parent=this.parent;const i=n.indexOf(this);n.splice(i,0,t),r||M.emit(nt,this.parent)}}movePrev(t=!1){const r=this.parent;if(!r)return;const n=r.children;if(Array.isArray(n)){const i=n.indexOf(this);i>0&&(n.splice(i,1),n.splice(i-1,0,this),t||M.emit(nt,r))}}moveNext(t=!1){const r=this.parent;if(!r)return;const n=r.children;if(Array.isArray(n)){const i=n.indexOf(this);i>-1&&i<n.length-1&&(n.splice(i,1),n.splice(i+1,0,this),t||M.emit(nt,r))}}toDsl(){const{id:t,name:r,from:n,invisible:i,locked:s,slot:o,children:a,props:u,directives:c,events:l}=this,h=Array.isArray(a)?a.map(f=>f.toDsl()):a;return{id:t,name:r,from:n,invisible:i,locked:s,slot:o,children:h,props:Or.toDsl(u),directives:ke.toDsl(c),events:$r.toDsl(l)}}dispose(t=!1){const{children:r,disposed:n}=this;n||(Array.isArray(r)&&r.forEach(i=>i.dispose(!0)),this.parent?this.parent.removeChild(this,t):t||M.emit(nt,this),this.parent=null,this.disposed=!0,delete It.nodes[this.id])}lock(t=!1){if(this.locked=!0,Array.isArray(this.children))for(const r of this.children)r.lock(!0);t||M.emit(nt,this)}unlock(t=!1){if(this.locked=!1,Array.isArray(this.children))for(const r of this.children)r.unlock(!0);t||M.emit(nt,this)}setVisible(t,r=!1){if(this.invisible=!t,Array.isArray(this.children))for(const n of this.children)n.setVisible(t,!0);r||M.emit(nt,this)}isChild(t){let r=!1;if(Array.isArray(this.children)){for(const n of this.children)if(t===n||t.id===n.id){r=!0;break}else if(r=n.isChild(t),r)break}return r}},j(It,"nodes",{}),It);const G="EVENT_BLOCK_CHANGE",Ue=class Ue{constructor(t){j(this,"__VTJ_BLOCK__",!0);j(this,"id");j(this,"name","");j(this,"inject",[]);j(this,"state",{});j(this,"lifeCycles",{});j(this,"methods",{});j(this,"computed",{});j(this,"watch",[]);j(this,"css","");j(this,"props",[]);j(this,"emits",[]);j(this,"slots",[]);j(this,"dataSources",{});j(this,"nodes",[]);j(this,"locked",!1);j(this,"disposed",!1);const{id:r}=t;this.id=r||mt(),this.update(t,!0)}update(t,r=!1){for(const i of Ue.normalAttrs){const s=t[i];s&&(this[i]=s)}const{nodes:n=[]}=t;n.length&&(this.nodes=n.map(i=>new Fr(i))),r||M.emit(G,this)}toDsl(t){const{__VTJ_BLOCK__:r,id:n,nodes:i}=this;return xt(K({},Ue.normalAttrs.reduce((s,o)=>(s[o]=this[o],s),{})),{__VTJ_BLOCK__:r,__VERSION__:t||gc().toString(),id:n,nodes:i.map(s=>s.toDsl())})}dispose(){this.nodes.map(t=>t.dispose(!0)),this.nodes=[],this.disposed=!0}setFunction(t,r,n,i=!1){this[t][r]=n,i||M.emit(G,this)}removeFunction(t,r,n=!1){delete this[t][r],n||M.emit(G,this)}setState(t,r,n=!1){this.state[t]=r,n||M.emit(G,this)}removeState(t,r=!1){delete this.state[t],r||M.emit(G,this)}setCss(t,r=!1){this.css=t,r||M.emit(G,this)}setWatch(t,r=!1){t.id=t.id||mt();const n=this.watch.findIndex(i=>i.id&&i.id===t.id||i===t);n>-1?this.watch.splice(n,1,t):this.watch.push(t),r||M.emit(G,this)}removeWatch(t,r=!1){const n=this.watch.findIndex(i=>i.id&&i.id===t.id||i===t);n>-1&&(this.watch.splice(n,1),r||M.emit(G,this))}setProp(t,r=!1){const n=this.props.findIndex(i=>typeof i=="string"?i===t.name:i.name===t.name);n>-1?this.props.splice(n,1,t):this.props.push(t),r||M.emit(G,this)}removeProp(t,r=!1){const n=this.props.findIndex(i=>typeof i=="string"?i===t.name:i.name===t.name);n>-1&&(this.props.splice(n,1),r||M.emit(G,this))}setEmit(t,r=!1){const n=bt(t)?{name:t,params:[]}:t,i=this.emits.findIndex(s=>s===n.name||s===n);i>-1?this.emits.splice(i,1,n):this.emits.push(n),r||M.emit(G,this)}removeEmit(t,r=!1){const n=this.emits.findIndex(i=>bt(i)?i===t:i.name===t);n>-1&&(this.emits.splice(n,1),r||M.emit(G,this))}setSlot(t,r=!1){const n=bt(t)?{name:t,params:[]}:t,i=this.slots.findIndex(s=>s===n.name||s===n);i>-1?this.slots.splice(i,1,n):this.slots.push(n),r||M.emit(G,this)}removeSlot(t,r=!1){const n=this.slots.findIndex(i=>bt(i)?i===t:i.name===t);n>-1&&(this.slots.splice(n,1),r||M.emit(G,this))}setInject(t,r=!1){const n=this.inject.findIndex(i=>i.name===t.name);n>-1?this.inject.splice(n,1,t):this.inject.push(t),r||M.emit(G,this)}removeInject(t,r=!1){const n=this.inject.findIndex(i=>i.name===t.name);n>-1&&(this.inject.splice(n,1),r||M.emit(G,this))}setDataSource(t,r=!1){this.dataSources[t.name]=t,r||M.emit(G,this)}removeDataSource(t,r=!1){delete this.dataSources[t],r||M.emit(G,this)}insertAfter(t,r,n=!1){t.parent=null;const i=this.nodes.indexOf(r);this.nodes.splice(i+1,0,t),n||M.emit(G,this)}insertBefore(t,r,n=!1){t.parent=null;const i=this.nodes.indexOf(r);this.nodes.splice(i,0,t),n||M.emit(G,this)}appendNode(t,r=!1){t.parent=null,this.nodes.push(t),r||M.emit(G,this)}addNode(t,r,n="inner",i=!1){r?["left","top"].includes(n)?r.parent?r.insertAfter(t,i):this.insertBefore(t,r,i):["right","bottom"].includes(n)?r.parent?r.insertAfter(t,i):this.insertAfter(t,r,i):r.appendChild(t,i):this.appendNode(t,i)}__removeNode(t,r=!1){const n=this.nodes.findIndex(i=>i.id===t.id);n>-1&&(this.nodes.splice(n,1),r||M.emit(G,this))}removeNode(t,r=!1){t.parent?t.dispose(r):(t.dispose(!0),this.__removeNode(t,r))}move(t,r,n="inner",i=!1){t.parent?t.parent.removeChild(t,!0):this.__removeNode(t,!0),this.addNode(t,r,n,i)}movePrev(t,r=!1){if(t.parent)t.movePrev(r);else{const n=this.nodes,i=n.indexOf(t);i>0&&(n.splice(i,1),n.splice(i-1,0,t),r||M.emit(G,this))}}moveNext(t,r=!1){if(t.parent)t.moveNext(r);else{const n=this.nodes,i=n.indexOf(t);i>-1&&i<n.length-1&&(n.splice(i,1),n.splice(i+1,0,t),r||M.emit(G,this))}}cloneNode(t,r=!1){const n=Fi(t.toDsl()),i=new Fr(n);return this.addNode(i,t,"bottom",r),i}lock(t=!1){this.locked=!0;for(const r of this.nodes)r.lock(!0);t||M.emit(G,this)}unlock(t=!1){this.locked=!1;for(const r of this.nodes)r.unlock(!0);t||M.emit(G,this)}isChild(t){let r=!1;for(const n of this.nodes)if(t===n||t.id===n.id){r=!0;break}else if(r=n.isChild(t),r)break;return r}};j(Ue,"normalAttrs",["name","locked","inject","state","lifeCycles","methods","computed","watch","css","props","emits","slots","dataSources","__TEMPLATE_ID__"]);let qt=Ue;const it="EVENT_PROJECT_CHANGE",Zn="EVENT_PROJECT_ACTIVED",Qn="EVENT_PROJECT_DEPS_CHANGE",Ie="EVENT_PROJECT_PAGES_CHANGE",Me="EVENT_PROJECT_BLOCKS_CHANGE",Xn="EVENT_PROJECT_APIS_CHANGE",ti="EVENT_PROJECT_META_CHANGE",Dc="EVENT_PROJECT_PUBLISH",Pc="EVENT_PROJECT_FILE_PUBLISH";var Kt;let We=(Kt=class{constructor(t){j(this,"id","");j(this,"name","");j(this,"description","");j(this,"homepage","");j(this,"dependencies",[]);j(this,"pages",[]);j(this,"blocks",[]);j(this,"apis",[]);j(this,"meta",[]);j(this,"currentFile",null);j(this,"config",{});j(this,"__BASE_PATH__","/");const{id:r}=t;this.id=r||mt(),this.update(t,!0)}update(t,r=!1){for(const n of Kt.attrs){const i=t[n];i&&(this[n]=i)}r||M.emit(it,{model:this,type:"update",data:t})}isPageFile(t){return t.type==="page"}cleanPagesDsl(t){for(const r of t)delete r.dsl,r.children&&r.children.length&&this.cleanPagesDsl(r.children)}toDsl(t){const{id:r}=this,n=Kt.attrs.reduce((i,s)=>(i[s]=this[s],i),{});return n.pages&&(n.pages=n.pages.map(i=>(delete i.dsl,i)),this.cleanPagesDsl(n.pages)),n.blocks&&(n.blocks=n.blocks.map(i=>(delete i.dsl,i))),K({__VTJ_PROJECT__:!0,id:r},n)}active(t,r=!1){this.currentFile=t,r||M.emit(Zn,{model:this,type:"update",data:t})}deactivate(t=!1){this.currentFile=null,t||M.emit(Zn,{model:this,type:"update",data:null})}setDeps(t,r=!1){const n=this.dependencies,i=n.findIndex(o=>o.package===t.package);let s;if(i>-1?(s="update",n.splice(i,1,K(K({},n[i]),t))):(s="create",n.push(t)),!r){const o={model:this,type:s,data:t};M.emit(Qn,o),M.emit(it,o)}}removeDeps(t,r=!1){const n=this.dependencies,i=n.findIndex(s=>s.package===t.package);if(i>-1&&n.splice(i,1),!r){const s={model:this,type:"delete",data:t};M.emit(Qn,s),M.emit(it,s)}}getPage(t){const r=(n,i=[])=>{for(const s of i){if(s.id===n)return s;if(s.children&&s.children.length){const o=r(n,s.children);if(o)return o}}};return r(t,this.pages)}getPages(){const t=(r=[])=>{let n=[];for(const i of r)i.dir?i.children&&i.children.length&&(n=n.concat(t(i.children))):n.push(i);return n};return t(this.pages)}createPage(t,r,n=!1){return H(this,null,function*(){if(t.id=t.raw?t.name:t.id||mt(),t.type="page",t.dir?t.children=[]:t.dsl=t.dsl||new qt({id:t.id,name:zn(t.name)}).toDsl(),r){const i=this.getPage(r);i?i.children?i.children.push(t):i.children=[t]:console.warn(`not found PageFile for id: ${r} `)}else this.pages.push(t);if(!n){const i={model:this,type:"create",data:t};M.emit(Ie,i),M.emit(it,i)}!this.currentFile&&!t.dir&&(yield Je(1e3),this.active(t,n))})}updatePage(t,r=!1){const n=this.getPage(t.id);if(n?Object.assign(n,t):console.warn(`not found PageFile for id: ${t.id} `),!r){const i={model:this,type:"update",data:t};M.emit(Ie,i),M.emit(it,i)}}clonePage(t,r,n=!1){var h;const i=mt(),s=`${t.name}Copy`,o=`${t.title}_副本`,a=new qt({id:i,name:s}).toDsl(),u=kt({},t,{id:i,name:s,title:o,dsl:a}),c=r?((h=this.getPage(r))==null?void 0:h.children)||[]:this.pages,l=c.findIndex(f=>f.id===t.id);if(c.splice(l+1,0,u),!n){const f={model:this,type:"clone",data:{source:t,target:u}};M.emit(Ie,f),M.emit(it,f)}}removePage(t,r=!1){var s;const n=this.getPage(t),i=(o,a)=>{const u=a.findIndex(c=>c.id===o);if(u>=0){a.splice(u,1);return}for(const c of a)c.children&&c.children.length&&i(o,c.children)};if(i(t,this.pages),t===this.homepage&&(this.homepage=""),((s=this.currentFile)==null?void 0:s.id)===t&&this.deactivate(r),!r){const o={model:this,type:"delete",data:n};M.emit(Ie,o),M.emit(it,o)}}getBlock(t){return this.blocks.find(r=>r.id===t)}createBlock(t,r=!1){return H(this,null,function*(){const n=t.id||mt(),i=zn(t.name);t.id=n,t.type="block",t.dsl=new qt({id:n,name:i}).toDsl(),this.blocks.push(t);const s=t.fromType||"Schema";if(!r){const o={model:this,type:"create",data:t};M.emit(Me,o),M.emit(it,o)}!this.currentFile&&s==="Schema"&&(yield Je(1e3),this.active(t,r))})}updateBlock(t,r=!1){const n=this.getBlock(t.id);if(n?(Object.assign(n,t),n.dsl&&(n.dsl.name=t.name)):console.warn(`not found PageFile for id: ${t.id} `),!r){const i={model:this,type:"update",data:t};M.emit(Me,i),M.emit(it,i)}}cloneBlock(t,r=!1){const n=mt(),i=`${t.name}Copy`,s=`${t.title}_副本`,o=new qt({id:n,name:i}).toDsl(),a=kt({},t,{id:n,name:i,title:s,dsl:o}),u=this.blocks.findIndex(c=>c.id===t.id);if(this.blocks.splice(u+1,0,a),!r){const c={model:this,type:"clone",data:{source:t,target:a}};M.emit(Me,c),M.emit(it,c)}}removeBlock(t,r=!1){var o;const n=this.getBlock(t),i=this.blocks,s=i.findIndex(a=>a.id===t);if(s>-1?(i.splice(s,1),((o=this.currentFile)==null?void 0:o.id)===t&&this.deactivate(r)):console.warn(`not found PageFile for id: ${t} `),!r){const a={model:this,type:"delete",data:n};M.emit(Me,a),M.emit(it,a)}}existBlockName(t,r=[]){return this.blocks.some(n=>n.name===t&&!r.includes(n.id))}existPageName(t,r=[]){return this.getPages().some(n=>n.name===t&&!r.includes(n.id))}setApi(t,r=!1){const n=this.apis.find(s=>s.name===t.name||s.id===t.id);let i;if(n?(i="update",Object.assign(n,t)):(i="create",t.id=mt(),this.apis.push(t)),!r){const s={model:this,type:i,data:t};M.emit(Xn,s),M.emit(it,s)}}removeApi(t,r=!1){const n=this.apis.findIndex(i=>i.name===t||i.id===t);if(n>-1?this.apis.splice(n,1):console.warn(`not found Api for name: ${t} `),!r){const i={model:this,type:"delete",data:t};M.emit(Xn,i),M.emit(it,i)}}existApiName(t,r=[]){return this.apis.some(n=>n.name===t&&!r.includes(n.id))}setMeta(t,r=!1){const n=this.meta.find(s=>s.code===t.code||s.id===t.id);let i;if(n?(i="update",Object.assign(n,t)):(i="create",t.id=mt(),this.meta.push(t)),!r){const s={model:this,type:i,data:t};M.emit(ti,s),M.emit(it,s)}}removeMeta(t,r=!1){const n=this.meta.findIndex(i=>i.code===t||i.id===t);if(n>-1?this.meta.splice(n,1):console.warn(`not found meta for name: ${name} `),!r){const i={model:this,type:"delete",data:t};M.emit(ti,i),M.emit(it,i)}}existMetaCode(t,r=[]){return this.meta.some(n=>n.code===t&&!r.includes(n.id))}setHomepage(t,r=!1){if(this.homepage=t,!r){const n={model:this,type:"update",data:t};M.emit(it,n)}}setConfig(t,r=!1){if(this.config=Object.assign(this.config,t),!r){const n={model:this,type:"update",data:t};M.emit(it,n)}}publish(t){const r={model:this,type:"publish",data:t||this};t?M.emit(Pc,r):M.emit(Dc,r)}},j(Kt,"attrs",["name","homepage","description","dependencies","pages","blocks","apis","meta","config","__BASE_PATH__"]),Kt);const Fe="EVENT_HISTORY_CHANGE",Ar="EVENT_HISTORY_LOAD";let Mi=class{constructor(t,r={}){j(this,"options",{max:50});j(this,"index",-1);j(this,"id");j(this,"items");Object.assign(this.options,r);const{id:n,items:i=[]}=t;this.id=n,this.items=i}toDsl(){const{id:t,items:r}=this;return{id:t,items:r.map(n=>({id:n.id,label:n.label}))}}get(t){return this.items.find(r=>r.id===t)}add(t,r=!1){const{max:n}=this.options,i={id:mt(),label:new Date().toLocaleString(),dsl:ji(t)};if(this.items.unshift(i),this.items.length>n){const s=this.items.splice(n);r||M.emit(Fe,{model:this,type:"delete",data:s.map(o=>o.id)})}this.index=-1,r||M.emit(Fe,{model:this,type:"create",data:i})}remove(t,r=!1){const n=this.items.findIndex(i=>i.id===t);n>-1?(this.items.splice(n,1),n===this.index?this.index=-1:this.index>=this.items.length&&(this.index=this.items.length-1)):console.warn(`not found HistoryItem for id: ${t} `),r||M.emit(Fe,{model:this,type:"delete",data:[t]})}forward(t=!1){const{index:r,items:n}=this;if(r<0)return;--this.index;const i=n[this.index];i&&!t&&M.emit(Ar,{model:this,type:"load",data:i})}backward(t=!1){const{index:r,items:n}=this;if(r>=n.length-1)return;r<0&&(this.index=0),++this.index;const i=n[this.index];i&&!t&&M.emit(Ar,{model:this,type:"load",data:i})}load(t,r=!1){const n=this.items.findIndex(i=>i.id===t);n>=0&&(this.index=n,r||M.emit(Ar,{model:this,type:"load",data:this.items[n]}))}clear(t=!1){this.index=-1;const r=this.items.map(n=>n.id);this.items=[],t||M.emit(Fe,{model:this,type:"clear",data:r})}};const M=Sc();function Cv(e){return e instanceof qt}function Nv(e){return e instanceof Fr}function Bv(e){return!!e.__VTJ_BLOCK__}function Fi(e){const t=ji(e);return delete t.id,Array.isArray(t.children)&&(t.children=t.children.map(r=>Fi(r))),t}function kv(e){const t=e.fromType||"Schema";return t==="Schema"?{type:"Schema",id:e.id}:t==="UrlSchema"?{type:"UrlSchema",url:(e.urls||"").split(",")[0]||""}:t==="Plugin"?{type:"Plugin",urls:(e.urls||"").split(","),library:e.library}:""}const xw=Object.freeze(Object.defineProperty({__proto__:null,BUILT_IN_COMPONENTS:Oc,BUILT_IN_LIBRARAY_MAP:Rv,BUILT_IN_MATERIALS:jv,BUILT_IN_NAME:Av,BUILT_IN_TAGS:Dv,BUILT_IN_VUE:ki,BUILT_IN_VUE_ROUTER:Ii,Base:$c,BlockModel:qt,DirectiveModel:ke,EVENT_BLOCK_CHANGE:G,EVENT_HISTORY_CHANGE:Fe,EVENT_HISTORY_LOAD:Ar,EVENT_NODE_CHANGE:nt,EVENT_PROJECT_ACTIVED:Zn,EVENT_PROJECT_APIS_CHANGE:Xn,EVENT_PROJECT_BLOCKS_CHANGE:Me,EVENT_PROJECT_CHANGE:it,EVENT_PROJECT_DEPS_CHANGE:Qn,EVENT_PROJECT_FILE_PUBLISH:Pc,EVENT_PROJECT_META_CHANGE:ti,EVENT_PROJECT_PAGES_CHANGE:Ie,EVENT_PROJECT_PUBLISH:Dc,EventModel:$r,HistoryModel:Mi,NodeModel:Fr,ProjectModel:We,PropModel:Or,Service:Pv,VTJ_CORE_VERSION:$v,cloneDsl:Fi,createNodeFrom:kv,emitter:M,isBlock:Cv,isBlockSchema:Bv,isNode:Nv},Symbol.toStringTag,{value:"Module"}));var Iv=Object.defineProperty,Mv=(e,t,r)=>t in e?Iv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yt=(e,t,r)=>Mv(e,typeof t!="symbol"?t+"":t,r);(function(){if(typeof window>"u"||typeof EventTarget>"u")return;const e=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(t,r,n){typeof n!="boolean"&&(n=n||{},n.passive=!1),e.call(this,t,r,n)}})();/**!
|
|
56
|
+
*/const $v="0.9.0-alpha.2",Av="BuiltIn",ki="VueMaterial",Ii="VueRouterMaterial",jv=[ki,Ii],Rv={vue:"Vue","vue-router":"VueRouter"},Oc={[ki]:["Transition","TransitionGroup","KeepAlive","Teleport","Suspense"],[Ii]:["RouterView","RouterLink"]},Dv=["slot","template","component","img","div","p","h1","h2","h3","span","a"];let Pv=class{},$c=class{constructor(){j(this,"listeners",[]);j(this,"isReady",!1)}triggerReady(){this.isReady=!0;for(const t of this.listeners)t();this.listeners=[]}ready(t){this.isReady?t():this.listeners.push(t)}resetReady(){this.isReady=!1}},Or=class Ac{constructor(t,r,n){j(this,"isUnset",!1);this.name=t,this.value=r,this.defaultValue=n,this.setValue(r)}setValue(t){this.value=t,this.isUnset=this.value===this.defaultValue}getValue(){var t;return(t=this.value)!=null?t:this.defaultValue}static toDsl(t={}){return Object.entries(t).reduce((r,[n,i])=>(i.isUnset||(r[n]=i.getValue()),r),{})}static parse(t={}){return Object.entries(t).reduce((r,[n,i])=>(r[n]=new Ac(n,i),r),{})}},$r=class jc{constructor(t){j(this,"name");j(this,"handler");j(this,"modifiers",{});this.schema=t;const{name:r,handler:n}=this.schema;this.name=r,this.handler=n,this.update(t)}update(t){Object.assign(this.schema,t);const{handler:r,modifiers:n={}}=this.schema;this.handler=r,this.modifiers=n}static toDsl(t){return Object.entries(t).reduce((r,[n,i])=>{const{handler:s,modifiers:o}=i;return r[n]={name:n,handler:s,modifiers:o},r},{})}static parse(t={}){return Object.entries(t).reduce((r,[n,i])=>(r[n]=new jc(i),r),{})}},ke=class Rc{constructor(t){j(this,"id");j(this,"name","");j(this,"arg");j(this,"modifiers");j(this,"value");j(this,"iterator");this.schema=t,this.id=t.id||mt(),this.update(t)}update(t){Object.assign(this.schema,t);const{name:r,arg:n,modifiers:i,value:s,iterator:o}=this.schema;this.name=r,this.arg=n,this.modifiers=i,this.value=s,this.iterator=o}static parse(t=[]){return t.map(r=>new Rc(r))}static toDsl(t=[]){return t.map(r=>{const{name:n,arg:i,modifiers:s,value:o,iterator:a,id:u}=r;return{id:u,name:n,arg:i,modifiers:s,value:o,iterator:a}})}};const nt="EVENT_NODE_CHANGE";var It;let Fr=(It=class{constructor(t,r=null){j(this,"__VTJ_NODE__",!0);j(this,"locked",!1);j(this,"id");j(this,"name");j(this,"from");j(this,"invisible",!1);j(this,"children","");j(this,"slot");j(this,"props",{});j(this,"events",{});j(this,"directives",[]);j(this,"disposed",!1);this.parent=r;const{id:n=mt(),name:i,from:s=""}=t;this.id=n,this.name=i,this.from=s,this.update(t,!0),It.nodes[this.id]=this}update(t,r=!1){const{invisible:n=!1,locked:i=!1,children:s=[],slot:o,props:a={},events:u={},directives:c=[]}=t;this.invisible=n,this.locked=i,this.setChildren(s,!0),this.setSlot(o,!0),this.props=Or.parse(a),this.events=$r.parse(u),this.directives=ke.parse(c),r||M.emit(nt,this)}setChildren(t="",r=!1){Array.isArray(t)?this.children=t.map(n=>new It(n,this)):this.children=t,r||M.emit(nt,this)}setSlot(t,r=!1){this.slot=typeof t=="string"?{name:t,params:[]}:t,r||M.emit(nt,this)}setProp(t,r,n,i=!1){const s=this.props[t];s?s.setValue(r):this.props[t]=new Or(t,r,n),i||M.emit(nt,this)}removeProp(t,r=!1){delete this.props[t],r||M.emit(nt,this)}getPropValue(t){const r=this.props[t];if(r)return r.getValue()}setEvent(t,r=!1){const n=this.events[t.name];n?n.update(t):this.events[t.name]=new $r(t),r||M.emit(nt,this)}removeEvent(t,r=!1){delete this.events[t],r||M.emit(nt,this)}setDirective(t,r=!1){const n=this.directives.findIndex(i=>i.id===t.id);n>=0?this.directives.splice(n,1,new ke(t)):this.directives.push(new ke(t)),r||M.emit(nt,this)}removeDirective(t,r=!1){const n=this.directives.findIndex(i=>i===t||i.id===t.id);n>=0&&this.directives.splice(n,1),r||M.emit(nt,this)}removeChild(t,r=!1){const{children:n,disposed:i}=this;if(i||!Array.isArray(n))return;const s=n.findIndex(o=>o===t);t.parent=null,n.splice(s,1),r||M.emit(nt,this)}appendChild(t,r=!1){const{children:n,disposed:i}=this;i||(t.parent=this,Array.isArray(n)?n.push(t):this.children=[t],r||M.emit(nt,this))}insertAfter(t,r=!1){if(!this.parent)return;const n=this.parent.children;if(Array.isArray(n)){t.parent=this.parent;const i=n.indexOf(this);n.splice(i+1,0,t),r||M.emit(nt,this.parent)}}insertBefore(t,r=!1){if(!this.parent)return;const n=this.parent.children;if(Array.isArray(n)){t.parent=this.parent;const i=n.indexOf(this);n.splice(i,0,t),r||M.emit(nt,this.parent)}}movePrev(t=!1){const r=this.parent;if(!r)return;const n=r.children;if(Array.isArray(n)){const i=n.indexOf(this);i>0&&(n.splice(i,1),n.splice(i-1,0,this),t||M.emit(nt,r))}}moveNext(t=!1){const r=this.parent;if(!r)return;const n=r.children;if(Array.isArray(n)){const i=n.indexOf(this);i>-1&&i<n.length-1&&(n.splice(i,1),n.splice(i+1,0,this),t||M.emit(nt,r))}}toDsl(){const{id:t,name:r,from:n,invisible:i,locked:s,slot:o,children:a,props:u,directives:c,events:l}=this,h=Array.isArray(a)?a.map(f=>f.toDsl()):a;return{id:t,name:r,from:n,invisible:i,locked:s,slot:o,children:h,props:Or.toDsl(u),directives:ke.toDsl(c),events:$r.toDsl(l)}}dispose(t=!1){const{children:r,disposed:n}=this;n||(Array.isArray(r)&&r.forEach(i=>i.dispose(!0)),this.parent?this.parent.removeChild(this,t):t||M.emit(nt,this),this.parent=null,this.disposed=!0,delete It.nodes[this.id])}lock(t=!1){if(this.locked=!0,Array.isArray(this.children))for(const r of this.children)r.lock(!0);t||M.emit(nt,this)}unlock(t=!1){if(this.locked=!1,Array.isArray(this.children))for(const r of this.children)r.unlock(!0);t||M.emit(nt,this)}setVisible(t,r=!1){if(this.invisible=!t,Array.isArray(this.children))for(const n of this.children)n.setVisible(t,!0);r||M.emit(nt,this)}isChild(t){let r=!1;if(Array.isArray(this.children)){for(const n of this.children)if(t===n||t.id===n.id){r=!0;break}else if(r=n.isChild(t),r)break}return r}},j(It,"nodes",{}),It);const G="EVENT_BLOCK_CHANGE",Ue=class Ue{constructor(t){j(this,"__VTJ_BLOCK__",!0);j(this,"id");j(this,"name","");j(this,"inject",[]);j(this,"state",{});j(this,"lifeCycles",{});j(this,"methods",{});j(this,"computed",{});j(this,"watch",[]);j(this,"css","");j(this,"props",[]);j(this,"emits",[]);j(this,"slots",[]);j(this,"dataSources",{});j(this,"nodes",[]);j(this,"locked",!1);j(this,"disposed",!1);const{id:r}=t;this.id=r||mt(),this.update(t,!0)}update(t,r=!1){for(const i of Ue.normalAttrs){const s=t[i];s&&(this[i]=s)}const{nodes:n=[]}=t;n.length&&(this.nodes=n.map(i=>new Fr(i))),r||M.emit(G,this)}toDsl(t){const{__VTJ_BLOCK__:r,id:n,nodes:i}=this;return xt(K({},Ue.normalAttrs.reduce((s,o)=>(s[o]=this[o],s),{})),{__VTJ_BLOCK__:r,__VERSION__:t||gc().toString(),id:n,nodes:i.map(s=>s.toDsl())})}dispose(){this.nodes.map(t=>t.dispose(!0)),this.nodes=[],this.disposed=!0}setFunction(t,r,n,i=!1){this[t][r]=n,i||M.emit(G,this)}removeFunction(t,r,n=!1){delete this[t][r],n||M.emit(G,this)}setState(t,r,n=!1){this.state[t]=r,n||M.emit(G,this)}removeState(t,r=!1){delete this.state[t],r||M.emit(G,this)}setCss(t,r=!1){this.css=t,r||M.emit(G,this)}setWatch(t,r=!1){t.id=t.id||mt();const n=this.watch.findIndex(i=>i.id&&i.id===t.id||i===t);n>-1?this.watch.splice(n,1,t):this.watch.push(t),r||M.emit(G,this)}removeWatch(t,r=!1){const n=this.watch.findIndex(i=>i.id&&i.id===t.id||i===t);n>-1&&(this.watch.splice(n,1),r||M.emit(G,this))}setProp(t,r=!1){const n=this.props.findIndex(i=>typeof i=="string"?i===t.name:i.name===t.name);n>-1?this.props.splice(n,1,t):this.props.push(t),r||M.emit(G,this)}removeProp(t,r=!1){const n=this.props.findIndex(i=>typeof i=="string"?i===t.name:i.name===t.name);n>-1&&(this.props.splice(n,1),r||M.emit(G,this))}setEmit(t,r=!1){const n=bt(t)?{name:t,params:[]}:t,i=this.emits.findIndex(s=>s===n.name||s===n);i>-1?this.emits.splice(i,1,n):this.emits.push(n),r||M.emit(G,this)}removeEmit(t,r=!1){const n=this.emits.findIndex(i=>bt(i)?i===t:i.name===t);n>-1&&(this.emits.splice(n,1),r||M.emit(G,this))}setSlot(t,r=!1){const n=bt(t)?{name:t,params:[]}:t,i=this.slots.findIndex(s=>s===n.name||s===n);i>-1?this.slots.splice(i,1,n):this.slots.push(n),r||M.emit(G,this)}removeSlot(t,r=!1){const n=this.slots.findIndex(i=>bt(i)?i===t:i.name===t);n>-1&&(this.slots.splice(n,1),r||M.emit(G,this))}setInject(t,r=!1){const n=this.inject.findIndex(i=>i.name===t.name);n>-1?this.inject.splice(n,1,t):this.inject.push(t),r||M.emit(G,this)}removeInject(t,r=!1){const n=this.inject.findIndex(i=>i.name===t.name);n>-1&&(this.inject.splice(n,1),r||M.emit(G,this))}setDataSource(t,r=!1){this.dataSources[t.name]=t,r||M.emit(G,this)}removeDataSource(t,r=!1){delete this.dataSources[t],r||M.emit(G,this)}insertAfter(t,r,n=!1){t.parent=null;const i=this.nodes.indexOf(r);this.nodes.splice(i+1,0,t),n||M.emit(G,this)}insertBefore(t,r,n=!1){t.parent=null;const i=this.nodes.indexOf(r);this.nodes.splice(i,0,t),n||M.emit(G,this)}appendNode(t,r=!1){t.parent=null,this.nodes.push(t),r||M.emit(G,this)}addNode(t,r,n="inner",i=!1){r?["left","top"].includes(n)?r.parent?r.insertAfter(t,i):this.insertBefore(t,r,i):["right","bottom"].includes(n)?r.parent?r.insertAfter(t,i):this.insertAfter(t,r,i):r.appendChild(t,i):this.appendNode(t,i)}__removeNode(t,r=!1){const n=this.nodes.findIndex(i=>i.id===t.id);n>-1&&(this.nodes.splice(n,1),r||M.emit(G,this))}removeNode(t,r=!1){t.parent?t.dispose(r):(t.dispose(!0),this.__removeNode(t,r))}move(t,r,n="inner",i=!1){t.parent?t.parent.removeChild(t,!0):this.__removeNode(t,!0),this.addNode(t,r,n,i)}movePrev(t,r=!1){if(t.parent)t.movePrev(r);else{const n=this.nodes,i=n.indexOf(t);i>0&&(n.splice(i,1),n.splice(i-1,0,t),r||M.emit(G,this))}}moveNext(t,r=!1){if(t.parent)t.moveNext(r);else{const n=this.nodes,i=n.indexOf(t);i>-1&&i<n.length-1&&(n.splice(i,1),n.splice(i+1,0,t),r||M.emit(G,this))}}cloneNode(t,r=!1){const n=Fi(t.toDsl()),i=new Fr(n);return this.addNode(i,t,"bottom",r),i}lock(t=!1){this.locked=!0;for(const r of this.nodes)r.lock(!0);t||M.emit(G,this)}unlock(t=!1){this.locked=!1;for(const r of this.nodes)r.unlock(!0);t||M.emit(G,this)}isChild(t){let r=!1;for(const n of this.nodes)if(t===n||t.id===n.id){r=!0;break}else if(r=n.isChild(t),r)break;return r}};j(Ue,"normalAttrs",["name","locked","inject","state","lifeCycles","methods","computed","watch","css","props","emits","slots","dataSources","__TEMPLATE_ID__"]);let qt=Ue;const it="EVENT_PROJECT_CHANGE",Zn="EVENT_PROJECT_ACTIVED",Qn="EVENT_PROJECT_DEPS_CHANGE",Ie="EVENT_PROJECT_PAGES_CHANGE",Me="EVENT_PROJECT_BLOCKS_CHANGE",Xn="EVENT_PROJECT_APIS_CHANGE",ti="EVENT_PROJECT_META_CHANGE",Dc="EVENT_PROJECT_PUBLISH",Pc="EVENT_PROJECT_FILE_PUBLISH";var Kt;let We=(Kt=class{constructor(t){j(this,"id","");j(this,"name","");j(this,"description","");j(this,"homepage","");j(this,"dependencies",[]);j(this,"pages",[]);j(this,"blocks",[]);j(this,"apis",[]);j(this,"meta",[]);j(this,"currentFile",null);j(this,"config",{});j(this,"__BASE_PATH__","/");const{id:r}=t;this.id=r||mt(),this.update(t,!0)}update(t,r=!1){for(const n of Kt.attrs){const i=t[n];i&&(this[n]=i)}r||M.emit(it,{model:this,type:"update",data:t})}isPageFile(t){return t.type==="page"}cleanPagesDsl(t){for(const r of t)delete r.dsl,r.children&&r.children.length&&this.cleanPagesDsl(r.children)}toDsl(t){const{id:r}=this,n=Kt.attrs.reduce((i,s)=>(i[s]=this[s],i),{});return n.pages&&(n.pages=n.pages.map(i=>(delete i.dsl,i)),this.cleanPagesDsl(n.pages)),n.blocks&&(n.blocks=n.blocks.map(i=>(delete i.dsl,i))),K({__VTJ_PROJECT__:!0,id:r},n)}active(t,r=!1){this.currentFile=t,r||M.emit(Zn,{model:this,type:"update",data:t})}deactivate(t=!1){this.currentFile=null,t||M.emit(Zn,{model:this,type:"update",data:null})}setDeps(t,r=!1){const n=this.dependencies,i=n.findIndex(o=>o.package===t.package);let s;if(i>-1?(s="update",n.splice(i,1,K(K({},n[i]),t))):(s="create",n.push(t)),!r){const o={model:this,type:s,data:t};M.emit(Qn,o),M.emit(it,o)}}removeDeps(t,r=!1){const n=this.dependencies,i=n.findIndex(s=>s.package===t.package);if(i>-1&&n.splice(i,1),!r){const s={model:this,type:"delete",data:t};M.emit(Qn,s),M.emit(it,s)}}getPage(t){const r=(n,i=[])=>{for(const s of i){if(s.id===n)return s;if(s.children&&s.children.length){const o=r(n,s.children);if(o)return o}}};return r(t,this.pages)}getPages(){const t=(r=[])=>{let n=[];for(const i of r)i.dir?i.children&&i.children.length&&(n=n.concat(t(i.children))):n.push(i);return n};return t(this.pages)}createPage(t,r,n=!1){return H(this,null,function*(){if(t.id=t.raw?t.name:t.id||mt(),t.type="page",t.dir?t.children=[]:t.dsl=t.dsl||new qt({id:t.id,name:zn(t.name)}).toDsl(),r){const i=this.getPage(r);i?i.children?i.children.push(t):i.children=[t]:console.warn(`not found PageFile for id: ${r} `)}else this.pages.push(t);if(!n){const i={model:this,type:"create",data:t};M.emit(Ie,i),M.emit(it,i)}!this.currentFile&&!t.dir&&(yield Je(1e3),this.active(t,n))})}updatePage(t,r=!1){const n=this.getPage(t.id);if(n?Object.assign(n,t):console.warn(`not found PageFile for id: ${t.id} `),!r){const i={model:this,type:"update",data:t};M.emit(Ie,i),M.emit(it,i)}}clonePage(t,r,n=!1){var h;const i=mt(),s=`${t.name}Copy`,o=`${t.title}_副本`,a=new qt({id:i,name:s}).toDsl(),u=kt({},t,{id:i,name:s,title:o,dsl:a}),c=r?((h=this.getPage(r))==null?void 0:h.children)||[]:this.pages,l=c.findIndex(f=>f.id===t.id);if(c.splice(l+1,0,u),!n){const f={model:this,type:"clone",data:{source:t,target:u}};M.emit(Ie,f),M.emit(it,f)}}removePage(t,r=!1){var s;const n=this.getPage(t),i=(o,a)=>{const u=a.findIndex(c=>c.id===o);if(u>=0){a.splice(u,1);return}for(const c of a)c.children&&c.children.length&&i(o,c.children)};if(i(t,this.pages),t===this.homepage&&(this.homepage=""),((s=this.currentFile)==null?void 0:s.id)===t&&this.deactivate(r),!r){const o={model:this,type:"delete",data:n};M.emit(Ie,o),M.emit(it,o)}}getBlock(t){return this.blocks.find(r=>r.id===t)}createBlock(t,r=!1){return H(this,null,function*(){const n=t.id||mt(),i=zn(t.name);t.id=n,t.type="block",t.dsl=new qt({id:n,name:i}).toDsl(),this.blocks.push(t);const s=t.fromType||"Schema";if(!r){const o={model:this,type:"create",data:t};M.emit(Me,o),M.emit(it,o)}!this.currentFile&&s==="Schema"&&(yield Je(1e3),this.active(t,r))})}updateBlock(t,r=!1){const n=this.getBlock(t.id);if(n?(Object.assign(n,t),n.dsl&&(n.dsl.name=t.name)):console.warn(`not found PageFile for id: ${t.id} `),!r){const i={model:this,type:"update",data:t};M.emit(Me,i),M.emit(it,i)}}cloneBlock(t,r=!1){const n=mt(),i=`${t.name}Copy`,s=`${t.title}_副本`,o=new qt({id:n,name:i}).toDsl(),a=kt({},t,{id:n,name:i,title:s,dsl:o}),u=this.blocks.findIndex(c=>c.id===t.id);if(this.blocks.splice(u+1,0,a),!r){const c={model:this,type:"clone",data:{source:t,target:a}};M.emit(Me,c),M.emit(it,c)}}removeBlock(t,r=!1){var o;const n=this.getBlock(t),i=this.blocks,s=i.findIndex(a=>a.id===t);if(s>-1?(i.splice(s,1),((o=this.currentFile)==null?void 0:o.id)===t&&this.deactivate(r)):console.warn(`not found PageFile for id: ${t} `),!r){const a={model:this,type:"delete",data:n};M.emit(Me,a),M.emit(it,a)}}existBlockName(t,r=[]){return this.blocks.some(n=>n.name===t&&!r.includes(n.id))}existPageName(t,r=[]){return this.getPages().some(n=>n.name===t&&!r.includes(n.id))}setApi(t,r=!1){const n=this.apis.find(s=>s.name===t.name||s.id===t.id);let i;if(n?(i="update",Object.assign(n,t)):(i="create",t.id=mt(),this.apis.push(t)),!r){const s={model:this,type:i,data:t};M.emit(Xn,s),M.emit(it,s)}}removeApi(t,r=!1){const n=this.apis.findIndex(i=>i.name===t||i.id===t);if(n>-1?this.apis.splice(n,1):console.warn(`not found Api for name: ${t} `),!r){const i={model:this,type:"delete",data:t};M.emit(Xn,i),M.emit(it,i)}}existApiName(t,r=[]){return this.apis.some(n=>n.name===t&&!r.includes(n.id))}setMeta(t,r=!1){const n=this.meta.find(s=>s.code===t.code||s.id===t.id);let i;if(n?(i="update",Object.assign(n,t)):(i="create",t.id=mt(),this.meta.push(t)),!r){const s={model:this,type:i,data:t};M.emit(ti,s),M.emit(it,s)}}removeMeta(t,r=!1){const n=this.meta.findIndex(i=>i.code===t||i.id===t);if(n>-1?this.meta.splice(n,1):console.warn(`not found meta for name: ${name} `),!r){const i={model:this,type:"delete",data:t};M.emit(ti,i),M.emit(it,i)}}existMetaCode(t,r=[]){return this.meta.some(n=>n.code===t&&!r.includes(n.id))}setHomepage(t,r=!1){if(this.homepage=t,!r){const n={model:this,type:"update",data:t};M.emit(it,n)}}setConfig(t,r=!1){if(this.config=Object.assign(this.config,t),!r){const n={model:this,type:"update",data:t};M.emit(it,n)}}publish(t){const r={model:this,type:"publish",data:t||this};t?M.emit(Pc,r):M.emit(Dc,r)}},j(Kt,"attrs",["name","homepage","description","dependencies","pages","blocks","apis","meta","config","__BASE_PATH__"]),Kt);const Fe="EVENT_HISTORY_CHANGE",Ar="EVENT_HISTORY_LOAD";let Mi=class{constructor(t,r={}){j(this,"options",{max:50});j(this,"index",-1);j(this,"id");j(this,"items");Object.assign(this.options,r);const{id:n,items:i=[]}=t;this.id=n,this.items=i}toDsl(){const{id:t,items:r}=this;return{id:t,items:r.map(n=>({id:n.id,label:n.label}))}}get(t){return this.items.find(r=>r.id===t)}add(t,r=!1){const{max:n}=this.options,i={id:mt(),label:new Date().toLocaleString(),dsl:ji(t)};if(this.items.unshift(i),this.items.length>n){const s=this.items.splice(n);r||M.emit(Fe,{model:this,type:"delete",data:s.map(o=>o.id)})}this.index=-1,r||M.emit(Fe,{model:this,type:"create",data:i})}remove(t,r=!1){const n=this.items.findIndex(i=>i.id===t);n>-1?(this.items.splice(n,1),n===this.index?this.index=-1:this.index>=this.items.length&&(this.index=this.items.length-1)):console.warn(`not found HistoryItem for id: ${t} `),r||M.emit(Fe,{model:this,type:"delete",data:[t]})}forward(t=!1){const{index:r,items:n}=this;if(r<0)return;--this.index;const i=n[this.index];i&&!t&&M.emit(Ar,{model:this,type:"load",data:i})}backward(t=!1){const{index:r,items:n}=this;if(r>=n.length-1)return;r<0&&(this.index=0),++this.index;const i=n[this.index];i&&!t&&M.emit(Ar,{model:this,type:"load",data:i})}load(t,r=!1){const n=this.items.findIndex(i=>i.id===t);n>=0&&(this.index=n,r||M.emit(Ar,{model:this,type:"load",data:this.items[n]}))}clear(t=!1){this.index=-1;const r=this.items.map(n=>n.id);this.items=[],t||M.emit(Fe,{model:this,type:"clear",data:r})}};const M=Sc();function Cv(e){return e instanceof qt}function Nv(e){return e instanceof Fr}function Bv(e){return!!e.__VTJ_BLOCK__}function Fi(e){const t=ji(e);return delete t.id,Array.isArray(t.children)&&(t.children=t.children.map(r=>Fi(r))),t}function kv(e){const t=e.fromType||"Schema";return t==="Schema"?{type:"Schema",id:e.id}:t==="UrlSchema"?{type:"UrlSchema",url:(e.urls||"").split(",")[0]||""}:t==="Plugin"?{type:"Plugin",urls:(e.urls||"").split(","),library:e.library}:""}const xw=Object.freeze(Object.defineProperty({__proto__:null,BUILT_IN_COMPONENTS:Oc,BUILT_IN_LIBRARAY_MAP:Rv,BUILT_IN_MATERIALS:jv,BUILT_IN_NAME:Av,BUILT_IN_TAGS:Dv,BUILT_IN_VUE:ki,BUILT_IN_VUE_ROUTER:Ii,Base:$c,BlockModel:qt,DirectiveModel:ke,EVENT_BLOCK_CHANGE:G,EVENT_HISTORY_CHANGE:Fe,EVENT_HISTORY_LOAD:Ar,EVENT_NODE_CHANGE:nt,EVENT_PROJECT_ACTIVED:Zn,EVENT_PROJECT_APIS_CHANGE:Xn,EVENT_PROJECT_BLOCKS_CHANGE:Me,EVENT_PROJECT_CHANGE:it,EVENT_PROJECT_DEPS_CHANGE:Qn,EVENT_PROJECT_FILE_PUBLISH:Pc,EVENT_PROJECT_META_CHANGE:ti,EVENT_PROJECT_PAGES_CHANGE:Ie,EVENT_PROJECT_PUBLISH:Dc,EventModel:$r,HistoryModel:Mi,NodeModel:Fr,ProjectModel:We,PropModel:Or,Service:Pv,VTJ_CORE_VERSION:$v,cloneDsl:Fi,createNodeFrom:kv,emitter:M,isBlock:Cv,isBlockSchema:Bv,isNode:Nv},Symbol.toStringTag,{value:"Module"}));var Iv=Object.defineProperty,Mv=(e,t,r)=>t in e?Iv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yt=(e,t,r)=>Mv(e,typeof t!="symbol"?t+"":t,r);(function(){if(typeof window>"u"||typeof EventTarget>"u")return;const e=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(t,r,n){typeof n!="boolean"&&(n=n||{},n.passive=!1),e.call(this,t,r,n)}})();/**!
|
|
57
57
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
58
58
|
* @name @vtj/utils
|
|
59
59
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
60
|
-
* @version 0.9.0-alpha.
|
|
60
|
+
* @version 0.9.0-alpha.2
|
|
61
61
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
62
|
-
*/const Fv="0.9.0-alpha.
|
|
62
|
+
*/const Fv="0.9.0-alpha.2";/**
|
|
63
63
|
* @vue/shared v3.5.13
|
|
64
64
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
65
65
|
* @license MIT
|
|
@@ -72,9 +72,9 @@ version: 2.9.0
|
|
|
72
72
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
73
73
|
* @name @vtj/renderer
|
|
74
74
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
75
|
-
* @version 0.9.0-alpha.
|
|
75
|
+
* @version 0.9.0-alpha.2
|
|
76
76
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
77
|
-
*/const be="0.9.0-alpha.
|
|
77
|
+
*/const be="0.9.0-alpha.2";var lt=(e=>(e.Runtime="Runtime",e.Design="Design",e.Raw="Raw",e.VNode="VNode",e))(lt||{});const mi=["$el","$emit","$nextTick","$parent","$root","$attrs","$slots","$watch","$props","$options","$forceUpdate"],a_=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeUnmount","unmounted","errorCaptured","renderTracked","renderTriggered","activated","deactivated"],Eu=["vIf","vShow","vModel","vFor","vBind"],Su={String,Number,Boolean,Array,Object,Function,Date},cn="VtjPage",Qi="VtjHomepage";function Le(e,t){return e.map(r=>lc(r)||r.startsWith("/")?r:`${t}${r}`)}function un(e){return/\.css$/.test(e)}function ln(e){return/\.js$/.test(e)}function xu(e){return/\.json$/.test(e)}function c_(e){return e.map(t=>`<script src="${re.append(t,{v:be})}"><\/script>`).join("")}function u_(e=[]){return e.map(t=>`<link rel="stylesheet" href="${re.append(t,{v:be})}" />`).join("")}function Tu(e,t=!1){return t&&e.endsWith(".prod.js")?e.replace(".prod.js",".js"):e}function Ou(e,t,r=!1){const n=e.filter(f=>!!f.enabled),i=[],s=[],o=[],a=[],u={},c={},l=[],h={};return n.forEach(({urls:f,assetsUrl:p,library:d,assetsLibrary:m,localeLibrary:b})=>{f==null||f.forEach(S=>{ln(S)&&i.push(Tu(S,r)),un(S)&&s.push(S)}),d&&(a.push(d),u[d]=Le(f||[],t),b&&(c[d]=b)),p&&o.push(p),m&&l.push(m),d&&m&&(h[m]=d)}),{scripts:Le(i,t),css:Le(s,t),materials:Le(o,t),libraryExports:a,materialExports:bc(l),materialMapLibrary:h,libraryMap:u,libraryLocaleMap:c}}function $u(e,t){var s;const{name:r,parent:n,alias:i}=e;return n?(s=t[n])==null?void 0:s[i||r]:t[i||r]}function Xi(e){return bt(e)?e:JSON.stringify(e)}function ts(e,t,r){const n=e.CSSStyleSheet;if(n.prototype.replaceSync){const i=new n;i.id=t,i.replaceSync(r);const s=e.document,o=s.adoptedStyleSheets,a=Array.from(o).filter(u=>u.id!==t);s.adoptedStyleSheets=[...a,i]}else{const i=e.document;let s=i.getElementById(t);s?s.innerHTML=r:(s=i.createElement("style"),s.id=t,s.innerHTML=r,i.head.appendChild(s))}}function Au(e,t){return H(this,null,function*(){const r=yield window.fetch(t).then(n=>n.text()).catch(()=>"");r&&ts(window,e,r)})}function ju(e,t=window){const r=t.document,n=t.document.head;for(const i of e)if(!r.getElementById(i)){const s=r.createElement("link");s.rel="stylesheet",s.id=i,s.href=i,n.appendChild(s)}}function Ru(n,i){return H(this,arguments,function*(e,t,r=window){const s=r.document,o=r.document.head;let a=r[t];return a?a.default||a:new Promise((u,c)=>{for(const l of e){const h=s.createElement("script");h.src=l,h.onload=()=>{a=r[t],a?u(a.default||a):c(null)},h.onerror=f=>{c(f)},o.appendChild(h)}})})}function Du(e){return _e(e)||_e(e==null?void 0:e.install)}function Oe(e,t,r=!1,n=!1){var i;try{const s=['"use strict";',"var __self = arguments[0];"];s.push("return ");let o=(e.value||"").trim();o=o.replace(/this(\W|$)/g,(u,c)=>`__self${c}`),o=s.join(`
|
|
78
78
|
`)+o;const a=`with(${r?"{}":"$scope || {}"}) { ${o} }`;return new Function("$scope",a)(t)}catch(s){if(Ze.error("parseExpression.error",s,e,(i=t==null?void 0:t.__self)!=null?i:t),n)throw s}}function gi(e,t,r=!1,n=!1){var s;const i=Oe(e,t,r,n);if(typeof i!="function"&&(Ze.error("parseFunction.error","not a function",e,(s=t==null?void 0:t.__self)!=null?s:t),n))throw new Error(`"${e.value}" not a function`);return i}function St(e){return e&&e.type==="JSExpression"}function ar(e){return typeof e=="object"&&e&&e.type==="JSFunction"}function Pu(e){return St(e)||ar(e)}function l_(e){return Pu(e)?e.value:JSON.stringify(e)}let he=null;const h_=Wi({settings:{type:"form",validSuccess:!0,originResponse:!1,loading:!0,validate:e=>{var t,r;return((t=e.data)==null?void 0:t.code)===0||!!((r=e.data)!=null&&r.success)},failMessage:!0,showError:e=>{qr.error({message:e||"未知错误"})},showLoading:()=>{he&&he.close(),he=dl.service({lock:!0,text:"Loading",background:"rgba(0, 0, 0, 0.05)"})},hideLoading:()=>{he&&(he.close(),he=null)}}});let me;function Cu(e,t){const{jsonp:r,request:n}=t;if(e.method==="jsonp")return(i={})=>r(e.url,xt(K({},e.jsonpOptions),{query:i}));{const i=e.headers?Oe(e.headers,{},!0):void 0,s={url:e.url,method:e.method,settings:xt(K({},e.settings),{headers:i})};return(o,a)=>(delete s.data,n.send(kt(s,a||{},{data:o})))}}function Nu(e,t){const{metaQuery:r}=t;if(!r)return;const{code:n,queryCode:i}=e;return(s,o)=>{if(!r){console.warn("adapter.metaQuery is not defined!");return}return r(n,i,s,o)}}function Bu(e=[],t=[],r){const n={};for(const i of e)n[i.id]=Cu(i,r);for(const i of t)n[i.id]=Nu(i,r);return n}function ku(){return H(this,arguments,function*(e=[]){me=yield wr(()=>import("./mockjs-BKNhwXuJ.js").then(t=>t.m),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default||t),me&&(me.setup({timeout:"50-500"}),es(),e.forEach(t=>Iu(me,t)))})}function Iu(e,t){if(!t.mock)return;const{url:r,mockTemplate:n}=t;if(r&&n){const i=en(`${r}(.*)`),s=Tc(r,{decode:decodeURIComponent}),o=Oe(n,{},!0);e.mock(i,a=>{var h;const u=re.parse(a.url)||{},c=a.body instanceof FormData?mu(a.body):a.body,l=(h=s(a.url))==null?void 0:h.params;return Object.assign(a,{data:c,params:u,query:l}),e.mock(o(a))})}}function es(){me&&(me._mocked={})}const f_={session:!1,authKey:"Authorization",storageKey:"ACCESS_STORAGE",storagePrefix:"__VTJ_",unauthorized:"/unauthorized",auth:"/#/login",redirectParam:"r",unauthorizedCode:401,unauthorizedMessage:"登录已经失效,请重新登录!",noPermissionMessage:"无权限访问该页面"},rs=Symbol("access");class Mu{constructor(t){j(this,"options");j(this,"data",null);j(this,"mode",lt.Raw);this.options=Object.assign({},f_,t),this.loadData()}connect(t){const{mode:r,router:n,request:i}=t;this.mode=r,n&&r===lt.Raw&&this.setGuard(n),i&&this.setRequest(i)}login(t){const{storageKey:r,storagePrefix:n,session:i,authKey:s}=this.options;this.setData(t),this.data&&(Pr.save(r,t,{type:"local",prefix:n}),i&&Cr.set(s,this.data.token))}clear(){const{storageKey:t,storagePrefix:r,session:n,authKey:i}=this.options;this.data=null,Pr.remove(t,{type:"local",prefix:r}),n&&Cr.remove(i)}logout(){this.clear(),this.toLogin()}getData(){return this.data}getToken(){var t;return(t=this.data)==null?void 0:t.token}can(t){const{permissions:r={}}=this.data||{};return typeof t=="function"?t(r):Wn(t).every(n=>r[n])}some(t){const{permissions:r={}}=this.data||{};return Wn(t).some(n=>r[n])}install(t){t.config.globalProperties.$access||(t.config.globalProperties.$access=this),t.provide(rs,this)}isAuthPath(t){const{auth:r,isAuth:n}=this.options;if(n)return n(t);if(t.path&&typeof r=="string"){const i=r.split("#")[1]||r;return t.path===i}return!1}toLogin(){const{auth:t,redirectParam:r}=this.options;if(!t||this.mode!==lt.Raw)return;const n=r?`?${r}=${encodeURIComponent(location.href)}`:"";typeof t=="function"?t(n):location.href=r?`${t}${n}`:t}setData(t){const{privateKey:r}=this.options;if(Array.isArray(t)&&r){const n=t.map(i=>Jn(i,r));this.data=JSON.parse(n.join(""));return}if(typeof t=="string")try{const n=r?Jn(t,r):t;n?this.data=JSON.parse(n):console.warn("RSA解密失败或登录信息缺失")}catch(n){console.warn(n)}else this.data=t}loadData(){const{storageKey:t,storagePrefix:r}=this.options,n=Pr.get(t,{type:"local",prefix:r});this.setData(n)}isLogined(){const{session:t,authKey:r}=this.options;return t&&r?!!Cr.get(r):!!this.data}hasRoutePermission(t){if(t.name===cn){const r=t.params.id;return r&&this.can(r)}return!0}setGuard(t){t.beforeEach((r,n,i)=>this.guard(r,i))}guard(t,r){if(this.isWhiteList(t)||this.isAuthPath(t))return r();if(this.isLogined()){if(this.hasRoutePermission(t))return r();{const n=this.options.noPermissionMessage||"无权限访问";return this.showTip(n),r(!1)}}r(!1),this.toLogin()}isWhiteList(t){const{whiteList:r}=this.options;return r?Array.isArray(r)?r.some(n=>t.fullPath.startsWith(n)):r(t):!1}isUnauthorized(t){const{unauthorizedCode:r=401}=this.options;return t.status===r||t.data.code===r}showUnauthorizedAlert(t){return H(this,null,function*(){const{unauthorizedMessage:r="登录已失效"}=this.options;this.isUnauthorized(t)&&(yield this.showTip(r),this.toLogin())})}showTip(t){return H(this,null,function*(){const{alert:r}=this.options;r&&(yield Je(150),yield r(t,{title:"提示",type:"warning"}).catch(n=>n))})}setRequest(t){t.useRequest(r=>{var n,i;return(n=this.data)!=null&&n.token&&(r.headers[this.options.authKey]=(i=this.data)==null?void 0:i.token),r}),t.useResponse(r=>H(this,null,function*(){return yield this.showUnauthorizedAlert(r),r}),r=>H(this,null,function*(){const n=r.response||r||{};return yield this.showUnauthorizedAlert(n),Promise.reject(r)}))}}function Fu(){return Io(rs,null)}class Lu{constructor(t){j(this,"__id",null);j(this,"__mode");j(this,"__instance",null);j(this,"__contextRefs",{});j(this,"__refs",{});j(this,"context",{});j(this,"state",{});j(this,"props",{});j(this,"$props",{});j(this,"$refs",{});j(this,"$el",null);j(this,"$emit",null);j(this,"$nextTick",null);j(this,"$parent",null);j(this,"$root",null);j(this,"$attrs",null);j(this,"$slots",null);j(this,"$watch",null);j(this,"$options",null);j(this,"$forceUpdate",null);j(this,"$components",{});j(this,"$libs",{});j(this,"$apis",{});j(this,"__transform",{});const{mode:r,dsl:n,attrs:i}=t;this.__mode=r,n&&(this.__id=n.id||null,this.__transform=n.transform||{}),i&&Object.assign(this,i)}setup(t,r=Ur){const n=r.getCurrentInstance();if(!n)return;this.__refs={},this.$refs={},this.context={},this.__contextRefs={},this.__instance=n.proxy;const i=n.appContext.config.globalProperties;Object.assign(this,i),Object.assign(this,t||{}),this.__proxy(),r.onMounted(()=>{this.__proxy()}),r.onUnmounted(()=>{this.__cleanup()}),r.onBeforeUpdate(()=>{this.__refs={},this.$refs={},this.__contextRefs={},this.context={}})}__proxy(){this.__instance&&mi.forEach(t=>{var r;this[t]=(r=this.__instance)==null?void 0:r[t]})}__cleanup(){mi.forEach(t=>{this[t]=null})}__parseFunction(t){var r;if(t)if(this.__mode===lt.Runtime){const{id:n,type:i}=t,s=n&&(r=this.__transform[n])!=null?r:t.value;return gi({type:i,value:s},this)}else return gi(t,this)}__parseExpression(t){var r;if(t)if(this.__mode===lt.Runtime){const{id:n,type:i}=t,s=n&&(r=this.__transform[n])!=null?r:t.value;return Oe({type:i,value:s},this)}else return Oe(t,this)}__ref(t=null,r){if(this.__mode!==lt.VNode)return t&&t!==this.__id&&(this.__contextRefs[t]=this),n=>H(this,null,function*(){var s,o;yield Je(0);let i=(n==null?void 0:n.$vtjEl)||(n==null?void 0:n.$el)||((o=(s=n==null?void 0:n._)==null?void 0:s.vnode)==null?void 0:o.el)||n;if(!i){typeof r=="string"&&(delete this.$refs[r],t&&delete this.__refs[t]);return}if(i.nodeType===3&&i.nextSibling&&(i=i.nextSibling),i.__vtj__=t,lt.Design===this.__mode&&(i.__context__=this,i.draggable=!0),t&&(this.__refs[t]=n),typeof r=="function")r(n);else if(r){const a=this.$refs[r];if(a&&n!==a){const u=new Set([].concat(a,n));this.$refs[r]=Array.from(u)}else this.$refs[r]=n}return n})}__clone(t={}){const r=K(K({},this.context),t),n=xt(K({},r),{context:r});return n.context.__proto__=this.context,n.__proto__=this,n}}function Vr(e){var h,f;const{Vue:t=Ur,mode:r=lt.Runtime,components:n={},libs:i={},apis:s={},loader:o}=e,a=t.computed(()=>e.dsl),u={$components:n,$libs:i,$apis:s},c=new Lu({mode:r,dsl:a.value,attrs:u}),l=t.defineComponent(K({name:a.value.name,props:K({},d_((h=a.value.props)!=null?h:[],c)),setup(p){var y,_,E,g;c.$props=p,c.props=p,a.value.id&&ts(e.window||window,a.value.id,a.value.css||""),c.state=m_(t,(y=a.value.state)!=null?y:{},c);const d=g_(t,(_=a.value.computed)!=null?_:{},c),m=v_((E=a.value.methods)!=null?E:{},c),b=y_(t,a.value.inject,c),S=Vu(a.value.dataSources||{},c),v=K(K(K(K({},b),d),m),S);return c.setup(v,t),b_(t,(g=a.value.watch)!=null?g:[],c),{vtj:c}},emits:p_(a.value.emits),expose:["vtj"],render(){if(!a.value.nodes)return null;const p=a.value.nodes||[];return p.length===1?Qe(p[0],c,t,o):p.map(d=>Qe(d,c,t,o))}},__((f=a.value.lifeCycles)!=null?f:{},c)));return{renderer:t.markRaw(l),context:c}}function p_(e=[]){return e.map(t=>bt(t)?t:t.name)}function d_(e=[],t){const r=n=>n?(Array.isArray(n)?n:[n]).map(i=>Su[i]):void 0;return e.map(n=>bt(n)?{name:n}:{name:n.name,type:n.type,required:n.required,default:St(n.default)?t.__parseExpression(n.default):n.default}).reduce((n,i)=>(n[i.name]={type:r(i.type),required:i.required,default:i.default},n),{})}function m_(e,t,r){return e.reactive(Object.keys(t||{}).reduce((n,i)=>{let s=t[i];return St(s)?s=r.__parseExpression(s):ar(s)&&(s=r.__parseFunction(s)),n[i]=s,n},{}))}function g_(e,t,r){return Object.entries(t!=null?t:{}).reduce((n,[i,s])=>(n[i]=e.computed(r.__parseFunction(s)),n),{})}function v_(e,t){return Object.entries(e!=null?e:{}).reduce((r,[n,i])=>(r[n]=t.__parseFunction(i),r),{})}function y_(e,t=[],r){return t.reduce((n,i)=>{var c;const{name:s,from:o}=i||{};i.default;const a=St(o)?r.__parseExpression(o)||s:o!=null?o:s,u=St(i.default)?r.__parseExpression(i.default):(c=i.default)!=null?c:null;return n[s]=e.inject(a,u),n},{})}function Vu(e,t){return Object.keys(e).reduce((r,n)=>{const i=e[n],s=t.$apis[i.ref],o=ar(i.transform)?i.transform.value?t.__parseFunction(i.transform):void 0:i.transform;return r[n]=(...a)=>H(this,null,function*(){const u=yield s.apply(t,a);return o?o(u):u}),r},{})}function b_(e,t=[],r){t.forEach(n=>{e.watch(r.__parseExpression(n.source),r.__parseFunction(n.handler),{deep:n.deep,immediate:n.immediate})})}function __(e,t){return Object.entries(e!=null?e:{}).reduce((r,[n,i])=>(r[n]=t.__parseFunction(i),r),{})}let Rn=[];const Hu=e=>e;function ns(r){return H(this,arguments,function*(e,t=window){const{urls:n=[],library:i}=e,s=n.filter(a=>ln(a));if(s.length===0||!i)return null;const o=n.filter(a=>un(a));return o.length&&ju(o,t),yield Ru(s,i,t).catch(a=>(console.warn("loadScriptUrl error",s,i,a),null))})}function Hr(e){const{getDsl:t,getDslByUrl:r,options:n}=e;return n.window&&(Rn.forEach(i=>{delete n.window[i]}),Rn=[]),(i,s,o=Ur)=>!s||typeof s=="string"?i:s.type==="Schema"&&s.id?o.defineAsyncComponent(()=>H(this,null,function*(){const a=yield t(s.id);return a&&(a.name=i),a?Vr(xt(K({},n),{Vue:o,dsl:a,mode:lt.Runtime,loader:Hr(e)})).renderer:null})):s.type==="UrlSchema"&&s.url?o.defineAsyncComponent(()=>H(this,null,function*(){const a=yield r(s.url);return a&&(a.name=i),a?Vr(xt(K({},n),{Vue:o,dsl:a,mode:lt.Runtime,loader:Hr(e)})).renderer:null})):s.type==="Plugin"?(s.library&&Rn.push(s.library),o.defineAsyncComponent(()=>H(this,null,function*(){return(yield ns(s,n.window))||(console.warn("getPlugin result is null",s),null)}))):i}function Qe(e,t,r=Ur,n=Hu){if(!e||!e.name||e.invisible)return null;const{id:i=null,directives:s=[]}=e,{vIf:o,vFor:a,vShow:u,vModels:c,vBind:l}=w_(s);if(o&&!E_(o,t))return null;const h=f=>{var v,y,_,E;const p=f.$components,d=(()=>{var x,O;if(e.name==="component")return S_(f,(x=e.props)==null?void 0:x.is);if(e.name==="slot")return e.name;const g=n(e.name,e.from,r);return bt(g)&&(O=p[g])!=null?O:g})(),m=x_(i,(v=e.props)!=null?v:{},f),b=T_(r,(y=e.events)!=null?y:{},f);if(e.name==="slot")return O_(r,e,m,f,n);l&&Object.assign(m,f.__parseExpression(l.value)),u&&(m.style=Object.assign((_=m.style)!=null?_:{},A_(u,f))),c.forEach(g=>{Object.assign(m,j_(r,g,f))});const S=R_(r,(E=e.children)!=null?E:[],f,n,e);return r.createVNode(d,K(K({},m),b),S)};return a?C_(a,h,t):h(t)}function w_(e=[]){const t=e.find(a=>Lt(a.name)==="vIf"),r=e.find(a=>Lt(a.name)==="vFor"),n=e.find(a=>Lt(a.name)==="vShow"),i=e.find(a=>Lt(a.name)==="vBind"),s=e.filter(a=>Lt(a.name)==="vModel"),o=e.filter(a=>!Eu.includes(Lt(a.name)));return{vIf:t,vFor:r,vShow:n,vModels:s,vBind:i,others:o}}function E_(e,t){return!!t.__parseExpression(e.value)}function S_(e,t){return t?St(t)?e.__parseExpression(t):t:"div"}function x_(e,t,r){const n=Object.keys(t||{}).reduce((i,s)=>{let o=t[s];return St(o)?o=r.__parseExpression(o):ar(o)&&(o=r.__parseFunction(o)),i[s]=o,i},{});return n.ref=r.__ref(e,n.ref),n}function T_(e,t,r){const n=["passive","capture","once"],i={capture:"Capture",once:"Once",passive:"OnceCapture"};return Object.keys(t||{}).reduce((s,o)=>{const a=t[o],u=is(a.modifiers),c=u.find(f=>n.includes(f)),l="on"+Zr(o)+(c&&i[c]||""),h=r.__parseFunction(a.handler);return h&&(s[l]=e.withModifiers(h,u)),s},{})}function is(e={},t=!1){const r=Object.keys(e);return t?r.map(n=>"."+n):r}function O_(e,t,r,n,i){var u;const{children:s}=t,o=$_(t,n),a=(u=n.$slots)==null?void 0:u[o.name];return a?a(r):s?bt(s)?e.createTextVNode(s):St(s)?e.createTextVNode(Xi(n.__parseExpression(s))):Array.isArray(s)?s.map(c=>Qe(c,n,e,i)):null:null}function $_(e,t){const{props:r}=e,n=(r==null?void 0:r.name)||"default";return{name:St(n)?t.__parseExpression(n):n,params:[]}}function A_(e,t){return t.__parseExpression(e.value)?{}:{display:"none"}}function j_(e,t,r){var a;const n={type:"JSFunction",value:(a=t.value)!=null&&a.value?`(v) => {
|
|
79
79
|
${t.value.value} = v;
|
|
80
80
|
}`:"(v) => {}"},i=r.__parseFunction(n),s=is(t.modifiers),o=St(t.arg)?r.__parseExpression(t.arg):t.arg||"modelValue";return{[o]:r.__parseExpression(t.value),[`onUpdate:${o}`]:s.length&&i?e.withModifiers(i,s):i}}function R_(e,t,r,n,i){if(!t)return null;if(bt(t))return{default:()=>t};if(St(t))return{default:()=>Xi(r.__parseExpression(t))};if(Array.isArray(t)&&t.length>0){const s=D_(t),o=a=>!a||!i?{}:i!=null&&i.id&&Object.keys(a).length?{[`scope_${i.id}`]:a}:{};return Object.entries(s).reduce((a,[u,{nodes:c,params:l}])=>(a[u]=h=>{const f=l.length?_c(h!=null?h:{},l):o(h);return c.map(p=>Qe(p,r.__clone(f),e,n))},a),{})}return null}function D_(e){const t={default:{params:[],nodes:[]}};for(const r of e){const n=P_(r.slot),i=n.name;t[i]?(t[i].nodes.push(r),t[i].params=t[i].params.concat(n.params)):t[i]={nodes:[r],params:n.params}}return t}function P_(e="default"){return bt(e)?{name:e,params:[]}:K({params:[]},e)}function C_(e,t,r){const{value:n,iterator:i}=e,{item:s="item",index:o="index"}=i||{};let a=r.__parseExpression(n)||[];return Number.isInteger(a)&&(a=new Array(a).fill(!0).map((u,c)=>c+1)),Array.isArray(a)?a.map((u,c)=>t(r.__clone({[s]:u,[o]:c}))):(console.warn("[vForRender]:",`${n==null?void 0:n.value} is not a Arrary`),[])}function N_(e){return ol()?(al(e),!0):!1}function ss(e){return typeof e=="function"?e():Cn(e)}const Uu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const B_=e=>e!=null,k_=()=>{};function I_(e){return Fo()}function M_(...e){if(e.length!==1)return Xu(...e);const t=e[0];return typeof t=="function"?tl(el(()=>({get:t,set:k_}))):Nr(t)}function F_(e,t){I_()&&rl(e,t)}const L_=Uu?window:void 0,V_=Uu?window.document:void 0;function H_(e){var t;const r=ss(e);return(t=r==null?void 0:r.$el)!=null?t:r}function U_(){const e=Nr(!1),t=Fo();return t&&sl(()=>{e.value=!0},t),e}function z_(e){const t=U_();return Lo(()=>(t.value,!!e()))}function q_(e,t,r={}){const f=r,{window:n=L_}=f,i=fs(f,["window"]);let s;const o=z_(()=>n&&"MutationObserver"in n),a=()=>{s&&(s.disconnect(),s=void 0)},u=Lo(()=>{const p=ss(e),d=(Array.isArray(p)?p:[p]).map(H_).filter(B_);return new Set(d)}),c=Mo(()=>u.value,p=>{a(),o.value&&p.size&&(s=new MutationObserver(t),p.forEach(d=>s.observe(d,i)))},{immediate:!0,flush:"post"}),l=()=>s==null?void 0:s.takeRecords(),h=()=>{c(),a()};return N_(h),{isSupported:o,stop:h,takeRecords:l}}function K_(e=null,t={}){var r,n,i;const{document:s=V_,restoreOnUnmount:o=h=>h}=t,a=(r=s==null?void 0:s.title)!=null?r:"",u=M_((n=e!=null?e:s==null?void 0:s.title)!=null?n:null),c=e&&typeof e=="function";function l(h){if(!("titleTemplate"in t))return h;const f=t.titleTemplate||"%s";return typeof f=="function"?f(h):ss(f).replace(/%s/g,h)}return Mo(u,(h,f)=>{h!==f&&s&&(s.title=l(typeof h=="string"?h:""))},{immediate:!0}),t.observe&&!t.titleTemplate&&s&&!c&&q_((i=s.head)==null?void 0:i.querySelector("title"),()=>{s&&s.title!==u.value&&(u.value=l(s.title))},{childList:!0}),F_(()=>{if(o){const h=o(a,u.value||"");h!=null&&s&&(s.title=h)}}),u}const ko=zr({name:"VtjPageContainer",setup(){return H(this,null,function*(){const e=as(),t=Vo(),r=t.params.id,n=r?e.getPage(r):e.getHomepage(),i=n?yield e.getRenderComponent(n.id):null;return n&&(Object.assign(t.meta,n.meta||{}),K_(n.title||"VTJ")),{provider:e,component:i,file:n,query:t.query,meta:n==null?void 0:n.meta}})},render(){const{component:e,query:t}=this;return e?Pn(e,t):Pn("div","页面不存在")}}),J_={"data-l-h6o7ki7":"",class:"vtj-startup__wrapper"},W_={"data-l-h6o7ki7":"",class:"vtj-startup"},Y_={"data-l-h6o7ki7":"",class:"vtj-startup__name"},G_={"data-l-h6o7ki7":""},Z_={"data-l-h6o7ki7":"",class:"vtj-startup__tagline"},Q_={"data-l-h6o7ki7":"",class:"vtj-startup__actions"},zu=zr({__name:"Startup",props:{name:{default:"VTJ.PRO"},tagline:{default:"基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台"},actionText:{default:"开始设计"}},setup(e){((n,i)=>{let s=document.getElementById("h6o7ki7");s||(s=document.createElement("style"),s.id="h6o7ki7",document.head.appendChild(s),s.innerHTML=i)})("h6o7ki7",`
|
|
@@ -142,4 +142,4 @@ version: 2.9.0
|
|
|
142
142
|
}
|
|
143
143
|
.vtj-startup__actions button[data-l-h6o7ki7]:hover{
|
|
144
144
|
opacity: 0.7;
|
|
145
|
-
}`);const t=e,r=()=>{if(typeof window<"u"){let n=(window.__VTJ_LINK__||{}).href||window.location.pathname+"__vtj__/#/";window.location.href=n}};return(n,i)=>(Nn(),nl("div",J_,[ae("div",W_,[ae("h1",Y_,[ae("span",G_,pn(t.name),1)]),ae("div",Z_,pn(t.tagline),1),ae("div",Q_,[ae("button",{"data-l-h6o7ki7":"",onClick:r},pn(t.actionText),1)])])]))}}),X_=zr({name:"VtjStartupContainer",render(){return Pn(zu)}}),os=Symbol("Provider");var qu=(e=>(e.Production="production",e.Development="development",e))(qu||{});class Ku extends $c{constructor(r){super();j(this,"mode");j(this,"globals",{});j(this,"modules",{});j(this,"adapter",{request:h_,jsonp:bu});j(this,"apis",{});j(this,"dependencies",{});j(this,"materials",{});j(this,"library",{});j(this,"service");j(this,"project",null);j(this,"components",{});j(this,"nodeEnv","development");j(this,"router",null);j(this,"materialPath","./");j(this,"urlDslCaches",{});this.options=r;const{service:n,mode:i=lt.Raw,dependencies:s,materials:o,project:a={},adapter:u={},globals:c={},modules:l={},router:h=null,materialPath:f="./",nodeEnv:p="development"}=r;this.mode=i,this.modules=l,this.service=n,this.router=h,this.materialPath=f,this.nodeEnv=p,s&&(this.dependencies=s),o&&(this.materials=o),Object.assign(this.globals,c),Object.assign(this.adapter,u);const{access:d,request:m}=this.adapter;d&&d.connect({mode:i,router:h,request:m}),i!==lt.Design&&this.load(a)}load(r){return H(this,null,function*(){var a;const n=this.modules[`.vtj/projects/${r.id}.json`];if(this.project=n?yield n():yield this.service.init(r),!this.project)throw new Error("project is null");const{apis:i=[],meta:s=[]}=this.project,o=window;o.CKEDITOR_VERSION=void 0,this.nodeEnv!=="production"?yield this.loadAssets(o):yield this.loadDependencies(o),this.apis=Bu(i,s,this.adapter),es(),(a=this.project.config)!=null&&a.mock&&ku(i),this.initRouter(),this.triggerReady()})}loadDependencies(r){return H(this,null,function*(){const n=Object.entries(this.dependencies);for(const[i,s]of n)r[i]||(r[i]=yield s())})}loadAssets(r){return H(this,null,function*(){const{dependencies:n=[]}=this.project,{dependencies:i,library:s,components:o,materialPath:a,nodeEnv:u}=this,{libraryExports:c,libraryMap:l,materials:h,materialExports:f,materialMapLibrary:p}=Ou(n,a,u==="development");for(const m of c){const b=i[m],S=r[m];if(S)s[m]=S;else if(b)r[m]=s[m]=yield b();else{const v=l[m]||[];for(const y of v)un(y)&&(yield Au(m,re.append(y,{v:be}))),ln(y)&&(yield pi(re.append(y,{v:be})));s[m]=r[m]}}for(const m of h)yield pi(re.append(m,{v:be}));const d=this.materials||{};for(const m of f){const b=r[p[m]],S=Oc[m];if(S)b&&S.forEach(v=>{o[v]=b[v]});else{const v=d[m]?(yield d[m]()).default:r[m];v&&b&&(v.components||[]).forEach(y=>{o[y.name]=$u(y,b)})}}})}initRouter(){const{router:r,project:n,options:i}=this;if(!r)return;const{routeParentName:s,pageRouteName:o="page",routeMeta:a}=i,u={path:`/${o}/:id`,name:cn,component:ko},c={path:"/",name:Qi,component:n!=null&&n.homepage?ko:X_,meta:a};s?(r.addRoute(s,u),r.addRoute(s,c)):(r.addRoute(u),r.addRoute(c))}install(r){const n=r.config.globalProperties.installed||{};for(const[i,s]of Object.entries(this.library))!n[i]&&Du(s)&&(r.use(s),n[i]=!0);this.options.install&&r.use(this.options.install),this.adapter.access&&r.use(this.adapter.access),r.provide(os,this),r.config.globalProperties.installed=n,this.mode===lt.Design&&(r.config.errorHandler=(i,s,o)=>{const a=s==null?void 0:s.$options.name,u=typeof i=="string"?i:(i==null?void 0:i.message)||(i==null?void 0:i.msg)||"未知错误",c=`[ ${a} ] ${u} ${o}`;console.error("[VTJ Error]:",{err:i,instance:s,info:o},i==null?void 0:i.stack),qr.error({title:"未处理的异常:请在控制台查看详情",message:c})})}getFile(r){const{blocks:n=[]}=this.project||{};return this.getPage(r)||n.find(i=>i.id===r)||null}getPage(r){const{pages:n=[]}=this.project||{},i=(s,o=[])=>{for(const a of o){if(a.id===s)return a;if(a.children&&a.children.length){const u=i(s,a.children);if(u)return u}}};return i(r,n)||null}getHomepage(){const{homepage:r}=this.project||{};return r?this.getPage(r):null}getDsl(r){return H(this,null,function*(){const n=this.modules[`.vtj/files/${r}.json`];return n?yield n():this.service.getFile(r).catch(()=>null)})}getDslByUrl(r){return H(this,null,function*(){return this.urlDslCaches[r]||(this.urlDslCaches[r]=this.adapter.request.send({url:r,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(i=>i.data).catch(()=>null))})}createDslRenderer(r,n={}){const{library:i,components:s,mode:o,apis:a}=this,u=K({mode:o,Vue:i.Vue,components:s,libs:i,apis:a,window},n),c=Hr({getDsl:l=>H(this,null,function*(){return(yield this.getDsl(l))||null}),getDslByUrl:l=>H(this,null,function*(){return(yield this.getDslByUrl(l))||null}),options:u});return Vr(xt(K({},u),{dsl:r,loader:c}))}getRenderComponent(r,n){return H(this,null,function*(){var u;const i=this.getFile(r);if(!i)return Ze.warn(`Can not find file: ${r}`),null;n&&n(i);const s=`.vtj/vue/${r}.vue`,o=this.modules[s];if(o)return(u=yield o())==null?void 0:u.default;const a=yield this.getDsl(i.id);return a?this.createDslRenderer(a).renderer:(Ze.warn(`Can not find dsl: ${r}`),null)})}defineUrlSchemaComponent(r,n){return ps(()=>H(this,null,function*(){const i=yield this.getDslByUrl(r);return i?(i.name=n||i.name,this.createDslRenderer(i).renderer):null}))}definePluginComponent(r){return ps(()=>H(this,null,function*(){return yield ns(r,window)}))}}function tw(e){const t=new Ku(e);return{provider:t,onReady:r=>t.ready(r)}}function as(e={}){const t=Io(os);if(!t)throw new Error("Can not find provider");if(t.nodeEnv==="development"){const{id:r,version:n}=e;r&&n&&H(this,null,function*(){const i=yield t.getDsl(r);(i==null?void 0:i.__VERSION__)!==n&&qr.warning({title:i==null?void 0:i.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})}return t}const cs=new Ji({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>{var t;return((t=e.data)==null?void 0:t.code)===0},showError:e=>{qr.error({message:e||"未知错误"})}}}),ew=(e="/__vtj__/api/:type.json")=>(t,r)=>cs.send({url:e,method:"post",params:{type:t},data:{type:t,data:r}}),rw=(e="/__vtj__/api/uploader.json")=>(t,r)=>H(void 0,null,function*(){return yield cs.send({url:e,method:"post",data:{files:t,projectId:r},settings:{type:"data"}}).then(n=>n&&n[0]?n[0]:null).catch(()=>null)});class hn{constructor(){j(this,"api");j(this,"pluginCaches",{});j(this,"uploader");this.api=ew(),this.uploader=rw()}getExtension(){return H(this,null,function*(){console.log("BaseService.getExtension")})}init(t){return H(this,null,function*(){return console.log("BaseService.init",t),{}})}saveProject(t){return H(this,null,function*(){return!!(yield this.api("saveProject",t).catch(()=>!1))})}saveMaterials(t,r){return H(this,null,function*(){return console.log("BaseService.saveMaterials",t,r),!1})}saveFile(t){return H(this,null,function*(){return console.log("BaseService.saveFile",t),!1})}getFile(t){return H(this,null,function*(){return console.log("BaseService.getFile",t),{}})}removeFile(t){return H(this,null,function*(){return console.log("BaseService.removeFile",t),!1})}saveHistory(t){return H(this,null,function*(){return console.log("BaseService.saveHistory",t),!1})}removeHistory(t){return H(this,null,function*(){return console.log("BaseService.removeHistory",t),!1})}getHistory(t){return H(this,null,function*(){return console.log("BaseService.getHistory",t),{}})}getHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.getHistoryItem",t,r),{}})}saveHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.saveHistoryItem",t,r),!1})}removeHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.removeHistoryItem",t,r),!1})}publish(t){return H(this,null,function*(){return!!(yield this.api("publish",t).catch(()=>!1))})}publishFile(t,r){return H(this,null,function*(){return!!(yield this.api("publishFile",{project:t,file:r}).catch(()=>!1))})}genVueContent(t,r){return H(this,null,function*(){return yield this.api("genVueContent",{project:t,dsl:r}).catch(()=>"")})}createRawPage(t){return H(this,null,function*(){return yield this.api("createRawPage",t).catch(()=>"")})}removeRawPage(t){return H(this,null,function*(){return yield this.api("removeRawPage",t).catch(()=>"")})}uploadStaticFile(t,r){return H(this,null,function*(){return yield this.uploader(t,r).catch(()=>null)})}getStaticFiles(t){return H(this,null,function*(){return yield this.api("getStaticFiles",t).catch(()=>[])})}removeStaticFile(t,r){return H(this,null,function*(){return yield this.api("removeStaticFile",{name:t,projectId:r}).catch(()=>"")})}clearStaticFiles(t){return H(this,null,function*(){return yield this.api("clearStaticFiles",t).catch(()=>"")})}getPluginMaterial(t){return H(this,null,function*(){const{urls:r=[]}=t,n=r.filter(s=>xu(s))[0];return n?this.pluginCaches[n]||(this.pluginCaches[n]=cs.send({url:n,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(s=>s.data).catch(()=>null)):null})}}const pt=new Yi({type:"local",expired:0,prefix:"__VTJ_"});class nw extends hn{init(t){const r=new We(t),n=pt.get(`project_${r.id}`),i=Object.assign(r.toDsl(),n||{});return pt.save(`project_${r.id}`,i),Promise.resolve(i)}saveProject(t){const r=new We(t);return pt.save(`project_${r.id}`,r.toDsl()),Promise.resolve(!0)}saveMaterials(t,r){return pt.save(`materials_${t.id}`,tn(r)),Promise.resolve(!0)}saveFile(t){return pt.save(`file_${t.id}`,t),Promise.resolve(!0)}getFile(t){const r=pt.get(`file_${t}`);return r?Promise.resolve(r):Promise.reject(null)}removeFile(t){return pt.remove(`file_${t}`),Promise.resolve(!0)}saveHistory(t){return pt.save(`history_${t.id}`,t),Promise.resolve(!0)}removeHistory(t){const r=pt.get(`history_${t}`);if(r){const n=(r.items||[]).map(i=>i.id);this.removeHistoryItem(t,n),pt.remove(`history_${t}`)}return Promise.resolve(!0)}getHistory(t){const r=pt.get(`history_${t}`),n=new Mi(r||{id:t});return Promise.resolve(n.toDsl())}getHistoryItem(t,r){const n=pt.get(`history_${t}_${r}`);return Promise.resolve(n)}saveHistoryItem(t,r){return pt.save(`history_${t}_${r.id}`,r),Promise.resolve(!0)}removeHistoryItem(t,r){return r.forEach(n=>{pt.remove(`history_${t}_${n}`)}),Promise.resolve(!0)}}class Ju extends hn{constructor(){super(...arguments);j(this,"projects",{});j(this,"materials",{});j(this,"files",{});j(this,"histories",{});j(this,"historyItems",{})}init(r){const n=new We(r),i=this.projects[n.id]||{},s=Object.assign(n.toDsl(),i);return this.projects[s.id]=s,Promise.resolve(s)}saveProject(r){const n=new We(r);return this.projects[n.id]=n.toDsl(),Promise.resolve(!0)}saveMaterials(r,n){return r.id&&(this.materials[r.id]=tn(n)),Promise.resolve(!0)}saveFile(r){return this.files[r.id]=r,Promise.resolve(!0)}getFile(r){const n=this.files[r];return n?Promise.resolve(n):Promise.reject(null)}removeFile(r){return delete this.files[r],Promise.resolve(!0)}saveHistory(r){return this.histories[r.id]=r,Promise.resolve(!0)}removeHistory(r){const n=this.histories[r];if(n){const i=(n.items||[]).map(s=>s.id);this.removeHistoryItem(r,i),delete this.historyItems[r]}return Promise.resolve(!0)}getHistory(r){const n=this.histories[r],i=new Mi(n||{id:r});return Promise.resolve(i)}getHistoryItem(r,n){const i=`${r}_${n}`,s=this.historyItems[i]||{};return Promise.resolve(s)}saveHistoryItem(r,n){const i=`${r}_${n.id}`;return this.historyItems[i]=n,Promise.resolve(!0)}removeHistoryItem(r,n){return n.forEach(i=>{const s=`${r}_${i}`;delete this.historyItems[s]}),Promise.resolve(!0)}}let Dn=null;function iw(){return Dn||(Dn=new Ju,Dn)}class sw extends hn{constructor(){super(...arguments);j(this,"getFileCaches",{})}getExtension(){return H(this,null,function*(){return yield this.api("getExtension",{}).catch(()=>{})})}init(r){return H(this,null,function*(){return(yield this.api("init",r).catch(()=>null))||{}})}saveProject(r){return H(this,null,function*(){return!!(yield this.api("saveProject",r).catch(()=>!1))})}saveMaterials(r,n){return H(this,null,function*(){return!!(yield this.api("saveMaterials",{project:r,materials:tn(n)}).catch(()=>!1))})}saveFile(r){return H(this,null,function*(){return!!(yield this.api("saveFile",r).catch(()=>!1))})}getFile(r){return H(this,null,function*(){return this.getFileCaches[r]||(this.getFileCaches[r]=this.api("getFile",r).catch(()=>null)).finally(()=>{delete this.getFileCaches[r]})})}removeFile(r){return H(this,null,function*(){return!!(yield this.api("removeFile",r).catch(()=>!1))})}saveHistory(r){return H(this,null,function*(){return!!(yield this.api("saveHistory",r).catch(()=>!1))})}removeHistory(r){return H(this,null,function*(){return!!(yield this.api("removeHistory",r).catch(()=>!1))})}getHistory(r){return H(this,null,function*(){return(yield this.api("getHistory",r).catch(()=>null))||{}})}getHistoryItem(r,n){return H(this,null,function*(){return(yield this.api("getHistoryItem",{fId:r,id:n}).catch(()=>null))||{}})}saveHistoryItem(r,n){return H(this,null,function*(){return!!(yield this.api("saveHistoryItem",{fId:r,item:n}).catch(()=>!1))})}removeHistoryItem(r,n){return H(this,null,function*(){return!!(yield this.api("removeHistoryItem",{fId:r,ids:n}).catch(()=>!1))})}}function Wu(e=[]){return e.map(t=>{const{id:r,title:n,icon:i,children:s,hidden:o}=t;return{id:r,title:n,icon:i,hidden:o,url:`/page/${r}`,children:s&&s.length?Wu(s):void 0}})}function Yu(e,t){if(!t)return e;let r=[];for(const n of e)if(n.children&&n.children.length){const i=Yu(n.children,t);i.length&&(n.children=i,r.push(n))}else t[n.id]&&r.push(n);return r}function ow(){const e=as(),t=Vo(),r=Fu(),n=Nr(!1),i=Nr(!1),s=r==null?void 0:r.getData(),o=e.project;il(()=>{const{name:c,params:l,meta:h}=t;if(c===cn){const f=e.getPage(l.id);n.value=!(f!=null&&f.mask),i.value=!!(f!=null&&f.pure)}else if(c===Qi){const f=e.getHomepage();n.value=!(f!=null&&f.mask),i.value=!!(f!=null&&f.pure)}else n.value=!h.mask,i.value=!!h.pure});const a=Wu(o==null?void 0:o.pages),u=o==null?void 0:o.config;return{disabled:n,logo:u==null?void 0:u.logo,themeSwitchable:u==null?void 0:u.themeSwitchable,title:(u==null?void 0:u.title)||(o==null?void 0:o.description)||(o==null?void 0:o.name)||"VTJ App",menus:Yu(a,s==null?void 0:s.permissions),pure:i}}const Kw=Object.freeze(Object.defineProperty({__proto__:null,ACCESS_KEY:rs,Access:Mu,BUILT_IN_DIRECTIVES:Eu,BaseService:hn,CONTEXT_HOST:mi,Context:Lu,ContextMode:lt,DATA_TYPES:Su,HOMEPAGE_ROUTE_NAME:Qi,JSCodeToString:l_,LIFE_CYCLES_LIST:a_,LocalService:sw,MemoryService:Ju,NodeEnv:qu,PAGE_ROUTE_NAME:cn,Provider:Ku,Startup:zu,StorageService:nw,VTJ_RENDERER_VERSION:be,adoptedStyleSheets:ts,createAssetScripts:c_,createAssetsCss:u_,createDataSources:Vu,createLoader:Hr,createMemoryService:iw,createMetaApi:Nu,createProvider:tw,createRenderer:Vr,createSchemaApi:Cu,createSchemaApis:Bu,defaultLoader:Hu,fillBasePath:Le,getModifiers:is,getPlugin:ns,getRawComponent:$u,isCSSUrl:un,isJSCode:Pu,isJSExpression:St,isJSFunction:ar,isJSON:xu,isJSUrl:ln,isVuePlugin:Du,loadCss:Au,loadCssUrl:ju,loadScriptUrl:Ru,mockApi:Iu,mockApis:ku,mockCleanup:es,nodeRender:Qe,parseDeps:Ou,parseExpression:Oe,parseFunction:gi,providerKey:os,removeProdFlag:Tu,toString:Xi,useAccess:Fu,useMask:ow,useProvider:as},Symbol.toStringTag,{value:"Module"})),aw=zr({__name:"app",setup(e){return(t,r)=>{const n=cl("router-view");return Nn(),ds(Cn(gl),{locale:Cn(ml)},{default:ms(()=>[(Nn(),ds(ul,null,{default:ms(()=>[ll(n)]),_:1}))]),_:1},8,["locale"])}}}),cw=[{path:"/",name:"home",component:()=>wr(()=>import("./index-jVlS6cmy.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,1,10,11,12,13,14,15,0,16,17,18]),import.meta.url)},{path:"/preview/:id",name:"preview",component:()=>wr(()=>import("./preview-B7UFOWBt.js"),__vite__mapDeps([19,14,15,3,4,5,6,7,8,9,1,10,11,12,13,0,16]),import.meta.url)},{path:"/auth",name:"auth",component:()=>wr(()=>import("./auth-BTiGpIv5.js"),__vite__mapDeps([20,3,4,5,6,7,8,9,1,10,11,12,13,14,15,0,16,17,21]),import.meta.url)}],uw=fl({history:pl(),routes:cw}),us=hl(aw),lw=new Mu({});us.use(lw);us.use(uw);us.mount("#app");export{Mu as $,Ku as A,Oi as B,Ou as C,kt as D,u_ as E,c_ as F,Ze as G,G as H,Rv as I,_e as J,bu as K,na as L,$u as M,Bu as N,es as O,ku as P,s_ as Q,Zn as R,St as S,Ug as T,ji as U,yc as V,Ri as W,mt as X,i_ as Y,ot as Z,lt as _,bt as a,ki as a0,Ii as a1,We as a2,Ib as a3,xg as a4,kv as a5,l_ as a6,a_ as a7,Su as a8,ar as a9,ke as aa,it as ab,Me as ac,Ie as ad,Qn as ae,Dc as af,Pc as ag,Fe as ah,Ar as ai,qt as aj,Mi as ak,Kw as al,xw as am,qw as an,un as ao,ln as ap,ju as aq,Ru as ar,tw as b,sv as c,Wg as d,Je as e,lc as f,zn as g,Fb as h,Lb as i,Av as j,Oe as k,gi as l,kb as m,Cv as n,Wn as o,cv as p,iv as q,M as r,bc as s,nt as t,Fr as u,Lt as v,$c as w,sw as x,Ig as y,Pr as z};
|
|
145
|
+
}`);const t=e,r=()=>{if(typeof window<"u"){let n=(window.__VTJ_LINK__||{}).href||window.location.pathname+"__vtj__/#/";window.location.href=n}};return(n,i)=>(Nn(),nl("div",J_,[ae("div",W_,[ae("h1",Y_,[ae("span",G_,pn(t.name),1)]),ae("div",Z_,pn(t.tagline),1),ae("div",Q_,[ae("button",{"data-l-h6o7ki7":"",onClick:r},pn(t.actionText),1)])])]))}}),X_=zr({name:"VtjStartupContainer",render(){return Pn(zu)}}),os=Symbol("Provider");var qu=(e=>(e.Production="production",e.Development="development",e))(qu||{});class Ku extends $c{constructor(r){super();j(this,"mode");j(this,"globals",{});j(this,"modules",{});j(this,"adapter",{request:h_,jsonp:bu});j(this,"apis",{});j(this,"dependencies",{});j(this,"materials",{});j(this,"library",{});j(this,"service");j(this,"project",null);j(this,"components",{});j(this,"nodeEnv","development");j(this,"router",null);j(this,"materialPath","./");j(this,"urlDslCaches",{});this.options=r;const{service:n,mode:i=lt.Raw,dependencies:s,materials:o,project:a={},adapter:u={},globals:c={},modules:l={},router:h=null,materialPath:f="./",nodeEnv:p="development"}=r;this.mode=i,this.modules=l,this.service=n,this.router=h,this.materialPath=f,this.nodeEnv=p,s&&(this.dependencies=s),o&&(this.materials=o),Object.assign(this.globals,c),Object.assign(this.adapter,u);const{access:d,request:m}=this.adapter;d&&d.connect({mode:i,router:h,request:m}),i!==lt.Design&&this.load(a)}load(r){return H(this,null,function*(){var a;const n=this.modules[`.vtj/projects/${r.id}.json`];if(this.project=n?yield n():yield this.service.init(r),!this.project)throw new Error("project is null");const{apis:i=[],meta:s=[]}=this.project,o=window;o.CKEDITOR_VERSION=void 0,this.nodeEnv!=="production"?yield this.loadAssets(o):yield this.loadDependencies(o),this.apis=Bu(i,s,this.adapter),es(),(a=this.project.config)!=null&&a.mock&&ku(i),this.initRouter(),this.triggerReady()})}loadDependencies(r){return H(this,null,function*(){const n=Object.entries(this.dependencies);for(const[i,s]of n)r[i]||(r[i]=yield s())})}loadAssets(r){return H(this,null,function*(){const{dependencies:n=[]}=this.project,{dependencies:i,library:s,components:o,materialPath:a,nodeEnv:u}=this,{libraryExports:c,libraryMap:l,materials:h,materialExports:f,materialMapLibrary:p}=Ou(n,a,u==="development");for(const m of c){const b=i[m],S=r[m];if(S)s[m]=S;else if(b)r[m]=s[m]=yield b();else{const v=l[m]||[];for(const y of v)un(y)&&(yield Au(m,re.append(y,{v:be}))),ln(y)&&(yield pi(re.append(y,{v:be})));s[m]=r[m]}}for(const m of h)yield pi(re.append(m,{v:be}));const d=this.materials||{};for(const m of f){const b=r[p[m]],S=Oc[m];if(S)b&&S.forEach(v=>{o[v]=b[v]});else{const v=d[m]?(yield d[m]()).default:r[m];v&&b&&(v.components||[]).forEach(y=>{o[y.name]=$u(y,b)})}}})}initRouter(){const{router:r,project:n,options:i}=this;if(!r)return;const{routeParentName:s,pageRouteName:o="page",routeMeta:a}=i,u={path:`/${o}/:id`,name:cn,component:ko},c={path:"/",name:Qi,component:n!=null&&n.homepage?ko:X_,meta:a};s?(r.addRoute(s,u),r.addRoute(s,c)):(r.addRoute(u),r.addRoute(c))}install(r){const n=r.config.globalProperties.installed||{};for(const[i,s]of Object.entries(this.library))!n[i]&&Du(s)&&(r.use(s),n[i]=!0);this.options.install&&r.use(this.options.install),this.adapter.access&&r.use(this.adapter.access),r.provide(os,this),r.config.globalProperties.installed=n,this.mode===lt.Design&&(r.config.errorHandler=(i,s,o)=>{const a=s==null?void 0:s.$options.name,u=typeof i=="string"?i:(i==null?void 0:i.message)||(i==null?void 0:i.msg)||"未知错误",c=`[ ${a} ] ${u} ${o}`;console.error("[VTJ Error]:",{err:i,instance:s,info:o},i==null?void 0:i.stack),qr.error({title:"未处理的异常:请在控制台查看详情",message:c})})}getFile(r){const{blocks:n=[]}=this.project||{};return this.getPage(r)||n.find(i=>i.id===r)||null}getPage(r){const{pages:n=[]}=this.project||{},i=(s,o=[])=>{for(const a of o){if(a.id===s)return a;if(a.children&&a.children.length){const u=i(s,a.children);if(u)return u}}};return i(r,n)||null}getHomepage(){const{homepage:r}=this.project||{};return r?this.getPage(r):null}getDsl(r){return H(this,null,function*(){const n=this.modules[`.vtj/files/${r}.json`];return n?yield n():this.service.getFile(r).catch(()=>null)})}getDslByUrl(r){return H(this,null,function*(){return this.urlDslCaches[r]||(this.urlDslCaches[r]=this.adapter.request.send({url:r,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(i=>i.data).catch(()=>null))})}createDslRenderer(r,n={}){const{library:i,components:s,mode:o,apis:a}=this,u=K({mode:o,Vue:i.Vue,components:s,libs:i,apis:a,window},n),c=Hr({getDsl:l=>H(this,null,function*(){return(yield this.getDsl(l))||null}),getDslByUrl:l=>H(this,null,function*(){return(yield this.getDslByUrl(l))||null}),options:u});return Vr(xt(K({},u),{dsl:r,loader:c}))}getRenderComponent(r,n){return H(this,null,function*(){var u;const i=this.getFile(r);if(!i)return Ze.warn(`Can not find file: ${r}`),null;n&&n(i);const s=`.vtj/vue/${r}.vue`,o=this.modules[s];if(o)return(u=yield o())==null?void 0:u.default;const a=yield this.getDsl(i.id);return a?this.createDslRenderer(a).renderer:(Ze.warn(`Can not find dsl: ${r}`),null)})}defineUrlSchemaComponent(r,n){return ps(()=>H(this,null,function*(){const i=yield this.getDslByUrl(r);return i?(i.name=n||i.name,this.createDslRenderer(i).renderer):null}))}definePluginComponent(r){return ps(()=>H(this,null,function*(){return yield ns(r,window)}))}}function tw(e){const t=new Ku(e);return{provider:t,onReady:r=>t.ready(r)}}function as(e={}){const t=Io(os);if(!t)throw new Error("Can not find provider");if(t.nodeEnv==="development"){const{id:r,version:n}=e;r&&n&&H(this,null,function*(){const i=yield t.getDsl(r);(i==null?void 0:i.__VERSION__)!==n&&qr.warning({title:i==null?void 0:i.name,message:"当前组件源码版本与运行时版本不一致,请重新发布组件"})})}return t}const cs=new Ji({settings:{type:"json",validSuccess:!0,originResponse:!1,failMessage:!0,validate:e=>{var t;return((t=e.data)==null?void 0:t.code)===0},showError:e=>{qr.error({message:e||"未知错误"})}}}),ew=(e="/__vtj__/api/:type.json")=>(t,r)=>cs.send({url:e,method:"post",params:{type:t},data:{type:t,data:r}}),rw=(e="/__vtj__/api/uploader.json")=>(t,r)=>H(void 0,null,function*(){return yield cs.send({url:e,method:"post",data:{files:t,projectId:r},settings:{type:"data"}}).then(n=>n&&n[0]?n[0]:null).catch(()=>null)});class hn{constructor(){j(this,"api");j(this,"pluginCaches",{});j(this,"uploader");this.api=ew(),this.uploader=rw()}getExtension(){return H(this,null,function*(){console.log("BaseService.getExtension")})}init(t){return H(this,null,function*(){return console.log("BaseService.init",t),{}})}saveProject(t){return H(this,null,function*(){return!!(yield this.api("saveProject",t).catch(()=>!1))})}saveMaterials(t,r){return H(this,null,function*(){return console.log("BaseService.saveMaterials",t,r),!1})}saveFile(t){return H(this,null,function*(){return console.log("BaseService.saveFile",t),!1})}getFile(t){return H(this,null,function*(){return console.log("BaseService.getFile",t),{}})}removeFile(t){return H(this,null,function*(){return console.log("BaseService.removeFile",t),!1})}saveHistory(t){return H(this,null,function*(){return console.log("BaseService.saveHistory",t),!1})}removeHistory(t){return H(this,null,function*(){return console.log("BaseService.removeHistory",t),!1})}getHistory(t){return H(this,null,function*(){return console.log("BaseService.getHistory",t),{}})}getHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.getHistoryItem",t,r),{}})}saveHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.saveHistoryItem",t,r),!1})}removeHistoryItem(t,r){return H(this,null,function*(){return console.log("BaseService.removeHistoryItem",t,r),!1})}publish(t){return H(this,null,function*(){return!!(yield this.api("publish",t).catch(()=>!1))})}publishFile(t,r){return H(this,null,function*(){return!!(yield this.api("publishFile",{project:t,file:r}).catch(()=>!1))})}genVueContent(t,r){return H(this,null,function*(){return yield this.api("genVueContent",{project:t,dsl:r}).catch(()=>"")})}createRawPage(t){return H(this,null,function*(){return yield this.api("createRawPage",t).catch(()=>"")})}removeRawPage(t){return H(this,null,function*(){return yield this.api("removeRawPage",t).catch(()=>"")})}uploadStaticFile(t,r){return H(this,null,function*(){return yield this.uploader(t,r).catch(()=>null)})}getStaticFiles(t){return H(this,null,function*(){return yield this.api("getStaticFiles",t).catch(()=>[])})}removeStaticFile(t,r){return H(this,null,function*(){return yield this.api("removeStaticFile",{name:t,projectId:r}).catch(()=>"")})}clearStaticFiles(t){return H(this,null,function*(){return yield this.api("clearStaticFiles",t).catch(()=>"")})}getPluginMaterial(t){return H(this,null,function*(){const{urls:r=[]}=t,n=r.filter(s=>xu(s))[0];return n?this.pluginCaches[n]||(this.pluginCaches[n]=cs.send({url:n,method:"get",settings:{validSuccess:!1,originResponse:!0}}).then(s=>s.data).catch(()=>null)):null})}}const pt=new Yi({type:"local",expired:0,prefix:"__VTJ_"});class nw extends hn{init(t){const r=new We(t),n=pt.get(`project_${r.id}`),i=Object.assign(r.toDsl(),n||{});return pt.save(`project_${r.id}`,i),Promise.resolve(i)}saveProject(t){const r=new We(t);return pt.save(`project_${r.id}`,r.toDsl()),Promise.resolve(!0)}saveMaterials(t,r){return pt.save(`materials_${t.id}`,tn(r)),Promise.resolve(!0)}saveFile(t){return pt.save(`file_${t.id}`,t),Promise.resolve(!0)}getFile(t){const r=pt.get(`file_${t}`);return r?Promise.resolve(r):Promise.reject(null)}removeFile(t){return pt.remove(`file_${t}`),Promise.resolve(!0)}saveHistory(t){return pt.save(`history_${t.id}`,t),Promise.resolve(!0)}removeHistory(t){const r=pt.get(`history_${t}`);if(r){const n=(r.items||[]).map(i=>i.id);this.removeHistoryItem(t,n),pt.remove(`history_${t}`)}return Promise.resolve(!0)}getHistory(t){const r=pt.get(`history_${t}`),n=new Mi(r||{id:t});return Promise.resolve(n.toDsl())}getHistoryItem(t,r){const n=pt.get(`history_${t}_${r}`);return Promise.resolve(n)}saveHistoryItem(t,r){return pt.save(`history_${t}_${r.id}`,r),Promise.resolve(!0)}removeHistoryItem(t,r){return r.forEach(n=>{pt.remove(`history_${t}_${n}`)}),Promise.resolve(!0)}}class Ju extends hn{constructor(){super(...arguments);j(this,"projects",{});j(this,"materials",{});j(this,"files",{});j(this,"histories",{});j(this,"historyItems",{})}init(r){const n=new We(r),i=this.projects[n.id]||{},s=Object.assign(n.toDsl(),i);return this.projects[s.id]=s,Promise.resolve(s)}saveProject(r){const n=new We(r);return this.projects[n.id]=n.toDsl(),Promise.resolve(!0)}saveMaterials(r,n){return r.id&&(this.materials[r.id]=tn(n)),Promise.resolve(!0)}saveFile(r){return this.files[r.id]=r,Promise.resolve(!0)}getFile(r){const n=this.files[r];return n?Promise.resolve(n):Promise.reject(null)}removeFile(r){return delete this.files[r],Promise.resolve(!0)}saveHistory(r){return this.histories[r.id]=r,Promise.resolve(!0)}removeHistory(r){const n=this.histories[r];if(n){const i=(n.items||[]).map(s=>s.id);this.removeHistoryItem(r,i),delete this.historyItems[r]}return Promise.resolve(!0)}getHistory(r){const n=this.histories[r],i=new Mi(n||{id:r});return Promise.resolve(i)}getHistoryItem(r,n){const i=`${r}_${n}`,s=this.historyItems[i]||{};return Promise.resolve(s)}saveHistoryItem(r,n){const i=`${r}_${n.id}`;return this.historyItems[i]=n,Promise.resolve(!0)}removeHistoryItem(r,n){return n.forEach(i=>{const s=`${r}_${i}`;delete this.historyItems[s]}),Promise.resolve(!0)}}let Dn=null;function iw(){return Dn||(Dn=new Ju,Dn)}class sw extends hn{constructor(){super(...arguments);j(this,"getFileCaches",{})}getExtension(){return H(this,null,function*(){return yield this.api("getExtension",{}).catch(()=>{})})}init(r){return H(this,null,function*(){return(yield this.api("init",r).catch(()=>null))||{}})}saveProject(r){return H(this,null,function*(){return!!(yield this.api("saveProject",r).catch(()=>!1))})}saveMaterials(r,n){return H(this,null,function*(){return!!(yield this.api("saveMaterials",{project:r,materials:tn(n)}).catch(()=>!1))})}saveFile(r){return H(this,null,function*(){return!!(yield this.api("saveFile",r).catch(()=>!1))})}getFile(r){return H(this,null,function*(){return this.getFileCaches[r]||(this.getFileCaches[r]=this.api("getFile",r).catch(()=>null)).finally(()=>{delete this.getFileCaches[r]})})}removeFile(r){return H(this,null,function*(){return!!(yield this.api("removeFile",r).catch(()=>!1))})}saveHistory(r){return H(this,null,function*(){return!!(yield this.api("saveHistory",r).catch(()=>!1))})}removeHistory(r){return H(this,null,function*(){return!!(yield this.api("removeHistory",r).catch(()=>!1))})}getHistory(r){return H(this,null,function*(){return(yield this.api("getHistory",r).catch(()=>null))||{}})}getHistoryItem(r,n){return H(this,null,function*(){return(yield this.api("getHistoryItem",{fId:r,id:n}).catch(()=>null))||{}})}saveHistoryItem(r,n){return H(this,null,function*(){return!!(yield this.api("saveHistoryItem",{fId:r,item:n}).catch(()=>!1))})}removeHistoryItem(r,n){return H(this,null,function*(){return!!(yield this.api("removeHistoryItem",{fId:r,ids:n}).catch(()=>!1))})}}function Wu(e=[]){return e.map(t=>{const{id:r,title:n,icon:i,children:s,hidden:o}=t;return{id:r,title:n,icon:i,hidden:o,url:`/page/${r}`,children:s&&s.length?Wu(s):void 0}})}function Yu(e,t){if(!t)return e;let r=[];for(const n of e)if(n.children&&n.children.length){const i=Yu(n.children,t);i.length&&(n.children=i,r.push(n))}else t[n.id]&&r.push(n);return r}function ow(){const e=as(),t=Vo(),r=Fu(),n=Nr(!1),i=Nr(!1),s=r==null?void 0:r.getData(),o=e.project;il(()=>{const{name:c,params:l,meta:h}=t;if(c===cn){const f=e.getPage(l.id);n.value=!(f!=null&&f.mask),i.value=!!(f!=null&&f.pure)}else if(c===Qi){const f=e.getHomepage();n.value=!(f!=null&&f.mask),i.value=!!(f!=null&&f.pure)}else n.value=!h.mask,i.value=!!h.pure});const a=Wu(o==null?void 0:o.pages),u=o==null?void 0:o.config;return{disabled:n,logo:u==null?void 0:u.logo,themeSwitchable:u==null?void 0:u.themeSwitchable,title:(u==null?void 0:u.title)||(o==null?void 0:o.description)||(o==null?void 0:o.name)||"VTJ App",menus:Yu(a,s==null?void 0:s.permissions),pure:i}}const Kw=Object.freeze(Object.defineProperty({__proto__:null,ACCESS_KEY:rs,Access:Mu,BUILT_IN_DIRECTIVES:Eu,BaseService:hn,CONTEXT_HOST:mi,Context:Lu,ContextMode:lt,DATA_TYPES:Su,HOMEPAGE_ROUTE_NAME:Qi,JSCodeToString:l_,LIFE_CYCLES_LIST:a_,LocalService:sw,MemoryService:Ju,NodeEnv:qu,PAGE_ROUTE_NAME:cn,Provider:Ku,Startup:zu,StorageService:nw,VTJ_RENDERER_VERSION:be,adoptedStyleSheets:ts,createAssetScripts:c_,createAssetsCss:u_,createDataSources:Vu,createLoader:Hr,createMemoryService:iw,createMetaApi:Nu,createProvider:tw,createRenderer:Vr,createSchemaApi:Cu,createSchemaApis:Bu,defaultLoader:Hu,fillBasePath:Le,getModifiers:is,getPlugin:ns,getRawComponent:$u,isCSSUrl:un,isJSCode:Pu,isJSExpression:St,isJSFunction:ar,isJSON:xu,isJSUrl:ln,isVuePlugin:Du,loadCss:Au,loadCssUrl:ju,loadScriptUrl:Ru,mockApi:Iu,mockApis:ku,mockCleanup:es,nodeRender:Qe,parseDeps:Ou,parseExpression:Oe,parseFunction:gi,providerKey:os,removeProdFlag:Tu,toString:Xi,useAccess:Fu,useMask:ow,useProvider:as},Symbol.toStringTag,{value:"Module"})),aw=zr({__name:"app",setup(e){return(t,r)=>{const n=cl("router-view");return Nn(),ds(Cn(gl),{locale:Cn(ml)},{default:ms(()=>[(Nn(),ds(ul,null,{default:ms(()=>[ll(n)]),_:1}))]),_:1},8,["locale"])}}}),cw=[{path:"/",name:"home",component:()=>wr(()=>import("./index-BRvb6BFi.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,1,10,11,12,13,14,15,0,16,17,18]),import.meta.url)},{path:"/preview/:id",name:"preview",component:()=>wr(()=>import("./preview-D0Efiuc4.js"),__vite__mapDeps([19,14,15,3,4,5,6,7,8,9,1,10,11,12,13,0,16]),import.meta.url)},{path:"/auth",name:"auth",component:()=>wr(()=>import("./auth-DwOvqdPT.js"),__vite__mapDeps([20,3,4,5,6,7,8,9,1,10,11,12,13,14,15,0,16,17,21]),import.meta.url)}],uw=fl({history:pl(),routes:cw}),us=hl(aw),lw=new Mu({});us.use(lw);us.use(uw);us.mount("#app");export{Mu as $,Ku as A,Oi as B,Ou as C,kt as D,u_ as E,c_ as F,Ze as G,G as H,Rv as I,_e as J,bu as K,na as L,$u as M,Bu as N,es as O,ku as P,s_ as Q,Zn as R,St as S,Ug as T,ji as U,yc as V,Ri as W,mt as X,i_ as Y,ot as Z,lt as _,bt as a,ki as a0,Ii as a1,We as a2,Ib as a3,xg as a4,kv as a5,l_ as a6,a_ as a7,Su as a8,ar as a9,ke as aa,it as ab,Me as ac,Ie as ad,Qn as ae,Dc as af,Pc as ag,Fe as ah,Ar as ai,qt as aj,Mi as ak,Kw as al,xw as am,qw as an,un as ao,ln as ap,ju as aq,Ru as ar,tw as b,sv as c,Wg as d,Je as e,lc as f,zn as g,Fb as h,Lb as i,Av as j,Oe as k,gi as l,kb as m,Cv as n,Wn as o,cv as p,iv as q,M as r,bc as s,nt as t,Fr as u,Lt as v,$c as w,sw as x,Ig as y,Pr as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vue-router-DVXkXLMI.js","./vue-BvlBnlDq.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var b=Object.defineProperty,h=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var R=(o,e,t)=>e in o?b(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,l=(o,e)=>{for(var t in e||(e={}))P.call(e,t)&&R(o,t,e[t]);if(E)for(var t of E(e))B.call(e,t)&&R(o,t,e[t]);return o},d=(o,e)=>h(o,A(e));var f=(o,e,t)=>new Promise((c,a)=>{var p=r=>{try{i(t.next(r))}catch(m){a(m)}},s=r=>{try{i(t.throw(r))}catch(m){a(m)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(p,s);i((t=t.apply(o,e)).next())});import{_ as g}from"./monaco-editor-B5_fO_Um.js";import{useRoute as O}from"./vue-router-DVXkXLMI.js";import{c as k}from"./element-plus-DxszZ-Od.js";import"./vxe-CHtaO4Up.js";import{E as D,b as I}from"./extension-
|
|
2
|
+
var b=Object.defineProperty,h=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var R=(o,e,t)=>e in o?b(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,l=(o,e)=>{for(var t in e||(e={}))P.call(e,t)&&R(o,t,e[t]);if(E)for(var t of E(e))B.call(e,t)&&R(o,t,e[t]);return o},d=(o,e)=>h(o,A(e));var f=(o,e,t)=>new Promise((c,a)=>{var p=r=>{try{i(t.next(r))}catch(m){a(m)}},s=r=>{try{i(t.throw(r))}catch(m){a(m)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(p,s);i((t=t.apply(o,e)).next())});import{_ as g}from"./monaco-editor-B5_fO_Um.js";import{useRoute as O}from"./vue-router-DVXkXLMI.js";import{c as k}from"./element-plus-DxszZ-Od.js";import"./vxe-CHtaO4Up.js";import{E as D,b as I}from"./extension-CrajlLQB.js";import{x as T,$ as L,b as S,_ as $}from"./index-CB3vT47S.js";import{d as j,az as C,r as z,f as H,o as M,R as N,V as W,W as q}from"./vue-BvlBnlDq.js";import"./lodash-es-D4Nl9glD.js";import"./@vueuse-Boef7d6G.js";import"./@element-plus-icons-vue-Br0k9_nr.js";import"./shared-CuSW-11R.js";import"./dayjs-DzmFq6fg.js";import"./mockjs-BKNhwXuJ.js";const ae=j({__name:"preview",setup(o){return f(this,null,function*(){let e,t;const c=new T,a=([e,t]=C(()=>c.getExtension().catch(()=>null)),e=yield e,t(),e),{options:p,adapters:s}=a?([e,t]=C(()=>new D(a).load()),e=yield e,t(),e):{},{__BASE_PATH__:i="/"}=a||{},r=s==null?void 0:s.access,m=s==null?void 0:s.remote,y=r?new L(d(l({},r),{alert:k.alert})):void 0,{provider:v,onReady:V}=S(d(l({mode:$.Runtime,service:c,materialPath:i,adapter:{access:y,remote:m}},p||{}),{dependencies:{Vue:()=>g(()=>import("./vue-BvlBnlDq.js").then(n=>n.aw),[],import.meta.url),VueRouter:()=>g(()=>import("./vue-router-DVXkXLMI.js"),__vite__mapDeps([0,1]),import.meta.url)}})),w=O(),_=z(),u=H();return V(()=>f(this,null,function*(){const n=u==null?void 0:u.appContext.app;n&&(n.use(I),n.use(v)),_.value=yield v.getRenderComponent(w.params.id.toString(),x=>{Object.assign(w.meta,x.meta)})})),(n,x)=>_.value?(M(),N(W(_.value),{key:0})):q("",!0)})}});export{ae as default};
|
|
@@ -7,7 +7,8 @@ function injectLink() {
|
|
|
7
7
|
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112-56.64 98.112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64h-448z"></path></svg>';
|
|
8
8
|
panel.appendChild(link);
|
|
9
9
|
link.addEventListener('click', function (e) {
|
|
10
|
-
const
|
|
10
|
+
const { hash, pathname } = location;
|
|
11
|
+
const section = hash ? hash.split('?')[0].split('/') : pathname.split('/');
|
|
11
12
|
const id = section.pop() || '';
|
|
12
13
|
const options = window.__VTJ_LINK__ || {};
|
|
13
14
|
let path = options.href || window.location.pathname + '__vtj__/#/';
|
package/dist/entry/link.js
CHANGED
|
@@ -61,7 +61,10 @@
|
|
|
61
61
|
|
|
62
62
|
el.addEventListener('click', function (e) {
|
|
63
63
|
if (!isDragged) {
|
|
64
|
-
const
|
|
64
|
+
const { hash, pathname } = location;
|
|
65
|
+
const section = hash
|
|
66
|
+
? hash.split('?')[0].split('/')
|
|
67
|
+
: pathname.split('/');
|
|
65
68
|
const id = section.pop() || '';
|
|
66
69
|
const options = window.__VTJ_LINK__ || {};
|
|
67
70
|
let path = options.href || window.location.pathname + '__vtj__/#/';
|
package/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<meta http-equiv="Expires" content="0"/>
|
|
10
10
|
<title>低代码设计器 - VTJ.PRO</title>
|
|
11
11
|
<script>
|
|
12
|
-
var __BUILD_TIME__ = '
|
|
12
|
+
var __BUILD_TIME__ = '1731933732766';
|
|
13
13
|
(function () {
|
|
14
14
|
const regex = /<!--{{(\d*)}}-->/;
|
|
15
15
|
window.fetch('?t=' + Date.now()).then(async (res) => {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
});
|
|
26
26
|
})();
|
|
27
27
|
</script>
|
|
28
|
-
<!--{{
|
|
28
|
+
<!--{{1731933732766}}-->
|
|
29
29
|
|
|
30
|
-
<script type="module" crossorigin src="./assets/index-
|
|
30
|
+
<script type="module" crossorigin src="./assets/index-CB3vT47S.js"></script>
|
|
31
31
|
<link rel="modulepreload" crossorigin href="./assets/vue-BvlBnlDq.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="./assets/monaco-editor-B5_fO_Um.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="./assets/vue-router-DVXkXLMI.js">
|
package/package.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"name": "@vtj/pro",
|
|
3
3
|
"description": "VTJ.PRO",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.9.0-alpha.
|
|
5
|
+
"version": "0.9.0-alpha.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@vtj/core": "~0.9.0-alpha.
|
|
9
|
-
"@vtj/
|
|
10
|
-
"@vtj/
|
|
11
|
-
"@vtj/renderer": "~0.9.0-alpha.
|
|
12
|
-
"@vtj/local": "~0.9.0-alpha.
|
|
8
|
+
"@vtj/core": "~0.9.0-alpha.2",
|
|
9
|
+
"@vtj/materials": "~0.9.0-alpha.2",
|
|
10
|
+
"@vtj/designer": "~0.9.0-alpha.2",
|
|
11
|
+
"@vtj/renderer": "~0.9.0-alpha.2",
|
|
12
|
+
"@vtj/local": "~0.9.0-alpha.2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"vue": "~3.5.5",
|
|
16
16
|
"vue-router": "~4.4.0",
|
|
17
|
-
"@vtj/icons": "~0.9.0-alpha.0",
|
|
18
|
-
"@vtj/charts": "~0.9.0-alpha.0",
|
|
19
17
|
"@vtj/cli": "~0.9.0-alpha.0",
|
|
20
|
-
"@vtj/
|
|
21
|
-
"@vtj/
|
|
18
|
+
"@vtj/icons": "~0.9.0-alpha.2",
|
|
19
|
+
"@vtj/ui": "~0.9.0-alpha.2",
|
|
20
|
+
"@vtj/utils": "~0.9.0-alpha.2",
|
|
21
|
+
"@vtj/charts": "~0.9.0-alpha.2"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
"./vite": {
|