@melt-js/libs-core 2026.11.15 → 2026.11.16

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.
Files changed (76) hide show
  1. package/README.md +35 -2
  2. package/dist/browser.d.mts +3 -0
  3. package/dist/browser.mjs +1 -50
  4. package/dist/browser.mjs.gz +0 -0
  5. package/dist/cdn/browser.umd.cjs +2 -0
  6. package/dist/cdn/browser.umd.cjs.gz +0 -0
  7. package/dist/cdn/demo-browser.umd.cjs +2 -0
  8. package/dist/cdn/demo-browser.umd.cjs.gz +0 -0
  9. package/dist/cdn/demo.umd.cjs +2 -0
  10. package/dist/cdn/demo.umd.cjs.gz +0 -0
  11. package/dist/cdn/example-esm.html +1 -0
  12. package/dist/cdn/example-umd.html +1 -0
  13. package/dist/cdn/index.umd.cjs +2 -0
  14. package/dist/cdn/index.umd.cjs.gz +0 -0
  15. package/dist/cdn/manifest.json +129 -0
  16. package/dist/cdn/vendor.umd.cjs +50 -0
  17. package/dist/cdn/vendor.umd.cjs.gz +0 -0
  18. package/dist/cdn.d.mts +3 -0
  19. package/dist/cdn.mjs +1 -0
  20. package/dist/demo/browser.mjs +1 -0
  21. package/dist/demo/browser.mjs.gz +0 -0
  22. package/dist/demo/clipboard.d.mts +6 -0
  23. package/dist/demo/clipboard.mjs +1 -0
  24. package/{src → dist}/demo/docs.d.mts +3 -0
  25. package/dist/demo/docs.mjs +1 -0
  26. package/dist/demo/docs.mjs.gz +0 -0
  27. package/{src → dist}/demo/download.d.mts +38 -33
  28. package/dist/demo/download.mjs +1 -0
  29. package/dist/demo/download.mjs.gz +0 -0
  30. package/dist/demo/fullscreen.mjs +1 -0
  31. package/dist/demo/index.d.mts +9 -0
  32. package/dist/demo/index.mjs +1 -0
  33. package/dist/demo/model.mjs +1 -0
  34. package/dist/demo/remote-debug.d.mts +11 -0
  35. package/dist/demo/remote-debug.mjs +1 -0
  36. package/{src → dist}/demo/runtime.mjs +92 -104
  37. package/dist/demo/split-pane.d.mts +8 -0
  38. package/dist/demo/split-pane.mjs +1 -0
  39. package/dist/demo/standalone.d.mts +9 -0
  40. package/dist/demo/standalone.mjs +1 -0
  41. package/dist/demo/tabs.d.mts +15 -0
  42. package/dist/demo/tabs.mjs +1 -0
  43. package/{src/index.ts → dist/index.d.ts} +1 -1
  44. package/dist/loading.mjs +1 -0
  45. package/dist/remote-address.cjs +2 -0
  46. package/{src → dist}/remote.d.mts +16 -2
  47. package/dist/remote.mjs +1 -0
  48. package/dist/remote.mjs.gz +0 -0
  49. package/dist/vendor/hel-runtime.mjs +50 -0
  50. package/dist/vendor/hel-runtime.mjs.gz +0 -0
  51. package/package.json +41 -25
  52. package/scripts/browser-formats.mjs +355 -0
  53. package/scripts/build-browser.mjs +59 -13
  54. package/scripts/build-protected-esm.mjs +51 -0
  55. package/scripts/cdn-runtime.cjs +30 -0
  56. package/scripts/check-tdz.mjs +327 -324
  57. package/scripts/comps-bundle-obfuscation.cjs +2 -1
  58. package/scripts/package-artifacts.mjs +199 -0
  59. package/scripts/package-env.cjs +193 -193
  60. package/scripts/publish-stage.mjs +50 -42
  61. package/scripts/webpack-bundle-obfuscation.cjs +13 -0
  62. package/demo/index.js +0 -1
  63. package/dist/hel-deployment.json +0 -8
  64. package/src/browser.d.mts +0 -2
  65. package/src/browser.mjs +0 -3
  66. package/src/demo/docs.mjs +0 -75
  67. package/src/demo/download.mjs +0 -118
  68. package/src/demo/fullscreen.mjs +0 -80
  69. package/src/demo/index.d.mts +0 -4
  70. package/src/demo/index.mjs +0 -4
  71. package/src/demo/model.mjs +0 -203
  72. package/src/remote.mjs +0 -286
  73. package/tsconfig.json +0 -13
  74. /package/{src → dist}/demo/fullscreen.d.mts +0 -0
  75. /package/{src → dist}/demo/model.d.mts +0 -0
  76. /package/{src → scripts}/remote-address.cjs +0 -0
