@melt-js/libs-core 2026.11.15 → 2026.11.16-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/README.md +73 -16
- package/dist/browser.d.mts +3 -0
- package/dist/browser.mjs +1 -50
- package/dist/browser.mjs.gz +0 -0
- package/dist/cdn/browser.umd.cjs +2 -0
- package/dist/cdn/browser.umd.cjs.gz +0 -0
- package/dist/cdn/demo-browser.umd.cjs +2 -0
- package/dist/cdn/demo-browser.umd.cjs.gz +0 -0
- package/dist/cdn/demo.umd.cjs +2 -0
- package/dist/cdn/demo.umd.cjs.gz +0 -0
- package/dist/cdn/example-esm.html +1 -0
- package/dist/cdn/example-umd.html +1 -0
- package/dist/cdn/index.umd.cjs +2 -0
- package/dist/cdn/index.umd.cjs.gz +0 -0
- package/dist/cdn/manifest.json +141 -0
- package/dist/cdn/vendor.umd.cjs +16 -0
- package/dist/cdn/vendor.umd.cjs.gz +0 -0
- package/dist/cdn.d.mts +3 -0
- package/dist/cdn.mjs +1 -0
- package/dist/demo/browser.d.mts +1 -0
- package/dist/demo/browser.mjs +1 -0
- package/dist/demo/browser.mjs.gz +0 -0
- package/dist/demo/clipboard.d.mts +6 -0
- package/dist/demo/clipboard.mjs +1 -0
- package/{src → dist}/demo/docs.d.mts +3 -0
- package/dist/demo/docs.mjs +1 -0
- package/dist/demo/docs.mjs.gz +0 -0
- package/{src → dist}/demo/download.d.mts +10 -2
- package/dist/demo/download.mjs +1 -0
- package/dist/demo/download.mjs.gz +0 -0
- package/dist/demo/fullscreen.mjs +1 -0
- package/dist/demo/highlight.d.mts +2 -0
- package/dist/demo/highlight.mjs +1 -0
- package/dist/demo/index.d.mts +10 -0
- package/dist/demo/index.mjs +1 -0
- package/dist/demo/model.mjs +1 -0
- package/dist/demo/remote-debug.d.mts +9 -0
- package/dist/demo/remote-debug.mjs +1 -0
- package/{src → dist}/demo/runtime.mjs +92 -104
- package/dist/demo/split-pane.d.mts +8 -0
- package/dist/demo/split-pane.mjs +1 -0
- package/dist/demo/standalone.d.mts +12 -0
- package/dist/demo/standalone.mjs +1 -0
- package/dist/demo/standalone.mjs.gz +0 -0
- package/dist/demo/tabs.d.mts +15 -0
- package/dist/demo/tabs.mjs +1 -0
- package/{src/index.ts → dist/index.d.ts} +1 -1
- package/dist/loading.mjs +1 -0
- package/dist/loading.mjs.gz +0 -0
- package/dist/remote-address.cjs +2 -0
- package/{src → dist}/remote.d.mts +20 -2
- package/dist/remote.mjs +1 -0
- package/dist/remote.mjs.gz +0 -0
- package/dist/vendor/hel-runtime.mjs +16 -0
- package/dist/vendor/hel-runtime.mjs.gz +0 -0
- package/package.json +41 -25
- package/scripts/browser-formats.mjs +357 -0
- package/scripts/build-browser.mjs +59 -13
- package/scripts/build-protected-esm.mjs +54 -0
- package/scripts/cdn-runtime.cjs +30 -0
- package/scripts/check-tdz.mjs +327 -324
- package/scripts/client-build-security.cjs +48 -0
- package/scripts/comps-bundle-obfuscation.cjs +269 -262
- package/scripts/comps-obfuscator-options.cjs +7 -1
- package/scripts/hel-build-paths.cjs +49 -48
- package/scripts/obfuscator-split-strings.cjs +22 -0
- package/scripts/package-artifacts.mjs +206 -0
- package/scripts/package-env.cjs +156 -193
- package/scripts/publish-stage.mjs +50 -42
- package/scripts/webpack-bundle-obfuscation.cjs +125 -121
- package/demo/index.js +0 -1
- package/dist/hel-deployment.json +0 -8
- package/src/browser.d.mts +0 -2
- package/src/browser.mjs +0 -3
- package/src/demo/docs.mjs +0 -75
- package/src/demo/download.mjs +0 -118
- package/src/demo/fullscreen.mjs +0 -80
- package/src/demo/index.d.mts +0 -4
- package/src/demo/index.mjs +0 -4
- package/src/demo/model.mjs +0 -203
- package/src/remote.mjs +0 -286
- package/tsconfig.json +0 -13
- /package/{src → dist}/demo/fullscreen.d.mts +0 -0
- /package/{src → dist}/demo/model.d.mts +0 -0
- /package/{src → scripts}/remote-address.cjs +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@melt-js/libs-core",
|
|
3
|
+
"version": "2026.11.16-2",
|
|
4
|
+
"entries": {
|
|
5
|
+
"@melt-js/libs-core": {
|
|
6
|
+
"specifier": "@melt-js/libs-core",
|
|
7
|
+
"esm": "dist/browser.mjs",
|
|
8
|
+
"umd": "dist/cdn/index.umd.cjs",
|
|
9
|
+
"exports": [
|
|
10
|
+
"HEL_BASES",
|
|
11
|
+
"HEL_LOADING_TYPES",
|
|
12
|
+
"HelLoadError",
|
|
13
|
+
"assertHelExports",
|
|
14
|
+
"bindReactRuntime",
|
|
15
|
+
"bindVueRuntime",
|
|
16
|
+
"createHelComponentResource",
|
|
17
|
+
"createHelLoader",
|
|
18
|
+
"exposeLib",
|
|
19
|
+
"getLib",
|
|
20
|
+
"isHelMetaHost",
|
|
21
|
+
"loadCdnResources",
|
|
22
|
+
"loadHelComponent",
|
|
23
|
+
"loadHelLib",
|
|
24
|
+
"loadHelLibsSerial",
|
|
25
|
+
"preloadHelLibs",
|
|
26
|
+
"resolveHelDep",
|
|
27
|
+
"resolveHelDeps",
|
|
28
|
+
"resolveHelHost",
|
|
29
|
+
"showHelLoading"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"@melt-js/libs-core/browser": {
|
|
33
|
+
"specifier": "@melt-js/libs-core/browser",
|
|
34
|
+
"esm": "dist/browser.mjs",
|
|
35
|
+
"umd": "dist/cdn/browser.umd.cjs",
|
|
36
|
+
"exports": [
|
|
37
|
+
"HEL_BASES",
|
|
38
|
+
"HEL_LOADING_TYPES",
|
|
39
|
+
"HelLoadError",
|
|
40
|
+
"assertHelExports",
|
|
41
|
+
"bindReactRuntime",
|
|
42
|
+
"bindVueRuntime",
|
|
43
|
+
"createHelComponentResource",
|
|
44
|
+
"createHelLoader",
|
|
45
|
+
"exposeLib",
|
|
46
|
+
"getLib",
|
|
47
|
+
"isHelMetaHost",
|
|
48
|
+
"loadCdnResources",
|
|
49
|
+
"loadHelComponent",
|
|
50
|
+
"loadHelLib",
|
|
51
|
+
"loadHelLibsSerial",
|
|
52
|
+
"preloadHelLibs",
|
|
53
|
+
"resolveHelDep",
|
|
54
|
+
"resolveHelDeps",
|
|
55
|
+
"resolveHelHost",
|
|
56
|
+
"showHelLoading"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"@melt-js/libs-core/demo": {
|
|
60
|
+
"specifier": "@melt-js/libs-core/demo",
|
|
61
|
+
"esm": "dist/demo/browser.mjs",
|
|
62
|
+
"umd": "dist/cdn/demo.umd.cjs",
|
|
63
|
+
"exports": [
|
|
64
|
+
"DOWNLOAD_FORMATS",
|
|
65
|
+
"DOWNLOAD_HINT",
|
|
66
|
+
"EXAMPLE_HINT",
|
|
67
|
+
"bindReactRuntime",
|
|
68
|
+
"bindVueRuntime",
|
|
69
|
+
"buildComponentDocs",
|
|
70
|
+
"buildDownloadFile",
|
|
71
|
+
"componentEmitNames",
|
|
72
|
+
"componentEvents",
|
|
73
|
+
"componentModels",
|
|
74
|
+
"componentOptions",
|
|
75
|
+
"componentPropNames",
|
|
76
|
+
"copyTextToClipboard",
|
|
77
|
+
"createDemoFullscreen",
|
|
78
|
+
"createDemoTabsController",
|
|
79
|
+
"createDownloadController",
|
|
80
|
+
"createSplitPaneController",
|
|
81
|
+
"defaultModelEvent",
|
|
82
|
+
"fallbackModels",
|
|
83
|
+
"getDownloadFormatHint",
|
|
84
|
+
"highlightCode",
|
|
85
|
+
"isSameValue",
|
|
86
|
+
"loadStandaloneLibrary",
|
|
87
|
+
"mountStandaloneExample",
|
|
88
|
+
"normalizeModel",
|
|
89
|
+
"normalizeModels",
|
|
90
|
+
"resolveModels",
|
|
91
|
+
"schemaModels",
|
|
92
|
+
"setupDemoRemoteDebug"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"@melt-js/libs-core/demo/browser": {
|
|
96
|
+
"specifier": "@melt-js/libs-core/demo/browser",
|
|
97
|
+
"esm": "dist/demo/browser.mjs",
|
|
98
|
+
"umd": "dist/cdn/demo-browser.umd.cjs",
|
|
99
|
+
"exports": [
|
|
100
|
+
"DOWNLOAD_FORMATS",
|
|
101
|
+
"DOWNLOAD_HINT",
|
|
102
|
+
"EXAMPLE_HINT",
|
|
103
|
+
"bindReactRuntime",
|
|
104
|
+
"bindVueRuntime",
|
|
105
|
+
"buildComponentDocs",
|
|
106
|
+
"buildDownloadFile",
|
|
107
|
+
"componentEmitNames",
|
|
108
|
+
"componentEvents",
|
|
109
|
+
"componentModels",
|
|
110
|
+
"componentOptions",
|
|
111
|
+
"componentPropNames",
|
|
112
|
+
"copyTextToClipboard",
|
|
113
|
+
"createDemoFullscreen",
|
|
114
|
+
"createDemoTabsController",
|
|
115
|
+
"createDownloadController",
|
|
116
|
+
"createSplitPaneController",
|
|
117
|
+
"defaultModelEvent",
|
|
118
|
+
"fallbackModels",
|
|
119
|
+
"getDownloadFormatHint",
|
|
120
|
+
"highlightCode",
|
|
121
|
+
"isSameValue",
|
|
122
|
+
"loadStandaloneLibrary",
|
|
123
|
+
"mountStandaloneExample",
|
|
124
|
+
"normalizeModel",
|
|
125
|
+
"normalizeModels",
|
|
126
|
+
"resolveModels",
|
|
127
|
+
"schemaModels",
|
|
128
|
+
"setupDemoRemoteDebug"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"resources": [],
|
|
133
|
+
"imports": {
|
|
134
|
+
"@melt-js/libs-core": "https://unpkg.com/@melt-js/libs-core@2026.11.16-2/dist/browser.mjs",
|
|
135
|
+
"@melt-js/libs-core/browser": "https://unpkg.com/@melt-js/libs-core@2026.11.16-2/dist/browser.mjs",
|
|
136
|
+
"@melt-js/libs-core/demo": "https://unpkg.com/@melt-js/libs-core@2026.11.16-2/dist/demo/browser.mjs",
|
|
137
|
+
"@melt-js/libs-core/demo/browser": "https://unpkg.com/@melt-js/libs-core@2026.11.16-2/dist/demo/browser.mjs"
|
|
138
|
+
},
|
|
139
|
+
"styles": [],
|
|
140
|
+
"vendor": "dist/cdn/vendor.umd.cjs"
|
|
141
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(function(Ne,Ue){typeof exports=="object"&&typeof module<"u"?Ue(exports):typeof define=="function"&&define.amd?define(["exports"],Ue):(Ne=typeof globalThis<"u"?globalThis:Ne||self,Ue((Ne.MeltCdnVendors=Ne.MeltCdnVendors||{},Ne.MeltCdnVendors["@melt-js/libs-core"]={})))})(this,(function(Ne){"use strict";var Ue=Object.defineProperty,ia=(t,e)=>{for(var r in e)Ue(t,r,{get:e[r],enumerable:!0})},mr={};ia(mr,{bindReactRuntime:()=>wn,bindVueRuntime:()=>On,default:()=>ii,exposeLib:()=>si,getLib:()=>ui});var sa=Object.create,hr=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,ca=Object.getOwnPropertyNames,la=Object.getPrototypeOf,pa=Object.prototype.hasOwnProperty,gr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fa=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ca(e))!pa.call(t,i)&&i!==r&&hr(t,i,{get:()=>e[i],enumerable:!(n=ua(e,i))||n.enumerable});return t},$e=(t,e,r)=>(r=t!=null?sa(la(t)):{},fa(!t||!t.__esModule?hr(r,"default",{value:t,enumerable:!0}):r,t)),gt=gr(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(a,s){(s==null||s>a.length)&&(s=a.length);for(var u=0,p=Array(s);u<s;u++)p[u]=a[u];return p}function r(a){if(Array.isArray(a))return a}function n(a){if(Array.isArray(a))return e(a)}function i(a,s){var u=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!u){if(Array.isArray(a)||(u=N(a))||s){u&&(a=u);var p=0,v=function(){};return{s:v,n:function(){return p>=a.length?{done:!0}:{done:!1,value:a[p++]}},e:function(E){throw E},f:v}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y,A=!0,S=!1;return{s:function(){u=u.call(a)},n:function(){var E=u.next();return A=E.done,E},e:function(E){S=!0,y=E},f:function(){try{A||u.return==null||u.return()}finally{if(S)throw y}}}}function o(a,s,u){return(s=I(s))in a?Object.defineProperty(a,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[s]=u,a}function l(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function c(a,s){var u=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(u!=null){var p,v,y,A,S=[],E=!0,O=!1;try{if(y=(u=u.call(a)).next,s===0){if(Object(u)!==u)return;E=!1}else for(;!(E=(p=y.call(u)).done)&&(S.push(p.value),S.length!==s);E=!0);}catch(k){O=!0,v=k}finally{try{if(!E&&u.return!=null&&(A=u.return(),Object(A)!==A))return}finally{if(O)throw v}}return S}}function f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(a,s){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(a);s&&(p=p.filter(function(v){return Object.getOwnPropertyDescriptor(a,v).enumerable})),u.push.apply(u,p)}return u}function g(a){for(var s=1;s<arguments.length;s++){var u=arguments[s]!=null?arguments[s]:{};s%2?h(Object(u),!0).forEach(function(p){o(a,p,u[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):h(Object(u)).forEach(function(p){Object.defineProperty(a,p,Object.getOwnPropertyDescriptor(u,p))})}return a}function b(a,s){return r(a)||c(a,s)||N(a,s)||f()}function _(a){return n(a)||l(a)||N(a)||d()}function L(a,s){if(typeof a!="object"||!a)return a;var u=a[Symbol.toPrimitive];if(u!==void 0){var p=u.call(a,s);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function I(a){var s=L(a,"string");return typeof s=="symbol"?s:s+""}function T(a){"@babel/helpers - typeof";return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},T(a)}function N(a,s){if(a){if(typeof a=="string")return e(a,s);var u={}.toString.call(a).slice(8,-1);return u==="Object"&&a.constructor&&(u=a.constructor.name),u==="Map"||u==="Set"?Array.from(a):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?e(a,s):void 0}}var P=null;function D(){if(typeof window<"u"){P=window;return}if(typeof global<"u"){P=global;return}throw new Error("unable to locate global object")}function C(){return P||D(),P}function F(a){var s,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=null;(s=P)!==null&&s!==void 0&&s.__HEL_MICRO_SHARED__&&(p=P.__HEL_MICRO_SHARED__),u?P=g(g({},P),a):P=a,p&&(P.__HEL_MICRO_SHARED__=p)}function M(){return C()}function w(){var a=C();return a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver}function U(a,s){for(var u=null,p=a.length,v=0;v<p;v++){var y=a[v];if(y.tagName===s){u=y;break}}return u}function Q(a){return Object.keys(a)}function $(){var a=function(p){var v=p||{},y=v.search||"";if(!y){var A=v.hash||"",S=A.split("?")[1]||"";S&&(y="?".concat(S))}return y};try{var s;return a((s=C())===null||s===void 0||(s=s.top)===null||s===void 0?void 0:s.location)}catch{var u;return a((u=C())===null||u===void 0?void 0:u.location)}}function z(a){var s,u=(s=C())===null||s===void 0?void 0:s.localStorage;return u?.getItem(a)}function Z(a,s){var u,p=(u=C())===null||u===void 0?void 0:u.localStorage;return p?.setItem(a,s)}function ne(){var a=$(),s={};if(a!=null&&a.startsWith("?")){var u=a.substring(1),p=u.split("&");p.forEach(function(v){var y=v.split("="),A=b(y,2),S=A[0],E=A[1];s[S]=E})}return s}function W(){var a="";try{throw new Error("getJsRunLocation")}catch(p){var s=p.stack.split(`
|
|
5
|
+
`),u=s.length;a=s[u-1]||s[u-2]||""}return a}function x(a,s,u,p){var v=B(a,s);v[u]=p}function B(a,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=a[s];return p||(p=u,a[s]=p),p}function ee(a,s){Object.keys(s).forEach(function(u){var p=s[u];[null,void 0,""].includes(p)||(a[u]=p)})}function V(a,s){a.includes(s)||a.push(s)}function G(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.nullValues,p=u===void 0?[null,void 0,""]:u,v=s.emptyObjIsNull,y=v===void 0?!0:v,A=s.emptyArrIsNull,S=A===void 0?!0:A,E=p.includes(a);if(E)return!0;if(Array.isArray(a))return S?a.length===0:!1;if(T(a)==="object"){var O=Q(a),k=O.length;return y?k===0:!1}return!1}function X(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return s}function q(a,s){return Object.prototype.hasOwnProperty.call(a,s)}function te(){var a=C();return a.process&&a.global&&!a.document}function re(a,s,u){if(a&&typeof a!="string")return a;try{var p=JSON.parse(a);return p||s}catch(v){if(s!==void 0)return s;throw u?new Error(u):v}}var ue=G,pe=V,fe=Q;function ve(a,s){var u=[];return a.forEach(function(p){return pe(u,p)}),s.forEach(function(p){return pe(u,p)}),u}function ye(a,s){var u=s||function(v){return!ue(v)},p={};return fe(a).forEach(function(v){u(a[v])&&(p[v]=a[v])}),p}function Ee(a,s,u){var p=u,v=i(a),y;try{for(v.s();!(y=v.n()).done;){var A=y.value,S=A[s];if(![null,void 0,""].includes(S)){p=S;break}}}catch(E){v.e(E)}finally{v.f()}return p}function _e(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"MULTI",u=a.split(`
|
|
6
|
+
`),p=u.length-1,v=u.map(function(y,A){var S;if(!y&&(A===0||A===p))return"";var E=function(k,K){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",J=k;return k.endsWith("<br/>")?(J=k.substring(0,J.length-5),"".concat(J).concat(K)):"".concat(J).concat(Y)},O=((S=y.trimStart)===null||S===void 0?void 0:S.call(y))||y;return s==="MULTI"?"".concat(E(O,""),`
|
|
7
|
+
`):(O=E(O,`
|
|
8
|
+
`," "),O)}).join("");return v}function xn(a){return _e(a,"ONE")}function ci(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=C(),p=xn(a),v=u.alert||X;if(s){var y;!((y=u.location)===null||y===void 0)&&y.port&&v(p);return}v(p)}function Le(a,s,u){a.dataset?a.dataset[s]=u:a.setAttribute("data-".concat(s),u)}function ct(a){Le(a,"heldisabled","1"),a.disabled=!0}var li=Object.freeze({__proto__:null,noop:X,hasProp:q,isServer:te,safeParse:re,isNull:ue,noDupPush:pe,okeys:fe,merge2List:ve,purify:ye,getObjsVal:Ee,pfstr:_e,nbstr:xn,nbalert:ci,setDataset:Le,disableNode:ct});function pi(a,s){var u=this,p=s.fn,v=s.fnName,y=s.arg1PlatObjFnKeys,A=y.includes(v);return function(){for(var S=function(J){return g({platform:a},ye(J||{}))},E=arguments.length,O=new Array(E),k=0;k<E;k++)O[k]=arguments[k];var K=O[0],Y=O[1];return A?O[0]=S(K):O[1]=S(Y),p.apply(u,O)}}function Mn(a,s,u){var p=u||{},v=p.ignoreKeys,y=v===void 0?[]:v,A=p.arg1PlatObjFnKeys,S=A===void 0?[]:A,E={};return Object.keys(s).forEach(function(O){var k=s[O];if(y.includes(O)){E[O]=k;return}var K=T(k);if(K&&K==="object"){E[O]=Mn(a,k,u);return}if(K==="function"){E[O]=pi(a,{arg1PlatObjFnKeys:S,fn:k,fnName:O});return}E[O]=k}),E}var fi="hel",Rn="unpkg",Zt={NONE:0,LOG:1,TRACE:2},ae="__default_online_ver__",jn=Rn,ie={CORE_VER:"4.13.1",DEFAULT_API_PREFIX:"https://unpkg.com",DEFAULT_API_URL:"/openapi/v1/app/info",DEFAULT_ONLINE_VER:ae,DEFAULT_USER_LS_KEY:"HelUserRtxName",DEFAULT_PLAT:jn,LS_LOG_MODE:"HelConfig.logMode",LS_LOG_FILTER:"HelConfig.logFilter",PLAT_HEL:fi,PLAT_UNPKG:Rn,KEY_CSS_STR:"CSS_STR",KEY_ASSET_CTX:"ASSET_CTX",KEY_STYLE_TAG_ADDED:"STYLE_TAG_ADDED",KEY_CSS_LINK_TAG_ADDED:"CSS_LINK_TAG_ADDED",KEY_IGNORE_CSS_PREFIX_LIST:"IGNORE_CSS_PREFIX_LIST",KEY_IGNORE_STYLE_TAG_KEY:"IGNORE_STYLE_TAG_KEY",KEY_IGNORE_CSS_PREFIX_2_KEYS:"IGNORE_CSS_PREFIX_2_KEYS"},Ye={SUB_APP_LOADED:"subAppLoaded",SUB_LIB_LOADED:"SubLibLoaded",STYLE_STR_FETCHED:"StyleStrFetched",STYLE_TAG_ADDED:"StyleTagAdded",CSS_LINK_TAG_ADDED:"CssLinkTagAdded"},We={NOT_LOAD:0,LOADING:1,LOADED:2},Gn=ie.LS_LOG_FILTER,kn=ie.LS_LOG_MODE,Xe=Zt.NONE,Fn=Zt.LOG,di=Zt.TRACE,Te={isIncludeFilter:function(a,s){if(!s.includes(","))return a.includes(s);var u=s.split(",");return u.some(function(p){return a.includes(p)})},getLogFilter:function(){return De().logFilter},setLogFilter:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;De().logFilter=a,s&&Z(Gn,a)},setLogMode:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=parseInt(a,10);[Xe,Fn,di].includes(u)&&(De().logMode=u,s&&Z(kn,u))},getLogMode:function(){return De().logMode}},Ce={};function vi(){if(!De().isInit){De().isInit=!0;var a=ne(),s=a.hellog,u=a.hellogf,p=s||z(kn)||Xe;Te.setLogMode(p,!1);var v=u||z(Gn)||"";Te.setLogFilter(v,!1)}}function mi(){return{logMode:Xe,logFilter:"",isInit:!1}}function hi(){if(Ce=M().__HEL_MICRO_DEBUG__,!G(Ce)){Ce.logMode===void 0&&(Ce.logMode=Xe,Ce.logFilter="");return}Ce=mi(),M().__HEL_MICRO_DEBUG__=Ce;try{vi()}catch{}}function lt(){return Te.getLogMode()!==Xe}function De(){return Ce}var Un=" %c--> HEL LOG:",Bn="color:#ad4e00;font-weight:600";function de(){if(lt()){for(var a=Te.getLogMode()===Fn?console.log:console.trace||console.log,s=arguments.length,u=new Array(s),p=0;p<s;p++)u[p]=arguments[p];var v=u[0],y=u.slice(1);if(typeof v!="string")return a.apply(void 0,[Un,Bn].concat(u));var A=Te.getLogFilter(),S=["".concat(Un," ").concat(v),Bn].concat(_(y));if(A){Te.isIncludeFilter(v,A)&&a.apply(void 0,_(S));return}a.apply(void 0,_(S))}}var Je={};function gi(a){!lt()||Je[a]||(Je[a]=Date.now())}function $t(a,s,u){if(!(!lt()||!Je[a])){var p=Je[a];de("[[ PerfCheck ]] (".concat(a,"/").concat(s,") costs ").concat(Date.now()-p," ms")),u&&Hn(a)}}function Hn(a){Je[a]=0}var bi=ie.DEFAULT_API_URL,yi=ie.DEFAULT_USER_LS_KEY,er=ie.PLAT_HEL,Kn=ie.PLAT_UNPKG,Ai=ie.DEFAULT_API_PREFIX,_i=ie.CORE_VER,Si=ie.KEY_CSS_LINK_TAG_ADDED,Ei=ie.KEY_STYLE_TAG_ADDED,Yn=ie.KEY_IGNORE_CSS_PREFIX_LIST,Li=ie.KEY_IGNORE_STYLE_TAG_KEY,Ii=ie.KEY_IGNORE_CSS_PREFIX_2_KEYS;function tr(a){var s=a||{},u=s.apiPrefix;return{apiMode:"get",apiPrefix:u,apiSuffix:"",apiPathOfApp:bi,apiPathOfAppVersion:"",getSubAppAndItsVersionFn:null,customMetaUrl:"",customMetaJsonpUrl:"",getMeta:null,onFetchMetaFailed:null,strictMatchVer:!0,getUserName:null,userLsKey:yi,shouldUseGray:null,trustAppNames:null,semverApi:null,hook:{}}}function rr(a){var s=g(g({isConfigOverwrite:!1,platform:a,appName2Comp:{},appName2Lib:{},appName2isLibAssigned:{},appName2EmitApp:{},appName2verLoadStatus:{},appName2verEmitLib:{},appName2verEmitApp:{},appName2verStyleStr:{},appName2verStyleFetched:{},appName2verExtraCssList:{},appName2verAppVersion:{},appName2verCustomData:{},appName2app:{},appName2appVersion:{},appName2styleStr:{},appGroupName2firstVer:{},isOriginInitCalled:!1},tr()),{},{origin:tr({apiPrefix:Ai})});return s}function nr(){var a={};return{on:function(s,u){var p=a[s];if(!p){var v=[];a[s]=v,p=v}p.push(u)},emit:function(s){for(var u=arguments.length,p=new Array(u>1?u-1:0),v=1;v<u;v++)p[v-1]=arguments[v];var y=a[s];if(y){var A=y.slice();A.forEach(function(S){return S.apply(void 0,p)})}},off:function(s,u){var p=a[s];if(p)for(var v=0,y=p.length;v<y;v++){var A=p[v];if(A===u){p.splice(v,1);break}}}}}function Ti(){var a=rr(Kn),s=rr(er),u={platform:er,platformHint:"the platform value here does not make any sense!",appName2platform:{},appGroupName2platform:{},caches:o(o({},Kn,a),er,s),common:{}},p=nr(),v=nr();return{ver:_i,isStyleObInit:!1,nativeHeadAppend:null,nativeBodyAppend:null,patchedHeadAppend:null,patchedBodyAppend:null,createFeature:W(),eventBus:p,userEventBus:v,cacheRoot:u,unpkgCache:a,helCache:s,dev:{setLogMode:Te.setLogMode,setLogFilter:Te.setLogFilter}}}function Wn(a){var s=[Si,Ei,Yn,Li,Ii],u=function(p){return p===Yn?[]:{}};s.forEach(function(p){return B(a,p,u(p))})}function Ci(){var a=Ve();if(a){var s=a.cacheRoot;B(s,"appGroupName2platform"),B(s,"common");var u=s.caches;Object.keys(u).forEach(function(p){var v=u[p];B(v,"appGroupName2firstVer"),B(v,"appName2isLibAssigned"),B(v,"appName2verExtraCssList"),B(v,"appName2verCustomData"),B(v,"hook"),B(v,"origin",tr()),B(v.origin,"hook")}),Wn(s.common),a.userEventBus||(a.userEventBus=nr());return}a=Ti(),Wn(a.cacheRoot.common),M().__HEL_MICRO_SHARED__=a}function Ve(){var a=M().__HEL_MICRO_SHARED__;return a}function pt(){return jn}function oe(a){var s=a||pt(),u=xe(),p=u.caches[s];if(!p){var v=T(a);if(v!=="string")throw console.error("invalid plaform:",a),new Error("fatal error: platform only can be a string, now it is ".concat(v));var y=rr(a);u.caches[s]=y,p=y}return p}function xe(){return Ve().cacheRoot}var Ie={getCustomData:function(a,s,u){var p=u.versionId,v=u.platform,y=oe(v),A=y.appName2verCustomData,S=B(A,a),E=B(S,s);return E[p||ae]},getAppMeta:function(a,s){var u=oe(s),p=u.appName2app;return p[a]},setVerLoadStatus:function(a,s,u,p){var v=p||{},y=v.versionId,A=v.platform,S=oe(A)[u],E=y||ae;x(S,a,E,s)},getVerLoadStatus:function(a,s,u){var p,v=u||{},y=v.versionId,A=v.platform,S=oe(A)[s],E=y||ae;return((p=S[a])===null||p===void 0?void 0:p[E])||We.NOT_LOAD},ensureOnlineModule:function(a,s,u){if(!a[ae]){var p=Ie.getAppMeta(s,u),v=a[p?.online_version];v&&(a[ae]=v)}}};function Pi(a,s){var u,p=s||{},v=p.versionId,y=p.platform,A=oe(y),S=A.appName2verEmitApp,E=A.appName2Comp,O=A.strictMatchVer,k=A.appName2EmitApp,K=(u=p.strictMatchVer)!==null&&u!==void 0?u:O,Y=B(S,a);Ie.ensureOnlineModule(Y,a,y);var J=v||ae,se=Y[J],ce=E[a],le=ce?{Comp:ce}:null,me=K?null:k[a]||le,Pe=se||me||null;return de("[[ core:getVerApp ]] appName,options,result:",a,p,Pe),Pe}function Xn(a,s){de("[[ core:setEmitApp ]] appName,emitApp:",a,s);var u=s.versionId,p=s.platform,v=oe(p),y=v.appName2verEmitApp,A=v.appName2Comp,S=v.appName2EmitApp,E=B(y,a);E[ae]||(A[a]=s.Comp,S[a]=s,x(y,a,ae,s)),u&&x(y,a,u,s)}var Jn=ie.KEY_CSS_LINK_TAG_ADDED,ar=ie.KEY_STYLE_TAG_ADDED,qn=ie.KEY_IGNORE_CSS_PREFIX_LIST,Ni=ie.KEY_IGNORE_STYLE_TAG_KEY,or=ie.KEY_IGNORE_CSS_PREFIX_2_KEYS;function zn(a){var s=xe(),u=s.common,p=B(u,a);return p}function ft(a){var s=xe(),u=s.common;return u[a]}function qe(a,s){var u=zn(a),p=u[s];return p!==void 0?p:null}function ze(a,s,u){var p=zn(a);p[s]=u}var he={setIgnoreCssPrefix:function(a){var s=ft(qn);V(s,a)},setIgnoreStyleTagKey:function(a){var s=he.getIgnoreStyleTagMap();s[a]=1},getIgnoreStyleTagMap:function(){var a=ft(Ni);return a},setIgnoreCssPrefixKey:function(a,s){var u=qe(or,a);u||(u=[],ze(or,a,u)),V(u,s)},getIgnoreCssPrefixKeys:function(a){var s=ft(or);return s[a]||[]},getMatchedIgnoreCssPrefix:function(a){for(var s=ft(qn),u="",p=0;p<s.length;p++){var v=s[p];if(a.startsWith(v)){u=v;break}}return u},getIgnoreCssPrefixCssUrlList:function(a){var s=qe(Jn,a);return s||(s=[],ze(Jn,a,s)),s},setIgnoreCssPrefixCssUrl:function(a,s){var u=he.getIgnoreCssPrefixCssUrlList(a);u.push(s)},getStyleTagText:function(a){var s=qe(ar,a)||"";return s},clearStyleTagText:function(a){ze(ar,a,"")},appendStyleTagText:function(a,s){var u=he.getStyleTagText(a);ze(ar,a,"".concat(u," ").concat(s))}};function ir(a,s){var u=a.apiMode,p=a.apiPrefix,v=a.apiSuffix,y=a.apiPathOfApp,A=a.apiPathOfAppVersion,S=a.getSubAppAndItsVersionFn,E=a.onFetchMetaFailed,O=a.strictMatchVer,k=a.getUserName,K=a.userLsKey,Y=a.shouldUseGray,J=a.getApiPrefix,se=a.trustAppNames,ce=a.platform,le=a.origin,me=a.hook,Pe=a.customMetaUrl,Ze=a.customMetaJsonpUrl,mt=a.getMeta,ht={apiMode:u,apiPrefix:p,apiSuffix:v,apiPathOfApp:y,apiPathOfAppVersion:A,getSubAppAndItsVersionFn:S,onFetchMetaFailed:E,strictMatchVer:O,getUserName:k,userLsKey:K,shouldUseGray:Y,getApiPrefix:J,trustAppNames:se,hook:me,platform:ce,customMetaUrl:Pe,customMetaJsonpUrl:Ze,getMeta:mt};return s&&(ht.origin=le),ht}function Oi(a){var s=oe(a);return ir(s,!0)}function wi(a){var s=Ve(),u=s.nativeHeadAppend,p=s.nativeBodyAppend,v=a.headAppend||null,y=a.bodyAppend||null,A=function(S){return"pass same ".concat(S," handle, hel will ignore it for avlid 'Maximum call stack size exceeded'")};v&&v===u?console.error(A("headAppend")):s.patchedHeadAppend=v,y&&y===p?console.error(A("bodyAppend")):s.patchedBodyAppend=y}function Di(a,s){var u=oe(s),p=ir(a);u.isConfigOverwrite||(u.isConfigOverwrite=!0,ee(u,p))}function Vi(a,s){var u=oe(a),p="[[ core:originInit ]] invalid call, it can only been called";if(u.isConfigOverwrite){de("".concat(p," before init"));return}if(u.isOriginInitCalled){de("".concat(p," one time"));return}var v=ir(s);u.isOriginInitCalled=!0,ee(u.origin,v)}function dt(a){return xe().appGroupName2platform[a]||pt()}function xi(a,s,u){var p=xe().appGroupName2platform;return(u||!p[a])&&(p[a]=s),dt(a)}function sr(a){return xe().appName2platform[a]||pt()}function Mi(a,s,u){var p=xe().appName2platform;return(u||!p[a])&&(p[a]=s),sr(a)}function Qn(a,s){var u=s.customKey,p=s.platform,v=p===void 0?sr(a):p,y=oe(v),A=y.appName2verCustomData,S=B(A,a),E=B(S,u);return E}function Ri(a,s){var u=Qn(a,s),p=u[s.versionId||ae];return p!==void 0?p:null}function ji(a,s){var u=s.customValue,p=s.versionId,v=Qn(a,s);v[p||ae]=u,v[ae]||(v[ae]=u)}var Gi=Ye.STYLE_TAG_ADDED,ki=Ye.CSS_LINK_TAG_ADDED;function Fe(){return Ve().eventBus}function Fi(){return Ve().userEventBus}var vt={styleTagAdded:function(a){return"".concat(Gi,"/").concat(a)},cssLinkTagAdded:function(a){return"".concat(ki,"(").concat(a,")")}};function Ui(a,s){var u,p=s||{},v=p.versionId,y=p.platform,A=oe(y),S=A.appName2verEmitLib,E=A.appName2Lib,O=A.strictMatchVer,k=A.appName2isLibAssigned,K=(u=p.strictMatchVer)!==null&&u!==void 0?u:O,Y=B(S,a);Ie.ensureOnlineModule(Y,a);var J=v||ae,se=Y[J],ce=k[a]?E[a]:null,le=K?null:ce,me=se||le||null;return de("[[ core:getVerLib ]] appName,options,result:",a,p,me),me}function Zn(a,s,u){var p=u||{},v=p.appGroupName,y=s.versionId,A=s.appProperties,S=s.platform||u.platform,E=oe(S),O=E.appName2verEmitLib,k=E.appName2Lib,K=E.appName2isLibAssigned,Y=Ie.getAppMeta(a,S),J=function(ce){var le=k[ce];le?T(le)==="object"&&Object.keys(le).length===0&&Object.assign(le,A):k[ce]=A,K[ce]=!0};J(a),v?J(v):Y&&J(Y.app_group_name),de("[[ core:setEmitLib ]] appMeta:",Y);var se=B(O,a);se[ae]||x(O,a,ae,A),y&&x(O,a,y,A)}function $n(a,s){var u=oe(s),p=u.appName2app;return p[a]}function Bi(a,s){var u=oe(s),p=u.appName2app;p[a.name]=a}function ur(a,s,u){Ie.setVerLoadStatus(a,s,"appName2verLoadStatus",u)}function Hi(a,s){return Ie.getVerLoadStatus(a,"appName2verLoadStatus",s)}function Ki(a,s,u){Ie.setVerLoadStatus(a,s,"appName2verStyleFetched",u)}function Yi(a,s){return Ie.getVerLoadStatus(a,"appName2verStyleFetched",s)}function Wi(a,s){var u,p=s||{},v=p.platform,y=p.versionId,A=oe(v),S=A.appName2verStyleStr,E=A.appName2styleStr,O=E[a]||"";return y?((u=S[a])===null||u===void 0?void 0:u[y])||O||"":O}function Xi(a,s,u){var p=u||{},v=p.platform,y=p.versionId,A=oe(v),S=A.appName2verStyleStr,E=A.appName2verStyleFetched,O=A.appName2styleStr;if(!y){O[a]=s;return}x(S,a,y,s),x(E,a,y,We.LOADED)}function Ji(a,s,u){var p=u||{},v=p.versionId,y=p.platform,A=oe(y),S=A.appName2verExtraCssList;de("[[ core:setVerExtraCssList ]] cssList:",s);var E=B(S,a);E[ae]||x(S,a,ae,s),v&&x(S,a,v,s)}function qi(a,s){var u=s||{},p=u.versionId,v=u.platform,y=oe(v),A=y.appName2verExtraCssList,S=B(A,a),E=S[p]||S[ae]||[];return de("[[ core:getVerExtraCssList ]] options,cssList:",u,E),E}function zi(a,s){var u,p=s||{},v=p.platform,y=p.versionId,A=oe(v),S=A.appName2verAppVersion,E=A.appName2appVersion,O=E[a]||null;return y&&((u=S[a])===null||u===void 0?void 0:u[y])||O}function Qi(a,s,u){var p=u||{},v=p.platform,y=oe(v),A=y.appName2verAppVersion,S=y.appGroupName2firstVer,E=y.appName2appVersion,O=s.version_tag||s.sub_app_version;if(O){var k=Ie.getAppMeta(a,v),K=B(A,a);K[ae]||(x(A,a,ae,s),E[a]=s),x(A,a,O,s),S[k.app_group_name]=s.sub_app_version}}function Qe(a,s){var u=a.split("@"),p=u.slice(1),v=p.join("@");return v||s||a}function ea(a){return a==="js"||a==="mjs"}function cr(a,s){var u=W();de("[[ core:tryGetVersion ]] may include ver source > ".concat(u));var p=oe(s),v=p.appGroupName2firstVer,y=v[a]||"";if(u.includes("https://")||u.includes("http://")){var A=u.split("//"),S=b(A,2),E=S[1],O=E.split("/");if(y){var k=E.includes("/".concat(y,"/"));if(k){var K=y.startsWith("@");if(K){var Y=y.split("/")[1]||"";return Qe(Y)}else{var J=O.indexOf(y),se=O[J-1],ce=se.startsWith("@");if(!ce)return Qe(y)}}var le=O[1],me=O[2];if(le==="static"&&ea(me)||ea(le))return Qe(y)}var Pe=E.indexOf("@");if(Pe>=0){var Ze=O.filter(function(vr){return vr.includes("@")}),mt=Ze.findIndex(function(vr){return vr.startsWith("@")});if(mt>=0){var ht=Ze[mt+1]||"";return Qe(ht,y)}var cu=Ze[0]||"";return Qe(cu,y)}var lu=E.split("/".concat(s,"/")),pu=b(lu,2),oa=pu[1],fu=oa===void 0?"":oa,du=fu.split("/"),vu=b(du,1),mu=vu[0];return mu||y}return y}function lr(a,s){if(a===ae)return s||"";if(a.includes("_")){var u=a.substring(0,a.length-15);return u}return s||""}var pr=!1,fr=!1;function Zi(a){if(a&&(pr=!1,fr=!1),!fr){fr=!0;var s=C();s.__MASTER_APP_LOADED__===void 0&&(s.__MASTER_APP_LOADED__=!0,pr=!0)}}function $i(){var a=`WARNING: calling isSubApp is unsafe, use hel-iso.isSubApp instead,
|
|
9
|
+
`;return a+="more details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp",console.log("%c".concat(a),"color:red;"),!pr}function es(a,s){var u=s.platform,p=s.groupName,v=s.name,y=s.ver,A=s.elName;Le(a,"el",A),Le(a,"plat",u),Le(a,"gname",p),Le(a,"name",v),Le(a,"ver",y)}var ts=ie.KEY_ASSET_CTX;function dr(a,s){if(!s||!["LINK","SCRIPT"].includes(s.tagName))return a(s);var u=s.href,p=s.tagName,v=s.src,y=u||v||"",A=p==="LINK",S=qe(ts,y)||{},E=S.platform,O=S.groupName,k=S.name,K=S.ver,Y=S.beforeAppend,J=s;if(Y){var se=A?"href":"src",ce=s.getAttribute(se),le=function(Pe){return s.setAttribute(se,Pe)};J=Y({el:s,nativeAppend:a,setAssetUrl:le,url:ce,tagName:p})||s}var me=A?"HelLink":"HelScript";return E&&es(J,{platform:E,groupName:O,name:k,ver:K,elName:me}),a(J)}function rs(){var a=C();if(!(a.__POWERED_BY_QIANKUN__||a.__DISABLE_HEL_MONKEY_PATCH__)){var s=Ve(),u=a.document,p=s.nativeHeadAppend,v=s.nativeBodyAppend;if(!(p||!u)){var y=u.head,A=u.body;if(p=y.appendChild.bind(y),s.nativeHeadAppend=p,A)v=A.appendChild.bind(A),s.nativeBodyAppend=v;else{var S=w(),E=new S(function(K){for(var Y,J=0;J<K.length;J++){var se=K[J].addedNodes;if(Y=U(se,"BODY"),Y)break}Y&&(v=Y.appendChild.bind(Y),s.nativeBodyAppend=v,Y.appendChild=function(ce){return dr(k(v,Y,"body"),ce)},E.disconnect())}),O=U(u.childNodes,"HTML");O&&E.observe(O,{childList:!0})}var k=function(K,Y,J){var se=s.patchedHeadAppend,ce=s.patchedBodyAppend,le=J==="head";if(se&&le)return se;if(ce&&!le)return ce;if(a.__POWERED_BY_WUJIE__)return K;var me=a.Element;return me?me.prototype.appendChild.bind(Y):K};y.appendChild=function(K){return dr(k(p,y,"head"),K)},A&&(A.appendChild=function(K){return dr(k(v,A,"body"),K)})}}}var ta="preFetch";function ns(a,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=u.platform||dt(a),v=u.versionId||cr(a,p),y=u.appName||lr(v,a);de("[[ core:libReady ]] appGroupName ".concat(a,", appName ").concat(y,", versionId ").concat(v));var A=$n(y,p);A!=null&&A.__fromCust&&(v=u.versionId||A.online_version,y=A.name,de("[[ core:libReady ]] fromCust, appGroupName ".concat(a,", appName ").concat(y,", versionId ").concat(v)));var S={platform:p,appName:y,appGroupName:a,versionId:v,appProperties:s,Comp:function(){},lifecycle:{}};Zn(y,S,{appGroupName:a,platform:p}),ur(y,We.LOADED,{versionId:v,platform:p});var E=Fe();$t(ta,"libReady"),E.emit(Ye.SUB_LIB_LOADED,S)}function as(a,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=u.lifecycle,v=u.platform||dt(a),y=u.versionId||cr(a,v),A=u.appName||lr(y,a),S={Comp:s,appName:A,appGroupName:a,lifecycle:p,platform:v,versionId:y,isLib:!1};Xn(A,S),ur(A,We.LOADED,{versionId:y,platform:v});var E=Fe();$t(ta,"appReady"),E.emit(Ye.SUB_APP_LOADED,S)}var ra="/* @helstart ",os=" @helend */",is=ra.length;function ss(a,s){var u=Fe(),p=he.getMatchedIgnoreCssPrefix(s);return p&&(he.setIgnoreCssPrefixCssUrl(p,s),u.emit(vt.cssLinkTagAdded(p),{nodes:[a]})),p}function us(a){var s=C();if(s){var u=s.document.head.querySelectorAll('style[data-gname="'.concat(a,'"]'));if(u.length){he.clearStyleTagText(a),u.forEach(function(v){ct(v),he.appendStyleTagText(a,v.innerText)});var p=Fe();p.emit(vt.styleTagAdded(a),{nodes:u})}}}function cs(a,s){var u=a.tagName,p=a.innerText,v=a.href;if(["STYLE","LINK"].includes(u)){if(u==="STYLE"){if(!p)return;var y=p.indexOf(ra);if(y<0)return;var A=p.indexOf(os);if(A<0)return;var S=p.substring(is+y,A);if(S){var E=S.trim(),O="",k=E;if(E.includes("/")){var K=E.split("/");O=K[0],k=K[1]}Le(a,"gname",k),O&&Le(a,"plat",O),s[E]&&ct(a);var Y=Fe();he.appendStyleTagText(E,p),Y.emit(vt.styleTagAdded(E),{nodes:[a]})}return}var J=ss(a,v);J&&ct(a)}}function ls(a,s){var u=a.tagName,p=a.src,v=p===void 0?"":p;if(u!=="SCRIPT"||!v.endsWith(".hot-update.js"))return!1;var y=he.getMatchedIgnoreCssPrefix(v);if(!y)return!1;var A=he.getIgnoreCssPrefixKeys(y);if(!A.length)return!1;var S=!1;return A.forEach(function(E){s[E]&&(us(E),S=!0)}),S}function ps(){var a=Ve(),s=C(),u=a.isStyleObInit,p=s.document;if(!(u||!p)){a.isStyleObInit=!0;var v=he.getIgnoreStyleTagMap(),y=w();if(y){var A=new y(function(S){S.forEach(function(E){for(var O=E.addedNodes,k=E.removedNodes,K=O.length,Y=0;Y<K;Y++)cs(O[Y],v);for(var J=k.length,se=0;se<J&&!ls(k[se],v);se++);})});A.observe(document.head,{childList:!0})}}}na(),de("hel-micro-core ver ".concat(ie.CORE_VER));var fs=Ye,ds=We,vs=ie,ms=Mn,hs=li,gs=$i;function na(a){a&&aa(a),Zi(!!a),Ci(),hi(),rs(),ps()}var bs=pt,ys=oe,As=De,_s=lt,Ss=de,Es=gi,Ls=$t,Is=Hn,Ts=C,aa=F,Cs=Pi,Ps=Xn,Ns=Ui,Os=Zn,ws=$n,Ds=Bi,Vs=zi,xs=Qi,Ms=Ri,Rs=ji,js=qe,Gs=ze,ks=he,Fs=Hi,Us=ur,Bs=Yi,Hs=Ki,Ks=Wi,Ys=Xi,Ws=qi,Xs=Ji,Js=cr,qs=lr,zs=Oi,Qs=dt,Zs=xi,$s=Mi,eu=sr,tu=Di,ru=Vi,nu=wi,au=Fe,ou=Fi,iu=vt,su=ns,uu=as;t.allowLog=_s,t.appReady=uu,t.clearPerfMark=Is,t.commonDataUtil=ks,t.commonUtil=hs,t.evName=iu,t.getAppMeta=ws,t.getAppPlatform=Qs,t.getAppPlatformByAppName=eu,t.getAppStyleStr=Ks,t.getCommonData=js,t.getCustomData=Ms,t.getGlobalThis=Ts,t.getHelDebug=As,t.getHelEventBus=au,t.getPlatform=bs,t.getPlatformConfig=zs,t.getSharedCache=ys,t.getUserEventBus=ou,t.getVerApp=Cs,t.getVerExtraCssList=Ws,t.getVerLib=Ns,t.getVerLoadStatus=Fs,t.getVerStyleStrStatus=Bs,t.getVersion=Vs,t.helConsts=vs,t.helEvents=fs,t.helLoadStatus=ds,t.inectPlatToMod=ms,t.initGlobalConfig=nu,t.initPlatformConfig=tu,t.isSubApp=gs,t.libReady=su,t.log=Ss,t.originInit=ru,t.perfMark=Es,t.perfPeek=Ls,t.resetGlobalThis=na,t.setAppMeta=Ds,t.setAppPlatform=Zs,t.setAppPlatformByAppName=$s,t.setAppStyleStr=Ys,t.setCommonData=Gs,t.setCustomData=Rs,t.setEmitApp=Ps,t.setEmitLib=Os,t.setGlobalThis=aa,t.setVerExtraCssList=Xs,t.setVerLoadStatus=Us,t.setVerStyleStrStatus=Hs,t.setVersion=xs,t.tryGetAppName=qs,t.tryGetVersion=Js}),br=gr((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t,gt()):typeof define=="function"&&define.amd?define(["exports","hel-micro-core"],n):n((r=typeof globalThis<"u"?globalThis:r||self).HelLibProxy={},r.HelMicroCore)})(t,function(r,n){var i=function(){return i=Object.assign||function(V){for(var G,X=1,q=arguments.length;X<q;X++)for(var te in G=arguments[X])Object.prototype.hasOwnProperty.call(G,te)&&(V[te]=G[te]);return V},i.apply(this,arguments)};function o(V,G){var X=G||(n.getAppPlatform===null||n.getAppPlatform===void 0?void 0:n.getAppPlatform(V)),q=n.getSharedCache(X).appName2Lib;return q[V]||(q[V]={}),q[V]}var l="4.12.1";n.log("hel-lib-proxy ver ".concat(l));var c=n.getUserEventBus,f=n.helConsts,d=c();function h(V,G){var X=i({},G||{});return X.platform=X.platform||f.DEFAULT_PLAT,n.getVerLib(V,X)}function g(V,G){var X,q=!0,te="";G&&(typeof G=="string"?te=G:(te=G.platform||"",q=(X=G.asProxy)===null||X===void 0||X));var re=o(V,te=te||n.getAppPlatform(V)||f.DEFAULT_PLAT);return typeof Proxy=="function"&&q&&(re=(function(ue,pe,fe){return new Proxy(pe,{get:function(ve,ye){var Ee=String(ye);return n.log("[[getLibProxy]] call lib [".concat(ue,"] method [").concat(Ee,"]")),Object.keys(ve).length?ve[Ee]:o(ue,fe)[Ee]}})})(V,re,te)),n.log("[[ exposeLib ]] libName, libObj",V,re),re}function b(V,G,X){var q=(function(te){var re={allowDup:!1,platform:n.helConsts.DEFAULT_PLAT};return i(i({},re),te||{})})(X);n.libReady(V,G,q)}function _(V,G,X){n.appReady(V,G,X)}function L(V,G){return n.getVerApp(V,G)}var I=n.isSubApp;function T(){return!n.isSubApp()}var N=Object.freeze({__proto__:null,VER:l,eventBus:d,getLib:h,exposeLib:g,libReady:b,appReady:_,exposeApp:L,isSubApp:I,isMasterApp:T}),P=n.commonUtil.purify,D=["isMasterApp","isSubApp","eventBus"],C=["appReady","libReady"];function F(V,G){return G&&typeof G=="object"&&!Array.isArray(G)?i({platform:V},P(G)):{platform:V}}function M(V,G){var X={};return Object.keys(V).forEach(function(q){var te=V[q];if(D.includes(q))X[q]=te;else if(C.includes(q))X[q]=(function(ue,pe){return function(){for(var fe=[],ve=0;ve<arguments.length;ve++)fe[ve]=arguments[ve];var ye=fe[0],Ee=fe[1],_e=fe[2];return ue(ye,Ee,F(pe,_e===void 0?{}:_e))}})(te,G);else{var re=q==="exposeLib";X[q]=(function(ue,pe,fe){return function(){for(var ve=[],ye=0;ye<arguments.length;ye++)ve[ye]=arguments[ye];var Ee=ve[0],_e=ve[1];return ue(Ee,!fe||typeof _e!="string"&&_e!==void 0?F(pe,_e):_e||pe)}})(te,G,re)}}),X}var w=function V(G){var X=M(N,G);return X.createInstance=V,X},U=l,Q=b,$=g,z=h,Z=I,ne=T,W=d,x=_,B=L,ee={VER:U,libReady:Q,exposeLib:$,getLib:z,isSubApp:Z,isMasterApp:ne,eventBus:W,appReady:x,exposeApp:B,createInstance:w};(function(V){var G=n.getGlobalThis();n.commonUtil.isServer()||G.HelLibProxy||(n.log("auto bind hel-lib-proxy to global.HelLibProxy"),G.HelLibProxy=V)})(ee),r.VER=U,r.appReady=x,r.createInstance=w,r.default=ee,r.eventBus=W,r.exposeApp=B,r.exposeLib=$,r.getLib=z,r.isMasterApp=ne,r.isSubApp=Z,r.libReady=Q,Object.defineProperty(r,"__esModule",{value:!0})})}),da=$e(br()),bt=$e(gt()),m=$e(gt());function va(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ma(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ba(n.key),n)}}function ha(t,e,r){return e&&ma(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ga(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ba(t){var e=ga(t,"string");return typeof e=="symbol"?e:String(e)}var ya=/\s/,Aa=/[a-zA-Z0-9\-]/,yr="<!DOCTYPE html>",_a="<!--",Ar="-->",Sa="</meta>",Ea="</link>",La=["meta","link"],Ia={meta:Sa,link:Ea},Ta=(function(){function t(){va(this,t),this.input="",this.len=0,this.cur=0}return ha(t,[{key:"eof",get:function(){return this.cur>=this.len}},{key:"peek",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.input[this.cur+e]}},{key:"sub",value:function(e,r){var n=r||this.cur;return this.input.substring(n,n+e)}},{key:"moveCur",value:function(e){this.cur+=e}},{key:"consumeChar",value:function(e){var r=this.peek();if(r===e)this.cur++;else throw new Error("Unexpected character: '".concat(r,"' should be '").concat(e,"'"));return r}},{key:"consumeSpace",value:function(){this.consumeWhile(ya)}},{key:"consumeWhile",value:function(e){var r=[];do{var n=this.peek();if(e.test(n))r.push(n),this.cur++;else break}while(!this.eof);return r.join("")}},{key:"noop",value:function(){}},{key:"pureInput",value:function(e){var r=e.trim();r.startsWith(yr)&&(r=r.substring(yr.length));var n=function i(o){var l=o.indexOf(_a),c=o.indexOf(Ar);if(l>=0&&c>=0){var f=o.substring(0,l),d=o.substring(c+Ar.length);return i("".concat(f).concat(d))}return o};return r=n(r),r}},{key:"parse",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e||"";return this.input=this.pureInput(n),this.len=n.length,this.onTagOpen=r.onTagOpen||this.noop(),this.onTagClose=r.onTagClose||this.noop(),this.cur=0,this.parseNodes()}},{key:"parseNodes",value:function(){var e=[];do{var r=void 0;if(this.peek()==="<"){if(this.peek(1)==="/")break;r=this.parseElement()}else r=this.parseTextNode();r!==" "&&e.push(r)}while(!this.eof);return e}},{key:"parseTextNode",value:function(){var e=this.consumeWhile(/[^<]/);return e.replace(/[\s\n]+/g," ")}},{key:"parseElement",value:function(){var e=this;this.consumeChar("<");var r=this.parseTag();this.onTagOpen(r),this.consumeSpace();var n=this.parseAttrs(),i=this.peek(),o=this.peek(-1),l=function(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;e.parseTag(),e.consumeSpace(),e.consumeChar(">"),_&&e.moveCur(_);var L={tag:r,attrs:n,children:b};return e.onTagClose(r,L),L};if("".concat(o).concat(i)==="/>")return l([]);if(La.includes(r)&&i===">"){var c=Ia[r],f=c.length,d=this.sub(f,this.cur+1),h=d===c?f:0;return l([],h)}this.consumeChar(">");var g=this.parseNodes();return this.consumeChar("<"),this.consumeChar("/"),l(g)}},{key:"parseTag",value:function(){var e=this.consumeWhile(Aa);return e}},{key:"parseAttrs",value:function(){for(var e={};this.peek()!==">";){var r=this.parseTag();if(!r){this.consumeChar(this.peek());continue}if(this.peek()==="="){this.consumeChar("="),this.consumeChar('"');var n=this.consumeWhile(/[^"]/);this.consumeChar('"'),e[r]=n}else e[r]="";this.consumeSpace()}return e}}]),t})();function Ca(t,e){var r=new Ta,n=r.parse(t,e);return n}var _r="4.15.3";function yt(t){var e=t.appGroupName,r=t.Comp,n=t.platform,i=t.lifecycle,o=t.appName,l=t.versionId;(0,m.appReady)(e,r,{lifecycle:i,platform:n,appName:o,versionId:l})}var H=function(){return H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},H.apply(this,arguments)};function Me(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function R(t,e,r,n){function i(o){return o instanceof r?o:new r(function(l){l(o)})}return new(r||(r=Promise))(function(o,l){function c(h){try{d(n.next(h))}catch(g){l(g)}}function f(h){try{d(n.throw(h))}catch(g){l(g)}}function d(h){h.done?o(h.value):i(h.value).then(c,f)}d((n=n.apply(t,[])).next())})}function j(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(h){return f([d,h])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=d[0]&2?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(h){d=[6,h],i=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var At={LS_CACHE_APP_PREFIX:"HelAppCache",DATABASE_NAME:"HelIndexedDB",STORE_NAME:"HelMetaData"},Sr={};function Er(){return{db:null,name:"",storeName:"",version:1}}function Lr(){var t=(0,m.getGlobalThis)();return"indexedDB"in t?t.indexedDB:(console.warn("The current browser is not support indexedDB!"),null)}var Pa=(function(){function t(e){this.dbInfo=Er(),this.ready=null,this.initStorage(e)}return t.prototype.initStorage=function(e){var r=Lr();if(r){var n=null,i=null;this.ready=new Promise(function(_,L){n=_,i=L});var o=this.dbInfo;if(e){var l=e.name,c=e.storeName,f=e.version;Object.assign(o,m.commonUtil.purify({name:l,storeName:c,version:f}))}var d=Sr[o.name];d||(d=Er(),Sr[o.name]=d),o.db=d.db;var h=this.isUpgradeNeeded(o);if(o.db)if(h)o.db.close();else{n(o);return}var g=[o.name,void 0];h&&(g[1]=o.version);var b=r.open.apply(r,g);h&&(b.onupgradeneeded=function(_){d.db=b.result,o.db=b.result;try{o.db.createObjectStore(o.storeName)}catch(I){if(I.name==="ConstraintError"){var L=m.commonUtil.nbstr(`
|
|
10
|
+
The database "`.concat(o.name,`"
|
|
11
|
+
has been upgraded from version `).concat(_.oldVersion," to version ").concat(_.newVersion,`,
|
|
12
|
+
but the storage "`).concat(o.storeName,'" already exists.'));console.warn(L)}else throw I}}),b.onerror=function(){i(b.error)},b.onsuccess=function(){o.db=b.result,d.db=b.result,o.db.onversionchange=function(_){_.target.close()},n(o)}}},t.prototype.isUpgradeNeeded=function(e){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(console.warn('The database "'.concat(e.name,`" can't be downgraded from version `).concat(e.db.version," to version ").concat(e.version)),e.version=e.db.version),i||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1},t.prototype.getObjectStore=function(e,r){var n=e.name,i=e.db,o=e.storeName;if(!i)throw new Error("get ".concat(o," objectStore failed in ").concat(n," database"));var l=i.transaction(o,r||"readonly").objectStore(o);return l},t.prototype.attachHandler=function(e,r,n){e.onsuccess=function(){r(e.result||null)},e.onerror=function(){n(e.error)}},t.prototype.getItem=function(e){return R(this,void 0,void 0,function(){var r,n,i,o=this;return j(this,function(l){switch(l.label){case 0:return[4,this.getDbInfo()];case 1:return r=l.sent(),n=this.getObjectStore(r),i=n.get(e),[2,new Promise(function(c,f){o.attachHandler(i,c,f)})]}})})},t.prototype.setItem=function(e,r){return R(this,void 0,void 0,function(){var n,i,o,l=this;return j(this,function(c){switch(c.label){case 0:return[4,this.getDbInfo()];case 1:return n=c.sent(),i=this.getObjectStore(n,"readwrite"),o=i.put(r,e),[2,new Promise(function(f,d){l.attachHandler(o,f,d)})]}})})},t.prototype.removeItem=function(e){return R(this,void 0,void 0,function(){var r,n,i,o=this;return j(this,function(l){switch(l.label){case 0:return[4,this.getDbInfo()];case 1:return r=l.sent(),n=this.getObjectStore(r,"readwrite"),i=n.delete(e),[2,new Promise(function(c,f){o.attachHandler(i,c,f)})]}})})},t.prototype.getDbInfo=function(){return this.ready?this.ready:Promise.reject("forget init")},t})();function Ir(t){return t.startsWith("//")?!1:t.startsWith("/")||t.startsWith("./")||t.startsWith("../")}function Na(t,e){return e.startsWith(t)?"build":Ir(e)?"relative":"static"}function _t(){if(!Lr())return null;try{var t=new Pa({name:At.DATABASE_NAME,storeName:At.STORE_NAME});return{setItem:function(e,r){return t.setItem(e,r)},getItem:function(e){return t.getItem(e)},removeItem:function(e){return t.removeItem(e)}}}catch(e){return console.error("new IndexedDBStorage error: ".concat(e.message)),null}}function et(){var t,e={getItem:function(){},setItem:function(){},removeItem:function(){}};try{var r=(t=(0,m.getGlobalThis)())===null||t===void 0?void 0:t.localStorage;return r||e}catch{return e}}function Oa(t,e,r){var n=Object.prototype.hasOwnProperty.call(t,e);if(n)return t[e]||r}function ge(t){return t||(0,m.getPlatform)()}function St(t,e){try{et().setItem(t,JSON.stringify(e))}catch(r){(0,m.log)("save localStorage failed: ".concat(r.message))}}function Tr(t){if(!t)return t;var e=t.appInfo,r=t.appVersion;return e&&r?{app:e,version:r}:t}function tt(t,e){var r="".concat(At.LS_CACHE_APP_PREFIX,".").concat(ge(e),".").concat(t);return r}function Et(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h,g,b;return j(this,function(_){switch(_.label){case 0:r=e||{},n=r.platform,i=r.cacheKey,o=r.storageType,l=o===void 0?"indexedDB":o,c=i||tt(t,n),_.label=1;case 1:return _.trys.push([1,4,,5]),l!=="indexedDB"?[3,3]:(f=_t(),f?[4,f.getItem(c)]:[3,3]);case 2:return d=_.sent(),[2,Tr(d)];case 3:return h=et().getItem(c),g=m.commonUtil.safeParse(h||"",null),[2,Tr(g)];case 4:return b=_.sent(),console.error(b),[2,null];case 5:return[2]}})})}function Lt(t,e,r){var n=tt(t,r),i=e?.({appName:t,innerKey:n})||n;return i}function Cr(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return r=e.getCacheKey,n=e.storageType,i=e.platform,o=Lt(t,r,i),[4,Et(t,{platform:i,cacheKey:o,storageType:n})];case 1:return l=c.sent(),l?[2,{appInfo:l.app,appVersion:l.version}]:[2,null]}})})}function wa(t,e,r){var n=r==="indexedDB";if(!n)return St(t,e);var i=_t();if(!i)return St(t,e);i.setItem(t,e).catch(function(o){(0,m.log)("save indexeddb failed, use localStorage instead, err: ".concat(o.message)),St(t,e)})}var Re={GET_APP_AND_VER:"getSubAppAndItsVersion",GET_APP_AND_FULL_VER:"getSubAppAndItsFullVersion",BATCH_GET_APP_AND_VER:"batchGetSubAppAndItsVersion",BATCH_GET_APP_AND_FULL_VER:"batchGetSubAppAndItsFullVersion",GET_APP_VER:"getSubAppVersion",GET_APP_FULL_VER:"getSubAppFullVersion"},Be="get",Pr="Jsonp";function Da(t){var e=t.userLsKey,r=et().getItem(e)||"";if(r)return r;try{var n={};(0,m.getGlobalThis)().document.cookie.split(";").forEach(function(i){var o=i.split("="),l=o[0],c=o[1];n[l]=c}),r=n[e]||"",(0,m.log)("[[ getUserName ]] result:",r)}catch(i){(0,m.log)("[[ getUserName ]] err:",i)}return r}var Va=Object.freeze({__proto__:null,getUserName:Da}),It=m.commonUtil.isNull;function rt(t,e,r){var n=(0,m.getPlatformConfig)(t),i=n.origin,o=n[e],l=i[e];return r||o||l}function Nr(t,e,r,n){var i=rt(t,e,n);if(i)return i(r);var o=Va[e]||(function(){return null});return o(r)}function Ae(t,e,r,n){var i=r||[],o=i[0],l=i[1];if(!It(o,n))return o;var c=(0,m.getPlatformConfig)(t),f=c[e];if(!It(f,n))return f;var d=c.origin,h=d[e];return It(h,n)?l:h}function Tt(t,e){var r,n=(0,m.getPlatformConfig)(t.platform),i=t.hook||{},o=n.origin,l=n.hook;return i[e]||l[e]||((r=o.hook)===null||r===void 0?void 0:r[e])}function Or(t,e){var r,n,i,o="";if(e&&(o=((r=e.getApiPrefix)===null||r===void 0?void 0:r.call(e))||e.apiPrefix),o)return o;var l=(0,m.getPlatformConfig)(t);if(o=((n=l.getApiPrefix)===null||n===void 0?void 0:n.call(l))||l.apiPrefix,o)return o;var c=l.origin;return o=((i=c.getApiPrefix)===null||i===void 0?void 0:i.call(c))||c.apiPrefix,o}var xa=11,je={now:function(){return new Date().getTime()},rand:function(){return Math.random().toString().substring(6)},removeElem:function(t){var e=t.parentNode;e&&e.nodeType!==xa&&e.removeChild(t)},parseData:function(t){var e="";if(typeof t=="string")e=t;else if(typeof t=="object")for(var r in t)e+="".concat(e,"&").concat(r,"=").concat(encodeURIComponent(t[r]));return e+="&_t=".concat(je.now()),e=e.substring(1),e},getJSON:function(t,e){return new Promise(function(r,n){var i="",o=t;o=o+(o.indexOf("?")===-1?"?":"&")+je.parseData(e);var l=/callback=(\w+)/.exec(o);l?.[1]?i=l[1]:i="helJsonp_".concat(je.now(),"_").concat(je.rand()),o.includes("?")?o="".concat(o,"&callback=").concat(i):o="".concat(o,"?callback=").concat(i);var c=(0,m.getGlobalThis)(),f=c.document,d=f.createElement("script");d.type="text/javascript",d.src=o,d.id=i,d.onerror=n,d.addEventListener("error",n),c[i]=function(g){delete c[i];var b=f.getElementById(i);return b&&je.removeElem(b),r(g)};var h=f.getElementsByTagName("head");h?.[0]&&h[0].appendChild(d)})}},Ma=je.getJSON;function Ra(){return"XMLHttpRequest"in(0,m.getGlobalThis)()?new XMLHttpRequest:null}function ja(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return r=e||{},n=r.method,i=Me(r,["method"]),o=new Ga(i),[4,o.request(t,n)];case 1:return l=c.sent(),[2,l]}})})}var Ga=(function(){function t(e){this.req=null,this.resultPromise=Promise.resolve(null),this.init(e||{})}return t.prototype.init=function(e){var r=Ra();if(!r)throw new Error("current browser is not support XMLHttpRequest!");this.req=r;var n=e.responseType,i=e.timeout,o=i===void 0?1e4:i,l=e.withCredentials,c=e.headers;r.responseType=n||"json",r.timeout=o,r.withCredentials=!!l,c&&Object.keys(c).forEach(function(b){r.setRequestHeader(b,c[b])});var f=null,d=null;this.resultPromise=new Promise(function(b,_){f=b,d=_});var h=function(){var b=r.response,_=r.status,L=r.statusText,I=r.responseURL;f({data:b,status:_,statusText:L,url:I})},g=function(b){var _=r.status,L=r.statusText,I=r.responseURL;d({msg:b,status:_,statusText:L,url:I})};r.onload=function(){return h()},r.onerror=function(b){return g(b)},r.onabort=function(b){return g(b)},r.ontimeout=function(b){return g(b)},r.onprogress=function(){}},t.prototype.request=function(e,r){return R(this,void 0,Promise,function(){var n;return j(this,function(i){switch(i.label){case 0:if(!this.req)throw new Error("forget init");return this.req.open(r?r.toUpperCase():"GET",e),this.req.send(),[4,this.resultPromise];case 1:return n=i.sent(),[2,n]}})})},t})(),wr=0,ka="try_detect_latest_ver";function Dr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Vr(t,e){var r="";return(0,m.allowLog)()&&(e&&(wr+=1,r="_".concat(wr)),console.time("".concat(t).concat(r))),r}function Ct(t,e){(0,m.allowLog)()&&console.timeEnd("".concat(t).concat(e||""))}function Fa(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,He("".concat(e,"/").concat(t,"@latest/").concat(ka,"_").concat(Date.now()))];case 1:return r=c.sent().url,n=r.split("@"),i=n[n.length-1],o=i.split("/")[0],[2,o];case 2:return l=c.sent(),(0,m.log)("[[ getSemverLatestVer ]] returns ver(latest) due to error:",l.message),[2,"latest"];case 3:return[2]}})})}function Ua(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return[4,(0,m.getGlobalThis)().fetch(t)];case 1:return r=c.sent(),n=r.status,i=r.url,[200,304].includes(n)?e?[4,r.json()]:[3,3]:[2,{url:i,reply:null,status:n}];case 2:return o=c.sent(),[2,{url:i,reply:o,status:n}];case 3:return[4,r.text()];case 4:return l=c.sent(),[2,{url:i,reply:l,status:n}]}})})}function Ba(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return[4,ja(t,{method:"GET",responseType:e?"json":"text"})];case 1:return r=c.sent(),n=r.status,i=r.data,o=r.url,l=o===void 0?"":o,n===400?[2,{url:l,reply:null,status:n}]:[2,{url:l,reply:i,status:n}]}})})}function He(t,e){return e===void 0&&(e=!0),R(this,void 0,void 0,function(){var r,n;return j(this,function(i){switch(i.label){case 0:return r=Ba,(0,m.getGlobalThis)().fetch&&(r=Ua),[4,r(t,e)];case 1:return n=i.sent(),[2,n]}})})}function xr(t){var e=t.extraCssList,r=e===void 0?[]:e,n=t.custom;if(n){var i=n.extraCssList,o=i===void 0?[]:i,l=n.enable,c=l===void 0?!0:l;if(c){var f=m.commonUtil.merge2List(r,o);return f}}return r.slice()}var Pt=m.commonUtil.safeParse,be={handleSemverRet:function(t,e){var r=t||{},n,i=r.data||r;return e.onlyVersion&&(n=r.version||r.data,i=n),n=n||i.version,!e.isFullVersion&&n&&Reflect.deleteProperty(n,"html_content"),n?{data:i,code:"0",msg:""}:{data:null,code:"404",msg:"no version found"}},appendSearchKV:function(t,e,r){var n=t;return r&&(n+="&".concat(e,"=").concat(r)),n},appendSuffix:function(t,e){var r=t;return e&&(r+=e),r},getSemverApiVal:function(t){var e=t.semverApi;return e===void 0&&(e=!(t.customMetaUrl||t.customMetaJsonpUrl)),e}};function Nt(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f;return j(this,function(d){switch(d.label){case 0:r=null,n=e.semverApi,i=n===void 0?!0:n,o=i?Be:e.apiMode,l="request ".concat(t),Vr(l),d.label=1;case 1:return d.trys.push([1,6,,7]),o!==Be?[3,3]:[4,He(t)];case 2:return c=d.sent(),r=c.reply,[3,5];case 3:return[4,Ma(t)];case 4:r=d.sent(),d.label=5;case 5:return Ct(l),i?[2,be.handleSemverRet(r,e)]:[2,r];case 6:return f=d.sent(),Ct(l),[2,{data:null,code:"404",msg:f.message}];case 7:return[2]}})})}function Mr(t){var e=H({},t);return e.additional_scripts=Pt(e.additional_scripts,[]),e.additional_body_scripts=Pt(e.additional_body_scripts,[]),e}function Ot(t){var e=H({},t);return e.src_map=Pt(e.src_map,{htmlIndexSrc:"",webDirPath:"",headAssetList:[],bodyAssetList:[],chunkJsSrcList:[],chunkCssSrcList:[],staticJsSrcList:[],staticCssSrcList:[],relativeJsSrcList:[],relativeCssSrcList:[],otherSrcList:[]}),e}function Rr(t,e,r,n){return n===void 0&&(n=!1),R(this,void 0,void 0,function(){var i;return j(this,function(o){switch(o.label){case 0:return i=r,i?[3,3]:n?(i="latest",[3,3]):[3,1];case 1:return[4,Fa(e,t)];case 2:i=o.sent(),o.label=3;case 3:return[2,"".concat(t,"/").concat(e,"@").concat(i,"/hel_dist/hel-meta.json?_t=").concat(Date.now())]}})})}function wt(t,e){var r=e.versionId,n=e.projectId,i=e.branchId,o=e.apiMode,l=e.isFullVersion,c=l===void 0?!1:l,f=e.versionIdList,d=f===void 0?[]:f,h=e.projectIdList,g=h===void 0?[]:h,b=e.branchIdList,_=b===void 0?[]:b,L=e.loadOptions,I=L===void 0?{}:L,T=ge(e.platform),N=t,P=N,D=r,C=n,F=i,M=!1;Array.isArray(t)&&(N=t[0],P=t.join(","),D=d.join(","),C=g.join(","),F=_.join(","),M=!0);var w=function(ue,pe){return Ae(T,ue,[I[ue],pe])},U=function(ue,pe){return Nr(T,ue,pe,I[ue])},Q=w("userLsKey",m.helConsts.DEFAULT_USER_LS_KEY),$=U("getUserName",{platform:T,appName:N,userLsKey:Q}),z=U("shouldUseGray",{appName:N}),Z=w("apiSuffix"),ne="";typeof z=="boolean"&&(ne=z?"1":"0");var W=o!==Be,x="",B="",ee=!1;if(M)B=c?Re.BATCH_GET_APP_AND_FULL_VER:Re.BATCH_GET_APP_AND_VER;else{var V=w("customMetaUrl",""),G=w("customMetaJsonpUrl","");V?x=D?"".concat(V,"/").concat(N,"@").concat(D,"?"):"".concat(V,"/").concat(N,"?"):W&&G&&(x=D?"".concat(G,"/").concat(N,"@").concat(D,"?"):"".concat(G,"/").concat(N,"?")),x?ee=!0:B=c?Re.GET_APP_AND_FULL_VER:Re.GET_APP_AND_VER}if(!ee){var X=w("apiPathOfApp",m.helConsts.DEFAULT_API_URL),q=Or(T,I),te=W?Pr:"",re="".concat(B).concat(te);x="".concat(q).concat(X,"/").concat(re,"?name=").concat(P),x=be.appendSearchKV(x,"version",D)}return x=be.appendSearchKV(x,"userName",$),x=be.appendSearchKV(x,"projId",C),x=be.appendSearchKV(x,"branch",F),x=be.appendSearchKV(x,"gray",ne),x=be.appendSuffix(x,Z),x.endsWith("?")&&(x=x.substring(0,x.length-1)),{url:x,userName:$}}function Ha(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return r=e.versionId,n=e.platform,i=e.loadOptions,o=Or(n,i),[4,Rr(o,t,r||"",i?.skip404Sniff)];case 1:return l=c.sent(),[2,l]}})})}function Ka(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c;return j(this,function(f){switch(f.label){case 0:return r=e.loadOptions,n=r===void 0?{}:r,i="",o="",l=be.getSemverApiVal(n),l?[4,Ha(t,e)]:[3,2];case 1:return o=f.sent(),[3,3];case 2:c=wt(t,e),o=c.url,i=c.userName,f.label=3;case 3:return[2,{url:o,userName:i}]}})})}function Ya(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F;return j(this,function(M){switch(M.label){case 0:return r=e.apiMode,n=e.appName,i=e.isFullVersion,o=i===void 0?!1:i,l=e.semverApi,c=e.customMetaUrl,f=e.apiPrefix,d=f===void 0?"":f,h=e.getUrl,g=ge(e.platform),b=d||Ae(g,"apiPrefix"),_=Ae(g,"apiSuffix"),L=Ae(g,"apiPathOfApp"),I=Ae(g,"apiPathOfAppVersion"),T="",N=!!c,N?(T="".concat(c,"/").concat(n).concat(t?"@".concat(t):""),[3,4]):[3,1];case 1:return l?[4,Rr(b,n,t)]:[3,3];case 2:return T=M.sent(),[3,4];case 3:P=r===Be?"":Pr,D=o?Re.GET_APP_FULL_VER:Re.GET_APP_VER,C="".concat(D).concat(P),F=I||L||m.helConsts.DEFAULT_API_URL,T="".concat(b).concat(F,"/").concat(C,"?ver=").concat(t),T=be.appendSearchKV(T,"name",n),T=be.appendSuffix(T,_),M.label=4;case 4:return T=h?.(T)||T,[2,T]}})})}function jr(t,e){var r=e;if(Dr(r,"app")&&Dr(r,"version")&&(r={code:0,data:{app:r.app,version:r.version}}),!r||Number(r.code)!==0)throw new Error(r?.msg||"getSubAppAndItsVersion err`");var n=r.data||{},i=n.app,o=n.version;if(!i)throw new Error("no app for ".concat(t));if(!o)throw new Error("no version for ".concat(t));return{app:Mr(i),version:Ot(o)}}function Dt(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F,M=this;return j(this,function(w){switch(w.label){case 0:return r=e.versionId,n=e.branchId,i=e.projectId,o=e.platform,l=e.apiMode,c=e.loadOptions,f=c===void 0?{}:c,d="getSubAppAndItsVersionFn",h="getMeta",g=h,b=rt(o,h,f.getMeta),b||(b=rt(o,d,f.getSubAppAndItsVersionFn),g=d),[4,Ka(t,e)];case 1:return _=w.sent(),L=_.url,I=_.userName,T=function(U,Q){return R(M,void 0,void 0,function(){var $,z,Z,ne;return j(this,function(W){switch(W.label){case 0:return $=U||L,z=be.getSemverApiVal(f),[4,Nt($,{apiMode:Q||l,semverApi:z})];case 1:return Z=W.sent(),ne=jr(t,Z),[2,ne]}})})},b?(N=Nr(o,"shouldUseGray",{appName:t},f.shouldUseGray),P={platform:o,appName:t,userName:I,versionId:r,branchId:n,projectId:i,url:L,needGrayVer:N,innerRequest:T},(0,m.log)("[[ ".concat(g," ]] fnParams:"),P),[4,Promise.resolve(b(P))]):[3,3];case 2:return D=w.sent(),C=jr(t,D),[2,C];case 3:return[4,T()];case 4:return F=w.sent(),[2,F]}})})}function Wa(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f,d,h,g,b,_;return j(this,function(L){switch(L.label){case 0:return r=e.apiMode,n=e.isFullVersion,i=n===void 0?!1:n,o=e.semverApi,l=e.customMetaUrl,[4,Ya(t,e)];case 1:return c=L.sent(),f=l?!1:o,[4,Nt(c,{apiMode:r,isFullVersion:i,semverApi:f,onlyVersion:!0})];case 2:if(d=L.sent(),h=d.data,g=d.code,b=d.msg,parseInt(g,10)!==0||!h)throw new Error(b||"ver not found");return _=Ot(h),[2,_]}})})}function Xa(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f,d,h=this;return j(this,function(g){switch(g.label){case 0:return t.length?(r=e.apiMode,n=e.batchGetFn,i=e.semverApi,o=ge(e.platform),[4,wt(t,e)]):[2,[]];case 1:return l=g.sent().url,c=function(){return R(h,void 0,void 0,function(){var b,_,L,I,T;return j(this,function(N){switch(N.label){case 0:return[4,Nt(l,{apiMode:r,semverApi:i})];case 1:if(b=N.sent(),_=b.data,L=b.code,I=b.msg,parseInt(L,10)!==0||!_)throw new Error(I||"batch get failed");return T=_.map(function(P){return{app:Mr(P.app),version:Ot(P.version)}}),[2,T]}})})},f=[],n?(d={url:l,platform:o,innerRequest:c},[4,Promise.resolve(n(d))]):[3,3];case 2:return f=g.sent(),[3,5];case 3:return[4,c()];case 4:f=g.sent(),g.label=5;case 5:return[2,f]}})})}var Vt=m.commonUtil.noop,Gr=m.commonUtil.okeys;function Ja(){var t=(0,m.getGlobalThis)();t.__HEL_LOAD_ASSETS_FLAG__=1}function kr(t){var e;try{var r=(e=(0,m.getGlobalThis)())===null||e===void 0?void 0:e.document,n=r.querySelector(t);return!!n}catch{return!1}}function Fr(t,e){var r=t["data-helex"]||"",n=t["data-helappend"],i=(0,m.getGlobalThis)();if(n==="0")return!1;if(r){var o=r.split(",");if(e==="script"&&o.every(function(c){return!!i[c]}))return!1;var l=kr("".concat(e,'[data-helex="').concat(r,'"]'));return!l}return!0}function xt(t,e,r){var n=(0,m.getGlobalThis)().document;Gr(e).forEach(function(i){return t.setAttribute(i,e[i])}),r?n.body.appendChild(t):n.head.appendChild(t)}function qa(t,e){t.textContent===""?t.textContent=e:t.innerText=e}function Mt(t){var e=t.attrs,r=t.innerText,n=t.appendToBody,i=n===void 0?!0:n,o=t.onloadCb,l=o===void 0?Vt:o,c=t.onerrorCb,f=c===void 0?Vt:c,d=e.src,h=Me(e,["src"]),g=h,b=function(I){return l(I),I};if(!d&&!r)return b(!1);var _=(0,m.getGlobalThis)().document;if(d&&kr('script[src="'.concat(d,'"]'))||!Fr(g,"script"))return b(!1);var L=_.createElement("script");return d&&L.setAttribute("src",d),Gr(g).forEach(function(I){return L.setAttribute(I,g[I])}),L.onload=l,L.onerror=f,r&&qa(L,r),xt(L,g,i),!0}function Rt(t){var e=t.appendToBody,r=e===void 0?!1:e,n=t.innerText,i=t.attrs,o=i.href,l=i.rel,c=Me(i,["href","rel"]),f=c,d=(0,m.getGlobalThis)().document;if(!(!o&&!n)){if(!Fr(f,"link"))return!1;var h=d.createElement("link");o?(h.setAttribute("href",o),h.setAttribute("rel",l||"stylesheet")):l&&h.setAttribute("rel",l),n&&(h.innerText=n),xt(h,f,r)}}function za(t){var e=t.appendToBody,r=e===void 0?!1:e,n=t.innerText,i=n===void 0?"":n,o=t.attrs,l=(0,m.getGlobalThis)().document,c=l.createElement("style");c.innerText=i,xt(c,o,r)}function Ur(t){return["link","staticLink","relativeLink"].includes(t.tag)}function Br(t,e){return Vt(e),["script","staticScript","relativeScript"].includes(t)}function Hr(t){return t==="staticScript"}function Kr(t,e){var r=t.attrs,n=t.innerText,i=n===void 0?"":n,o=e.appendToBody,l=e.appendCss,c=e.webDirPath,f=e.cssAppendTypes,d=e.excludeCssList,h={appendToBody:o,attrs:r,innerText:i},g=r.href;if(!(g.endsWith(".ico")&&t.append!==!0)){if(g.endsWith(".css")){l&&f.includes(Na(c,g))&&!d.includes(g)&&Rt(h);return}Rt(h)}}function nt(t,e){var r=e.appendToBody;t.forEach(function(n){var i=n.tag,o=n.attrs,l=n.append,c=l===void 0?!0:l,f=n.innerText,d=f===void 0?"":f;if(c){if(Ur(n)){Kr(n,e);return}if(Br(i,o)){Mt({appendToBody:r,attrs:o,innerText:d});return}i==="style"&&za({appendToBody:r,attrs:o,innerText:d})}})}function jt(t,e){return R(this,void 0,void 0,function(){var r,n;return j(this,function(i){switch(i.label){case 0:return r=e.appendToBody,n=function(o){return new Promise(function(l,c){var f=o.tag,d=o.attrs,h=o.append,g=h===void 0?!0:h,b=o.innerText,_=b===void 0?"":b;if(!g)return l(!0);if(Ur(o))return Kr(o,e),l(!0);if(Br(f,d)){var L=function(){return l(!0)},I=function(T,N,P,D,C){console.error(T,N,P,D,C);var F=C instanceof Error?C:new Error(String(T));c(F)};return Mt({appendToBody:r,attrs:d,innerText:_,onloadCb:L,onerrorCb:I})}l(!0)})},[4,Promise.all(t.map(n))];case 1:return i.sent(),[2]}})})}function Qa(t){var e=t.assetUrlList,r=t.appendCss,n=t.excludeCssList,i=t.appendToBody;if(e)for(var o=0,l=e;o<l.length;o++){var c=l[o];c.endsWith(".css")?r&&!n.includes(c)&&Rt({appendToBody:i,attrs:{href:c}}):Mt({appendToBody:i,attrs:{src:c}})}}function Za(t,e,r){return R(this,void 0,void 0,function(){var n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F,M,w,U,Q,$,z,Z,ne,W,x,B;return j(this,function(ee){switch(ee.label){case 0:return Ja(),n=t.additional_scripts,i=n===void 0?[]:n,o=t.additional_body_scripts,l=o===void 0?[]:o,c=e.src_map,f=c.headAssetList,d=f===void 0?[]:f,h=c.bodyAssetList,g=h===void 0?[]:h,b=c.webDirPath,_=c.chunkCssSrcList,L=_===void 0?[]:_,I=r.useAdditionalScript,T=I===void 0?!1:I,N=r.appendCss,P=N===void 0?!0:N,D=r.cssAppendTypes,C=D===void 0?["build","static","relative"]:D,F=r.getExcludeCssList,M=xr(r),w=m.commonUtil.merge2List(M,L),U=F?.(w,{version:e})||[],Q={excludeCssList:U,webDirPath:b,appendCss:P,cssAppendTypes:C,appendToBody:!1},$={excludeCssList:U,webDirPath:b,appendCss:P,cssAppendTypes:C,appendToBody:!0},T?(z=function(V){return V.endsWith(".css")?{tag:"staticLink",attrs:{href:V}}:{tag:"staticScript",attrs:{src:V}}},Z=i.map(z),ne=l.map(z),[4,jt(Z,Q)]):[3,3];case 1:return ee.sent(),[4,jt(ne,$)];case 2:ee.sent(),ee.label=3;case 3:return M.length&&Qa({assetUrlList:M,excludeCssList:U,appendToBody:!1}),W=[],x=[],B=[],d.forEach(function(V){Hr(V.tag)?W.push(V):x.push(V)}),g.forEach(function(V){Hr(V.tag)?W.push(V):B.push(V)}),W.length?[4,jt(W,Q)]:[3,5];case 4:return ee.sent(),nt(x,Q),nt(B,$),[2];case 5:return nt(x,Q),nt(B,$),[2]}})})}var Oe={ENABLE_DISK_CACHE:!1,ENABLE_DISK_CACHE_FOR_ERR:!0,ENABLE_SYNC_META:!0,STORAGE_TYPE:"localStorage",EXTRA_DATA_PREFIX:"HelExtraData"},Gt="[[ isEmitVerMatchInputVer ]]";function kt(t,e){var r,n=e.branchId,i=e.platform,o=e.emitVer,l=e.inputVer,c=e.projectId,f=Ae(i,"strictMatchVer",[e.strictMatchVer]),d=(0,m.getAppMeta)(t,i);if(f===!1)return(0,m.log)("".concat(Gt," set strictMatchVer false for app (").concat(t,"), trust emitVer (").concat(o,") is the target version")),!0;if(!o)return(0,m.log)("".concat(Gt," emitVer should not be null")),!0;if(!l&&d){if(n)return(0,m.log)("".concat(Gt," found branchId ").concat(n)),!0;var h=d.online_version,g=d.build_version;if(c){var b=((r=d.proj_ver)===null||r===void 0?void 0:r.map)||{},_=b[c];if(_)return o===_.b||o===g||o===_.o}return o===h||o===g}return o===l}function $a(t){var e=(0,m.getGlobalThis)();!m.commonUtil.isServer()&&!e.HelMicro&&((0,m.log)("auto bind hel-micro to global.HelMicro"),e.HelMicro=t)}var Ft=m.helConsts.DEFAULT_ONLINE_VER,Yr="http://localhost",Wr="http://127.0.0.1",Ut=["script","link","style"];function eo(t){var e=(0,m.getGlobalThis)().DOMParser,r=new e().parseFromString(t,"text/html"),n=[],i=function(o,l,c){o.querySelectorAll(c).forEach(function(f){var d=f.getAttributeNames(),h={};d.forEach(function(g){var b=f.getAttribute(g);b!==null&&(h[g]=b)}),n.push({head:l,tag:c,attrs:h,innerText:f.innerText})})};return Ut.forEach(function(o){return i(r.head,!0,o)}),Ut.forEach(function(o){return i(r.body,!1,o)}),n}var we={isSrcMatchHost:function(t,e){return e.startsWith(Yr)||e.startsWith(Wr)?t.startsWith(Yr)||t.startsWith(Wr):t.startsWith(e)},parseHtml:function(t){if((0,m.getGlobalThis)().DOMParser)return eo(t);var e=!0,r=[],n=function(i){return Ut.includes(i)};return Ca(t,{onTagOpen:function(i){n(i)&&r.push({tag:i,attrs:{},innerText:"",head:e})},onTagClose:function(i,o){if(i==="head"&&(e=!1),!!n(i)){var l=r[r.length-1];if(l){var c=o.children[0]||"";typeof c=="string"&&(l.innerText=c),l.attrs=o.attrs}}}}),r},convertToAssetList:function(t,e){var r=[],n=[],i=[],o=[],l=[],c=[];return t.forEach(function(f){var d=f.head,h=f.attrs,g=f.innerText,b=f.tag,_=d?r:n,L=h.src,I=h.href,T=h["data-helex"],N=h.rel,P=Oa(h,"data-helappend","1");if(b==="style")_.push({tag:b,attrs:h,innerText:g,append:!0});else{var D=L||I||"",C=D.endsWith(".css"),F=b==="link";if(!D)return;var M=!0,w=we.isSrcMatchHost(D,e);(N==="icon"||!w&&P!=="1"&&!T)&&(M=!1);var U=b;w||(Ir(D)?(U=F?"relativeLink":"relativeScript",C?l.push(D):c.push(D)):(U=F?"staticLink":"staticScript",C?i.push(D):o.push(D)));var Q={tag:U,attrs:h,innerText:g,append:M};_.push(Q)}}),{headAssetList:r,bodyAssetList:n,staticCssSrcList:i,staticJsSrcList:o,relativeCssSrcList:l,relativeJsSrcList:c}},getChunkList:function(t){var e=[],r=[];return t.forEach(function(n){var i=n.attrs,o=i.href,l=i.src,c=o||l||"";c&&(c.endsWith(".css")?e.push(c):r.push(c))}),{chunkCssSrcList:e,chunkJsSrcList:r}},extactHelMeta:function(t){var e=t.code,r=t.data,n=t.msg;if(e&&r){if(e!=="0")throw new Error(n||"server error occurred");return r}return t},getHelMeta:function(t,e,r){return R(this,void 0,void 0,function(){var n,i,o,l;return j(this,function(c){switch(c.label){case 0:n=function(f){return f===void 0&&(f=""),"fetch ".concat(t," helmeta by url ").concat(e," failed in custom mode! ").concat(f)},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,He(e)];case 2:if(i=c.sent().reply,o=we.extactHelMeta(i),o&&o.app&&o.version)return o.app.__fromCust=!0,[2,o];if(r)throw new Error(n());return(0,m.log)("[[ getCustomMeta ]] 404 is a expected behavior for custom mode, user can ignore it"),[2,null];case 3:if(l=c.sent(),r)throw new Error(n(l.messgae));return m.commonUtil.noop("json parse fail or other error"),[3,4];case 4:return[2]}})})}};function Xr(t){if(t){var e=t.enable,r=e===void 0?!0:e,n=t.host;return!!(n&&r)}return!1}function to(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h,b,g,b,_,L,I,T,N,P,D,C,F,M,w;return j(this,function(U){switch(U.label){case 0:return r=e.host,n=e.appGroupName,i=e.skipFetchHelMeta,o=i===void 0?!1:i,l=e.isApiUrl,c=e.parseHtml,f=e.attachHostSuffix,d=f===void 0?!0:f,h=Date.now(),l?[4,we.getHelMeta(t,r,!0)]:[3,2];case 1:return b=U.sent(),[2,b];case 2:return o?[3,4]:(g=r.endsWith("hel-meta.json")?r:"".concat(r,"/hel-meta.json?_t=").concat(h),[4,we.getHelMeta(t,g)]);case 3:if(b=U.sent(),b)return[2,b];U.label=4;case 4:_="",U.label=5;case 5:return U.trys.push([5,7,,8]),L=d?"".concat(r,"/index.html?_t=").concat(h):r,[4,He(L,!1)];case 6:if(I=U.sent(),_=I.reply||"",![200,304].includes(I.status))throw new Error("status ".concat(I.status));return[3,8];case 7:throw T=U.sent(),new Error("".concat(T.message," from ").concat(r));case 8:return N=c||we.parseHtml,P=N(_),D=we.convertToAssetList(P,r),C=D.headAssetList,F=D.bodyAssetList,M=Me(D,["headAssetList","bodyAssetList"]),w=we.getChunkList(C.concat(F)),[2,{app:{__fromCust:!0,name:t,app_group_name:n||t,online_version:Ft,build_version:Ft},version:{sub_app_name:t,sub_app_version:Ft,src_map:H(H({webDirPath:r,headAssetList:C,bodyAssetList:F},w),M)}}]}})})}var Jr=m.commonUtil,ro=m.helConsts,at=m.log,qr=ro.KEY_ASSET_CTX,zr={recordAssetCtx:function(t,e,r){var n=t.name,i=t.app_group_name,o=e.src_map,l=e.version_tag||e.sub_app_version,c=o.chunkCssSrcList,f=c===void 0?[]:c,d=o.chunkJsSrcList,h=d===void 0?[]:d,g=Tt(r,"beforeAppendAssetNode"),b=f.concat(h),_=r.platform;b.forEach(function(L){var I=(0,m.getCommonData)(qr,L)||{};I.marked||(Object.assign(I,{marked:!0,platform:_,groupName:i,name:n,ver:l,beforeAppend:g}),(0,m.setCommonData)(qr,L,I))})},tryTriggerOnFetchMetaSuccess:function(t,e,r){var n=r.loadOptions,i=r.fromFallback,o=Tt(n,"onFetchMetaSuccess");o?.({app:t,version:e,fromFallback:i})}};function Qr(t){var e=rt(t.platform,"onFetchMetaFailed",t.onFetchMetaFailed),r=Tt(t,"onFetchMetaFailed");return r||e}function no(t,e){var r=(0,m.getPlatformConfig)(t).apiMode;return e||r}function Zr(t,e){var r=ge(t),n=no(r,e);return{platform:r,apiMode:n}}function $r(t,e,r){return R(this,void 0,void 0,function(){var n,i;return j(this,function(o){switch(o.label){case 0:return n=_t(),i=Lt(t,e,r),n?[4,n.removeItem(i)]:[3,2];case 1:o.sent(),o.label=2;case 2:return et().removeItem(i),[2]}})})}function en(t,e,r){return R(this,void 0,void 0,function(){var n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F,M,w,U,Q,$,z,Z,ne,W,x,B,ee,V,G,X,q,te=this;return j(this,function(re){switch(re.label){case 0:return n=e.enableDiskCache,i=n===void 0?Oe.ENABLE_DISK_CACHE:n,o=e.enableSyncMeta,l=o===void 0?Oe.ENABLE_SYNC_META:o,c=e.versionId,f=c===void 0?"":c,d=e.projectId,h=d===void 0?"":d,g=e.branchId,b=e.isFullVersion,_=b===void 0?!1:b,L=e.custom,I=e.strictMatchVer,T=e.semverApi,N=(r||{}).callRemote,P=N===void 0?!0:N,D=Zr(e.platform,e.apiMode),C=D.platform,F=D.apiMode,Xr(L)?[4,to(t,L)]:[3,2];case 1:return M=re.sent(),w=M.app,U=M.version,Ke(w,{appVersion:U,platform:C,toDisk:!1,loadOptions:e}),(0,m.setAppPlatform)(w.app_group_name,C),(0,m.setAppPlatformByAppName)(t,C),[2,{appInfo:w,appVersion:U}];case 2:return Q=(0,m.getAppMeta)(t,C),$=(0,m.getVersion)(t,{platform:C,versionId:f}),z=!T&&!g,z&&Q&&$&&(Z=$.version_tag||$.sub_app_version,kt(t,{platform:C,projectId:h,emitVer:Z,inputVer:f,strictMatchVer:I}))?[2,{appInfo:Q,appVersion:$}]:(ne={platform:C,apiMode:F,versionId:f,projectId:h,branchId:g,isFullVersion:_,loadOptions:e},W=null,x=function(ue){return R(te,void 0,void 0,function(){var pe;return j(this,function(fe){switch(fe.label){case 0:return ue?[4,io(t,ne)]:[3,2];case 1:return pe=fe.sent(),[2,pe];case 2:return[2,null]}})})},i?[4,Cr(t,e)]:[3,9]);case 3:return W=re.sent(),W?[3,5]:(at("[[ getAppFromRemoteOrLocal ]] get meta from disk but failed!"),[4,x(P)]);case 4:return W=re.sent(),[3,8];case 5:return B=W.appInfo,ee=W.appVersion,at("[[ getAppFromRemoteOrLocal ]] disk meta:",W),V=ee.version_tag||ee.sub_app_version,f&&V!==f?[4,x(P)]:[3,7];case 6:return W=re.sent(),at("[[ getAppFromRemoteOrLocal ]] remote meta:",W),[3,8];case 7:Ke(B,{appVersion:ee,platform:C,toDisk:!1,loadOptions:e}),x(l).catch(function(ue){return Jr.noop(ue)}),re.label=8;case 8:return[3,11];case 9:return[4,x(P)];case 10:W=re.sent(),re.label=11;case 11:return W&&(G=W.appInfo,X=G.app_group_name,q=G.name,(0,m.setAppPlatform)(X,C),(0,m.setAppPlatformByAppName)(q,C)),[2,W]}})})}function ao(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,c,l,c;return j(this,function(f){switch(f.label){case 0:r=e.isFirstCall,n=r===void 0?!0:r,i=e.enableDiskCacheForErr,o=i===void 0?Oe.ENABLE_DISK_CACHE_FOR_ERR:i,f.label=1;case 1:return f.trys.push([1,3,,6]),[4,en(t,e)];case 2:return c=f.sent(),[2,{data:c,err:""}];case 3:if(l=f.sent(),n)throw l;return Qr(e)?[2,{data:null,err:l.message}]:(c=null,o?[4,Cr(t,e)]:[3,5]);case 4:if(c=f.sent(),!c)throw l;Jr.nbalert(`
|
|
13
|
+
[Dev mode alert err only]: `.concat(l.message,`, hel-micro will try use cached data to keep your app works well,
|
|
14
|
+
please check your network if this behavior is not as you expected! you can also set enableDiskCacheForErr = false
|
|
15
|
+
to skip reusing cached data.
|
|
16
|
+
`)),f.label=5;case 5:return[2,{data:c,err:l}];case 6:return[2]}})})}function oo(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f;return j(this,function(d){switch(d.label){case 0:return r=Zr(e.platform,e.apiMode),n=r.platform,i=r.apiMode,o=H(H({},e),{platform:n,apiMode:i}),[4,Dt(t,o)];case 1:if(l=d.sent(),c=l.app,f=l.version,at("[[ getAppAndVersion ]] result:",{app:c,version:f}),!f)throw new Error("no version found or builded");return[2,{appInfo:c,appVersion:f}]}})})}function Ke(t,e){var r=e.appVersion,n=e.platform,i=e.toDisk,o=i===void 0?!0:i,l=e.loadOptions;if(!(!t||!r)){var c=t,f=c.name;if(o){var d=Lt(f,l.getCacheKey),h={app:t,version:r};wa(d,h,l.storageType)}if(l.semverApi){var g=(0,m.getAppMeta)(f,n);g?.__setByLatest!==!0&&(c=l.versionId?c:H(H({},c),{__setByLatest:!0}),(0,m.setAppMeta)(c,n))}else(0,m.setAppMeta)(t,n);(0,m.setVersion)(f,r,{platform:n});var b=xr(l),_=r.version_tag||r.sub_app_version;(0,m.setVerExtraCssList)(f,b,{platform:n,versionId:_})}}function io(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l;return j(this,function(c){switch(c.label){case 0:return r=e.platform,n=e.loadOptions,[4,oo(t,e)];case 1:return i=c.sent(),o=i.appInfo,l=i.appVersion,Ke(o,{appVersion:l,platform:r,loadOptions:n}),[2,i]}})})}function tn(t,e){return e===void 0&&(e={}),R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F,M=this;return j(this,function(w){switch(w.label){case 0:r=e.isFirstCall,n=r===void 0?!0:r,i=e.controlLoadAssets,o=i===void 0?!1:i,l=e.platform,c=e.versionId,f=c===void 0?"":c,w.label=1;case 1:return w.trys.push([1,6,,9]),[4,ao(t,e)];case 2:return d=w.sent(),h=d.data,g=d.err,b=h||{},_=b.appInfo,L=b.appVersion,I=!_||!L,T=!1,I&&!n?(N=Qr(e),N?[4,Promise.resolve(N({platform:l,appName:t,versionId:f}))]:[3,4]):[3,4];case 3:P=w.sent(),P&&(_=P.app,L=P.version,T=!0,Ke(_,{appVersion:L,platform:ge(l),toDisk:!1,loadOptions:e})),w.label=4;case 4:if(!_)throw new Error(g||"app[".concat(t,"] not exist"));if(!L)throw new Error(g||"app[".concat(t,"]'s version[").concat(f,"] not exist"));return zr.tryTriggerOnFetchMetaSuccess(_,L,{loadOptions:e,fromFallback:T}),zr.recordAssetCtx(_,L,e),D=function(){return R(M,void 0,void 0,function(){return j(this,function(U){switch(U.label){case 0:return[4,Za(_,L,e)];case 1:return U.sent(),[2]}})})},o?[2,D]:[4,D()];case 5:return w.sent(),[2,null];case 6:return C=w.sent(),n?(console.error("loadApp err and try one more time: ",C),[4,tn(t,H(H({},e),{isFirstCall:!1}))]):[3,8];case 7:return F=w.sent(),[2,F];case 8:throw new Error("loadApp [".concat(t,"] err (").concat(C.message,"), recommend config onFetchMetaFailed hook"));case 9:return[2]}})})}function so(t,e){return R(this,void 0,Promise,function(){var r;return j(this,function(n){switch(n.label){case 0:return[4,Wa(t,e)];case 1:return r=n.sent(),[2,r]}})})}function uo(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h,g;return j(this,function(b){switch(b.label){case 0:return r=e||{},n=r.versionId,i=r.projectId,o=r.branchId,l=r.platform,c=r.reuseCache,f=c===void 0?!0:c,f&&!n&&!i&&!o&&(h=(0,m.getAppMeta)(t,l),g=(0,m.getVersion)(t,{platform:l}),h&&g&&(d={app:h,version:g})),d?[3,2]:[4,Dt(t,e||{})];case 1:d=b.sent(),b.label=2;case 2:return[2,d]}})})}function co(t,e){var r=e||{},n=r.versionId,i=r.platform,o=r.apiMode,l=o===void 0?Be:o,c=r.protocol,f=c===void 0?"http":c,d=r.projectId,h=r.branchId;r.semverApi;var g=wt(t,{platform:i,versionId:n,branchId:h,apiMode:l,projectId:d}).url;return f==="http"&&(g=g.replace("https:","http:")),g}function lo(t,e,r){return R(this,void 0,void 0,function(){var n;return j(this,function(i){switch(i.label){case 0:return Array.isArray(t)?(n=[],t.forEach(function(o){return n.push($r(o,e,r))}),[4,Promise.all(n)]):[3,2];case 1:return i.sent(),[3,4];case 2:return[4,$r(t,e,r)];case 3:i.sent(),i.label=4;case 4:return[2]}})})}var rn=Object.freeze({__proto__:null,getSubAppVersion:so,getSubAppMeta:uo,getMetaDataUrl:co,clearDiskCachedApp:lo});function nn(t,e){var r=(0,m.getVersion)(t,e);return r?.src_map.webDirPath||""}function Ge(t,e){var r=e||{},n=ge(r.platform),i=r.versionId||"";if(!i){var o=(0,m.getVersion)(t,{platform:n});if(o)i=o.version_tag||o.sub_app_version;else{var l=(0,m.getAppMeta)(t,n);i=l?.online_version||l?.build_version||""}}return{platform:n,versionId:i}}function po(t,e){var r={static:[],build:[]},n=(0,m.getVersion)(t,e);if(n){var i=n.src_map,o=i.webDirPath,l=i.chunkCssSrcList;l.forEach(function(c){c.startsWith(o)?r.build.push(c):r.static.push(c)})}return r}var fo=nn,an=Object.freeze({__proto__:null,getPlatAndVer:Ge,getGroupedStyleList:po,getWebDirPath:fo}),on=m.helConsts.KEY_CSS_STR,Bt=m.helLoadStatus,sn=Bt.LOADED,un=Bt.LOADING,vo=Bt.NOT_LOAD,ot=m.commonUtil.merge2List,Ht=(0,m.getHelEventBus)(),Kt=m.helEvents.STYLE_STR_FETCHED,Se={isStyleStatusMatch:function(t,e,r){var n=Ge(t,r),i=n.platform,o=n.versionId,l=(0,m.getVerStyleStrStatus)(t,{platform:i,versionId:o});return l===e},getSelfCssList:function(t,e){var r=Ge(t,e),n=(0,m.getVersion)(t,r),i=(0,m.getVerExtraCssList)(t,r),o=[],l=[];if(n){var c=n.src_map||{},f=c.chunkCssSrcList,d=f===void 0?[]:f,h=c.headAssetList,g=h===void 0?[]:h,b=c.bodyAssetList,_=b===void 0?[]:b;o=d;var L=function(T){var N=[];return T.forEach(function(P){var D=P.append,C=D===void 0?!0:D,F=P.attrs.href||"";F.endsWith(".css")&&C&&N.push(F)}),N},I=ot(L(g),L(_));l=ot(I,o)}return l=ot(l,i),{buildCssList:o,initExtraCssList:i,appCssList:l}},fetchStyleStr:function(t){return R(this,void 0,void 0,function(){var e,r,n,i,o,l,c;return j(this,function(f){switch(f.label){case 0:e="",r=0,n=t.length,f.label=1;case 1:if(!(r<n))return[3,7];if(i=t[r],!i.endsWith(".css"))return[3,6];if(o=(0,m.getCommonData)(on,i),o)return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,He(i,!1)];case 3:return l=f.sent(),o=l.reply,(0,m.setCommonData)(on,i,o),[3,5];case 4:return c=f.sent(),console.error(c),[3,5];case 5:e+=o,f.label=6;case 6:return r++,[3,1];case 7:return[2,e]}})})},waitStyleReady:function(t,e){return R(this,void 0,void 0,function(){var r;return j(this,function(n){switch(n.label){case 0:return r=null,[4,new Promise(function(i){r=function(o){var l=o.appName,c=o.platform,f=o.versionId,d=e.branchId,h=e.versionId,g=e.platform,b=e.strictMatchVer;l!==t||c!==g||!kt(t,{branchId:d,platform:g,emitVer:f,inputVer:h,strictMatchVer:b})||i(!0)},Ht.on(Kt,r)})];case 1:return n.sent(),r&&Ht.off(Kt,r),[2]}})})},computeStyleData:function(t,e){var r=Ge(t,e),n=Se.getSelfCssList(t,e),i=n.appCssList,o=n.buildCssList,l=n.initExtraCssList,c=e.extraCssList,f=c===void 0?[]:c,d=e.getExcludeCssList,h=ot(i,f),g=d?.(h,{version:(0,m.getVersion)(t,r)})||[],b=!g.length&&!f.length,_=h;return g.length&&(_=h.filter(function(L){return!g.includes(L)})),{validCssList:_,onlyUseAppCssList:b,buildCssList:o,initExtraCssList:l,appCssList:i}},fetchStyleData:function(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D;return j(this,function(C){switch(C.label){case 0:return r=Ge(t,e),n=e.extraStyleStr,i=n===void 0?"":n,o=e.cssListToStr,l=e.extraCssList,c=l===void 0?[]:l,f=e.strictMatchVer,d=e.branchId,h=Se.computeStyleData(t,e),g=h.validCssList,b=h.onlyUseAppCssList,_=h.buildCssList,L=h.initExtraCssList,I=h.appCssList,T={validCssList:g,buildCssList:_,initExtraCssList:L,appCssList:I,extraCssList:c,extraStyleStr:i,renderStyleStr:""},o?b?(N=(0,m.getVerStyleStrStatus)(t,r),P="",N!==un?[3,2]:[4,Se.waitStyleReady(t,H(H({},r),{strictMatchVer:f,branchId:d}))]):[3,6]:[2,T];case 1:return C.sent(),P=(0,m.getAppStyleStr)(t,r)||"",[3,5];case 2:return N!==vo?[3,4]:((0,m.setVerStyleStrStatus)(t,un,r),[4,Se.fetchStyleStr(I)]);case 3:return P=C.sent(),(0,m.setAppStyleStr)(t,P,r),(0,m.setVerStyleStrStatus)(t,sn,r),Ht.emit(Kt,H({appName:t},r)),[3,5];case 4:P=(0,m.getAppStyleStr)(t,r)||"",C.label=5;case 5:return T.renderStyleStr="".concat(P).concat(i),[3,8];case 6:return[4,Se.fetchStyleStr(g)];case 7:D=C.sent(),T.renderStyleStr="".concat(D).concat(i),C.label=8;case 8:return[2,T]}})})}};function mo(t,e){return R(this,void 0,Promise,function(){var r;return j(this,function(n){switch(n.label){case 0:return[4,Se.fetchStyleData(t,e||{})];case 1:return r=n.sent(),[2,r]}})})}function ho(t,e){var r=Ge(t,e),n=(0,m.getAppStyleStr)(t,r);return n}function go(t,e){var r=Se.getSelfCssList(t,e||{});return r}function bo(t){return R(this,void 0,void 0,function(){var e;return j(this,function(r){switch(r.label){case 0:return[4,Se.fetchStyleStr(t)];case 1:return e=r.sent(),[2,e]}})})}function yo(t,e){return Se.isStyleStatusMatch(t,sn,e||{})}function Ao(t){var e=(0,m.getGlobalThis)();if(e.document){var r=e.document.querySelectorAll('style[data-gname="'.concat(t,'"]'));r.forEach(m.commonUtil.disableNode)}}function _o(t){var e=m.commonDataUtil.getStyleTagText(t);return e}function So(t,e){var r=Yt(t,e),n=m.commonDataUtil.getIgnoreCssPrefixCssUrlList(r)||[];return n}function Yt(t,e){var r=(e||{}).custom||{},n="",i=r.host,o=r.enable,l=o===void 0?!0:o;if(i&&l)if(i.endsWith(".json")||i.endsWith(".html")){var c=i.split("/"),f=c.length;c.splice(f-1,f),n=c.join("/")}else n=i;else n=nn(t,e);return n}var cn=Object.freeze({__proto__:null,fetchAppStyleData:mo,getAppStyleStr:ho,getAppCssList:go,fetchStyleByUrlList:bo,isStyleFetched:yo,disableStyleTags:Ao,getStyleTagText:_o,getIgnoredCssUrlList:So,getSuitableCssPrefix:Yt});function ln(t,e,r){var n=r.platform,i=(0,m.getAppMeta)(e,n);if(!i){var o=(0,m.getAppMeta)(t,n),l=(0,m.getVersion)(t,r);if(o&&l){(0,m.setAppMeta)(H(H({},o),{name:e,__addedByTrust:!0}),n),(0,m.setVersion)(e,H(H({},l),{sub_app_name:e,__addedByTrust:!0}),{platform:n});var c=(0,m.getVerExtraCssList)(t,r);(0,m.setVerExtraCssList)(e,c,r)}}}function Eo(t,e,r){var n=r.platform,i=r.emitPlatform,o=r.versionId,l=r.emitVer,c=(0,m.getVerLib)(t,r);if(!c){ln(t,e,r);var f=(0,m.getVerLib)(e,{platform:n,versionId:o});if(!f&&i&&(f=(0,m.getVerLib)(e,{platform:i,versionId:l,strictMatchVer:!1})),!f)throw new Error("seems plat ".concat(i," emit null lib for ").concat(e));return(0,m.libReady)(e,f,{platform:n,appName:t,versionId:o}),!1}return!0}function Lo(t,e,r){var n=r.platform,i=r.emitPlatform,o=r.versionId,l=r.emitVer,c=(0,m.getVerApp)(t,r);if(!c){ln(t,e,r);var f=(0,m.getVerApp)(e,{platform:n,versionId:o});if(!f&&i&&(f=(0,m.getVerApp)(e,{platform:i,versionId:l,strictMatchVer:!1})),!f)throw new Error("seems plat ".concat(i," emit null app for ").concat(e));return yt(H(H({},f),{platform:n,appGroupName:e,appName:t,versionId:o})),!1}return!0}function Wt(t,e){var r=e.versionId,n=r===void 0?"":r,i=e.isLib,o=ge(e.platform),l=Ae(o,"strictMatchVer",[e.strictMatchVer]),c=H(H({},e),{strictMatchVer:l}),f=t,d=e.custom;Xr(d)&&(f=d.appGroupName||t,c.strictMatchVer=!1);var h=(0,m.getAppMeta)(f,o);if(e.semverApi&&!n&&h&&h.__setByLatest!==!0)return null;if(i){var g=(0,m.getVerLib)(f,c),b={appName:f,appGroupName:h?.app_group_name||"",platform:o,appProperties:g,isLib:!0,versionId:n,Comp:null,lifecycle:void 0};return g?b:null}var _=(0,m.getVerApp)(f,c);return _||null}function pn(t,e,r){var n="[[ judgeAppReady ]]",i=e.versionId,o=i===void 0?"":i,l=e.projectId,c=e.appName,f=e.platform,d=e.next,h=e.error,g=e.isLib,b=e.strictMatchVer;(0,m.log)("".concat(n," receive emit app and judge (emitAppInfo, judgeOptions):"),t,{inputVer:o,projectId:l,appName:c,platform:f,isLib:g,strictMatchVer:b});var _=ge(f),L=t.appName,I=t.appGroupName,T=t.platform,N=T===void 0?_:T,P=t.versionId,D="".concat(f,"/").concat(c,"/").concat(o),C=(0,m.getAppMeta)(c,f),F=r.branchId,M=r.custom,w=r.trust,U=function(q){try{var te=g?Eo(c,I,q):Lo(c,I,q);return te}catch(re){return h(re),!1}};if(M){var Q=M.enable,$=Q===void 0?!0:Q,z=M.host,Z=M.appGroupName,ne=M.trust,W=ne===void 0?!1:ne,x=function(){return I&&(I===c||I===Z)};if($&&z){(0,m.log)("".concat(n," judge for custom:"),M);var B=function(q){(0,m.log)("".concat(n," custom conf ").concat(q?"":"mis","match current emit app!")),q&&d()};if(!W)return B(x());var ee=U({versionId:o,platform:_,emitPlatform:N,emitVer:P});return B(ee)}}if(b===!1&&I&&C?.app_group_name===I&&_===N)return(0,m.log)("".concat(n," treat emitApp as wanted when strictMatchVer is false (appInfo):"),t),d();var V=function(){return(0,m.log)("".concat(n," still wait ").concat(D," to be emitted (emitAppInfo,toMatch):"),t,G)},G={branchId:F,platform:f,emitVer:P,inputVer:o,projectId:l,strictMatchVer:b};if(c!==L||!kt(c,G))return V();var X=Ae(_,"trustAppNames",[null,[]],{emptyArrIsNull:!1});if(_!==N&&(w||X.includes(c))){var ee=U({versionId:o,platform:_,emitPlatform:N,emitVer:P});if(!ee)return(0,m.log)("".concat(n," transfer ").concat(N," app [").concat(c,"] to ").concat(_," plat due to being in trustAppNames")),V()}d()}var fn=Object.freeze({__proto__:null,getLibOrApp:Wt,judgeAppReady:pn});function dn(t){var e=t.platform,r=Me(t,["platform"]);(0,m.initPlatformConfig)(r,e)}function vn(){return(0,m.isSubApp)()}function Xt(t){if(t&&!t.default)try{t.default=t}catch{}return t}function it(t){var e=(0,m.getGlobalThis)();Object.keys(t).forEach(function(r){var n=t[r];n&&(e[r]=n)})}function mn(t){var e=Xt(t.React),r=Xt(t.ReactDOM),n=t.ReactIs||null,i=t.ReactReconciler||null,o={LEAH_React:e,LEAH_ReactDOM:r,LEAH_ReactIs:n,LEAH_ReactReconciler:i,React:e,ReactDOM:r,ReactIs:n,ReactReconciler:i};it(o)}function hn(t){var e=Xt(t.Vue),r={LEAH_Vue:e,Vue:e};it(r)}function gn(t){return"".concat(Oe.EXTRA_DATA_PREFIX,".").concat(t)}function bn(t,e){var r,n,i=e??!1,o=(n=(r=(0,m.getGlobalThis)().localStorage)===null||r===void 0?void 0:r.getItem(gn(t)))!==null&&n!==void 0?n:null;return o?i?JSON.parse(o):o:null}function yn(t,e,r){var n,i=r??!1,o=i?JSON.stringify(e):e;(n=(0,m.getGlobalThis)().localStorage)===null||n===void 0||n.setItem(gn(t),o)}function An(t){var e;return typeof t=="string"?(e=(0,m.getGlobalThis)())===null||e===void 0?void 0:e.document.getElementById(t):t}function _n(t,e){return{name:t,platform:e?.platform||(0,m.getAppPlatform)(t),versionId:e?.versionId||"",getShadowAppRoot:An,getShadowBodyRoot:An}}var Jt=m.commonUtil.getObjsVal,Io=m.commonUtil.purify,To=Oe.ENABLE_DISK_CACHE,Co=Oe.ENABLE_SYNC_META,Po=Oe.STORAGE_TYPE,qt="preFetchLib",No="preFetchApp",ke="preFetch";function Sn(t,e){var r=typeof e=="string"?{versionId:e}:H({},e||{});r.platform=ge(r.platform),r.isLib=t;var n=r.platform;return r.strictMatchVer=Ae(n,"strictMatchVer",[r.strictMatchVer]),r.storageType=r.storageType||"indexedDB",r.semverApi=Ae(n,"semverApi",[r.semverApi]),r}function Oo(t,e,r){if(r.shadow){if(!e)return;var n=Yt(t,r);m.commonDataUtil.setIgnoreCssPrefix(n),m.commonDataUtil.setIgnoreStyleTagKey(t),m.commonDataUtil.setIgnoreStyleTagKey(e),m.commonDataUtil.setIgnoreCssPrefixKey(n,e)}}function En(t,e,r){return R(this,void 0,void 0,function(){var n,i,o,l,c,f,d,h,g,b;return j(this,function(_){switch(_.label){case 0:return n=(0,m.getHelEventBus)(),i=e.platform,o=e.isLib,l=o===void 0?!1:o,c=e.versionId,f=e.projectId,d=e.strictMatchVer,h=l?m.helEvents.SUB_LIB_LOADED:m.helEvents.SUB_APP_LOADED,g=null,[4,new Promise(function(L,I){if(g=function(N){pn(N,{appName:t,platform:i,versionId:c,projectId:f,isLib:l,next:L,error:I,strictMatchVer:d},e)},n.on(h,g),r){var T=(0,m.getAppMeta)(t,i);T&&Oo(t,T.app_group_name,e),r().catch(I)}})];case 1:return _.sent(),g&&n.off(h,g),b=Wt(t,e),[2,b]}})})}function Ln(t,e){return R(this,void 0,void 0,function(){var r,n,i,o,l,c,f;return j(this,function(d){switch(d.label){case 0:r=null,n=e.versionId,i=e.isLib,o=i?qt:No,d.label=1;case 1:return d.trys.push([1,7,,8]),r=Wt(t,e),r&&(!n||n&&r.versionId===n)?((0,m.log)("[[ ".concat(o," ]] return cached app:"),t,e),[2,{emitApp:r,msg:""}]):(l=null,c=(0,m.getVerLoadStatus)(t,e),c!==m.helLoadStatus.LOADED?[3,3]:[4,En(t,e)]);case 2:return r=d.sent(),(0,m.log)("[[ ".concat(o," ]] return emit app:"),t,e,r),[2,{emitApp:r,msg:""}];case 3:return c===m.helLoadStatus.LOADING?[3,5]:((0,m.setVerLoadStatus)(t,m.helLoadStatus.LOADING,e),[4,tn(t,H(H({},e),{controlLoadAssets:!0}))]);case 4:l=d.sent(),(0,m.perfPeek)(ke,"loadApp"),d.label=5;case 5:return[4,En(t,e,l)];case 6:return r=d.sent(),(0,m.perfPeek)(ke,"waitAppEmit"),(0,m.log)("[[ ".concat(o," ]] return fetch&emit app:"),t,e,r),[2,{emitApp:r,msg:""}];case 7:return f=d.sent(),console.error(f),(0,m.setVerLoadStatus)(t,m.helLoadStatus.NOT_LOAD,e),[2,{emitApp:r,msg:f.message}];case 8:return[2]}})})}function zt(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h;return j(this,function(g){switch(g.label){case 0:return(0,m.perfMark)(ke),r="".concat(qt,"(").concat(t,")"),n=Vr(r,!0),i=Sn(!0,e),[4,Ln(t,i)];case 1:if(o=g.sent(),l=o.emitApp,c=o.msg,f=l?.appProperties,!f&&i.onLibNull&&(d=i.onLibNull(t,{versionId:i.versionId}),d&&(f=d)),Ct(r,n),(0,m.perfPeek)(ke,"end",!0),!f)throw h=c?" details : ".concat(c):"",new Error("".concat(qt," ").concat(t," fail from ").concat(i.platform,", it may be an invalid module!").concat(h));return[2,f]}})})}function In(t,e){return R(this,void 0,void 0,function(){var r,n;return j(this,function(i){switch(i.label){case 0:return(0,m.perfMark)(ke),r=Sn(!1,e),[4,Ln(t,r)];case 1:return n=i.sent(),(0,m.perfPeek)(ke,"end",!0),[2,n?.emitApp||null]}})})}function Tn(t,e){return R(this,void 0,Promise,function(){var r,n,i,o,l,c,f,d,h,g,b,_,L,I,T,N,P,D,C,F,M,w,U,Q,$;return j(this,function(z){switch(z.label){case 0:if(r=e?.preFetchConfigs||{},n=H({semverApi:!1},e?.common||{}),i=ge(n.platform),o=n.versionIdList,l=o===void 0?[]:o,c=n.projectIdList,f=c===void 0?[]:c,d=n.branchIdList,h=d===void 0?[]:d,g=[],b=[],_=[],t.length>8)throw new Error("only support 8 appName at most!");L=[],I=[],T={},N=[];for(P in t)N.push(P);D=0,z.label=1;case 1:return D<N.length?(C=N[D],F=t[C],M=r[F],w={platform:i,versionId:l[C]||"",projectId:f[C]||"",branchId:h[C]||""},typeof M=="string"&&M?w.versionId=M:typeof M=="object"&&M&&(w=H(H({},w),Io(M)),w.platform=i),T[F]=w,w.enableDiskCache=Jt([w,n],"enableDiskCache",To),w.enableSyncMeta=Jt([w,n],"enableSyncMeta",Co),w.storageType=Jt([w,n],"storageType",Po),[4,en(F,w,{callRemote:!1})]):[3,4];case 2:U=z.sent(),U||(I.push(F),g[C]=w.versionId||"",b[C]=w.projectId||"",_[C]=w.branchId||""),z.label=3;case 3:return D++,[3,1];case 4:return n.versionIdList=g,n.projectIdList=b,n.branchIdList=_,n.semverApi?[4,Promise.all(I.map(function(Z){return Dt(Z,T[Z])}))]:[3,6];case 5:return L=z.sent(),[3,8];case 6:return[4,Xa(I,n)];case 7:L=z.sent(),z.label=8;case 8:return L.forEach(function(Z){var ne=Z.app,W=Z.version,x=T[ne.name]||{};Ke(ne,{appVersion:W,platform:i,toDisk:x.enableDiskCache,loadOptions:x})}),Q=t.map(function(Z){return zt(Z,T[Z])}),[4,Promise.all(Q)];case 9:return $=z.sent(),[2,$]}})})}var wo=Object.freeze({__proto__:null,core:bt,VER:_r,emitApp:yt,getAppCacheKey:tt,getCachedAppMeta:Et,appMetaSrv:rn,appParamSrv:an,appStyleSrv:cn,logicSrv:fn,init:dn,isSubApp:vn,bindExternals:it,bindReactRuntime:mn,bindVueRuntime:hn,getExtraData:bn,setExtraData:yn,getFakeHelContext:_n,batchPreFetchLib:Tn,preFetchApp:In,preFetchLib:zt}),st=m.commonUtil.purify,Do=(0,m.getUserEventBus)(),Vo=["eventBus","getExtraData","setExtraData","bindExternals","bindVueRuntime","bindReactRuntime","isSubApp"],ut={ignoreFns:["tryGetAppName","log","commonUtil","getCommonData","setCommonData","setGlobalThis"],arg1PlatFns:["getPlatformConfig","getSharedCache"],arg2PlatFns:["initPlatformConfig","getAppMeta","setAppMeta","tryGetVersion","setAppPlatform"],arg2PlatObjFns:[]},xo=["preFetchLib","preFetchApp"],Mo=["getSubAppMeta","getMetaDataUrl"],Ro=["emitApp","init"],jo=["getAppCacheKey"];function Go(t,e){var r=this,n=e.fnName,i=e.fn,o=e.isCore,l=e.preFetchOptions;return function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];var d=function(P){return H({platform:t},st(P||{}))},h=c[0],g=c[1],b=c[2];if(o){if(n==="getPlatform")return t;ut.arg1PlatFns.includes(n)?c[0]=h||t:ut.arg2PlatFns.includes(n)?c[1]=g||t:ut.arg2PlatObjFns.includes(n)?c[1]=d(g):ut.ignoreFns.includes(n)||(n.startsWith("set")?c[2]=d(b):c[1]=d(g))}else if(n==="batchPreFetchLib"){var _=g||{},L=d(_.common);c[1]=H(H({},_),{common:L})}else if(xo.includes(n)){var I=st(typeof g=="string"?{versionId:g}:g||{});l&&(I=st(H(H({},l),I))),c[1]=H({platform:t},I)}else if(Mo.includes(n)){var T=(l||{}).semverApi,N=T===void 0?!0:T;c[1]=d(H({semverApi:N},st(g||{})))}else Ro.includes(n)?c[0]=d(h):jo.includes(n)?c[1]=g||t:c[1]=d(g);return i.apply(r,c)}}function Cn(t,e,r){var n=r.preFetchOptions,i=r.isCore,o={};return Object.keys(e).forEach(function(l){var c=e[l];if(Vo.includes(l)){o[l]=c;return}var f=typeof c;if(f==="function"){var d={fnName:l,fn:c,isCore:i,preFetchOptions:n};o[l]=Go(t,d);return}if(c&&f==="object"){var h=H(H({},r),{isCore:l==="core"});o[l]=Cn(t,c,h);return}o[l]=c}),o}function Qt(t,e){var r=Cn(t,wo,{preFetchOptions:e});return r.createInstance=Qt,r.createOriginInstance=Pn,r.resetGlobalThis=m.resetGlobalThis,r.eventBus=Do,r.default=r,r}function Pn(t,e){var r=e||{};r.trustAppNames;var n=Me(r,["trustAppNames"]);return(0,m.originInit)(t,e),Qt(t,n)}var Nn=_r,ko=zt,Fo=In,Uo=Tn,Bo=cn,Ho=an,Ko=rn,Yo=fn,Wo=yt,Xo=dn,Jo=vn,qo=tt,zo=Et,Qo=_n,Zo=bn,$o=yn,ei=it,On=hn,wn=mn,ti=bt,ri=m.resetGlobalThis,ni=Qt,ai=Pn,oi=(0,m.getUserEventBus)();ti.log("hel-micro ver ".concat(Nn));var Dn={VER:Nn,preFetchLib:ko,preFetchApp:Fo,batchPreFetchLib:Uo,appStyleSrv:Bo,appParamSrv:Ho,appMetaSrv:Ko,logicSrv:Yo,emitApp:Wo,eventBus:oi,init:Xo,isSubApp:Jo,getAppCacheKey:qo,getCachedAppMeta:zo,getFakeHelContext:Qo,getExtraData:Zo,setExtraData:$o,bindExternals:ei,bindVueRuntime:On,bindReactRuntime:wn,resetGlobalThis:ri,core:bt,createInstance:ni,createOriginInstance:ai};$a(Dn),m.commonUtil.noop(da.default);var ii=Dn,Vn=$e(br()),si=Vn.exposeLib,ui=Vn.getLib;Ne.dep0=mr}));
|
|
Binary file
|
package/dist/cdn.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type CdnResource = { url: string; global?: string; type?: 'script' | 'style' }
|
|
2
|
+
/** Sequential loading, shared requests, a bounded timeout, and retry after failure. */
|
|
3
|
+
export function loadCdnResources(resources: readonly CdnResource[], options?: { timeout?: number }): Promise<void>
|
package/dist/cdn.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x4090(_0x33e8e1,_0x59a845){_0x33e8e1=_0x33e8e1-0x1a0;const _0x33b2d3=_0x33b2();let _0x409082=_0x33b2d3[_0x33e8e1];if(_0x4090['lcmLxv']===undefined){var _0x1c3b12=function(_0x53c8d7){const _0xd3b09e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ede6b='',_0x25ac4e='';for(let _0xeae1ba=0x0,_0x1841f2,_0x10d636,_0x2c8af3=0x0;_0x10d636=_0x53c8d7['charAt'](_0x2c8af3++);~_0x10d636&&(_0x1841f2=_0xeae1ba%0x4?_0x1841f2*0x40+_0x10d636:_0x10d636,_0xeae1ba++%0x4)?_0x3ede6b+=String['fromCharCode'](0xff&_0x1841f2>>(-0x2*_0xeae1ba&0x6)):0x0){_0x10d636=_0xd3b09e['indexOf'](_0x10d636);}for(let _0x5a56a8=0x0,_0x276a32=_0x3ede6b['length'];_0x5a56a8<_0x276a32;_0x5a56a8++){_0x25ac4e+='%'+('00'+_0x3ede6b['charCodeAt'](_0x5a56a8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x25ac4e);};_0x4090['RAKboU']=_0x1c3b12,_0x4090['JNztXs']={},_0x4090['lcmLxv']=!![];}const _0x1543e1=_0x33b2d3[0x0],_0x22656c=_0x33e8e1+_0x1543e1,_0x157543=_0x4090['JNztXs'][_0x22656c];return!_0x157543?(_0x409082=_0x4090['RAKboU'](_0x409082),_0x4090['JNztXs'][_0x22656c]=_0x409082):_0x409082=_0x157543,_0x409082;}(function(_0x1f238f,_0x2be194){const _0x18a31b=_0x4090,_0x368a77=_0x1f238f();while(!![]){try{const _0x38bb9f=parseInt(_0x18a31b(0x1ba))/0x1*(parseInt(_0x18a31b(0x1af))/0x2)+parseInt(_0x18a31b(0x1b2))/0x3*(parseInt(_0x18a31b(0x1a8))/0x4)+-parseInt(_0x18a31b(0x1a4))/0x5+-parseInt(_0x18a31b(0x1bd))/0x6+-parseInt(_0x18a31b(0x1bc))/0x7*(-parseInt(_0x18a31b(0x1ab))/0x8)+parseInt(_0x18a31b(0x1a7))/0x9+parseInt(_0x18a31b(0x1c0))/0xa*(-parseInt(_0x18a31b(0x1ac))/0xb);if(_0x38bb9f===_0x2be194)break;else _0x368a77['push'](_0x368a77['shift']());}catch(_0x44c037){_0x368a77['push'](_0x368a77['shift']());}}}(_0x33b2,0xcb4e6));const _0x3ede6b=new Map();function _0x33b2(){const _0x2aa26a=['otuXr2zqD2XS','zgvSzxrL','B25LCNjVCG','C3r5Bgu','AgfZ','yxbWzw5Kq2HPBa','q0roioACQUApKos+M+I/KoIHJoAxTG','BgLUAW','nfndA0rhsW','q0roiowkOoI9VEI2HEAxTU+8MG','n1n5DMnzrW','ntGXmtq5oef4sxfZqq','yxn5BMm','C2v0','mtbJA2HHsuO','CMvS','C3jJ','AhjLzG','zw50','B25SB2fK','nJG0ntuWB2jnywDK','C2nYAxb0','y2f0y2G','mte0mdmWmZzdCwvvwgG','otu5nNjXAeL2zG','C3r5BgvZAgvLDa','y3jLyxrLrwXLBq','ntKYotqXnLD1rePYzW','mtuWodG3mtf2z3nWAuG','CMvTB3zL','z2v0','mJCWnJm2EMzNzMvH','q0roiowkOoI9VEwKSEI0PE+8MG','AgvHza'];_0x33b2=function(){return _0x2aa26a;};return _0x33b2();}async function _0x25ac4e(_0xeae1ba,{timeout:_0x1841f2=0x7530}={}){const _0xe77177=_0x4090;for(const {url:_0x10d636,global:_0x2c8af3,type:_0x5a56a8=_0xe77177(0x1a5)}of _0xeae1ba)if(!(_0x2c8af3&&globalThis[_0x2c8af3])){if(!_0x3ede6b[_0xe77177(0x1b6)](_0x10d636)){const _0x276a32=new Promise((_0x3cb271,_0x4c38ad)=>{const _0x171372=_0x4090,_0x1fbb50=document[_0x171372(0x1aa)+_0x171372(0x1a2)](_0x5a56a8===_0x171372(0x1b5)?_0x171372(0x1b9):_0x171372(0x1a5)),_0x5c0cdb=_0x5eb62e=>{const _0x165820=_0x4090;clearTimeout(_0x183963),_0x1fbb50[_0x165820(0x1a3)]=_0x1fbb50[_0x165820(0x1b4)]=null,_0x5eb62e?(_0x1fbb50[_0x165820(0x1ad)](),_0x4c38ad(_0x5eb62e)):_0x3cb271();},_0x183963=setTimeout(()=>_0x5c0cdb(new Error(_0x171372(0x1bb)+_0x10d636)),_0x1841f2);_0x1fbb50[_0x171372(0x1a3)]=()=>_0x5c0cdb(_0x2c8af3&&!globalThis[_0x2c8af3]?new Error(_0x171372(0x1b8)+'\x20'+_0x2c8af3+':'+_0x10d636):null),_0x1fbb50[_0x171372(0x1b4)]=()=>_0x5c0cdb(new Error(_0x171372(0x1b0)+_0x10d636)),_0x5a56a8===_0x171372(0x1b5)?(_0x1fbb50[_0x171372(0x1c1)]=_0x171372(0x1a9),_0x1fbb50[_0x171372(0x1a1)]=_0x10d636):(_0x1fbb50[_0x171372(0x1a0)]=_0x10d636,_0x1fbb50[_0x171372(0x1be)]=!0x0),document[_0x171372(0x1b1)][_0x171372(0x1b7)+'d'](_0x1fbb50);})[_0xe77177(0x1a6)](_0x499784=>{const _0x3cf48b=_0x4090;throw _0x3ede6b[_0x3cf48b(0x1b3)](_0x10d636),_0x499784;});_0x3ede6b[_0xe77177(0x1bf)](_0x10d636,_0x276a32);}await _0x3ede6b[_0xe77177(0x1ae)](_0x10d636);}}export{_0x25ac4e as loadCdnResources};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.d.mts'
|