@@ -0,0 +1,50 @@
1
+ var fn=Object.create;var it=Object.defineProperty;var pn=Object.getOwnPropertyDescriptor;var vn=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,hn=Object.prototype.hasOwnProperty;var st=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var mn=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vn(e))!hn.call(r,n)&&n!==t&&it(r,n,{get:()=>e[n],enumerable:!(a=pn(e,n))||a.enumerable});return r};var Fe=(r,e,t)=>(t=r!=null?fn(dn(r)):{},mn(e||!r||!r.__esModule?it(t,"default",{value:r,enumerable:!0}):t,r));var $e=st(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function ur(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function gn(r){if(Array.isArray(r))return r}function bn(r){if(Array.isArray(r))return ur(r)}function An(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=mr(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var a=0,n=function(){};return{s:n,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}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 i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function cr(r,e,t){return(e=In(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Sn(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function _n(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,c=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(f){c=!0,n=f}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw n}}return o}}function yn(){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 Ln(){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 ot(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,a)}return t}function Pe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ot(Object(t),!0).forEach(function(a){cr(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ot(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function je(r,e){return gn(r)||_n(r,e)||mr(r,e)||yn()}function tr(r){return bn(r)||Sn(r)||mr(r)||Ln()}function En(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function In(r){var e=En(r,"string");return typeof e=="symbol"?e:e+""}function be(r){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(r)}function mr(r,e){if(r){if(typeof r=="string")return ur(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ur(r,e):void 0}}var ne=null;function Cn(){if(typeof window<"u"){ne=window;return}if(typeof global<"u"){ne=global;return}throw new Error("unable to locate global object")}function z(){return ne||Cn(),ne}function Tn(r){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=null;(e=ne)!==null&&e!==void 0&&e.__HEL_MICRO_SHARED__&&(a=ne.__HEL_MICRO_SHARED__),t?ne=Pe(Pe({},ne),r):ne=r,a&&(ne.__HEL_MICRO_SHARED__=a)}function ke(){return z()}function At(){var r=z();return r.MutationObserver||r.WebKitMutationObserver||r.MozMutationObserver}function ut(r,e){for(var t=null,a=r.length,n=0;n<a;n++){var i=r[n];if(i.tagName===e){t=i;break}}return t}function St(r){return Object.keys(r)}function Pn(){var r=function(n){var i=n||{},s=i.search||"";if(!s){var o=i.hash||"",u=o.split("?")[1]||"";u&&(s="?".concat(u))}return s};try{var e;return r((e=z())===null||e===void 0||(e=e.top)===null||e===void 0?void 0:e.location)}catch{var t;return r((t=z())===null||t===void 0?void 0:t.location)}}function ct(r){var e,t=(e=z())===null||e===void 0?void 0:e.localStorage;return t?.getItem(r)}function lt(r,e){var t,a=(t=z())===null||t===void 0?void 0:t.localStorage;return a?.setItem(r,e)}function Mn(){var r=Pn(),e={};if(r!=null&&r.startsWith("?")){var t=r.substring(1),a=t.split("&");a.forEach(function(n){var i=n.split("="),s=je(i,2),o=s[0],u=s[1];e[o]=u})}return e}function _t(){var r="";try{throw new Error("getJsRunLocation")}catch(a){var e=a.stack.split(`
5
+ `),t=e.length;r=e[t-1]||e[t-2]||""}return r}function re(r,e,t,a){var n=U(r,e);n[t]=a}function U(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=r[e];return a||(a=t,r[e]=a),a}function yt(r,e){Object.keys(e).forEach(function(t){var a=e[t];[null,void 0,""].includes(a)||(r[t]=a)})}function lr(r,e){r.includes(e)||r.push(e)}function Lt(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.nullValues,a=t===void 0?[null,void 0,""]:t,n=e.emptyObjIsNull,i=n===void 0?!0:n,s=e.emptyArrIsNull,o=s===void 0?!0:s,u=a.includes(r);if(u)return!0;if(Array.isArray(r))return o?r.length===0:!1;if(be(r)==="object"){var c=St(r),f=c.length;return i?f===0:!1}return!1}function Et(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e}function Dn(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Vn(){var r=z();return r.process&&r.global&&!r.document}function xn(r,e,t){if(r&&typeof r!="string")return r;try{var a=JSON.parse(r);return a||e}catch(n){if(e!==void 0)return e;throw t?new Error(t):n}}var It=Lt,fr=lr,Ct=St;function Rn(r,e){var t=[];return r.forEach(function(a){return fr(t,a)}),e.forEach(function(a){return fr(t,a)}),t}function Tt(r,e){var t=e||function(n){return!It(n)},a={};return Ct(r).forEach(function(n){t(r[n])&&(a[n]=r[n])}),a}function wn(r,e,t){var a=t,n=An(r),i;try{for(n.s();!(i=n.n()).done;){var s=i.value,o=s[e];if(![null,void 0,""].includes(o)){a=o;break}}}catch(u){n.e(u)}finally{n.f()}return a}function Pt(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"MULTI",t=r.split(`
6
+ `),a=t.length-1,n=t.map(function(i,s){var o;if(!i&&(s===0||s===a))return"";var u=function(p,v){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",h=p;return p.endsWith("<br/>")?(h=p.substring(0,h.length-5),"".concat(h).concat(v)):"".concat(h).concat(d)},c=((o=i.trimStart)===null||o===void 0?void 0:o.call(i))||i;return e==="MULTI"?"".concat(u(c,""),`
7
+ `):(c=u(c,`
8
+ `," "),c)}).join("");return n}function Mt(r){return Pt(r,"ONE")}function Nn(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=z(),a=Mt(r),n=t.alert||Et;if(e){var i;!((i=t.location)===null||i===void 0)&&i.port&&n(a);return}n(a)}function se(r,e,t){r.dataset?r.dataset[e]=t:r.setAttribute("data-".concat(e),t)}function Ue(r){se(r,"heldisabled","1"),r.disabled=!0}var Fn=Object.freeze({__proto__:null,noop:Et,hasProp:Dn,isServer:Vn,safeParse:xn,isNull:It,noDupPush:fr,okeys:Ct,merge2List:Rn,purify:Tt,getObjsVal:wn,pfstr:Pt,nbstr:Mt,nbalert:Nn,setDataset:se,disableNode:Ue});function On(r,e){var t=this,a=e.fn,n=e.fnName,i=e.arg1PlatObjFnKeys,s=i.includes(n);return function(){for(var o=function(h){return Pe({platform:r},Tt(h||{}))},u=arguments.length,c=new Array(u),f=0;f<u;f++)c[f]=arguments[f];var p=c[0],v=c[1];return s?c[0]=o(p):c[1]=o(v),a.apply(t,c)}}function Dt(r,e,t){var a=t||{},n=a.ignoreKeys,i=n===void 0?[]:n,s=a.arg1PlatObjFnKeys,o=s===void 0?[]:s,u={};return Object.keys(e).forEach(function(c){var f=e[c];if(i.includes(c)){u[c]=f;return}var p=be(f);if(p&&p==="object"){u[c]=Dt(r,f,t);return}if(p==="function"){u[c]=On(r,{arg1PlatObjFnKeys:o,fn:f,fnName:c});return}u[c]=f}),u}var jn="hel",Vt="unpkg",gr={NONE:0,LOG:1,TRACE:2},G="__default_online_ver__",xt=Vt,$={CORE_VER:"4.13.1",DEFAULT_API_PREFIX:"https://unpkg.com",DEFAULT_API_URL:"/openapi/v1/app/info",DEFAULT_ONLINE_VER:G,DEFAULT_USER_LS_KEY:"HelUserRtxName",DEFAULT_PLAT:xt,LS_LOG_MODE:"HelConfig.logMode",LS_LOG_FILTER:"HelConfig.logFilter",PLAT_HEL:jn,PLAT_UNPKG:Vt,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"},De={SUB_APP_LOADED:"subAppLoaded",SUB_LIB_LOADED:"SubLibLoaded",STYLE_STR_FETCHED:"StyleStrFetched",STYLE_TAG_ADDED:"StyleTagAdded",CSS_LINK_TAG_ADDED:"CssLinkTagAdded"},Ve={NOT_LOAD:0,LOADING:1,LOADED:2},Rt=$.LS_LOG_FILTER,wt=$.LS_LOG_MODE,xe=gr.NONE,Nt=gr.LOG,kn=gr.TRACE,le={isIncludeFilter:function(e,t){if(!t.includes(","))return e.includes(t);var a=t.split(",");return a.some(function(n){return e.includes(n)})},getLogFilter:function(){return ve().logFilter},setLogFilter:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;ve().logFilter=e,t&&lt(Rt,e)},setLogMode:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=parseInt(e,10);[xe,Nt,kn].includes(a)&&(ve().logMode=a,t&&lt(wt,a))},getLogMode:function(){return ve().logMode}},ce={};function Un(){if(!ve().isInit){ve().isInit=!0;var r=Mn(),e=r.hellog,t=r.hellogf,a=e||ct(wt)||xe;le.setLogMode(a,!1);var n=t||ct(Rt)||"";le.setLogFilter(n,!1)}}function Bn(){return{logMode:xe,logFilter:"",isInit:!1}}function Hn(){if(ce=ke().__HEL_MICRO_DEBUG__,!Lt(ce)){ce.logMode===void 0&&(ce.logMode=xe,ce.logFilter="");return}ce=Bn(),ke().__HEL_MICRO_DEBUG__=ce;try{Un()}catch{}}function Be(){return le.getLogMode()!==xe}function ve(){return ce}var ft=" %c--> HEL LOG:",pt="color:#ad4e00;font-weight:600";function J(){if(Be()){for(var r=le.getLogMode()===Nt?console.log:console.trace||console.log,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var n=t[0],i=t.slice(1);if(typeof n!="string")return r.apply(void 0,[ft,pt].concat(t));var s=le.getLogFilter(),o=["".concat(ft," ").concat(n),pt].concat(tr(i));if(s){le.isIncludeFilter(n,s)&&r.apply(void 0,tr(o));return}r.apply(void 0,tr(o))}}var Me={};function Gn(r){!Be()||Me[r]||(Me[r]=Date.now())}function br(r,e,t){if(!(!Be()||!Me[r])){var a=Me[r];J("[[ PerfCheck ]] (".concat(r,"/").concat(e,") costs ").concat(Date.now()-a," ms")),t&&Ft(r)}}function Ft(r){Me[r]=0}var Kn=$.DEFAULT_API_URL,$n=$.DEFAULT_USER_LS_KEY,ar=$.PLAT_HEL,vt=$.PLAT_UNPKG,Yn=$.DEFAULT_API_PREFIX,Wn=$.CORE_VER,Xn=$.KEY_CSS_LINK_TAG_ADDED,qn=$.KEY_STYLE_TAG_ADDED,dt=$.KEY_IGNORE_CSS_PREFIX_LIST,Jn=$.KEY_IGNORE_STYLE_TAG_KEY,zn=$.KEY_IGNORE_CSS_PREFIX_2_KEYS;function pr(r){var e=r||{},t=e.apiPrefix;return{apiMode:"get",apiPrefix:t,apiSuffix:"",apiPathOfApp:Kn,apiPathOfAppVersion:"",getSubAppAndItsVersionFn:null,customMetaUrl:"",customMetaJsonpUrl:"",getMeta:null,onFetchMetaFailed:null,strictMatchVer:!0,getUserName:null,userLsKey:$n,shouldUseGray:null,trustAppNames:null,semverApi:null,hook:{}}}function vr(r){var e=Pe(Pe({isConfigOverwrite:!1,platform:r,appName2Comp:{},appName2Lib:{},appName2isLibAssigned:{},appName2EmitApp:{},appName2verLoadStatus:{},appName2verEmitLib:{},appName2verEmitApp:{},appName2verStyleStr:{},appName2verStyleFetched:{},appName2verExtraCssList:{},appName2verAppVersion:{},appName2verCustomData:{},appName2app:{},appName2appVersion:{},appName2styleStr:{},appGroupName2firstVer:{},isOriginInitCalled:!1},pr()),{},{origin:pr({apiPrefix:Yn})});return e}function dr(){var r={};return{on:function(t,a){var n=r[t];if(!n){var i=[];r[t]=i,n=i}n.push(a)},emit:function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),i=1;i<a;i++)n[i-1]=arguments[i];var s=r[t];if(s){var o=s.slice();o.forEach(function(u){return u.apply(void 0,n)})}},off:function(t,a){var n=r[t];if(n)for(var i=0,s=n.length;i<s;i++){var o=n[i];if(o===a){n.splice(i,1);break}}}}}function Qn(){var r=vr(vt),e=vr(ar),t={platform:ar,platformHint:"the platform value here does not make any sense!",appName2platform:{},appGroupName2platform:{},caches:cr(cr({},vt,r),ar,e),common:{}},a=dr(),n=dr();return{ver:Wn,isStyleObInit:!1,nativeHeadAppend:null,nativeBodyAppend:null,patchedHeadAppend:null,patchedBodyAppend:null,createFeature:_t(),eventBus:a,userEventBus:n,cacheRoot:t,unpkgCache:r,helCache:e,dev:{setLogMode:le.setLogMode,setLogFilter:le.setLogFilter}}}function ht(r){var e=[Xn,qn,dt,Jn,zn],t=function(n){return n===dt?[]:{}};e.forEach(function(a){return U(r,a,t(a))})}function Zn(){var r=de();if(r){var e=r.cacheRoot;U(e,"appGroupName2platform"),U(e,"common");var t=e.caches;Object.keys(t).forEach(function(a){var n=t[a];U(n,"appGroupName2firstVer"),U(n,"appName2isLibAssigned"),U(n,"appName2verExtraCssList"),U(n,"appName2verCustomData"),U(n,"hook"),U(n,"origin",pr()),U(n.origin,"hook")}),ht(e.common),r.userEventBus||(r.userEventBus=dr());return}r=Qn(),ht(r.cacheRoot.common),ke().__HEL_MICRO_SHARED__=r}function de(){var r=ke().__HEL_MICRO_SHARED__;return r}function He(){return xt}function K(r){var e=r||He(),t=he(),a=t.caches[e];if(!a){var n=be(r);if(n!=="string")throw console.error("invalid plaform:",r),new Error("fatal error: platform only can be a string, now it is ".concat(n));var i=vr(r);t.caches[e]=i,a=i}return a}function he(){return de().cacheRoot}var oe={getCustomData:function(e,t,a){var n=a.versionId,i=a.platform,s=K(i),o=s.appName2verCustomData,u=U(o,e),c=U(u,t);return c[n||G]},getAppMeta:function(e,t){var a=K(t),n=a.appName2app;return n[e]},setVerLoadStatus:function(e,t,a,n){var i=n||{},s=i.versionId,o=i.platform,u=K(o)[a],c=s||G;re(u,e,c,t)},getVerLoadStatus:function(e,t,a){var n,i=a||{},s=i.versionId,o=i.platform,u=K(o)[t],c=s||G;return((n=u[e])===null||n===void 0?void 0:n[c])||Ve.NOT_LOAD},ensureOnlineModule:function(e,t,a){if(!e[G]){var n=oe.getAppMeta(t,a),i=e[n?.online_version];i&&(e[G]=i)}}};function ei(r,e){var t,a=e||{},n=a.versionId,i=a.platform,s=K(i),o=s.appName2verEmitApp,u=s.appName2Comp,c=s.strictMatchVer,f=s.appName2EmitApp,p=(t=a.strictMatchVer)!==null&&t!==void 0?t:c,v=U(o,r);oe.ensureOnlineModule(v,r,i);var d=n||G,h=v[d],m=u[r],g=m?{Comp:m}:null,b=p?null:f[r]||g,S=h||b||null;return J("[[ core:getVerApp ]] appName,options,result:",r,a,S),S}function Ot(r,e){J("[[ core:setEmitApp ]] appName,emitApp:",r,e);var t=e.versionId,a=e.platform,n=K(a),i=n.appName2verEmitApp,s=n.appName2Comp,o=n.appName2EmitApp,u=U(i,r);u[G]||(s[r]=e.Comp,o[r]=e,re(i,r,G,e)),t&&re(i,r,t,e)}var mt=$.KEY_CSS_LINK_TAG_ADDED,nr=$.KEY_STYLE_TAG_ADDED,gt=$.KEY_IGNORE_CSS_PREFIX_LIST,ri=$.KEY_IGNORE_STYLE_TAG_KEY,ir=$.KEY_IGNORE_CSS_PREFIX_2_KEYS;function jt(r){var e=he(),t=e.common,a=U(t,r);return a}function Oe(r){var e=he(),t=e.common;return t[r]}function Te(r,e){var t=jt(r),a=t[e];return a!==void 0?a:null}function Ce(r,e,t){var a=jt(r);a[e]=t}var Z={setIgnoreCssPrefix:function(e){var t=Oe(gt);lr(t,e)},setIgnoreStyleTagKey:function(e){var t=Z.getIgnoreStyleTagMap();t[e]=1},getIgnoreStyleTagMap:function(){var e=Oe(ri);return e},setIgnoreCssPrefixKey:function(e,t){var a=Te(ir,e);a||(a=[],Ce(ir,e,a)),lr(a,t)},getIgnoreCssPrefixKeys:function(e){var t=Oe(ir);return t[e]||[]},getMatchedIgnoreCssPrefix:function(e){for(var t=Oe(gt),a="",n=0;n<t.length;n++){var i=t[n];if(e.startsWith(i)){a=i;break}}return a},getIgnoreCssPrefixCssUrlList:function(e){var t=Te(mt,e);return t||(t=[],Ce(mt,e,t)),t},setIgnoreCssPrefixCssUrl:function(e,t){var a=Z.getIgnoreCssPrefixCssUrlList(e);a.push(t)},getStyleTagText:function(e){var t=Te(nr,e)||"";return t},clearStyleTagText:function(e){Ce(nr,e,"")},appendStyleTagText:function(e,t){var a=Z.getStyleTagText(e);Ce(nr,e,"".concat(a," ").concat(t))}};function Ar(r,e){var t=r.apiMode,a=r.apiPrefix,n=r.apiSuffix,i=r.apiPathOfApp,s=r.apiPathOfAppVersion,o=r.getSubAppAndItsVersionFn,u=r.onFetchMetaFailed,c=r.strictMatchVer,f=r.getUserName,p=r.userLsKey,v=r.shouldUseGray,d=r.getApiPrefix,h=r.trustAppNames,m=r.platform,g=r.origin,b=r.hook,S=r.customMetaUrl,_=r.customMetaJsonpUrl,A=r.getMeta,I={apiMode:t,apiPrefix:a,apiSuffix:n,apiPathOfApp:i,apiPathOfAppVersion:s,getSubAppAndItsVersionFn:o,onFetchMetaFailed:u,strictMatchVer:c,getUserName:f,userLsKey:p,shouldUseGray:v,getApiPrefix:d,trustAppNames:h,hook:b,platform:m,customMetaUrl:S,customMetaJsonpUrl:_,getMeta:A};return e&&(I.origin=g),I}function ti(r){var e=K(r);return Ar(e,!0)}function ai(r){var e=de(),t=e.nativeHeadAppend,a=e.nativeBodyAppend,n=r.headAppend||null,i=r.bodyAppend||null,s=function(u){return"pass same ".concat(u," handle, hel will ignore it for avlid 'Maximum call stack size exceeded'")};n&&n===t?console.error(s("headAppend")):e.patchedHeadAppend=n,i&&i===a?console.error(s("bodyAppend")):e.patchedBodyAppend=i}function ni(r,e){var t=K(e),a=Ar(r);t.isConfigOverwrite||(t.isConfigOverwrite=!0,yt(t,a))}function ii(r,e){var t=K(r),a="[[ core:originInit ]] invalid call, it can only been called";if(t.isConfigOverwrite){J("".concat(a," before init"));return}if(t.isOriginInitCalled){J("".concat(a," one time"));return}var n=Ar(e);t.isOriginInitCalled=!0,yt(t.origin,n)}function Ge(r){return he().appGroupName2platform[r]||He()}function si(r,e,t){var a=he().appGroupName2platform;return(t||!a[r])&&(a[r]=e),Ge(r)}function Sr(r){return he().appName2platform[r]||He()}function oi(r,e,t){var a=he().appName2platform;return(t||!a[r])&&(a[r]=e),Sr(r)}function kt(r,e){var t=e.customKey,a=e.platform,n=a===void 0?Sr(r):a,i=K(n),s=i.appName2verCustomData,o=U(s,r),u=U(o,t);return u}function ui(r,e){var t=kt(r,e),a=t[e.versionId||G];return a!==void 0?a:null}function ci(r,e){var t=e.customValue,a=e.versionId,n=kt(r,e);n[a||G]=t,n[G]||(n[G]=t)}var li=De.STYLE_TAG_ADDED,fi=De.CSS_LINK_TAG_ADDED;function Ae(){return de().eventBus}function pi(){return de().userEventBus}var Ke={styleTagAdded:function(e){return"".concat(li,"/").concat(e)},cssLinkTagAdded:function(e){return"".concat(fi,"(").concat(e,")")}};function vi(r,e){var t,a=e||{},n=a.versionId,i=a.platform,s=K(i),o=s.appName2verEmitLib,u=s.appName2Lib,c=s.strictMatchVer,f=s.appName2isLibAssigned,p=(t=a.strictMatchVer)!==null&&t!==void 0?t:c,v=U(o,r);oe.ensureOnlineModule(v,r);var d=n||G,h=v[d],m=f[r]?u[r]:null,g=p?null:m,b=h||g||null;return J("[[ core:getVerLib ]] appName,options,result:",r,a,b),b}function Ut(r,e,t){var a=t||{},n=a.appGroupName,i=e.versionId,s=e.appProperties,o=e.platform||t.platform,u=K(o),c=u.appName2verEmitLib,f=u.appName2Lib,p=u.appName2isLibAssigned,v=oe.getAppMeta(r,o),d=function(g){var b=f[g];b?be(b)==="object"&&Object.keys(b).length===0&&Object.assign(b,s):f[g]=s,p[g]=!0};d(r),n?d(n):v&&d(v.app_group_name),J("[[ core:setEmitLib ]] appMeta:",v);var h=U(c,r);h[G]||re(c,r,G,s),i&&re(c,r,i,s)}function Bt(r,e){var t=K(e),a=t.appName2app;return a[r]}function di(r,e){var t=K(e),a=t.appName2app;a[r.name]=r}function _r(r,e,t){oe.setVerLoadStatus(r,e,"appName2verLoadStatus",t)}function hi(r,e){return oe.getVerLoadStatus(r,"appName2verLoadStatus",e)}function mi(r,e,t){oe.setVerLoadStatus(r,e,"appName2verStyleFetched",t)}function gi(r,e){return oe.getVerLoadStatus(r,"appName2verStyleFetched",e)}function bi(r,e){var t,a=e||{},n=a.platform,i=a.versionId,s=K(n),o=s.appName2verStyleStr,u=s.appName2styleStr,c=u[r]||"";return i?((t=o[r])===null||t===void 0?void 0:t[i])||c||"":c}function Ai(r,e,t){var a=t||{},n=a.platform,i=a.versionId,s=K(n),o=s.appName2verStyleStr,u=s.appName2verStyleFetched,c=s.appName2styleStr;if(!i){c[r]=e;return}re(o,r,i,e),re(u,r,i,Ve.LOADED)}function Si(r,e,t){var a=t||{},n=a.versionId,i=a.platform,s=K(i),o=s.appName2verExtraCssList;J("[[ core:setVerExtraCssList ]] cssList:",e);var u=U(o,r);u[G]||re(o,r,G,e),n&&re(o,r,n,e)}function _i(r,e){var t=e||{},a=t.versionId,n=t.platform,i=K(n),s=i.appName2verExtraCssList,o=U(s,r),u=o[a]||o[G]||[];return J("[[ core:getVerExtraCssList ]] options,cssList:",t,u),u}function yi(r,e){var t,a=e||{},n=a.platform,i=a.versionId,s=K(n),o=s.appName2verAppVersion,u=s.appName2appVersion,c=u[r]||null;return i&&((t=o[r])===null||t===void 0?void 0:t[i])||c}function Li(r,e,t){var a=t||{},n=a.platform,i=K(n),s=i.appName2verAppVersion,o=i.appGroupName2firstVer,u=i.appName2appVersion,c=e.version_tag||e.sub_app_version;if(c){var f=oe.getAppMeta(r,n),p=U(s,r);p[G]||(re(s,r,G,e),u[r]=e),re(s,r,c,e),o[f.app_group_name]=e.sub_app_version}}function Ie(r,e){var t=r.split("@"),a=t.slice(1),n=a.join("@");return n||e||r}function bt(r){return r==="js"||r==="mjs"}function yr(r,e){var t=_t();J("[[ core:tryGetVersion ]] may include ver source > ".concat(t));var a=K(e),n=a.appGroupName2firstVer,i=n[r]||"";if(t.includes("https://")||t.includes("http://")){var s=t.split("//"),o=je(s,2),u=o[1],c=u.split("/");if(i){var f=u.includes("/".concat(i,"/"));if(f){var p=i.startsWith("@");if(p){var m=i.split("/")[1]||"";return Ie(m)}else{var v=c.indexOf(i),d=c[v-1],h=d.startsWith("@");if(!h)return Ie(i)}}var g=c[1],b=c[2];if(g==="static"&&bt(b)||bt(g))return Ie(i)}var S=u.indexOf("@");if(S>=0){var _=c.filter(function(w){return w.includes("@")}),A=_.findIndex(function(w){return w.startsWith("@")});if(A>=0){var I=_[A+1]||"";return Ie(I,i)}var M=_[0]||"";return Ie(M,i)}var y=u.split("/".concat(e,"/")),V=je(y,2),O=V[1],j=O===void 0?"":O,F=j.split("/"),k=je(F,1),B=k[0];return B||i}return i}function Lr(r,e){if(r===G)return e||"";if(r.includes("_")){var t=r.substring(0,r.length-15);return t}return e||""}var hr=!1,sr=!1;function Ei(r){if(r&&(hr=!1,sr=!1),!sr){sr=!0;var e=z();e.__MASTER_APP_LOADED__===void 0&&(e.__MASTER_APP_LOADED__=!0,hr=!0)}}function Ii(){var r=`WARNING: calling isSubApp is unsafe, use hel-iso.isSubApp instead,
9
+ `;return r+="more details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp",console.log("%c".concat(r),"color:red;"),!hr}function Ci(r,e){var t=e.platform,a=e.groupName,n=e.name,i=e.ver,s=e.elName;se(r,"el",s),se(r,"plat",t),se(r,"gname",a),se(r,"name",n),se(r,"ver",i)}var Ti=$.KEY_ASSET_CTX;function or(r,e){if(!e||!["LINK","SCRIPT"].includes(e.tagName))return r(e);var t=e.href,a=e.tagName,n=e.src,i=t||n||"",s=a==="LINK",o=Te(Ti,i)||{},u=o.platform,c=o.groupName,f=o.name,p=o.ver,v=o.beforeAppend,d=e;if(v){var h=s?"href":"src",m=e.getAttribute(h),g=function(_){return e.setAttribute(h,_)};d=v({el:e,nativeAppend:r,setAssetUrl:g,url:m,tagName:a})||e}var b=s?"HelLink":"HelScript";return u&&Ci(d,{platform:u,groupName:c,name:f,ver:p,elName:b}),r(d)}function Pi(){var r=z();if(!(r.__POWERED_BY_QIANKUN__||r.__DISABLE_HEL_MONKEY_PATCH__)){var e=de(),t=r.document,a=e.nativeHeadAppend,n=e.nativeBodyAppend;if(!(a||!t)){var i=t.head,s=t.body;if(a=i.appendChild.bind(i),e.nativeHeadAppend=a,s)n=s.appendChild.bind(s),e.nativeBodyAppend=n;else{var o=At(),u=new o(function(p){for(var v,d=0;d<p.length;d++){var h=p[d].addedNodes;if(v=ut(h,"BODY"),v)break}v&&(n=v.appendChild.bind(v),e.nativeBodyAppend=n,v.appendChild=function(m){return or(f(n,v,"body"),m)},u.disconnect())}),c=ut(t.childNodes,"HTML");c&&u.observe(c,{childList:!0})}var f=function(v,d,h){var m=e.patchedHeadAppend,g=e.patchedBodyAppend,b=h==="head";if(m&&b)return m;if(g&&!b)return g;if(r.__POWERED_BY_WUJIE__)return v;var S=r.Element;return S?S.prototype.appendChild.bind(d):v};i.appendChild=function(p){return or(f(a,i,"head"),p)},s&&(s.appendChild=function(p){return or(f(n,s,"body"),p)})}}}var Ht="preFetch";function Mi(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=t.platform||Ge(r),n=t.versionId||yr(r,a),i=t.appName||Lr(n,r);J("[[ core:libReady ]] appGroupName ".concat(r,", appName ").concat(i,", versionId ").concat(n));var s=Bt(i,a);s!=null&&s.__fromCust&&(n=t.versionId||s.online_version,i=s.name,J("[[ core:libReady ]] fromCust, appGroupName ".concat(r,", appName ").concat(i,", versionId ").concat(n)));var o={platform:a,appName:i,appGroupName:r,versionId:n,appProperties:e,Comp:function(){},lifecycle:{}};Ut(i,o,{appGroupName:r,platform:a}),_r(i,Ve.LOADED,{versionId:n,platform:a});var u=Ae();br(Ht,"libReady"),u.emit(De.SUB_LIB_LOADED,o)}function Di(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=t.lifecycle,n=t.platform||Ge(r),i=t.versionId||yr(r,n),s=t.appName||Lr(i,r),o={Comp:e,appName:s,appGroupName:r,lifecycle:a,platform:n,versionId:i,isLib:!1};Ot(s,o),_r(s,Ve.LOADED,{versionId:i,platform:n});var u=Ae();br(Ht,"appReady"),u.emit(De.SUB_APP_LOADED,o)}var Gt="/* @helstart ",Vi=" @helend */",xi=Gt.length;function Ri(r,e){var t=Ae(),a=Z.getMatchedIgnoreCssPrefix(e);return a&&(Z.setIgnoreCssPrefixCssUrl(a,e),t.emit(Ke.cssLinkTagAdded(a),{nodes:[r]})),a}function wi(r){var e=z();if(e){var t=e.document.head.querySelectorAll('style[data-gname="'.concat(r,'"]'));if(t.length){Z.clearStyleTagText(r),t.forEach(function(n){Ue(n),Z.appendStyleTagText(r,n.innerText)});var a=Ae();a.emit(Ke.styleTagAdded(r),{nodes:t})}}}function Ni(r,e){var t=r.tagName,a=r.innerText,n=r.href;if(["STYLE","LINK"].includes(t)){if(t==="STYLE"){if(!a)return;var i=a.indexOf(Gt);if(i<0)return;var s=a.indexOf(Vi);if(s<0)return;var o=a.substring(xi+i,s);if(o){var u=o.trim(),c="",f=u;if(u.includes("/")){var p=u.split("/");c=p[0],f=p[1]}se(r,"gname",f),c&&se(r,"plat",c),e[u]&&Ue(r);var v=Ae();Z.appendStyleTagText(u,a),v.emit(Ke.styleTagAdded(u),{nodes:[r]})}return}var d=Ri(r,n);d&&Ue(r)}}function Fi(r,e){var t=r.tagName,a=r.src,n=a===void 0?"":a;if(t!=="SCRIPT"||!n.endsWith(".hot-update.js"))return!1;var i=Z.getMatchedIgnoreCssPrefix(n);if(!i)return!1;var s=Z.getIgnoreCssPrefixKeys(i);if(!s.length)return!1;var o=!1;return s.forEach(function(u){e[u]&&(wi(u),o=!0)}),o}function Oi(){var r=de(),e=z(),t=r.isStyleObInit,a=e.document;if(!(t||!a)){r.isStyleObInit=!0;var n=Z.getIgnoreStyleTagMap(),i=At();if(i){var s=new i(function(o){o.forEach(function(u){for(var c=u.addedNodes,f=u.removedNodes,p=c.length,v=0;v<p;v++)Ni(c[v],n);for(var d=f.length,h=0;h<d&&!Fi(f[h],n);h++);})});s.observe(document.head,{childList:!0})}}}Kt();J("hel-micro-core ver ".concat($.CORE_VER));var ji=De,ki=Ve,Ui=$,Bi=Dt,Hi=Fn,Gi=Ii;function Kt(r){r&&$t(r),Ei(!!r),Zn(),Hn(),Pi(),Oi()}var Ki=He,$i=K,Yi=ve,Wi=Be,Xi=J,qi=Gn,Ji=br,zi=Ft,Qi=z,$t=Tn,Zi=ei,es=Ot,rs=vi,ts=Ut,as=Bt,ns=di,is=yi,ss=Li,os=ui,us=ci,cs=Te,ls=Ce,fs=Z,ps=hi,vs=_r,ds=gi,hs=mi,ms=bi,gs=Ai,bs=_i,As=Si,Ss=yr,_s=Lr,ys=ti,Ls=Ge,Es=si,Is=oi,Cs=Sr,Ts=ni,Ps=ii,Ms=ai,Ds=Ae,Vs=pi,xs=Ke,Rs=Mi,ws=Di;L.allowLog=Wi;L.appReady=ws;L.clearPerfMark=zi;L.commonDataUtil=fs;L.commonUtil=Hi;L.evName=xs;L.getAppMeta=as;L.getAppPlatform=Ls;L.getAppPlatformByAppName=Cs;L.getAppStyleStr=ms;L.getCommonData=cs;L.getCustomData=os;L.getGlobalThis=Qi;L.getHelDebug=Yi;L.getHelEventBus=Ds;L.getPlatform=Ki;L.getPlatformConfig=ys;L.getSharedCache=$i;L.getUserEventBus=Vs;L.getVerApp=Zi;L.getVerExtraCssList=bs;L.getVerLib=rs;L.getVerLoadStatus=ps;L.getVerStyleStrStatus=ds;L.getVersion=is;L.helConsts=Ui;L.helEvents=ji;L.helLoadStatus=ki;L.inectPlatToMod=Bi;L.initGlobalConfig=Ms;L.initPlatformConfig=Ts;L.isSubApp=Gi;L.libReady=Rs;L.log=Xi;L.originInit=Ps;L.perfMark=qi;L.perfPeek=Ji;L.resetGlobalThis=Kt;L.setAppMeta=ns;L.setAppPlatform=Es;L.setAppPlatformByAppName=Is;L.setAppStyleStr=gs;L.setCommonData=ls;L.setCustomData=us;L.setEmitApp=es;L.setEmitLib=ts;L.setGlobalThis=$t;L.setVerExtraCssList=As;L.setVerLoadStatus=vs;L.setVerStyleStrStatus=hs;L.setVersion=ss;L.tryGetAppName=_s;L.tryGetVersion=Ss});var Er=st((Ye,Yt)=>{(function(r,e){typeof Ye=="object"&&typeof Yt<"u"?e(Ye,$e()):typeof define=="function"&&define.amd?define(["exports","hel-micro-core"],e):e((r=typeof globalThis<"u"?globalThis:r||self).HelLibProxy={},r.HelMicroCore)})(Ye,function(r,e){"use strict";var t=function(){return t=Object.assign||function(D){for(var E,C=1,N=arguments.length;C<N;C++)for(var H in E=arguments[C])Object.prototype.hasOwnProperty.call(E,H)&&(D[H]=E[H]);return D},t.apply(this,arguments)};function a(D,E){var C=E||(e.getAppPlatform===null||e.getAppPlatform===void 0?void 0:e.getAppPlatform(D)),N=e.getSharedCache(C).appName2Lib;return N[D]||(N[D]={}),N[D]}var n="4.12.1";e.log("hel-lib-proxy ver ".concat(n));var i=e.getUserEventBus,s=e.helConsts,o=i();function u(D,E){var C=t({},E||{});return C.platform=C.platform||s.DEFAULT_PLAT,e.getVerLib(D,C)}function c(D,E){var C,N=!0,H="";E&&(typeof E=="string"?H=E:(H=E.platform||"",N=(C=E.asProxy)===null||C===void 0||C));var Y=a(D,H=H||e.getAppPlatform(D)||s.DEFAULT_PLAT);return typeof Proxy=="function"&&N&&(Y=(function(Q,W,X){return new Proxy(W,{get:function(q,ee){var fe=String(ee);return e.log("[[getLibProxy]] call lib [".concat(Q,"] method [").concat(fe,"]")),Object.keys(q).length?q[fe]:a(Q,X)[fe]}})})(D,Y,H)),e.log("[[ exposeLib ]] libName, libObj",D,Y),Y}function f(D,E,C){var N=(function(H){var Y={allowDup:!1,platform:e.helConsts.DEFAULT_PLAT};return t(t({},Y),H||{})})(C);e.libReady(D,E,N)}function p(D,E,C){e.appReady(D,E,C)}function v(D,E){return e.getVerApp(D,E)}var d=e.isSubApp;function h(){return!e.isSubApp()}var m=Object.freeze({__proto__:null,VER:n,eventBus:o,getLib:u,exposeLib:c,libReady:f,appReady:p,exposeApp:v,isSubApp:d,isMasterApp:h}),g=e.commonUtil.purify,b=["isMasterApp","isSubApp","eventBus"],S=["appReady","libReady"];function _(D,E){return E&&typeof E=="object"&&!Array.isArray(E)?t({platform:D},g(E)):{platform:D}}function A(D,E){var C={};return Object.keys(D).forEach(function(N){var H=D[N];if(b.includes(N))C[N]=H;else if(S.includes(N))C[N]=(function(Q,W){return function(){for(var X=[],q=0;q<arguments.length;q++)X[q]=arguments[q];var ee=X[0],fe=X[1],pe=X[2];return Q(ee,fe,_(W,pe===void 0?{}:pe))}})(H,E);else{var Y=N==="exposeLib";C[N]=(function(Q,W,X){return function(){for(var q=[],ee=0;ee<arguments.length;ee++)q[ee]=arguments[ee];var fe=q[0],pe=q[1];return Q(fe,!X||typeof pe!="string"&&pe!==void 0?_(W,pe):pe||W)}})(H,E,Y)}}),C}var I=function D(E){var C=A(m,E);return C.createInstance=D,C},M=n,y=f,V=c,O=u,j=d,F=h,k=o,B=p,w=v,x={VER:M,libReady:y,exposeLib:V,getLib:O,isSubApp:j,isMasterApp:F,eventBus:k,appReady:B,exposeApp:w,createInstance:I};(function(D){var E=e.getGlobalThis();e.commonUtil.isServer()||E.HelLibProxy||(e.log("auto bind hel-lib-proxy to global.HelLibProxy"),E.HelLibProxy=D)})(x),r.VER=M,r.appReady=B,r.createInstance=I,r.default=x,r.eventBus=k,r.exposeApp=w,r.exposeLib=V,r.getLib=O,r.isMasterApp=F,r.isSubApp=j,r.libReady=y,Object.defineProperty(r,"__esModule",{value:!0})})});var va=Fe(Er()),Hr=Fe($e()),l=Fe($e());function Ns(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Wt(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,js(a.key),a)}}function Fs(r,e,t){return e&&Wt(r.prototype,e),t&&Wt(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function Os(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function js(r){var e=Os(r,"string");return typeof e=="symbol"?e:String(e)}var ks=/\s/,Us=/[a-zA-Z0-9\-]/,Xt="<!DOCTYPE html>",Bs="<!--",qt="-->",Hs="</meta>",Gs="</link>",Ks=["meta","link"],$s={meta:Hs,link:Gs},Ys=(function(){function r(){Ns(this,r),this.input="",this.len=0,this.cur=0}return Fs(r,[{key:"eof",get:function(){return this.cur>=this.len}},{key:"peek",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.input[this.cur+t]}},{key:"sub",value:function(t,a){var n=a||this.cur;return this.input.substring(n,n+t)}},{key:"moveCur",value:function(t){this.cur+=t}},{key:"consumeChar",value:function(t){var a=this.peek();if(a===t)this.cur++;else throw new Error("Unexpected character: '".concat(a,"' should be '").concat(t,"'"));return a}},{key:"consumeSpace",value:function(){this.consumeWhile(ks)}},{key:"consumeWhile",value:function(t){var a=[];do{var n=this.peek();if(t.test(n))a.push(n),this.cur++;else break}while(!this.eof);return a.join("")}},{key:"noop",value:function(){}},{key:"pureInput",value:function(t){var a=t.trim();a.startsWith(Xt)&&(a=a.substring(Xt.length));var n=function i(s){var o=s.indexOf(Bs),u=s.indexOf(qt);if(o>=0&&u>=0){var c=s.substring(0,o),f=s.substring(u+qt.length);return i("".concat(c).concat(f))}return s};return a=n(a),a}},{key:"parse",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t||"";return this.input=this.pureInput(n),this.len=n.length,this.onTagOpen=a.onTagOpen||this.noop(),this.onTagClose=a.onTagClose||this.noop(),this.cur=0,this.parseNodes()}},{key:"parseNodes",value:function(){var t=[];do{var a=void 0;if(this.peek()==="<"){if(this.peek(1)==="/")break;a=this.parseElement()}else a=this.parseTextNode();a!==" "&&t.push(a)}while(!this.eof);return t}},{key:"parseTextNode",value:function(){var t=this.consumeWhile(/[^<]/);return t.replace(/[\s\n]+/g," ")}},{key:"parseElement",value:function(){var t=this;this.consumeChar("<");var a=this.parseTag();this.onTagOpen(a),this.consumeSpace();var n=this.parseAttrs(),i=this.peek(),s=this.peek(-1),o=function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;t.parseTag(),t.consumeSpace(),t.consumeChar(">"),m&&t.moveCur(m);var g={tag:a,attrs:n,children:h};return t.onTagClose(a,g),g};if("".concat(s).concat(i)==="/>")return o([]);if(Ks.includes(a)&&i===">"){var u=$s[a],c=u.length,f=this.sub(c,this.cur+1),p=f===u?c:0;return o([],p)}this.consumeChar(">");var v=this.parseNodes();return this.consumeChar("<"),this.consumeChar("/"),o(v)}},{key:"parseTag",value:function(){var t=this.consumeWhile(Us);return t}},{key:"parseAttrs",value:function(){for(var t={};this.peek()!==">";){var a=this.parseTag();if(!a){this.consumeChar(this.peek());continue}if(this.peek()==="="){this.consumeChar("="),this.consumeChar('"');var n=this.consumeWhile(/[^"]/);this.consumeChar('"'),t[a]=n}else t[a]="";this.consumeSpace()}return t}}]),r})();function Jt(r,e){var t=new Ys,a=t.parse(r,e);return a}var da="4.15.3";function Gr(r){var e=r.appGroupName,t=r.Comp,a=r.platform,n=r.lifecycle,i=r.appName,s=r.versionId;(0,l.appReady)(e,t,{lifecycle:n,platform:a,appName:i,versionId:s})}var R=function(){return R=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++){t=arguments[a];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},R.apply(this,arguments)};function Ee(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(r);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(r,a[n])&&(t[a[n]]=r[a[n]]);return t}function T(r,e,t,a){function n(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function o(f){try{c(a.next(f))}catch(p){s(p)}}function u(f){try{c(a.throw(f))}catch(p){s(p)}}function c(f){f.done?i(f.value):n(f.value).then(o,u)}c((a=a.apply(r,e||[])).next())})}function P(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(f){return u([c,f])}}function u(c){if(a)throw new TypeError("Generator is already executing.");for(;t;)try{if(a=1,n&&(i=c[0]&2?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(f){c=[6,f],n=0}finally{a=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var Rr={LS_CACHE_APP_PREFIX:"HelAppCache",DATABASE_NAME:"HelIndexedDB",STORE_NAME:"HelMetaData"},zt={};function Qt(){return{db:null,name:"",storeName:"",version:1}}function ha(){var r=(0,l.getGlobalThis)();return"indexedDB"in r?r.indexedDB:(console.warn("The current browser is not support indexedDB!"),null)}var Ws=(function(){function r(e){this.dbInfo=Qt(),this.ready=null,this.initStorage(e)}return r.prototype.initStorage=function(e){var t=ha();if(t){var a=null,n=null;this.ready=new Promise(function(d,h){a=d,n=h});var i=this.dbInfo;if(e){var s=e.name,o=e.storeName,u=e.version;Object.assign(i,l.commonUtil.purify({name:s,storeName:o,version:u}))}var c=zt[i.name];c||(c=Qt(),zt[i.name]=c),i.db=c.db;var f=this.isUpgradeNeeded(i);if(i.db)if(f)i.db.close();else{a(i);return}var p=[i.name,void 0];f&&(p[1]=i.version);var v=t.open.apply(t,p);f&&(v.onupgradeneeded=function(d){c.db=v.result,i.db=v.result;try{i.db.createObjectStore(i.storeName)}catch(m){if(m.name==="ConstraintError"){var h=l.commonUtil.nbstr(`
10
+ The database "`.concat(i.name,`"
11
+ has been upgraded from version `).concat(d.oldVersion," to version ").concat(d.newVersion,`,
12
+ but the storage "`).concat(i.storeName,'" already exists.'));console.warn(h)}else throw m}}),v.onerror=function(){n(v.error)},v.onsuccess=function(){i.db=v.result,c.db=v.result,i.db.onversionchange=function(d){d.target.close()},a(i)}}},r.prototype.isUpgradeNeeded=function(e){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),a=e.version<e.db.version,n=e.version>e.db.version;if(a&&(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),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1},r.prototype.getObjectStore=function(e,t){var a=e.name,n=e.db,i=e.storeName;if(!n)throw new Error("get ".concat(i," objectStore failed in ").concat(a," database"));var s=n.transaction(i,t||"readonly").objectStore(i);return s},r.prototype.attachHandler=function(e,t,a){e.onsuccess=function(){t(e.result||null)},e.onerror=function(){a(e.error)}},r.prototype.getItem=function(e){return T(this,void 0,void 0,function(){var t,a,n,i=this;return P(this,function(s){switch(s.label){case 0:return[4,this.getDbInfo()];case 1:return t=s.sent(),a=this.getObjectStore(t),n=a.get(e),[2,new Promise(function(o,u){i.attachHandler(n,o,u)})]}})})},r.prototype.setItem=function(e,t){return T(this,void 0,void 0,function(){var a,n,i,s=this;return P(this,function(o){switch(o.label){case 0:return[4,this.getDbInfo()];case 1:return a=o.sent(),n=this.getObjectStore(a,"readwrite"),i=n.put(t,e),[2,new Promise(function(u,c){s.attachHandler(i,u,c)})]}})})},r.prototype.removeItem=function(e){return T(this,void 0,void 0,function(){var t,a,n,i=this;return P(this,function(s){switch(s.label){case 0:return[4,this.getDbInfo()];case 1:return t=s.sent(),a=this.getObjectStore(t,"readwrite"),n=a.delete(e),[2,new Promise(function(o,u){i.attachHandler(n,o,u)})]}})})},r.prototype.getDbInfo=function(){return this.ready?this.ready:Promise.reject("forget init")},r})();function ma(r){return r.startsWith("//")?!1:r.startsWith("/")||r.startsWith("./")||r.startsWith("../")}function Xs(r,e){return e.startsWith(r)?"build":ma(e)?"relative":"static"}function Kr(){if(!ha())return null;try{var r=new Ws({name:Rr.DATABASE_NAME,storeName:Rr.STORE_NAME});return{setItem:function(e,t){return r.setItem(e,t)},getItem:function(e){return r.getItem(e)},removeItem:function(e){return r.removeItem(e)}}}catch(e){return console.error("new IndexedDBStorage error: ".concat(e.message)),null}}function Ze(){var r,e={getItem:function(){},setItem:function(){},removeItem:function(){}};try{var t=(r=(0,l.getGlobalThis)())===null||r===void 0?void 0:r.localStorage;return t||e}catch{return e}}function qs(r,e,t){var a=Object.prototype.hasOwnProperty.call(r,e);if(a)return r[e]||t}function ae(r){return r||(0,l.getPlatform)()}function Ir(r,e){try{Ze().setItem(r,JSON.stringify(e))}catch(t){(0,l.log)("save localStorage failed: ".concat(t.message))}}function Zt(r){if(!r)return r;var e=r.appInfo,t=r.appVersion;return e&&t?{app:e,version:t}:r}function er(r,e){var t="".concat(Rr.LS_CACHE_APP_PREFIX,".").concat(ae(e),".").concat(r);return t}function $r(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f,p,v;return P(this,function(d){switch(d.label){case 0:t=e||{},a=t.platform,n=t.cacheKey,i=t.storageType,s=i===void 0?"indexedDB":i,o=n||er(r,a),d.label=1;case 1:return d.trys.push([1,4,,5]),s!=="indexedDB"?[3,3]:(u=Kr(),u?[4,u.getItem(o)]:[3,3]);case 2:return c=d.sent(),[2,Zt(c)];case 3:return f=Ze().getItem(o),p=l.commonUtil.safeParse(f||"",null),[2,Zt(p)];case 4:return v=d.sent(),console.error(v),[2,null];case 5:return[2]}})})}function Yr(r,e,t){var a=er(r,t),n=e?.({appName:r,innerKey:a})||a;return n}function ga(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return t=e.getCacheKey,a=e.storageType,n=e.platform,i=Yr(r,t,n),[4,$r(r,{platform:n,cacheKey:i,storageType:a})];case 1:return s=o.sent(),s?[2,{appInfo:s.app,appVersion:s.version}]:[2,null]}})})}function Js(r,e,t){var a=t==="indexedDB";if(!a)return Ir(r,e);var n=Kr();if(!n)return Ir(r,e);n.setItem(r,e).catch(function(i){(0,l.log)("save indexeddb failed, use localStorage instead, err: ".concat(i.message)),Ir(r,e)})}var _e={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"},Re="get",ba="Jsonp";function zs(r){var e=r.userLsKey,t=Ze().getItem(e)||"";if(t)return t;try{var a={};(0,l.getGlobalThis)().document.cookie.split(";").forEach(function(n){var i=n.split("="),s=i[0],o=i[1];a[s]=o}),t=a[e]||"",(0,l.log)("[[ getUserName ]] result:",t)}catch(n){(0,l.log)("[[ getUserName ]] err:",n)}return t}var Qs=Object.freeze({__proto__:null,getUserName:zs}),Cr=l.commonUtil.isNull;function Qe(r,e,t){var a=(0,l.getPlatformConfig)(r),n=a.origin,i=a[e],s=n[e];return t||i||s}function Aa(r,e,t,a){var n=Qe(r,e,a);if(n)return n(t);var i=Qs[e]||(function(){return null});return i(t)}function ie(r,e,t,a){var n=t||[],i=n[0],s=n[1];if(!Cr(i,a))return i;var o=(0,l.getPlatformConfig)(r),u=o[e];if(!Cr(u,a))return u;var c=o.origin,f=c[e];return Cr(f,a)?s:f}function wr(r,e){var t,a=(0,l.getPlatformConfig)(r.platform),n=r.hook||{},i=a.origin,s=a.hook;return n[e]||s[e]||((t=i.hook)===null||t===void 0?void 0:t[e])}function Sa(r,e){var t,a,n,i="";if(e&&(i=((t=e.getApiPrefix)===null||t===void 0?void 0:t.call(e))||e.apiPrefix),i)return i;var s=(0,l.getPlatformConfig)(r);if(i=((a=s.getApiPrefix)===null||a===void 0?void 0:a.call(s))||s.apiPrefix,i)return i;var o=s.origin;return i=((n=o.getApiPrefix)===null||n===void 0?void 0:n.call(o))||o.apiPrefix,i}var Zs=11,Se={now:function(){return new Date().getTime()},rand:function(){return Math.random().toString().substring(6)},removeElem:function(r){var e=r.parentNode;e&&e.nodeType!==Zs&&e.removeChild(r)},parseData:function(r){var e="";if(typeof r=="string")e=r;else if(typeof r=="object")for(var t in r)e+="".concat(e,"&").concat(t,"=").concat(encodeURIComponent(r[t]));return e+="&_t=".concat(Se.now()),e=e.substring(1),e},getJSON:function(r,e){return new Promise(function(t,a){var n="",i=r;i=i+(i.indexOf("?")===-1?"?":"&")+Se.parseData(e);var s=/callback=(\w+)/.exec(i);s?.[1]?n=s[1]:n="helJsonp_".concat(Se.now(),"_").concat(Se.rand()),i.includes("?")?i="".concat(i,"&callback=").concat(n):i="".concat(i,"?callback=").concat(n);var o=(0,l.getGlobalThis)(),u=o.document,c=u.createElement("script");c.type="text/javascript",c.src=i,c.id=n,c.onerror=a,c.addEventListener("error",a),o[n]=function(p){delete o[n];var v=u.getElementById(n);return v&&Se.removeElem(v),t(p)};var f=u.getElementsByTagName("head");f?.[0]&&f[0].appendChild(c)})}},eo=Se.getJSON;function ro(){return"XMLHttpRequest"in(0,l.getGlobalThis)()?new XMLHttpRequest:null}function to(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return t=e||{},a=t.method,n=Ee(t,["method"]),i=new ao(n),[4,i.request(r,a)];case 1:return s=o.sent(),[2,s]}})})}var ao=(function(){function r(e){this.req=null,this.resultPromise=Promise.resolve(null),this.init(e||{})}return r.prototype.init=function(e){var t=ro();if(!t)throw new Error("current browser is not support XMLHttpRequest!");this.req=t;var a=e.responseType,n=e.timeout,i=n===void 0?1e4:n,s=e.withCredentials,o=e.headers;t.responseType=a||"json",t.timeout=i,t.withCredentials=!!s,o&&Object.keys(o).forEach(function(v){t.setRequestHeader(v,o[v])});var u=null,c=null;this.resultPromise=new Promise(function(v,d){u=v,c=d});var f=function(){var v=t.response,d=t.status,h=t.statusText,m=t.responseURL;u({data:v,status:d,statusText:h,url:m})},p=function(v){var d=t.status,h=t.statusText,m=t.responseURL;c({msg:v,status:d,statusText:h,url:m})};t.onload=function(){return f()},t.onerror=function(v){return p(v)},t.onabort=function(v){return p(v)},t.ontimeout=function(v){return p(v)},t.onprogress=function(){}},r.prototype.request=function(e,t){return T(this,void 0,Promise,function(){var a;return P(this,function(n){switch(n.label){case 0:if(!this.req)throw new Error("forget init");return this.req.open(t?t.toUpperCase():"GET",e),this.req.send(),[4,this.resultPromise];case 1:return a=n.sent(),[2,a]}})})},r})(),ea=0,no="try_detect_latest_ver";function ra(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function _a(r,e){var t="";return(0,l.allowLog)()&&(e&&(ea+=1,t="_".concat(ea)),console.time("".concat(r).concat(t))),t}function Nr(r,e){(0,l.allowLog)()&&console.timeEnd("".concat(r).concat(e||""))}function io(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Ne("".concat(e,"/").concat(r,"@latest/").concat(no,"_").concat(Date.now()))];case 1:return t=o.sent().url,a=t.split("@"),n=a[a.length-1],i=n.split("/")[0],[2,i];case 2:return s=o.sent(),(0,l.log)("[[ getSemverLatestVer ]] returns ver(latest) due to error:",s.message),[2,"latest"];case 3:return[2]}})})}function so(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return[4,(0,l.getGlobalThis)().fetch(r)];case 1:return t=o.sent(),a=t.status,n=t.url,[200,304].includes(a)?e?[4,t.json()]:[3,3]:[2,{url:n,reply:null,status:a}];case 2:return i=o.sent(),[2,{url:n,reply:i,status:a}];case 3:return[4,t.text()];case 4:return s=o.sent(),[2,{url:n,reply:s,status:a}]}})})}function oo(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return[4,to(r,{method:"GET",responseType:e?"json":"text"})];case 1:return t=o.sent(),a=t.status,n=t.data,i=t.url,s=i===void 0?"":i,a===400?[2,{url:s,reply:null,status:a}]:[2,{url:s,reply:n,status:a}]}})})}function Ne(r,e){return e===void 0&&(e=!0),T(this,void 0,void 0,function(){var t,a;return P(this,function(n){switch(n.label){case 0:return t=oo,(0,l.getGlobalThis)().fetch&&(t=so),[4,t(r,e)];case 1:return a=n.sent(),[2,a]}})})}function ya(r){var e=r.extraCssList,t=e===void 0?[]:e,a=r.custom;if(a){var n=a.extraCssList,i=n===void 0?[]:n,s=a.enable,o=s===void 0?!0:s;if(o){var u=l.commonUtil.merge2List(t,i);return u}}return t.slice()}var Fr=l.commonUtil.safeParse,te={handleSemverRet:function(r,e){var t=r||{},a,n=t.data||t;return e.onlyVersion&&(a=t.version||t.data,n=a),a=a||n.version,!e.isFullVersion&&a&&Reflect.deleteProperty(a,"html_content"),a?{data:n,code:"0",msg:""}:{data:null,code:"404",msg:"no version found"}},appendSearchKV:function(r,e,t){var a=r;return t&&(a+="&".concat(e,"=").concat(t)),a},appendSuffix:function(r,e){var t=r;return e&&(t+=e),t},getSemverApiVal:function(r){var e=r.semverApi;return e===void 0&&(e=!(r.customMetaUrl||r.customMetaJsonpUrl)),e}};function Wr(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u;return P(this,function(c){switch(c.label){case 0:t=null,a=e.semverApi,n=a===void 0?!0:a,i=n?Re:e.apiMode,s="request ".concat(r),_a(s),c.label=1;case 1:return c.trys.push([1,6,,7]),i!==Re?[3,3]:[4,Ne(r)];case 2:return o=c.sent(),t=o.reply,[3,5];case 3:return[4,eo(r)];case 4:t=c.sent(),c.label=5;case 5:return Nr(s),n?[2,te.handleSemverRet(t,e)]:[2,t];case 6:return u=c.sent(),Nr(s),[2,{data:null,code:"404",msg:u.message}];case 7:return[2]}})})}function La(r){var e=R({},r);return e.additional_scripts=Fr(e.additional_scripts,[]),e.additional_body_scripts=Fr(e.additional_body_scripts,[]),e}function Xr(r){var e=R({},r);return e.src_map=Fr(e.src_map,{htmlIndexSrc:"",webDirPath:"",headAssetList:[],bodyAssetList:[],chunkJsSrcList:[],chunkCssSrcList:[],staticJsSrcList:[],staticCssSrcList:[],relativeJsSrcList:[],relativeCssSrcList:[],otherSrcList:[]}),e}function Ea(r,e,t,a){return a===void 0&&(a=!1),T(this,void 0,void 0,function(){var n;return P(this,function(i){switch(i.label){case 0:return n=t,n?[3,3]:a?(n="latest",[3,3]):[3,1];case 1:return[4,io(e,r)];case 2:n=i.sent(),i.label=3;case 3:return[2,"".concat(r,"/").concat(e,"@").concat(n,"/hel_dist/hel-meta.json?_t=").concat(Date.now())]}})})}function qr(r,e){var t=e.versionId,a=e.projectId,n=e.branchId,i=e.apiMode,s=e.isFullVersion,o=s===void 0?!1:s,u=e.versionIdList,c=u===void 0?[]:u,f=e.projectIdList,p=f===void 0?[]:f,v=e.branchIdList,d=v===void 0?[]:v,h=e.loadOptions,m=h===void 0?{}:h,g=ae(e.platform),b=r,S=b,_=t,A=a,I=n,M=!1;Array.isArray(r)&&(b=r[0],S=r.join(","),_=c.join(","),A=p.join(","),I=d.join(","),M=!0);var y=function(X,q){return ie(g,X,[m[X],q])},V=function(X,q){return Aa(g,X,q,m[X])},O=y("userLsKey",l.helConsts.DEFAULT_USER_LS_KEY),j=V("getUserName",{platform:g,appName:b,userLsKey:O}),F=V("shouldUseGray",{appName:b}),k=y("apiSuffix"),B="";typeof F=="boolean"&&(B=F?"1":"0");var w=i!==Re,x="",D="",E=!1;if(M)D=o?_e.BATCH_GET_APP_AND_FULL_VER:_e.BATCH_GET_APP_AND_VER;else{var C=y("customMetaUrl",""),N=y("customMetaJsonpUrl","");C?x=_?"".concat(C,"/").concat(b,"@").concat(_,"?"):"".concat(C,"/").concat(b,"?"):w&&N&&(x=_?"".concat(N,"/").concat(b,"@").concat(_,"?"):"".concat(N,"/").concat(b,"?")),x?E=!0:D=o?_e.GET_APP_AND_FULL_VER:_e.GET_APP_AND_VER}if(!E){var H=y("apiPathOfApp",l.helConsts.DEFAULT_API_URL),Y=Sa(g,m),Q=w?ba:"",W="".concat(D).concat(Q);x="".concat(Y).concat(H,"/").concat(W,"?name=").concat(S),x=te.appendSearchKV(x,"version",_)}return x=te.appendSearchKV(x,"userName",j),x=te.appendSearchKV(x,"projId",A),x=te.appendSearchKV(x,"branch",I),x=te.appendSearchKV(x,"gray",B),x=te.appendSuffix(x,k),x.endsWith("?")&&(x=x.substring(0,x.length-1)),{url:x,userName:j}}function uo(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return t=e.versionId,a=e.platform,n=e.loadOptions,i=Sa(a,n),[4,Ea(i,r,t||"",n?.skip404Sniff)];case 1:return s=o.sent(),[2,s]}})})}function co(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o;return P(this,function(u){switch(u.label){case 0:return t=e.loadOptions,a=t===void 0?{}:t,n="",i="",s=te.getSemverApiVal(a),s?[4,uo(r,e)]:[3,2];case 1:return i=u.sent(),[3,3];case 2:o=qr(r,e),i=o.url,n=o.userName,u.label=3;case 3:return[2,{url:i,userName:n}]}})})}function lo(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I;return P(this,function(M){switch(M.label){case 0:return t=e.apiMode,a=e.appName,n=e.isFullVersion,i=n===void 0?!1:n,s=e.semverApi,o=e.customMetaUrl,u=e.apiPrefix,c=u===void 0?"":u,f=e.getUrl,p=ae(e.platform),v=c||ie(p,"apiPrefix"),d=ie(p,"apiSuffix"),h=ie(p,"apiPathOfApp"),m=ie(p,"apiPathOfAppVersion"),g="",b=!!o,b?(g="".concat(o,"/").concat(a).concat(r?"@".concat(r):""),[3,4]):[3,1];case 1:return s?[4,Ea(v,a,r)]:[3,3];case 2:return g=M.sent(),[3,4];case 3:S=t===Re?"":ba,_=i?_e.GET_APP_FULL_VER:_e.GET_APP_VER,A="".concat(_).concat(S),I=m||h||l.helConsts.DEFAULT_API_URL,g="".concat(v).concat(I,"/").concat(A,"?ver=").concat(r),g=te.appendSearchKV(g,"name",a),g=te.appendSuffix(g,d),M.label=4;case 4:return g=f?.(g)||g,[2,g]}})})}function ta(r,e){var t=e;if(ra(t,"app")&&ra(t,"version")&&(t={code:0,data:{app:t.app,version:t.version}}),!t||Number(t.code)!==0)throw new Error(t?.msg||"getSubAppAndItsVersion err`");var a=t.data||{},n=a.app,i=a.version;if(!n)throw new Error("no app for ".concat(r));if(!i)throw new Error("no version for ".concat(r));return{app:La(n),version:Xr(i)}}function Jr(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I,M=this;return P(this,function(y){switch(y.label){case 0:return t=e.versionId,a=e.branchId,n=e.projectId,i=e.platform,s=e.apiMode,o=e.loadOptions,u=o===void 0?{}:o,c="getSubAppAndItsVersionFn",f="getMeta",p=f,v=Qe(i,f,u.getMeta),v||(v=Qe(i,c,u.getSubAppAndItsVersionFn),p=c),[4,co(r,e)];case 1:return d=y.sent(),h=d.url,m=d.userName,g=function(V,O){return T(M,void 0,void 0,function(){var j,F,k,B;return P(this,function(w){switch(w.label){case 0:return j=V||h,F=te.getSemverApiVal(u),[4,Wr(j,{apiMode:O||s,semverApi:F})];case 1:return k=w.sent(),B=ta(r,k),[2,B]}})})},v?(b=Aa(i,"shouldUseGray",{appName:r},u.shouldUseGray),S={platform:i,appName:r,userName:m,versionId:t,branchId:a,projectId:n,url:h,needGrayVer:b,innerRequest:g},(0,l.log)("[[ ".concat(p," ]] fnParams:"),S),[4,Promise.resolve(v(S))]):[3,3];case 2:return _=y.sent(),A=ta(r,_),[2,A];case 3:return[4,g()];case 4:return I=y.sent(),[2,I]}})})}function fo(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u,c,f,p,v,d;return P(this,function(h){switch(h.label){case 0:return t=e.apiMode,a=e.isFullVersion,n=a===void 0?!1:a,i=e.semverApi,s=e.customMetaUrl,[4,lo(r,e)];case 1:return o=h.sent(),u=s?!1:i,[4,Wr(o,{apiMode:t,isFullVersion:n,semverApi:u,onlyVersion:!0})];case 2:if(c=h.sent(),f=c.data,p=c.code,v=c.msg,parseInt(p,10)!==0||!f)throw new Error(v||"ver not found");return d=Xr(f),[2,d]}})})}function po(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u,c,f=this;return P(this,function(p){switch(p.label){case 0:return r.length?(t=e.apiMode,a=e.batchGetFn,n=e.semverApi,i=ae(e.platform),[4,qr(r,e)]):[2,[]];case 1:return s=p.sent().url,o=function(){return T(f,void 0,void 0,function(){var v,d,h,m,g;return P(this,function(b){switch(b.label){case 0:return[4,Wr(s,{apiMode:t,semverApi:n})];case 1:if(v=b.sent(),d=v.data,h=v.code,m=v.msg,parseInt(h,10)!==0||!d)throw new Error(m||"batch get failed");return g=d.map(function(S){return{app:La(S.app),version:Xr(S.version)}}),[2,g]}})})},u=[],a?(c={url:s,platform:i,innerRequest:o},[4,Promise.resolve(a(c))]):[3,3];case 2:return u=p.sent(),[3,5];case 3:return[4,o()];case 4:u=p.sent(),p.label=5;case 5:return[2,u]}})})}var Or=l.commonUtil.noop,Ia=l.commonUtil.okeys;function vo(){var r=(0,l.getGlobalThis)();r.__HEL_LOAD_ASSETS_FLAG__=1}function Ca(r){var e;try{var t=(e=(0,l.getGlobalThis)())===null||e===void 0?void 0:e.document,a=t.querySelector(r);return!!a}catch{return!1}}function Ta(r,e){var t=r["data-helex"]||"",a=r["data-helappend"],n=(0,l.getGlobalThis)();if(a==="0")return!1;if(t){var i=t.split(",");if(e==="script"&&i.every(function(o){return!!n[o]}))return!1;var s=Ca("".concat(e,'[data-helex="').concat(t,'"]'));return!s}return!0}function zr(r,e,t){var a=(0,l.getGlobalThis)().document;Ia(e).forEach(function(n){return r.setAttribute(n,e[n])}),t?a.body.appendChild(r):a.head.appendChild(r)}function ho(r,e){r.textContent===""?r.textContent=e:r.innerText=e}function Qr(r){var e=r.attrs,t=r.innerText,a=r.appendToBody,n=a===void 0?!0:a,i=r.onloadCb,s=i===void 0?Or:i,o=r.onerrorCb,u=o===void 0?Or:o,c=e.src,f=Ee(e,["src"]),p=f,v=function(m){return s(m),m};if(!c&&!t)return v(!1);var d=(0,l.getGlobalThis)().document;if(c&&Ca('script[src="'.concat(c,'"]'))||!Ta(p,"script"))return v(!1);var h=d.createElement("script");return c&&h.setAttribute("src",c),Ia(p).forEach(function(m){return h.setAttribute(m,p[m])}),h.onload=s,h.onerror=u,t&&ho(h,t),zr(h,p,n),!0}function jr(r){var e=r.appendToBody,t=e===void 0?!1:e,a=r.innerText,n=r.attrs,i=n.href,s=n.rel,o=Ee(n,["href","rel"]),u=o,c=(0,l.getGlobalThis)().document;if(!(!i&&!a)){if(!Ta(u,"link"))return!1;var f=c.createElement("link");i?(f.setAttribute("href",i),f.setAttribute("rel",s||"stylesheet")):s&&f.setAttribute("rel",s),a&&(f.innerText=a),zr(f,u,t)}}function mo(r){var e=r.appendToBody,t=e===void 0?!1:e,a=r.innerText,n=a===void 0?"":a,i=r.attrs,s=(0,l.getGlobalThis)().document,o=s.createElement("style");o.innerText=n,zr(o,i,t)}function Pa(r){return["link","staticLink","relativeLink"].includes(r.tag)}function Ma(r,e){return Or(e),["script","staticScript","relativeScript"].includes(r)}function aa(r){return r==="staticScript"}function Da(r,e){var t=r.attrs,a=r.innerText,n=a===void 0?"":a,i=e.appendToBody,s=e.appendCss,o=e.webDirPath,u=e.cssAppendTypes,c=e.excludeCssList,f={appendToBody:i,attrs:t,innerText:n},p=t.href;if(!(p.endsWith(".ico")&&r.append!==!0)){if(p.endsWith(".css")){s&&u.includes(Xs(o,p))&&!c.includes(p)&&jr(f);return}jr(f)}}function We(r,e){var t=e.appendToBody;r.forEach(function(a){var n=a.tag,i=a.attrs,s=a.append,o=s===void 0?!0:s,u=a.innerText,c=u===void 0?"":u;if(o){if(Pa(a)){Da(a,e);return}if(Ma(n,i)){Qr({appendToBody:t,attrs:i,innerText:c});return}n==="style"&&mo({appendToBody:t,attrs:i,innerText:c})}})}function Tr(r,e){return T(this,void 0,void 0,function(){var t,a;return P(this,function(n){switch(n.label){case 0:return t=e.appendToBody,a=function(i){return new Promise(function(s,o){var u=i.tag,c=i.attrs,f=i.append,p=f===void 0?!0:f,v=i.innerText,d=v===void 0?"":v;if(!p)return s(!0);if(Pa(i))return Da(i,e),s(!0);if(Ma(u,c)){var h=function(){return s(!0)},m=function(g,b,S,_,A){console.error(g,b,S,_,A);var I=A instanceof Error?A:new Error(String(g));o(I)};return Qr({appendToBody:t,attrs:c,innerText:d,onloadCb:h,onerrorCb:m})}s(!0)})},[4,Promise.all(r.map(a))];case 1:return n.sent(),[2]}})})}function go(r){var e=r.assetUrlList,t=r.appendCss,a=r.excludeCssList,n=r.appendToBody;if(e)for(var i=0,s=e;i<s.length;i++){var o=s[i];o.endsWith(".css")?t&&!a.includes(o)&&jr({appendToBody:n,attrs:{href:o}}):Qr({appendToBody:n,attrs:{src:o}})}}function bo(r,e,t){return T(this,void 0,void 0,function(){var a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I,M,y,V,O,j,F,k,B,w,x,D;return P(this,function(E){switch(E.label){case 0:return vo(),a=r.additional_scripts,n=a===void 0?[]:a,i=r.additional_body_scripts,s=i===void 0?[]:i,o=e.src_map,u=o.headAssetList,c=u===void 0?[]:u,f=o.bodyAssetList,p=f===void 0?[]:f,v=o.webDirPath,d=o.chunkCssSrcList,h=d===void 0?[]:d,m=t.useAdditionalScript,g=m===void 0?!1:m,b=t.appendCss,S=b===void 0?!0:b,_=t.cssAppendTypes,A=_===void 0?["build","static","relative"]:_,I=t.getExcludeCssList,M=ya(t),y=l.commonUtil.merge2List(M,h),V=I?.(y,{version:e})||[],O={excludeCssList:V,webDirPath:v,appendCss:S,cssAppendTypes:A,appendToBody:!1},j={excludeCssList:V,webDirPath:v,appendCss:S,cssAppendTypes:A,appendToBody:!0},g?(F=function(C){return C.endsWith(".css")?{tag:"staticLink",attrs:{href:C}}:{tag:"staticScript",attrs:{src:C}}},k=n.map(F),B=s.map(F),[4,Tr(k,O)]):[3,3];case 1:return E.sent(),[4,Tr(B,j)];case 2:E.sent(),E.label=3;case 3:return M.length&&go({assetUrlList:M,excludeCssList:V,appendToBody:!1}),w=[],x=[],D=[],c.forEach(function(C){aa(C.tag)?w.push(C):x.push(C)}),p.forEach(function(C){aa(C.tag)?w.push(C):D.push(C)}),w.length?[4,Tr(w,O)]:[3,5];case 4:return E.sent(),We(x,O),We(D,j),[2];case 5:return We(x,O),We(D,j),[2]}})})}var ge={SHADOW:!0,SET_STYLE_AS_STRING:!0,ENABLE_DISK_CACHE:!1,ENABLE_DISK_CACHE_FOR_ERR:!0,ENABLE_SYNC_META:!0,STORAGE_TYPE:"localStorage",ENABLE_APPEND_CSS:!0,API_MODE:"get",EXTRA_DATA_PREFIX:"HelExtraData"},Pr="[[ isEmitVerMatchInputVer ]]";function Zr(r,e){var t,a=e.branchId,n=e.platform,i=e.emitVer,s=e.inputVer,o=e.projectId,u=ie(n,"strictMatchVer",[e.strictMatchVer]),c=(0,l.getAppMeta)(r,n);if(u===!1)return(0,l.log)("".concat(Pr," set strictMatchVer false for app (").concat(r,"), trust emitVer (").concat(i,") is the target version")),!0;if(!i)return(0,l.log)("".concat(Pr," emitVer should not be null")),!0;if(!s&&c){if(a)return(0,l.log)("".concat(Pr," found branchId ").concat(a)),!0;var f=c.online_version,p=c.build_version;if(o){var v=((t=c.proj_ver)===null||t===void 0?void 0:t.map)||{},d=v[o];if(d)return i===d.b||i===p||i===d.o}return i===f||i===p}return i===s}function Ao(r){var e=(0,l.getGlobalThis)();!l.commonUtil.isServer()&&!e.HelMicro&&((0,l.log)("auto bind hel-micro to global.HelMicro"),e.HelMicro=r)}var Mr=l.helConsts.DEFAULT_ONLINE_VER,na="http://localhost",ia="http://127.0.0.1",kr=["script","link","style"];function So(r){var e=(0,l.getGlobalThis)().DOMParser,t=new e().parseFromString(r,"text/html"),a=[],n=function(i,s,o){i.querySelectorAll(o).forEach(function(u){var c=u.getAttributeNames(),f={};c.forEach(function(p){var v=u.getAttribute(p);v!==null&&(f[p]=v)}),a.push({head:s,tag:o,attrs:f,innerText:u.innerText})})};return kr.forEach(function(i){return n(t.head,!0,i)}),kr.forEach(function(i){return n(t.body,!1,i)}),a}var me={isSrcMatchHost:function(r,e){return e.startsWith(na)||e.startsWith(ia)?r.startsWith(na)||r.startsWith(ia):r.startsWith(e)},parseHtml:function(r){if((0,l.getGlobalThis)().DOMParser)return So(r);var e=!0,t=[],a=function(n){return kr.includes(n)};return Jt(r,{onTagOpen:function(n){a(n)&&t.push({tag:n,attrs:{},innerText:"",head:e})},onTagClose:function(n,i){if(n==="head"&&(e=!1),!!a(n)){var s=t[t.length-1];if(s){var o=i.children[0]||"";typeof o=="string"&&(s.innerText=o),s.attrs=i.attrs}}}}),t},convertToAssetList:function(r,e){var t=[],a=[],n=[],i=[],s=[],o=[];return r.forEach(function(u){var c=u.head,f=u.attrs,p=u.innerText,v=u.tag,d=c?t:a,h=f.src,m=f.href,g=f["data-helex"],b=f.rel,S=qs(f,"data-helappend","1");if(v==="style")d.push({tag:v,attrs:f,innerText:p,append:!0});else{var _=h||m||"",A=_.endsWith(".css"),I=v==="link";if(!_)return;var M=!0,y=me.isSrcMatchHost(_,e);(b==="icon"||!y&&S!=="1"&&!g)&&(M=!1);var V=v;y||(ma(_)?(V=I?"relativeLink":"relativeScript",A?s.push(_):o.push(_)):(V=I?"staticLink":"staticScript",A?n.push(_):i.push(_)));var O={tag:V,attrs:f,innerText:p,append:M};d.push(O)}}),{headAssetList:t,bodyAssetList:a,staticCssSrcList:n,staticJsSrcList:i,relativeCssSrcList:s,relativeJsSrcList:o}},getChunkList:function(r){var e=[],t=[];return r.forEach(function(a){var n=a.attrs,i=n.href,s=n.src,o=i||s||"";o&&(o.endsWith(".css")?e.push(o):t.push(o))}),{chunkCssSrcList:e,chunkJsSrcList:t}},extactHelMeta:function(r){var e=r.code,t=r.data,a=r.msg;if(e&&t){if(e!=="0")throw new Error(a||"server error occurred");return t}return r},getHelMeta:function(r,e,t){return T(this,void 0,void 0,function(){var a,n,i,s;return P(this,function(o){switch(o.label){case 0:a=function(u){return u===void 0&&(u=""),"fetch ".concat(r," helmeta by url ").concat(e," failed in custom mode! ").concat(u)},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Ne(e)];case 2:if(n=o.sent().reply,i=me.extactHelMeta(n),i&&i.app&&i.version)return i.app.__fromCust=!0,[2,i];if(t)throw new Error(a());return(0,l.log)("[[ getCustomMeta ]] 404 is a expected behavior for custom mode, user can ignore it"),[2,null];case 3:if(s=o.sent(),t)throw new Error(a(s.messgae));return l.commonUtil.noop("json parse fail or other error"),[3,4];case 4:return[2]}})})}};function Va(r){if(r){var e=r.enable,t=e===void 0?!0:e,a=r.host;return!!(a&&t)}return!1}function _o(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f,v,p,v,d,h,m,g,b,S,_,A,I,M,y;return P(this,function(V){switch(V.label){case 0:return t=e.host,a=e.appGroupName,n=e.skipFetchHelMeta,i=n===void 0?!1:n,s=e.isApiUrl,o=e.parseHtml,u=e.attachHostSuffix,c=u===void 0?!0:u,f=Date.now(),s?[4,me.getHelMeta(r,t,!0)]:[3,2];case 1:return v=V.sent(),[2,v];case 2:return i?[3,4]:(p=t.endsWith("hel-meta.json")?t:"".concat(t,"/hel-meta.json?_t=").concat(f),[4,me.getHelMeta(r,p)]);case 3:if(v=V.sent(),v)return[2,v];V.label=4;case 4:d="",V.label=5;case 5:return V.trys.push([5,7,,8]),h=c?"".concat(t,"/index.html?_t=").concat(f):t,[4,Ne(h,!1)];case 6:if(m=V.sent(),d=m.reply||"",![200,304].includes(m.status))throw new Error("status ".concat(m.status));return[3,8];case 7:throw g=V.sent(),new Error("".concat(g.message," from ").concat(t));case 8:return b=o||me.parseHtml,S=b(d),_=me.convertToAssetList(S,t),A=_.headAssetList,I=_.bodyAssetList,M=Ee(_,["headAssetList","bodyAssetList"]),y=me.getChunkList(A.concat(I)),[2,{app:{__fromCust:!0,name:r,app_group_name:a||r,online_version:Mr,build_version:Mr},version:{sub_app_name:r,sub_app_version:Mr,src_map:R(R({webDirPath:t,headAssetList:A,bodyAssetList:I},y),M)}}]}})})}var xa=l.commonUtil,yo=l.helConsts,ze=l.log,sa=yo.KEY_ASSET_CTX,oa={recordAssetCtx:function(r,e,t){var a=r.name,n=r.app_group_name,i=e.src_map,s=e.version_tag||e.sub_app_version,o=i.chunkCssSrcList,u=o===void 0?[]:o,c=i.chunkJsSrcList,f=c===void 0?[]:c,p=wr(t,"beforeAppendAssetNode"),v=u.concat(f),d=t.platform;v.forEach(function(h){var m=(0,l.getCommonData)(sa,h)||{};m.marked||(Object.assign(m,{marked:!0,platform:d,groupName:n,name:a,ver:s,beforeAppend:p}),(0,l.setCommonData)(sa,h,m))})},tryTriggerOnFetchMetaSuccess:function(r,e,t){var a=t.loadOptions,n=t.fromFallback,i=wr(a,"onFetchMetaSuccess");i?.({app:r,version:e,fromFallback:n})}};function Ra(r){var e=Qe(r.platform,"onFetchMetaFailed",r.onFetchMetaFailed),t=wr(r,"onFetchMetaFailed");return t||e}function Lo(r,e){var t=(0,l.getPlatformConfig)(r).apiMode;return e||t}function wa(r,e){var t=ae(r),a=Lo(t,e);return{platform:t,apiMode:a}}function ua(r,e,t){return T(this,void 0,void 0,function(){var a,n;return P(this,function(i){switch(i.label){case 0:return a=Kr(),n=Yr(r,e,t),a?[4,a.removeItem(n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return Ze().removeItem(n),[2]}})})}function Na(r,e,t){return T(this,void 0,void 0,function(){var a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I,M,y,V,O,j,F,k,B,w,x,D,E,C,N,H,Y,Q=this;return P(this,function(W){switch(W.label){case 0:return a=e.enableDiskCache,n=a===void 0?ge.ENABLE_DISK_CACHE:a,i=e.enableSyncMeta,s=i===void 0?ge.ENABLE_SYNC_META:i,o=e.versionId,u=o===void 0?"":o,c=e.projectId,f=c===void 0?"":c,p=e.branchId,v=e.isFullVersion,d=v===void 0?!1:v,h=e.custom,m=e.strictMatchVer,g=e.semverApi,b=(t||{}).callRemote,S=b===void 0?!0:b,_=wa(e.platform,e.apiMode),A=_.platform,I=_.apiMode,Va(h)?[4,_o(r,h)]:[3,2];case 1:return M=W.sent(),y=M.app,V=M.version,we(y,{appVersion:V,platform:A,toDisk:!1,loadOptions:e}),(0,l.setAppPlatform)(y.app_group_name,A),(0,l.setAppPlatformByAppName)(r,A),[2,{appInfo:y,appVersion:V}];case 2:return O=(0,l.getAppMeta)(r,A),j=(0,l.getVersion)(r,{platform:A,versionId:u}),F=!g&&!p,F&&O&&j&&(k=j.version_tag||j.sub_app_version,Zr(r,{platform:A,projectId:f,emitVer:k,inputVer:u,strictMatchVer:m}))?[2,{appInfo:O,appVersion:j}]:(B={platform:A,apiMode:I,versionId:u,projectId:f,branchId:p,isFullVersion:d,loadOptions:e},w=null,x=function(X){return T(Q,void 0,void 0,function(){var q;return P(this,function(ee){switch(ee.label){case 0:return X?[4,Co(r,B)]:[3,2];case 1:return q=ee.sent(),[2,q];case 2:return[2,null]}})})},n?[4,ga(r,e)]:[3,9]);case 3:return w=W.sent(),w?[3,5]:(ze("[[ getAppFromRemoteOrLocal ]] get meta from disk but failed!"),[4,x(S)]);case 4:return w=W.sent(),[3,8];case 5:return D=w.appInfo,E=w.appVersion,ze("[[ getAppFromRemoteOrLocal ]] disk meta:",w),C=E.version_tag||E.sub_app_version,u&&C!==u?[4,x(S)]:[3,7];case 6:return w=W.sent(),ze("[[ getAppFromRemoteOrLocal ]] remote meta:",w),[3,8];case 7:we(D,{appVersion:E,platform:A,toDisk:!1,loadOptions:e}),x(s).catch(function(X){return xa.noop(X)}),W.label=8;case 8:return[3,11];case 9:return[4,x(S)];case 10:w=W.sent(),W.label=11;case 11:return w&&(N=w.appInfo,H=N.app_group_name,Y=N.name,(0,l.setAppPlatform)(H,A),(0,l.setAppPlatformByAppName)(Y,A)),[2,w]}})})}function Eo(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,o,s,o;return P(this,function(u){switch(u.label){case 0:t=e.isFirstCall,a=t===void 0?!0:t,n=e.enableDiskCacheForErr,i=n===void 0?ge.ENABLE_DISK_CACHE_FOR_ERR:n,u.label=1;case 1:return u.trys.push([1,3,,6]),[4,Na(r,e)];case 2:return o=u.sent(),[2,{data:o,err:""}];case 3:if(s=u.sent(),a)throw s;return Ra(e)?[2,{data:null,err:s.message}]:(o=null,i?[4,ga(r,e)]:[3,5]);case 4:if(o=u.sent(),!o)throw s;xa.nbalert(`
13
+ [Dev mode alert err only]: `.concat(s.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
+ `)),u.label=5;case 5:return[2,{data:o,err:s}];case 6:return[2]}})})}function Io(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u;return P(this,function(c){switch(c.label){case 0:return t=wa(e.platform,e.apiMode),a=t.platform,n=t.apiMode,i=R(R({},e),{platform:a,apiMode:n}),[4,Jr(r,i)];case 1:if(s=c.sent(),o=s.app,u=s.version,ze("[[ getAppAndVersion ]] result:",{app:o,version:u}),!u)throw new Error("no version found or builded");return[2,{appInfo:o,appVersion:u}]}})})}function we(r,e){var t=e.appVersion,a=e.platform,n=e.toDisk,i=n===void 0?!0:n,s=e.loadOptions;if(!(!r||!t)){var o=r,u=o.name;if(i){var c=Yr(u,s.getCacheKey),f={app:r,version:t};Js(c,f,s.storageType)}if(s.semverApi){var p=(0,l.getAppMeta)(u,a);p?.__setByLatest!==!0&&(o=s.versionId?o:R(R({},o),{__setByLatest:!0}),(0,l.setAppMeta)(o,a))}else(0,l.setAppMeta)(r,a);(0,l.setVersion)(u,t,{platform:a});var v=ya(s),d=t.version_tag||t.sub_app_version;(0,l.setVerExtraCssList)(u,v,{platform:a,versionId:d})}}function Co(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s;return P(this,function(o){switch(o.label){case 0:return t=e.platform,a=e.loadOptions,[4,Io(r,e)];case 1:return n=o.sent(),i=n.appInfo,s=n.appVersion,we(i,{appVersion:s,platform:t,loadOptions:a}),[2,n]}})})}function Fa(r,e){return e===void 0&&(e={}),T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I,M=this;return P(this,function(y){switch(y.label){case 0:t=e.isFirstCall,a=t===void 0?!0:t,n=e.controlLoadAssets,i=n===void 0?!1:n,s=e.platform,o=e.versionId,u=o===void 0?"":o,y.label=1;case 1:return y.trys.push([1,6,,9]),[4,Eo(r,e)];case 2:return c=y.sent(),f=c.data,p=c.err,v=f||{},d=v.appInfo,h=v.appVersion,m=!d||!h,g=!1,m&&!a?(b=Ra(e),b?[4,Promise.resolve(b({platform:s,appName:r,versionId:u}))]:[3,4]):[3,4];case 3:S=y.sent(),S&&(d=S.app,h=S.version,g=!0,we(d,{appVersion:h,platform:ae(s),toDisk:!1,loadOptions:e})),y.label=4;case 4:if(!d)throw new Error(p||"app[".concat(r,"] not exist"));if(!h)throw new Error(p||"app[".concat(r,"]'s version[").concat(u,"] not exist"));return oa.tryTriggerOnFetchMetaSuccess(d,h,{loadOptions:e,fromFallback:g}),oa.recordAssetCtx(d,h,e),_=function(){return T(M,void 0,void 0,function(){return P(this,function(V){switch(V.label){case 0:return[4,bo(d,h,e)];case 1:return V.sent(),[2]}})})},i?[2,_]:[4,_()];case 5:return y.sent(),[2,null];case 6:return A=y.sent(),a?(console.error("loadApp err and try one more time: ",A),[4,Fa(r,R(R({},e),{isFirstCall:!1}))]):[3,8];case 7:return I=y.sent(),[2,I];case 8:throw new Error("loadApp [".concat(r,"] err (").concat(A.message,"), recommend config onFetchMetaFailed hook"));case 9:return[2]}})})}function To(r,e){return T(this,void 0,Promise,function(){var t;return P(this,function(a){switch(a.label){case 0:return[4,fo(r,e)];case 1:return t=a.sent(),[2,t]}})})}function Po(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f,p;return P(this,function(v){switch(v.label){case 0:return t=e||{},a=t.versionId,n=t.projectId,i=t.branchId,s=t.platform,o=t.reuseCache,u=o===void 0?!0:o,u&&!a&&!n&&!i&&(f=(0,l.getAppMeta)(r,s),p=(0,l.getVersion)(r,{platform:s}),f&&p&&(c={app:f,version:p})),c?[3,2]:[4,Jr(r,e||{})];case 1:c=v.sent(),v.label=2;case 2:return[2,c]}})})}function Mo(r,e){var t=e||{},a=t.versionId,n=t.platform,i=t.apiMode,s=i===void 0?Re:i,o=t.protocol,u=o===void 0?"http":o,c=t.projectId,f=t.branchId,p=t.semverApi,v=p===void 0?!0:p,d=qr(r,{platform:n,versionId:a,branchId:f,apiMode:s,projectId:c,semverApi:v}).url;return u==="http"&&(d=d.replace("https:","http:")),d}function Do(r,e,t){return T(this,void 0,void 0,function(){var a;return P(this,function(n){switch(n.label){case 0:return Array.isArray(r)?(a=[],r.forEach(function(i){return a.push(ua(i,e,t))}),[4,Promise.all(a)]):[3,2];case 1:return n.sent(),[3,4];case 2:return[4,ua(r,e,t)];case 3:n.sent(),n.label=4;case 4:return[2]}})})}var Oa=Object.freeze({__proto__:null,getSubAppVersion:To,getSubAppMeta:Po,getMetaDataUrl:Mo,clearDiskCachedApp:Do});function ja(r,e){var t=(0,l.getVersion)(r,e);return t?.src_map.webDirPath||""}function ye(r,e){var t=e||{},a=ae(t.platform),n=t.versionId||"";if(!n){var i=(0,l.getVersion)(r,{platform:a});if(i)n=i.version_tag||i.sub_app_version;else{var s=(0,l.getAppMeta)(r,a);n=s?.online_version||s?.build_version||""}}return{platform:a,versionId:n}}function Vo(r,e){var t={static:[],build:[]},a=(0,l.getVersion)(r,e);if(a){var n=a.src_map,i=n.webDirPath,s=n.chunkCssSrcList;s.forEach(function(o){o.startsWith(i)?t.build.push(o):t.static.push(o)})}return t}var xo=ja,ka=Object.freeze({__proto__:null,getPlatAndVer:ye,getGroupedStyleList:Vo,getWebDirPath:xo}),ca=l.helConsts.KEY_CSS_STR,et=l.helLoadStatus,Ua=et.LOADED,la=et.LOADING,Ro=et.NOT_LOAD,Xe=l.commonUtil.merge2List,Dr=(0,l.getHelEventBus)(),Vr=l.helEvents.STYLE_STR_FETCHED,ue={isStyleStatusMatch:function(r,e,t){var a=ye(r,t),n=a.platform,i=a.versionId,s=(0,l.getVerStyleStrStatus)(r,{platform:n,versionId:i});return s===e},getSelfCssList:function(r,e){var t=ye(r,e),a=(0,l.getVersion)(r,t),n=(0,l.getVerExtraCssList)(r,t),i=[],s=[];if(a){var o=a.src_map||{},u=o.chunkCssSrcList,c=u===void 0?[]:u,f=o.headAssetList,p=f===void 0?[]:f,v=o.bodyAssetList,d=v===void 0?[]:v;i=c;var h=function(g){var b=[];return g.forEach(function(S){var _=S.append,A=_===void 0?!0:_,I=S.attrs.href||"";I.endsWith(".css")&&A&&b.push(I)}),b},m=Xe(h(p),h(d));s=Xe(m,i)}return s=Xe(s,n),{buildCssList:i,initExtraCssList:n,appCssList:s}},fetchStyleStr:function(r){return T(this,void 0,void 0,function(){var e,t,a,n,i,s,o;return P(this,function(u){switch(u.label){case 0:e="",t=0,a=r.length,u.label=1;case 1:if(!(t<a))return[3,7];if(n=r[t],!n.endsWith(".css"))return[3,6];if(i=(0,l.getCommonData)(ca,n),i)return[3,5];u.label=2;case 2:return u.trys.push([2,4,,5]),[4,Ne(n,!1)];case 3:return s=u.sent(),i=s.reply,(0,l.setCommonData)(ca,n,i),[3,5];case 4:return o=u.sent(),console.error(o),[3,5];case 5:e+=i,u.label=6;case 6:return t++,[3,1];case 7:return[2,e]}})})},waitStyleReady:function(r,e){return T(this,void 0,void 0,function(){var t;return P(this,function(a){switch(a.label){case 0:return t=null,[4,new Promise(function(n){t=function(i){var s=i.appName,o=i.platform,u=i.versionId,c=e.branchId,f=e.versionId,p=e.platform,v=e.strictMatchVer;s!==r||o!==p||!Zr(r,{branchId:c,platform:p,emitVer:u,inputVer:f,strictMatchVer:v})||n(!0)},Dr.on(Vr,t)})];case 1:return a.sent(),t&&Dr.off(Vr,t),[2]}})})},computeStyleData:function(r,e){var t=ye(r,e),a=ue.getSelfCssList(r,e),n=a.appCssList,i=a.buildCssList,s=a.initExtraCssList,o=e.extraCssList,u=o===void 0?[]:o,c=e.getExcludeCssList,f=Xe(n,u),p=c?.(f,{version:(0,l.getVersion)(r,t)})||[],v=!p.length&&!u.length,d=f;return p.length&&(d=f.filter(function(h){return!p.includes(h)})),{validCssList:d,onlyUseAppCssList:v,buildCssList:i,initExtraCssList:s,appCssList:n}},fetchStyleData:function(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_;return P(this,function(A){switch(A.label){case 0:return t=ye(r,e),a=e.extraStyleStr,n=a===void 0?"":a,i=e.cssListToStr,s=e.extraCssList,o=s===void 0?[]:s,u=e.strictMatchVer,c=e.branchId,f=ue.computeStyleData(r,e),p=f.validCssList,v=f.onlyUseAppCssList,d=f.buildCssList,h=f.initExtraCssList,m=f.appCssList,g={validCssList:p,buildCssList:d,initExtraCssList:h,appCssList:m,extraCssList:o,extraStyleStr:n,renderStyleStr:""},i?v?(b=(0,l.getVerStyleStrStatus)(r,t),S="",b!==la?[3,2]:[4,ue.waitStyleReady(r,R(R({},t),{strictMatchVer:u,branchId:c}))]):[3,6]:[2,g];case 1:return A.sent(),S=(0,l.getAppStyleStr)(r,t)||"",[3,5];case 2:return b!==Ro?[3,4]:((0,l.setVerStyleStrStatus)(r,la,t),[4,ue.fetchStyleStr(m)]);case 3:return S=A.sent(),(0,l.setAppStyleStr)(r,S,t),(0,l.setVerStyleStrStatus)(r,Ua,t),Dr.emit(Vr,R({appName:r},t)),[3,5];case 4:S=(0,l.getAppStyleStr)(r,t)||"",A.label=5;case 5:return g.renderStyleStr="".concat(S).concat(n),[3,8];case 6:return[4,ue.fetchStyleStr(p)];case 7:_=A.sent(),g.renderStyleStr="".concat(_).concat(n),A.label=8;case 8:return[2,g]}})})}};function wo(r,e){return T(this,void 0,Promise,function(){var t;return P(this,function(a){switch(a.label){case 0:return[4,ue.fetchStyleData(r,e||{})];case 1:return t=a.sent(),[2,t]}})})}function No(r,e){var t=ye(r,e),a=(0,l.getAppStyleStr)(r,t);return a}function Fo(r,e){var t=ue.getSelfCssList(r,e||{});return t}function Oo(r){return T(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return[4,ue.fetchStyleStr(r)];case 1:return e=t.sent(),[2,e]}})})}function jo(r,e){return ue.isStyleStatusMatch(r,Ua,e||{})}function ko(r){var e=(0,l.getGlobalThis)();if(e.document){var t=e.document.querySelectorAll('style[data-gname="'.concat(r,'"]'));t.forEach(l.commonUtil.disableNode)}}function Uo(r){var e=l.commonDataUtil.getStyleTagText(r);return e}function Bo(r,e){var t=rt(r,e),a=l.commonDataUtil.getIgnoreCssPrefixCssUrlList(t)||[];return a}function rt(r,e){var t=(e||{}).custom||{},a="",n=t.host,i=t.enable,s=i===void 0?!0:i;if(n&&s)if(n.endsWith(".json")||n.endsWith(".html")){var o=n.split("/"),u=o.length;o.splice(u-1,u),a=o.join("/")}else a=n;else a=ja(r,e);return a}var Ba=Object.freeze({__proto__:null,fetchAppStyleData:wo,getAppStyleStr:No,getAppCssList:Fo,fetchStyleByUrlList:Oo,isStyleFetched:jo,disableStyleTags:ko,getStyleTagText:Uo,getIgnoredCssUrlList:Bo,getSuitableCssPrefix:rt});function Ha(r,e,t){var a=t.platform,n=(0,l.getAppMeta)(e,a);if(!n){var i=(0,l.getAppMeta)(r,a),s=(0,l.getVersion)(r,t);if(i&&s){(0,l.setAppMeta)(R(R({},i),{name:e,__addedByTrust:!0}),a),(0,l.setVersion)(e,R(R({},s),{sub_app_name:e,__addedByTrust:!0}),{platform:a});var o=(0,l.getVerExtraCssList)(r,t);(0,l.setVerExtraCssList)(e,o,t)}}}function Ho(r,e,t){var a=t.platform,n=t.emitPlatform,i=t.versionId,s=t.emitVer,o=(0,l.getVerLib)(r,t);if(!o){Ha(r,e,t);var u=(0,l.getVerLib)(e,{platform:a,versionId:i});if(!u&&n&&(u=(0,l.getVerLib)(e,{platform:n,versionId:s,strictMatchVer:!1})),!u)throw new Error("seems plat ".concat(n," emit null lib for ").concat(e));return(0,l.libReady)(e,u,{platform:a,appName:r,versionId:i}),!1}return!0}function Go(r,e,t){var a=t.platform,n=t.emitPlatform,i=t.versionId,s=t.emitVer,o=(0,l.getVerApp)(r,t);if(!o){Ha(r,e,t);var u=(0,l.getVerApp)(e,{platform:a,versionId:i});if(!u&&n&&(u=(0,l.getVerApp)(e,{platform:n,versionId:s,strictMatchVer:!1})),!u)throw new Error("seems plat ".concat(n," emit null app for ").concat(e));return Gr(R(R({},u),{platform:a,appGroupName:e,appName:r,versionId:i})),!1}return!0}function tt(r,e){var t=e.versionId,a=t===void 0?"":t,n=e.isLib,i=ae(e.platform),s=ie(i,"strictMatchVer",[e.strictMatchVer]),o=R(R({},e),{strictMatchVer:s}),u=r,c=e.custom;Va(c)&&(u=c.appGroupName||r,o.strictMatchVer=!1);var f=(0,l.getAppMeta)(u,i);if(e.semverApi&&!a&&f&&f.__setByLatest!==!0)return null;if(n){var p=(0,l.getVerLib)(u,o),v={appName:u,appGroupName:f?.app_group_name||"",platform:i,appProperties:p,isLib:!0,versionId:a,Comp:null,lifecycle:void 0};return p?v:null}var d=(0,l.getVerApp)(u,o);return d||null}function Ga(r,e,t){var a="[[ judgeAppReady ]]",n=e.versionId,i=n===void 0?"":n,s=e.projectId,o=e.appName,u=e.platform,c=e.next,f=e.error,p=e.isLib,v=e.strictMatchVer;(0,l.log)("".concat(a," receive emit app and judge (emitAppInfo, judgeOptions):"),r,{inputVer:i,projectId:s,appName:o,platform:u,isLib:p,strictMatchVer:v});var d=ae(u),h=r.appName,m=r.appGroupName,g=r.platform,b=g===void 0?d:g,S=r.versionId,_="".concat(u,"/").concat(o,"/").concat(i),A=(0,l.getAppMeta)(o,u),I=t.branchId,M=t.custom,y=t.trust,V=function(Y){try{var Q=p?Ho(o,m,Y):Go(o,m,Y);return Q}catch(W){return f(W),!1}};if(M){var O=M.enable,j=O===void 0?!0:O,F=M.host,k=M.appGroupName,B=M.trust,w=B===void 0?!1:B,x=function(){return m&&(m===o||m===k)};if(j&&F){(0,l.log)("".concat(a," judge for custom:"),M);var D=function(Y){(0,l.log)("".concat(a," custom conf ").concat(Y?"":"mis","match current emit app!")),Y&&c()};if(!w)return D(x());var E=V({versionId:i,platform:d,emitPlatform:b,emitVer:S});return D(E)}}if(v===!1&&m&&A?.app_group_name===m&&d===b)return(0,l.log)("".concat(a," treat emitApp as wanted when strictMatchVer is false (appInfo):"),r),c();var C=function(){return(0,l.log)("".concat(a," still wait ").concat(_," to be emitted (emitAppInfo,toMatch):"),r,N)},N={branchId:I,platform:u,emitVer:S,inputVer:i,projectId:s,strictMatchVer:v};if(o!==h||!Zr(o,N))return C();var H=ie(d,"trustAppNames",[null,[]],{emptyArrIsNull:!1});if(d!==b&&(y||H.includes(o))){var E=V({versionId:i,platform:d,emitPlatform:b,emitVer:S});if(!E)return(0,l.log)("".concat(a," transfer ").concat(b," app [").concat(o,"] to ").concat(d," plat due to being in trustAppNames")),C()}c()}var Ka=Object.freeze({__proto__:null,getLibOrApp:tt,judgeAppReady:Ga});function $a(r){var e=r.platform,t=Ee(r,["platform"]);(0,l.initPlatformConfig)(t,e)}function Ya(){return(0,l.isSubApp)()}function Ur(r){if(r&&!r.default)try{r.default=r}catch{}return r}function rr(r){var e=(0,l.getGlobalThis)();Object.keys(r).forEach(function(t){var a=r[t];a&&(e[t]=a)})}function Wa(r){var e=Ur(r.React),t=Ur(r.ReactDOM),a=r.ReactIs||null,n=r.ReactReconciler||null,i={LEAH_React:e,LEAH_ReactDOM:t,LEAH_ReactIs:a,LEAH_ReactReconciler:n,React:e,ReactDOM:t,ReactIs:a,ReactReconciler:n};rr(i)}function Xa(r){var e=Ur(r.Vue),t={LEAH_Vue:e,Vue:e};rr(t)}function qa(r){return"".concat(ge.EXTRA_DATA_PREFIX,".").concat(r)}function Ja(r,e){var t,a,n=e??!1,i=(a=(t=(0,l.getGlobalThis)().localStorage)===null||t===void 0?void 0:t.getItem(qa(r)))!==null&&a!==void 0?a:null;return i?n?JSON.parse(i):i:null}function za(r,e,t){var a,n=t??!1,i=n?JSON.stringify(e):e;(a=(0,l.getGlobalThis)().localStorage)===null||a===void 0||a.setItem(qa(r),i)}function fa(r){var e;return typeof r=="string"?(e=(0,l.getGlobalThis)())===null||e===void 0?void 0:e.document.getElementById(r):r}function Qa(r,e){return{name:r,platform:e?.platform||(0,l.getAppPlatform)(r),versionId:e?.versionId||"",getShadowAppRoot:fa,getShadowBodyRoot:fa}}var xr=l.commonUtil.getObjsVal,Ko=l.commonUtil.purify,$o=ge.ENABLE_DISK_CACHE,Yo=ge.ENABLE_SYNC_META,Wo=ge.STORAGE_TYPE,Br="preFetchLib",Xo="preFetchApp",Le="preFetch";function Za(r,e){var t=typeof e=="string"?{versionId:e}:R({},e||{});t.platform=ae(t.platform),t.isLib=r;var a=t.platform;return t.strictMatchVer=ie(a,"strictMatchVer",[t.strictMatchVer]),t.storageType=t.storageType||"indexedDB",t.semverApi=ie(a,"semverApi",[t.semverApi]),t}function qo(r,e,t){if(t.shadow){if(!e)return;var a=rt(r,t);l.commonDataUtil.setIgnoreCssPrefix(a),l.commonDataUtil.setIgnoreStyleTagKey(r),l.commonDataUtil.setIgnoreStyleTagKey(e),l.commonDataUtil.setIgnoreCssPrefixKey(a,e)}}function pa(r,e,t){return T(this,void 0,void 0,function(){var a,n,i,s,o,u,c,f,p,v;return P(this,function(d){switch(d.label){case 0:return a=(0,l.getHelEventBus)(),n=e.platform,i=e.isLib,s=i===void 0?!1:i,o=e.versionId,u=e.projectId,c=e.strictMatchVer,f=s?l.helEvents.SUB_LIB_LOADED:l.helEvents.SUB_APP_LOADED,p=null,[4,new Promise(function(h,m){if(p=function(b){Ga(b,{appName:r,platform:n,versionId:o,projectId:u,isLib:s,next:h,error:m,strictMatchVer:c},e)},a.on(f,p),t){var g=(0,l.getAppMeta)(r,n);g&&qo(r,g.app_group_name,e),t().catch(m)}})];case 1:return d.sent(),p&&a.off(f,p),v=tt(r,e),[2,v]}})})}function en(r,e){return T(this,void 0,void 0,function(){var t,a,n,i,s,o,u;return P(this,function(c){switch(c.label){case 0:t=null,a=e.versionId,n=e.isLib,i=n?Br:Xo,c.label=1;case 1:return c.trys.push([1,7,,8]),t=tt(r,e),t&&(!a||a&&t.versionId===a)?((0,l.log)("[[ ".concat(i," ]] return cached app:"),r,e),[2,{emitApp:t,msg:""}]):(s=null,o=(0,l.getVerLoadStatus)(r,e),o!==l.helLoadStatus.LOADED?[3,3]:[4,pa(r,e)]);case 2:return t=c.sent(),(0,l.log)("[[ ".concat(i," ]] return emit app:"),r,e,t),[2,{emitApp:t,msg:""}];case 3:return o===l.helLoadStatus.LOADING?[3,5]:((0,l.setVerLoadStatus)(r,l.helLoadStatus.LOADING,e),[4,Fa(r,R(R({},e),{controlLoadAssets:!0}))]);case 4:s=c.sent(),(0,l.perfPeek)(Le,"loadApp"),c.label=5;case 5:return[4,pa(r,e,s)];case 6:return t=c.sent(),(0,l.perfPeek)(Le,"waitAppEmit"),(0,l.log)("[[ ".concat(i," ]] return fetch&emit app:"),r,e,t),[2,{emitApp:t,msg:""}];case 7:return u=c.sent(),console.error(u),(0,l.setVerLoadStatus)(r,l.helLoadStatus.NOT_LOAD,e),[2,{emitApp:t,msg:u.message}];case 8:return[2]}})})}function at(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f;return P(this,function(p){switch(p.label){case 0:return(0,l.perfMark)(Le),t="".concat(Br,"(").concat(r,")"),a=_a(t,!0),n=Za(!0,e),[4,en(r,n)];case 1:if(i=p.sent(),s=i.emitApp,o=i.msg,u=s?.appProperties,!u&&n.onLibNull&&(c=n.onLibNull(r,{versionId:n.versionId}),c&&(u=c)),Nr(t,a),(0,l.perfPeek)(Le,"end",!0),!u)throw f=o?" details : ".concat(o):"",new Error("".concat(Br," ").concat(r," fail from ").concat(n.platform,", it may be an invalid module!").concat(f));return[2,u]}})})}function rn(r,e){return T(this,void 0,void 0,function(){var t,a;return P(this,function(n){switch(n.label){case 0:return(0,l.perfMark)(Le),t=Za(!1,e),[4,en(r,t)];case 1:return a=n.sent(),(0,l.perfPeek)(Le,"end",!0),[2,a?.emitApp||null]}})})}function tn(r,e){return T(this,void 0,Promise,function(){var t,a,n,i,s,o,u,c,f,p,v,d,h,m,g,b,S,_,A,I,M,y,V,O,j;return P(this,function(F){switch(F.label){case 0:if(t=e?.preFetchConfigs||{},a=R({semverApi:!1},e?.common||{}),n=ae(a.platform),i=a.versionIdList,s=i===void 0?[]:i,o=a.projectIdList,u=o===void 0?[]:o,c=a.branchIdList,f=c===void 0?[]:c,p=[],v=[],d=[],r.length>8)throw new Error("only support 8 appName at most!");h=[],m=[],g={},b=[];for(S in r)b.push(S);_=0,F.label=1;case 1:return _<b.length?(A=b[_],I=r[A],M=t[I],y={platform:n,versionId:s[A]||"",projectId:u[A]||"",branchId:f[A]||""},typeof M=="string"&&M?y.versionId=M:typeof M=="object"&&M&&(y=R(R({},y),Ko(M)),y.platform=n),g[I]=y,y.enableDiskCache=xr([y,a],"enableDiskCache",$o),y.enableSyncMeta=xr([y,a],"enableSyncMeta",Yo),y.storageType=xr([y,a],"storageType",Wo),[4,Na(I,y,{callRemote:!1})]):[3,4];case 2:V=F.sent(),V||(m.push(I),p[A]=y.versionId||"",v[A]=y.projectId||"",d[A]=y.branchId||""),F.label=3;case 3:return _++,[3,1];case 4:return a.versionIdList=p,a.projectIdList=v,a.branchIdList=d,a.semverApi?[4,Promise.all(m.map(function(k){return Jr(k,g[k])}))]:[3,6];case 5:return h=F.sent(),[3,8];case 6:return[4,po(m,a)];case 7:h=F.sent(),F.label=8;case 8:return h.forEach(function(k){var B=k.app,w=k.version,x=g[B.name]||{};we(B,{appVersion:w,platform:n,toDisk:x.enableDiskCache,loadOptions:x})}),O=r.map(function(k){return at(k,g[k])}),[4,Promise.all(O)];case 9:return j=F.sent(),[2,j]}})})}var Jo=Object.freeze({__proto__:null,core:Hr,VER:da,emitApp:Gr,getAppCacheKey:er,getCachedAppMeta:$r,appMetaSrv:Oa,appParamSrv:ka,appStyleSrv:Ba,logicSrv:Ka,init:$a,isSubApp:Ya,bindExternals:rr,bindReactRuntime:Wa,bindVueRuntime:Xa,getExtraData:Ja,setExtraData:za,getFakeHelContext:Qa,batchPreFetchLib:tn,preFetchApp:rn,preFetchLib:at}),qe=l.commonUtil.purify,zo=(0,l.getUserEventBus)(),Qo=["eventBus","getExtraData","setExtraData","bindExternals","bindVueRuntime","bindReactRuntime","isSubApp"],Je={ignoreFns:["tryGetAppName","log","commonUtil","getCommonData","setCommonData","setGlobalThis"],arg1PlatFns:["getPlatformConfig","getSharedCache"],arg2PlatFns:["initPlatformConfig","getAppMeta","setAppMeta","tryGetVersion","setAppPlatform"],arg2PlatObjFns:[]},Zo=["preFetchLib","preFetchApp"],eu=["getSubAppMeta","getMetaDataUrl"],ru=["emitApp","init"],tu=["getAppCacheKey"];function au(r,e){var t=this,a=e.fnName,n=e.fn,i=e.isCore,s=e.preFetchOptions;return function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];var c=function(S){return R({platform:r},qe(S||{}))},f=o[0],p=o[1],v=o[2];if(i){if(a==="getPlatform")return r;Je.arg1PlatFns.includes(a)?o[0]=f||r:Je.arg2PlatFns.includes(a)?o[1]=p||r:Je.arg2PlatObjFns.includes(a)?o[1]=c(p):Je.ignoreFns.includes(a)||(a.startsWith("set")?o[2]=c(v):o[1]=c(p))}else if(a==="batchPreFetchLib"){var d=p||{},h=c(d.common);o[1]=R(R({},d),{common:h})}else if(Zo.includes(a)){var m=qe(typeof p=="string"?{versionId:p}:p||{});s&&(m=qe(R(R({},s),m))),o[1]=R({platform:r},m)}else if(eu.includes(a)){var g=(s||{}).semverApi,b=g===void 0?!0:g;o[1]=c(R({semverApi:b},qe(p||{})))}else ru.includes(a)?o[0]=c(f):tu.includes(a)?o[1]=p||r:o[1]=c(p);return n.apply(t,o)}}function an(r,e,t){var a=t.preFetchOptions,n=t.isCore,i={};return Object.keys(e).forEach(function(s){var o=e[s];if(Qo.includes(s)){i[s]=o;return}var u=typeof o;if(u==="function"){var c={fnName:s,fn:o,isCore:n,preFetchOptions:a};i[s]=au(r,c);return}if(o&&u==="object"){var f=R(R({},t),{isCore:s==="core"});i[s]=an(r,o,f);return}i[s]=o}),i}function nt(r,e){var t=an(r,Jo,{preFetchOptions:e});return t.createInstance=nt,t.createOriginInstance=nn,t.resetGlobalThis=l.resetGlobalThis,t.eventBus=zo,t.default=t,t}function nn(r,e){var t=e||{},a=t.trustAppNames,n=Ee(t,["trustAppNames"]);return(0,l.originInit)(r,e),nt(r,n)}var sn=da,nu=at,iu=rn,su=tn,ou=Ba,uu=ka,cu=Oa,lu=Ka,fu=Gr,pu=$a,vu=Ya,du=er,hu=$r,mu=Qa,gu=Ja,bu=za,Au=rr,on=Xa,un=Wa,Su=Hr,_u=l.resetGlobalThis,yu=nt,Lu=nn,Eu=(0,l.getUserEventBus)();Su.log("hel-micro ver ".concat(sn));var cn={VER:sn,preFetchLib:nu,preFetchApp:iu,batchPreFetchLib:su,appStyleSrv:ou,appParamSrv:uu,appMetaSrv:cu,logicSrv:lu,emitApp:fu,eventBus:Eu,init:pu,isSubApp:vu,getAppCacheKey:du,getCachedAppMeta:hu,getFakeHelContext:mu,getExtraData:gu,setExtraData:bu,bindExternals:Au,bindVueRuntime:on,bindReactRuntime:un,resetGlobalThis:_u,core:Hr,createInstance:yu,createOriginInstance:Lu};Ao(cn);l.commonUtil.noop(va.default);var Iu=cn;var ln=Fe(Er());var export_exposeLib=ln.exposeLib;var export_getLib=ln.getLib;export{un as bindReactRuntime,on as bindVueRuntime,Iu as default,export_exposeLib as exposeLib,export_getLib as getLib};
17
+ /*! Bundled license information:
18
+
19
+ hel-lib-proxy/dist/hel-lib-proxy.min.js:
20
+ (*! *****************************************************************************
21
+ Copyright (c) Microsoft Corporation.
22
+
23
+ Permission to use, copy, modify, and/or distribute this software for any
24
+ purpose with or without fee is hereby granted.
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
27
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
29
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
30
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
31
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32
+ PERFORMANCE OF THIS SOFTWARE.
33
+ ***************************************************************************** *)
34
+
35
+ hel-micro/es/index.js:
36
+ (*! *****************************************************************************
37
+ Copyright (c) Microsoft Corporation.
38
+
39
+ Permission to use, copy, modify, and/or distribute this software for any
40
+ purpose with or without fee is hereby granted.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
43
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
44
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
45
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
46
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
47
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
48
+ PERFORMANCE OF THIS SOFTWARE.
49
+ ***************************************************************************** *)
50
+ */
Binary file
package/package.json CHANGED
@@ -1,60 +1,76 @@
1
1
  {
2
2
  "name": "@melt-js/libs-core",
3
- "version": "2026.11.15",
3
+ "version": "2026.11.16",
4
4
  "type": "module",
5
- "main": "src/remote.mjs",
6
- "module": "src/remote.mjs",
7
- "types": "src/index.ts",
5
+ "main": "dist/remote.mjs",
6
+ "module": "dist/remote.mjs",
7
+ "types": "dist/index.d.ts",
8
8
  "publishConfig": {
9
9
  "access": "public",
10
10
  "registry": "https://registry.npmjs.org",
11
11
  "tag": "latest"
12
12
  },
13
13
  "dependencies": {
14
- "hel-micro": "4.15.3",
15
- "acorn": "8.19.0",
16
- "dotenv": "16.6.1",
17
- "dotenv-expand": "12.0.3",
18
14
  "@babel/core": "7.29.13",
19
15
  "@babel/generator": "7.29.13",
20
16
  "@babel/parser": "7.29.13",
21
17
  "@babel/types": "7.29.11",
22
18
  "@vue/compiler-sfc": "2.7.14",
23
- "doctrine": "3.0.0"
24
- },
25
- "devDependencies": {
19
+ "acorn": "8.19.0",
20
+ "doctrine": "3.0.0",
21
+ "dotenv": "16.6.1",
22
+ "dotenv-expand": "12.0.3",
26
23
  "esbuild": "0.25.12",
27
- "typescript": "5.9.3"
24
+ "hel-lib-proxy": "4.12.3",
25
+ "hel-micro": "4.15.3",
26
+ "javascript-obfuscator": "4.2.2",
27
+ "rollup": "4.67.5",
28
+ "typescript": "5.9.3",
29
+ "vue-tsc": "3.3.11"
28
30
  },
31
+ "devDependencies": {},
29
32
  "exports": {
30
33
  ".": {
31
- "types": "./src/index.ts",
32
- "default": "./src/remote.mjs"
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/remote.mjs"
33
36
  },
34
- "./src/*": "./src/*",
35
37
  "./scripts/*": "./scripts/*",
36
38
  "./package.json": "./package.json",
37
39
  "./vdoc-parser": "./scripts/vdoc-parser/index.mjs",
38
40
  "./browser": {
39
- "types": "./src/browser.d.mts",
41
+ "types": "./dist/browser.d.mts",
40
42
  "default": "./dist/browser.mjs"
41
43
  },
44
+ "./demo/browser": {
45
+ "types": "./dist/demo/index.d.mts",
46
+ "default": "./dist/demo/browser.mjs"
47
+ },
42
48
  "./demo": {
43
- "types": "./src/demo/index.d.mts",
44
- "default": "./src/demo/index.mjs"
45
- }
49
+ "types": "./dist/demo/index.d.mts",
50
+ "default": "./dist/demo/index.mjs"
51
+ },
52
+ "./src/*": "./dist/*",
53
+ "./cdn/*": "./dist/cdn/*"
46
54
  },
47
55
  "files": [
48
- "src",
49
- "scripts",
50
- "tsconfig.json",
51
- "README.md",
52
56
  "dist",
53
- "demo"
57
+ "scripts",
58
+ "README.md"
54
59
  ],
55
60
  "bin": {
56
61
  "hel-publish-stage": "./scripts/publish-stage.mjs",
57
- "hel-check-tdz": "./scripts/check-tdz.mjs"
62
+ "hel-check-tdz": "./scripts/check-tdz.mjs",
63
+ "hel-package-artifacts": "./scripts/package-artifacts.mjs",
64
+ "hel-browser-formats": "./scripts/browser-formats.mjs"
65
+ },
66
+ "browserFormats": {
67
+ "outDir": "dist",
68
+ "entries": {
69
+ ".": "./dist/browser.mjs",
70
+ "./browser": "./dist/browser.mjs",
71
+ "./demo": "./dist/demo/browser.mjs",
72
+ "./demo/browser": "./dist/demo/browser.mjs"
73
+ }
58
74
  },
59
75
  "scripts": {
60
76
  "typecheck": "tsc --noEmit",