UNPKG

iobroker.backitup

Version:

ioBroker.backitup allows you to backup and restore your ioBroker installation and other systems, such as databases, Zigbee, scripts and many more.

5 lines 72.2 kB
var index_cjs$3={},index_cjs$2={},polyfills_cjs$1={};function _extends$2(){return _extends$2=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$2.apply(this,arguments)}function _object_without_properties_loose(t,e){if(t==null)return{};var r={},n=Object.keys(t),o,i;for(i=0;i<n.length;i++)o=n[i],!(e.indexOf(o)>=0)&&(r[o]=t[o]);return r}polyfills_cjs$1._extends=_extends$2;polyfills_cjs$1._object_without_properties_loose=_object_without_properties_loose;var index_cjs$1={},polyfills_cjs={};function _extends$1(){return _extends$1=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends$1.apply(this,arguments)}polyfills_cjs._=_extends$1;var define_process_env_default={},polyfills$1=polyfills_cjs;const FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return typeof window<"u"&&typeof window.document<"u"}function isReactNativeEnv(){var t;return typeof navigator<"u"&&((t=navigator)==null?void 0:t.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch{return!1}return!1}function isDebugMode(){return typeof process<"u"&&define_process_env_default&&define_process_env_default.FEDERATION_DEBUG?!!define_process_env_default.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:isBrowserDebug()}const getProcessEnv=function(){return typeof process<"u"&&define_process_env_default?define_process_env_default:{}},LOG_CATEGORY$1="[ Federation Runtime ]",parseEntry=(t,e,r=SEPARATOR)=>{const n=t.split(r),o=getProcessEnv().NODE_ENV==="development"&&e,i="*",a=s=>s.startsWith("http")||s.includes(MANIFEST_EXT);if(n.length>=2){let[s,...l]=n;t.startsWith(r)&&(s=n.slice(0,2).join(r),l=[o||n.slice(2).join(r)]);let c=o||l.join(r);return a(c)?{name:s,entry:c}:{name:s,version:c||i}}else if(n.length===1){const[s]=n;return o&&a(o)?{name:s,entry:o}:{name:s,version:o||i}}else throw`Invalid entry value: ${t}`},composeKeyWithSeparator=function(...t){return t.length?t.reduce((e,r)=>r?e?`${e}${SEPARATOR}${r}`:r:e,""):""},encodeName=function(t,e="",r=!1){try{const n=r?".js":"";return`${e}${t.replace(new RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${n}`}catch(n){throw n}},decodeName=function(t,e,r){try{let n=t;if(e){if(!n.startsWith(e))return n;n=n.replace(new RegExp(e,"g"),"")}return n=n.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(n){throw n}},generateExposeFilename=(t,e)=>{if(!t)return"";let r=t;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",e)},generateShareFilename=(t,e)=>t?encodeName(t,"__federation_shared_",e):"",getResourceUrl=(t,e)=>{if("getPublicPath"in t){let r;return t.getPublicPath.startsWith("function")?r=new Function("return "+t.getPublicPath)()():r=new Function(t.getPublicPath)(),`${r}${e}`}else return"publicPath"in t?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${e}`:`${t.publicPath}${e}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,e),"")},assert$1=(t,e)=>{t||error$1(e)},error$1=t=>{throw new Error(`${LOG_CATEGORY$1}: ${t}`)},warn$1=t=>{console.warn(`${LOG_CATEGORY$1}: ${t}`)};function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}const VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(t){return VERSION_PATTERN_REGEXP.test(t)}const simpleJoinRemoteEntry=(t,e)=>{if(!t)return e;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const i=o.slice(1);return i.endsWith("/")?i.slice(0,-1):i}return o})(t);return n?n.endsWith("/")?`${n}${e}`:`${n}/${e}`:e};function inferAutoPublicPath(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(t,e={}){var r,n;const{remotes:o={},overrides:i={},version:a}=e;let s;const l=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&a?inferAutoPublicPath(a):t.metaData.publicPath:t.metaData.getPublicPath,c=Object.keys(i);let u={};if(!Object.keys(o).length){var d;u=((d=t.remotes)==null?void 0:d.reduce((E,b)=>{let T;const $=b.federationContainerName;return c.includes($)?T=i[$]:"version"in b?T=b.version:T=b.entry,E[$]={matchedVersion:T},E},{}))||{}}Object.keys(o).forEach(E=>u[E]={matchedVersion:c.includes(E)?i[E]:o[E]});const{remoteEntry:{path:h,name:m,type:_},types:y,buildInfo:{buildVersion:p},globalName:g,ssrRemoteEntry:I}=t.metaData,{exposes:S}=t;let R={version:a||"",buildVersion:p,globalName:g,remoteEntry:simpleJoinRemoteEntry(h,m),remoteEntryType:_,remoteTypes:simpleJoinRemoteEntry(y.path,y.name),remoteTypesZip:y.zip||"",remoteTypesAPI:y.api||"",remotesInfo:u,shared:t==null?void 0:t.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version})),modules:S==null?void 0:S.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if((r=t.metaData)!=null&&r.prefetchInterface){const E=t.metaData.prefetchInterface;R=polyfills$1._({},R,{prefetchInterface:E})}if((n=t.metaData)!=null&&n.prefetchEntry){const{path:E,name:b,type:T}=t.metaData.prefetchEntry;R=polyfills$1._({},R,{prefetchEntry:simpleJoinRemoteEntry(E,b),prefetchEntryType:T})}if("publicPath"in t.metaData?s=polyfills$1._({},R,{publicPath:l(),ssrPublicPath:t.metaData.ssrPublicPath}):s=polyfills$1._({},R,{getPublicPath:l()}),I){const E=simpleJoinRemoteEntry(I.path,I.name);s.ssrRemoteEntry=E,s.ssrRemoteEntryType=I.type||"commonjs-module"}return s}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}const PREFIX="[ Module Federation ]";let Logger=class{setPrefix(e){this.prefix=e}log(...e){console.log(this.prefix,...e)}warn(...e){console.log(this.prefix,...e)}error(...e){console.log(this.prefix,...e)}success(...e){console.log(this.prefix,...e)}info(...e){console.log(this.prefix,...e)}ready(...e){console.log(this.prefix,...e)}debug(...e){isDebugMode()&&console.log(this.prefix,...e)}constructor(e){this.prefix=e}};function createLogger(t){return new Logger(t)}const logger$1=createLogger(PREFIX);async function safeWrapper$1(t,e){try{return await t()}catch(r){!e&&warn$1(r);return}}function isStaticResourcesEqual$1(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function createScript(t){let e=null,r=!0,n=2e4,o;const i=document.getElementsByTagName("script");for(let s=0;s<i.length;s++){const l=i[s],c=l.getAttribute("src");if(c&&isStaticResourcesEqual$1(c,t.url)){e=l,r=!1;break}}if(!e){const s=t.attrs;e=document.createElement("script"),e.type=(s==null?void 0:s.type)==="module"?"module":"text/javascript";let l;t.createScriptHook&&(l=t.createScriptHook(t.url,t.attrs),l instanceof HTMLScriptElement?e=l:typeof l=="object"&&("script"in l&&l.script&&(e=l.script),"timeout"in l&&l.timeout&&(n=l.timeout))),e.src||(e.src=t.url),s&&!l&&Object.keys(s).forEach(c=>{e&&(c==="async"||c==="defer"?e[c]=s[c]:e.getAttribute(c)||e.setAttribute(c,s[c]))})}const a=async(s,l)=>{clearTimeout(o);const c=()=>{(l==null?void 0:l.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(l)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteScript:u=!0}=t;u&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),s&&typeof s=="function")){const u=s(l);if(u instanceof Promise){const d=await u;return c(),d}return c(),u}c()};return e.onerror=a.bind(null,e.onerror),e.onload=a.bind(null,e.onload),o=setTimeout(()=>{a(null,new Error(`Remote script "${t.url}" time-outed.`))},n),{script:e,needAttach:r}}function createLink(t){let e=null,r=!0;const n=document.getElementsByTagName("link");for(let i=0;i<n.length;i++){const a=n[i],s=a.getAttribute("href"),l=a.getAttribute("rel");if(s&&isStaticResourcesEqual$1(s,t.url)&&l===t.attrs.rel){e=a,r=!1;break}}if(!e){e=document.createElement("link"),e.setAttribute("href",t.url);let i;const a=t.attrs;t.createLinkHook&&(i=t.createLinkHook(t.url,a),i instanceof HTMLLinkElement&&(e=i)),a&&!i&&Object.keys(a).forEach(s=>{e&&!e.getAttribute(s)&&e.setAttribute(s,a[s])})}const o=(i,a)=>{const s=()=>{(a==null?void 0:a.type)==="error"?t!=null&&t.onErrorCallback&&(t==null||t.onErrorCallback(a)):t!=null&&t.cb&&(t==null||t.cb())};if(e&&(e.onerror=null,e.onload=null,safeWrapper$1(()=>{const{needDeleteLink:l=!0}=t;l&&e!=null&&e.parentNode&&e.parentNode.removeChild(e)}),i)){const l=i(a);return s(),l}s()};return e.onerror=o.bind(null,e.onerror),e.onload=o.bind(null,e.onload),{link:e,needAttach:r}}function loadScript(t,e){const{attrs:r={},createScriptHook:n}=e;return new Promise((o,i)=>{const{script:a,needAttach:s}=createScript({url:t,cb:o,onErrorCallback:i,attrs:polyfills$1._({fetchpriority:"high"},r),createScriptHook:n,needDeleteScript:!0});s&&document.head.appendChild(a)})}function importNodeModule(t){if(!t)throw new Error("import specifier is required");return new Function("name","return import(name)")(t).then(r=>r).catch(r=>{throw console.error(`Error importing module ${t}:`,r),r})}const loadNodeFetch=async()=>{const t=await importNodeModule("node-fetch");return t.default||t},lazyLoaderHookFetch=async(t,e,r)=>{const o=await((i,a)=>r.lifecycle.fetch.emit(i,a))(t,e||{});return!o||!(o instanceof Response)?(typeof fetch>"u"?await loadNodeFetch():fetch)(t,e||{}):o},createScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(url,cb,attrs,loaderHook)=>{if(loaderHook!=null&&loaderHook.createScriptHook){const t=loaderHook.createScriptHook(url);t&&typeof t=="object"&&"url"in t&&(url=t.url)}let urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error(`Invalid URL: ${t}`));return}const getFetch=async()=>loaderHook!=null&&loaderHook.fetch?(t,e)=>lazyLoaderHookFetch(t,e,loaderHook):typeof fetch>"u"?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants;const res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);var _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;const script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data} })`,{filename,importModuleDynamically:(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=(_vm_constants=vm.constants)==null?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)!=null?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);const exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){const t=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,t);return}cb(void 0,exportedInterface)}catch(t){cb(t instanceof Error?t:new Error(`Script execution error: ${t}`))}};getFetch().then(async t=>{if((attrs==null?void 0:attrs.type)==="esm"||(attrs==null?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:t,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:new Error(`Script execution error: ${e}`))});handleScriptFetch(t,urlObj)}).catch(t=>{cb(t)})}:(t,e,r,n)=>{e(new Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(t,e)=>new Promise((r,n)=>{createScriptNode(t,(o,i)=>{if(o)n(o);else{var a,s;const l=(e==null||(a=e.attrs)==null?void 0:a.globalName)||`__FEDERATION_${e==null||(s=e.attrs)==null?void 0:s.name}:custom__`,c=globalThis[l]=i;r(c)}},e.attrs,e.loaderHook)}):(t,e)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};async function loadModule(t,e){const{fetch:r,vm:n}=e,i=await(await r(t)).text(),a=new n.SourceTextModule(i,{importModuleDynamically:async(s,l)=>{const c=new URL(s,t).href;return loadModule(c,e)}});return await a.link(async s=>{const l=new URL(s,t).href;return await loadModule(l,e)}),a}function normalizeOptions(t,e,r){return function(n){if(n===!1)return!1;if(typeof n>"u")return t?e:!1;if(n===!0)return e;if(n&&typeof n=="object")return polyfills$1._({},e,n);throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}const createModuleFederationConfig=t=>t;index_cjs$1.BROWSER_LOG_KEY=BROWSER_LOG_KEY;index_cjs$1.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX;index_cjs$1.EncodedNameTransformMap=EncodedNameTransformMap;index_cjs$1.FederationModuleManifest=FederationModuleManifest;index_cjs$1.MANIFEST_EXT=MANIFEST_EXT;index_cjs$1.MFModuleType=MFModuleType;index_cjs$1.MFPrefetchCommon=MFPrefetchCommon;index_cjs$1.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER;index_cjs$1.ManifestFileName=ManifestFileName;index_cjs$1.NameTransformMap=NameTransformMap;index_cjs$1.NameTransformSymbol=NameTransformSymbol;index_cjs$1.SEPARATOR=SEPARATOR;index_cjs$1.StatsFileName=StatsFileName;index_cjs$1.TEMP_DIR=TEMP_DIR;index_cjs$1.assert=assert$1;index_cjs$1.composeKeyWithSeparator=composeKeyWithSeparator;index_cjs$1.containerPlugin=ContainerPlugin;index_cjs$1.containerReferencePlugin=ContainerReferencePlugin;index_cjs$1.createLink=createLink;index_cjs$1.createLogger=createLogger;index_cjs$1.createModuleFederationConfig=createModuleFederationConfig;index_cjs$1.createScript=createScript;index_cjs$1.createScriptNode=createScriptNode;index_cjs$1.decodeName=decodeName;index_cjs$1.encodeName=encodeName;index_cjs$1.error=error$1;index_cjs$1.generateExposeFilename=generateExposeFilename;index_cjs$1.generateShareFilename=generateShareFilename;index_cjs$1.generateSnapshotFromManifest=generateSnapshotFromManifest;index_cjs$1.getProcessEnv=getProcessEnv;index_cjs$1.getResourceUrl=getResourceUrl;index_cjs$1.inferAutoPublicPath=inferAutoPublicPath;index_cjs$1.isBrowserEnv=isBrowserEnv;index_cjs$1.isDebugMode=isDebugMode;index_cjs$1.isManifestProvider=isManifestProvider;index_cjs$1.isReactNativeEnv=isReactNativeEnv;index_cjs$1.isRequiredVersion=isRequiredVersion;index_cjs$1.isStaticResourcesEqual=isStaticResourcesEqual$1;index_cjs$1.loadScript=loadScript;index_cjs$1.loadScriptNode=loadScriptNode;index_cjs$1.logger=logger$1;index_cjs$1.moduleFederationPlugin=ModuleFederationPlugin;index_cjs$1.normalizeOptions=normalizeOptions;index_cjs$1.parseEntry=parseEntry;index_cjs$1.safeToString=safeToString;index_cjs$1.safeWrapper=safeWrapper$1;index_cjs$1.sharePlugin=SharePlugin;index_cjs$1.simpleJoinRemoteEntry=simpleJoinRemoteEntry;index_cjs$1.warn=warn$1;var index_cjs={};const RUNTIME_001="RUNTIME-001",RUNTIME_002="RUNTIME-002",RUNTIME_003="RUNTIME-003",RUNTIME_004="RUNTIME-004",RUNTIME_005="RUNTIME-005",RUNTIME_006="RUNTIME-006",RUNTIME_007="RUNTIME-007",RUNTIME_008="RUNTIME-008",RUNTIME_009="RUNTIME-009",TYPE_001="TYPE-001",BUILD_001="BUILD-001",BUILD_002="BUILD-002",getDocsUrl=t=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t.split("-")[0].toLowerCase()}/${t}`,getShortErrorMsg=(t,e,r,n)=>{const o=[`${[e[t]]} #${t}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(getDocsUrl(t)),n&&o.push(`Original Error Message: ${n}`),o.join(` `)};function _extends(){return _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends.apply(this,arguments)}const runtimeDescMap={[RUNTIME_001]:"Failed to get remoteEntry exports.",[RUNTIME_002]:'The remote entry interface does not contain "init"',[RUNTIME_003]:"Failed to get manifest.",[RUNTIME_004]:"Failed to locate remote.",[RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[RUNTIME_006]:"Invalid loadShareSync function call from runtime",[RUNTIME_007]:"Failed to get remote snapshot.",[RUNTIME_008]:"Failed to load script resources.",[RUNTIME_009]:"Please call createInstance first."},typeDescMap={[TYPE_001]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},buildDescMap={[BUILD_001]:"Failed to find expose module.",[BUILD_002]:"PublicPath is required in prod mode."},errorDescMap=_extends({},runtimeDescMap,typeDescMap,buildDescMap);index_cjs.BUILD_001=BUILD_001;index_cjs.BUILD_002=BUILD_002;index_cjs.RUNTIME_001=RUNTIME_001;index_cjs.RUNTIME_002=RUNTIME_002;index_cjs.RUNTIME_003=RUNTIME_003;index_cjs.RUNTIME_004=RUNTIME_004;index_cjs.RUNTIME_005=RUNTIME_005;index_cjs.RUNTIME_006=RUNTIME_006;index_cjs.RUNTIME_007=RUNTIME_007;index_cjs.RUNTIME_008=RUNTIME_008;index_cjs.RUNTIME_009=RUNTIME_009;index_cjs.TYPE_001=TYPE_001;index_cjs.buildDescMap=buildDescMap;index_cjs.errorDescMap=errorDescMap;index_cjs.getShortErrorMsg=getShortErrorMsg;index_cjs.runtimeDescMap=runtimeDescMap;index_cjs.typeDescMap=typeDescMap;var polyfills=polyfills_cjs$1,sdk=index_cjs$1,errorCodes$1=index_cjs;const LOG_CATEGORY="[ Federation Runtime ]",logger=sdk.createLogger(LOG_CATEGORY);function assert(t,e){t||error(e)}function error(t){throw t instanceof Error?(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`),t):new Error(`${LOG_CATEGORY}: ${t}`)}function warn(t){t instanceof Error&&(t.message.startsWith(LOG_CATEGORY)||(t.message=`${LOG_CATEGORY}: ${t.message}`)),logger.warn(t)}function addUniqueItem(t,e){return t.findIndex(r=>r===e)===-1&&t.push(e),t}function getFMId(t){return"version"in t&&t.version?`${t.name}:${t.version}`:"entry"in t&&t.entry?`${t.name}:${t.entry}`:`${t.name}`}function isRemoteInfoWithEntry(t){return typeof t.entry<"u"}function isPureRemoteEntry(t){return!t.entry.includes(".json")}async function safeWrapper(t,e){try{return await t()}catch(r){!e&&warn(r);return}}function isObject(t){return t&&typeof t=="object"}const objectToString=Object.prototype.toString;function isPlainObject(t){return objectToString.call(t)==="[object Object]"}function isStaticResourcesEqual(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function arrayOptions(t){return Array.isArray(t)?t:[t]}function getRemoteEntryInfoFromSnapshot(t){const e={url:"",type:"global",globalName:""};return sdk.isBrowserEnv()||sdk.isReactNativeEnv()?"remoteEntry"in t?{url:t.remoteEntry,type:t.remoteEntryType,globalName:t.globalName}:e:"ssrRemoteEntry"in t?{url:t.ssrRemoteEntry||e.url,type:t.ssrRemoteEntryType||e.type,globalName:t.globalName}:e}const processModuleAlias=(t,e)=>{let r;return t.endsWith("/")?r=t.slice(0,-1):r=t,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},CurrentGlobal=typeof globalThis=="object"?globalThis:window,nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})(),Global=nativeGlobal;function definePropertyGlobalVal(t,e,r){Object.defineProperty(t,e,{value:r,configurable:!1,writable:!0})}function includeOwnProperty(t,e){return Object.hasOwnProperty.call(t,e)}includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(t){var e,r,n,o,i,a;includeOwnProperty(t,"__VMOK__")&&!includeOwnProperty(t,"__FEDERATION__")&&definePropertyGlobalVal(t,"__FEDERATION__",t.__VMOK__),includeOwnProperty(t,"__FEDERATION__")||(definePropertyGlobalVal(t,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(t,"__VMOK__",t.__FEDERATION__));var s;(s=(e=t.__FEDERATION__).__GLOBAL_PLUGIN__)!=null||(e.__GLOBAL_PLUGIN__=[]);var l;(l=(r=t.__FEDERATION__).__INSTANCES__)!=null||(r.__INSTANCES__=[]);var c;(c=(n=t.__FEDERATION__).moduleInfo)!=null||(n.moduleInfo={});var u;(u=(o=t.__FEDERATION__).__SHARE__)!=null||(o.__SHARE__={});var d;(d=(i=t.__FEDERATION__).__MANIFEST_LOADING__)!=null||(i.__MANIFEST_LOADING__={});var h;(h=(a=t.__FEDERATION__).__PRELOADED_MAP__)!=null||(a.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function resetFederationGlobalInfo(){CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__=[],CurrentGlobal.__FEDERATION__.__INSTANCES__=[],CurrentGlobal.__FEDERATION__.moduleInfo={},CurrentGlobal.__FEDERATION__.__SHARE__={},CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(globalLoading).forEach(t=>{delete globalLoading[t]})}function setGlobalFederationInstance(t){CurrentGlobal.__FEDERATION__.__INSTANCES__.push(t)}function getGlobalFederationConstructor(){return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(t,e=sdk.isDebugMode()){e&&(CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.17.1")}function getInfoWithoutType(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const n=Object.keys(t);for(const o of n){const[i,a]=o.split(":"),s=`${i}:${e}`,l=t[s];if(l)return{value:l,key:s}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t),n=getInfoWithoutType(e,r).value;if(n&&!n.version&&"version"in t&&t.version&&(n.version=t.version),n)return n;if("version"in t&&t.version){const{version:o}=t,i=polyfills._object_without_properties_loose(t,["version"]),a=getFMId(i),s=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,a).value;if((s==null?void 0:s.version)===o)return s}},getGlobalSnapshotInfoByModuleInfo=t=>getTargetSnapshotInfoByModuleInfo(t,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t,e)=>{const r=getFMId(t);return nativeGlobal.__FEDERATION__.moduleInfo[r]=e,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t=>(nativeGlobal.__FEDERATION__.moduleInfo=polyfills._extends({},nativeGlobal.__FEDERATION__.moduleInfo,t),()=>{const e=Object.keys(t);for(const r of e)delete nativeGlobal.__FEDERATION__.moduleInfo[r]}),getRemoteEntryExports=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,n=CurrentGlobal[r];return{remoteEntryKey:r,entryExports:n}},registerGlobalPlugins=t=>{const{__GLOBAL_PLUGIN__:e}=nativeGlobal.__FEDERATION__;t.forEach(r=>{e.findIndex(n=>n.name===r.name)===-1?e.push(r):warn(`The plugin ${r.name} has been registered.`)})},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(t),setPreloaded=t=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(t,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(t){return new RegExp(t)}function isXVersion(t){return!t||t.toLowerCase()==="x"||t==="*"}function pipe(...t){return e=>t.reduce((r,n)=>n(r),e)}function extractComparator(t){return t.match(parseRegex(comparator))}function combineVersion(t,e,r,n){const o=`${t}.${e}.${r}`;return n?`${o}-${n}`:o}function parseHyphen(t){return t.replace(parseRegex(hyphenRange),(e,r,n,o,i,a,s,l,c,u,d,h)=>(isXVersion(n)?r="":isXVersion(o)?r=`>=${n}.0.0`:isXVersion(i)?r=`>=${n}.${o}.0`:r=`>=${r}`,isXVersion(c)?l="":isXVersion(u)?l=`<${Number(c)+1}.0.0-0`:isXVersion(d)?l=`<${c}.${Number(u)+1}.0-0`:h?l=`<=${c}.${u}.${d}-${h}`:l=`<=${l}`,`${r} ${l}`.trim()))}function parseComparatorTrim(t){return t.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(t){return t.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(t){return t.replace(parseRegex(caretTrim),"$1^")}function parseCarets(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(caret),(r,n,o,i,a)=>isXVersion(n)?"":isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:a?n==="0"?o==="0"?`>=${n}.${o}.${i}-${a} <${n}.${o}.${Number(i)+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i}-${a} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${i} <${n}.${o}.${Number(i)+1}-0`:`>=${n}.${o}.${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i} <${Number(n)+1}.0.0-0`)).join(" ")}function parseTildes(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(tilde),(r,n,o,i,a)=>isXVersion(n)?"":isXVersion(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:a?`>=${n}.${o}.${i}-${a} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i} <${n}.${Number(o)+1}.0-0`)).join(" ")}function parseXRanges(t){return t.split(/\s+/).map(e=>e.trim().replace(parseRegex(xRange),(r,n,o,i,a,s)=>{const l=isXVersion(o),c=l||isXVersion(i),u=c||isXVersion(a);return n==="="&&u&&(n=""),s="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&u?(c&&(i=0),a=0,n===">"?(n=">=",c?(o=Number(o)+1,i=0,a=0):(i=Number(i)+1,a=0)):n==="<="&&(n="<",c?o=Number(o)+1:i=Number(i)+1),n==="<"&&(s="-0"),`${n+o}.${i}.${a}${s}`):c?`>=${o}.0.0${s} <${Number(o)+1}.0.0-0`:u?`>=${o}.${i}.0${s} <${o}.${Number(i)+1}.0-0`:r})).join(" ")}function parseStar(t){return t.trim().replace(parseRegex(star),"")}function parseGTE0(t){return t.trim().replace(parseRegex(gte0),"")}function compareAtom(t,e){return t=Number(t)||t,e=Number(e)||e,t>e?1:t===e?0:-1}function comparePreRelease(t,e){const{preRelease:r}=t,{preRelease:n}=e;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,i=r.length;o<=i;o++){const a=r[o],s=n[o];if(a!==s)return a===void 0&&s===void 0?0:a?s?compareAtom(a,s):-1:1}return 0}function compareVersion(t,e){return compareAtom(t.major,e.major)||compareAtom(t.minor,e.minor)||compareAtom(t.patch,e.patch)||comparePreRelease(t,e)}function eq(t,e){return t.version===e.version}function compare(t,e){switch(t.operator){case"":case"=":return eq(t,e);case">":return compareVersion(t,e)<0;case">=":return eq(t,e)||compareVersion(t,e)<0;case"<":return compareVersion(t,e)>0;case"<=":return eq(t,e)||compareVersion(t,e)>0;case void 0:return!0;default:return!1}}function parseComparatorString(t){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(t)}function parseRange(t){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(t.trim()).split(/\s+/).join(" ")}function satisfy(t,e){if(!t)return!1;const r=extractComparator(t);if(!r)return!1;const[,n,,o,i,a,s]=r,l={operator:n,version:combineVersion(o,i,a,s),major:o,minor:i,patch:a,preRelease:s==null?void 0:s.split(".")},c=e.split("||");for(const u of c){const d=u.trim();if(!d||d==="*"||d==="x")return!0;try{const h=parseRange(d);if(!h.trim())return!0;const m=h.split(" ").map(p=>parseComparatorString(p)).join(" ");if(!m.trim())return!0;const _=m.split(/\s+/).map(p=>parseGTE0(p)).filter(Boolean);if(_.length===0)continue;let y=!0;for(const p of _){const g=extractComparator(p);if(!g){y=!1;break}const[,I,,S,R,E,b]=g,T={operator:I,version:combineVersion(S,R,E,b),major:S,minor:R,patch:E,preRelease:b==null?void 0:b.split(".")};if(!compare(T,l)){y=!1;break}}if(y)return!0}catch(h){console.error(`[semver] Error processing range part "${d}":`,h);continue}}return!1}function formatShare(t,e,r,n){let o;"get"in t?o=t.get:"lib"in t?o=()=>Promise.resolve(t.lib):o=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)});var i,a,s;return polyfills._extends({deps:[],useIn:[],from:e,loading:null},t,{shareConfig:polyfills._extends({requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1},t.shareConfig),get:o,loaded:t!=null&&t.loaded||"lib"in t?!0:void 0,version:(i=t.version)!=null?i:"0",scope:Array.isArray(t.scope)?t.scope:[(a=t.scope)!=null?a:"default"],strategy:((s=t.strategy)!=null?s:n)||"version-first"})}function formatShareConfigs(t,e){const r=e.shared||{},n=e.name,o=Object.keys(r).reduce((a,s)=>{const l=arrayOptions(r[s]);return a[s]=a[s]||[],l.forEach(c=>{a[s].push(formatShare(c,n,s,e.shareStrategy))}),a},{}),i=polyfills._extends({},t.shared);return Object.keys(o).forEach(a=>{i[a]?o[a].forEach(s=>{i[a].find(c=>c.version===s.version)||i[a].push(s)}):i[a]=o[a]}),{shared:i,shareInfos:o}}function versionLt(t,e){const r=n=>{if(!Number.isNaN(Number(n))){const i=n.split(".");let a=n;for(let s=0;s<3-i.length;s++)a+=".0";return a}return n};return!!satisfy(r(t),`<=${r(e)}`)}const findVersion=(t,e)=>{const r=e||function(n,o){return versionLt(n,o)};return Object.keys(t).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},isLoaded=t=>!!t.loaded||typeof t.lib=="function",isLoading=t=>!!t.loading;function findSingletonVersionOrderByVersion(t,e,r){const n=t[e][r],o=function(i,a){return!isLoaded(n[i])&&versionLt(i,a)};return findVersion(t[e][r],o)}function findSingletonVersionOrderByLoaded(t,e,r){const n=t[e][r],o=function(i,a){const s=l=>isLoaded(l)||isLoading(l);return s(n[a])?s(n[i])?!!versionLt(i,a):!0:s(n[i])?!1:versionLt(i,a)};return findVersion(t[e][r],o)}function getFindShareFunction(t){return t==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t,e,r,n){if(!t)return;const{shareConfig:o,scope:i=DEFAULT_SCOPE,strategy:a}=r,s=Array.isArray(i)?i:[i];for(const l of s)if(o&&t[l]&&t[l][e]){const{requiredVersion:c}=o,d=getFindShareFunction(a)(t,l,e),h=()=>{if(o.singleton){if(typeof c=="string"&&!satisfy(d,c)){const y=`Version ${d} from ${d&&t[l][e][d].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${c})`;o.strictVersion?error(y):warn(y)}return t[l][e][d]}else{if(c===!1||c==="*"||satisfy(d,c))return t[l][e][d];for(const[y,p]of Object.entries(t[l][e]))if(satisfy(y,c))return p}},m={shareScopeMap:t,scope:l,pkgName:e,version:d,GlobalFederation:Global.__FEDERATION__,resolver:h};return(n.emit(m)||m).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(t){const{pkgName:e,extraOptions:r,shareInfos:n}=t,o=s=>{if(!s)return;const l={};s.forEach(d=>{l[d.version]=d});const u=findVersion(l,function(d,h){return!isLoaded(l[d])&&versionLt(d,h)});return l[u]};var i;const a=(i=r==null?void 0:r.resolver)!=null?i:o;return Object.assign({},a(n[e]),r==null?void 0:r.customShareInfo)}function getBuilderId$1(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function matchRemoteWithNameAndExpose(t,e){for(const r of t){const n=e.startsWith(r.name);let o=e.replace(r.name,"");if(n){if(o.startsWith("/")){const s=r.name;return o=`.${o}`,{pkgNameOrAlias:s,expose:o,remote:r}}else if(o==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const i=r.alias&&e.startsWith(r.alias);let a=r.alias&&e.replace(r.alias,"");if(r.alias&&i){if(a&&a.startsWith("/")){const s=r.alias;return a=`.${a}`,{pkgNameOrAlias:s,expose:a,remote:r}}else if(a==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function matchRemote(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function registerPlugins$1(t,e){const r=getGlobalHostPlugins(),n=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(o=>{t!=null&&t.find(i=>i.name!==o.name)&&t.push(o)}),t&&t.length>0&&t.forEach(o=>{n.forEach(i=>{i.applyPlugin(o,e)})}),t}const importCallback=".then(callbacks[0]).catch(callbacks[1])";async function loadEsmEntry({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${t}")${importCallback}`)([r,n]):import(t).then(r).catch(n)}catch(o){n(o)}})}async function loadSystemJsEntry({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof __system_context__>"u"?System.import(t).then(r).catch(n):new Function("callbacks",`System.import("${t}")${importCallback}`)([r,n])}catch(o){n(o)}})}function handleRemoteEntryLoaded(t,e,r){const{remoteEntryKey:n,entryExports:o}=getRemoteEntryExports(t,e);return assert(o,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_001,errorCodes$1.runtimeDescMap,{remoteName:t,remoteEntryUrl:r,remoteEntryKey:n})),o}async function loadEntryScript({name:t,globalName:e,entry:r,loaderHook:n}){const{entryExports:o}=getRemoteEntryExports(t,e);return o||sdk.loadScript(r,{attrs:{},createScriptHook:(i,a)=>{const s=n.lifecycle.createScript.emit({url:i,attrs:a});if(s&&(s instanceof HTMLScriptElement||"script"in s||"timeout"in s))return s}}).then(()=>handleRemoteEntryLoaded(t,e,r)).catch(i=>{throw assert(void 0,errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_008,errorCodes$1.runtimeDescMap,{remoteName:t,resourceUrl:r})),i})}async function loadEntryDom({remoteInfo:t,remoteEntryExports:e,loaderHook:r}){const{entry:n,entryGlobalName:o,name:i,type:a}=t;switch(a){case"esm":case"module":return loadEsmEntry({entry:n,remoteEntryExports:e});case"system":return loadSystemJsEntry({entry:n,remoteEntryExports:e});default:return loadEntryScript({entry:n,globalName:o,name:i,loaderHook:r})}}async function loadEntryNode({remoteInfo:t,loaderHook:e}){const{entry:r,entryGlobalName:n,name:o,type:i}=t,{entryExports:a}=getRemoteEntryExports(o,n);return a||sdk.loadScriptNode(r,{attrs:{name:o,globalName:n,type:i},loaderHook:{createScriptHook:(s,l={})=>{const c=e.lifecycle.createScript.emit({url:s,attrs:l});if(c&&"url"in c)return c}}}).then(()=>handleRemoteEntryLoaded(o,n,r)).catch(s=>{throw s})}function getRemoteEntryUniqueKey(t){const{entry:e,name:r}=t;return sdk.composeKeyWithSeparator(r,e)}async function getRemoteEntry({origin:t,remoteEntryExports:e,remoteInfo:r}){const n=getRemoteEntryUniqueKey(r);if(e)return e;if(!globalLoading[n]){const o=t.remoteHandler.hooks.lifecycle.loadEntry,i=t.loaderHook;globalLoading[n]=o.emit({loaderHook:i,remoteInfo:r,remoteEntryExports:e}).then(a=>a||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":sdk.isBrowserEnv())?loadEntryDom({remoteInfo:r,remoteEntryExports:e,loaderHook:i}):loadEntryNode({remoteInfo:r,loaderHook:i})))}return globalLoading[n]}function getRemoteInfo(t){return polyfills._extends({},t,{entry:"entry"in t?t.entry:"",type:t.type||DEFAULT_REMOTE_TYPE,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||DEFAULT_SCOPE})}function defaultPreloadArgs(t){return polyfills._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},t)}function formatPreloadArgs(t,e){return e.map(r=>{const n=matchRemote(t,r.nameOrAlias);return assert(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&sdk.safeToString({remoteInfo:n,remotes:t})}`),{remote:n,preloadConfig:defaultPreloadArgs(r)}})}function normalizePreloadExposes(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function preloadAssets(t,e,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:i,entryAssets:a}=r;if(e.options.inBrowser){if(a.forEach(s=>{const{moduleInfo:l}=s,c=e.moduleCache.get(t.name);getRemoteEntry(c?{origin:e,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:e,remoteInfo:l,remoteEntryExports:void 0})}),n){const s={rel:"preload",as:"style"};o.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(m instanceof HTMLLinkElement)return m}});u&&document.head.appendChild(c)})}else{const s={rel:"stylesheet",type:"text/css"};o.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(m instanceof HTMLLinkElement)return m},needDeleteLink:!1});u&&document.head.appendChild(c)})}if(n){const s={rel:"preload",as:"script"};i.forEach(l=>{const{link:c,needAttach:u}=sdk.createLink({url:l,cb:()=>{},attrs:s,createLinkHook:(d,h)=>{const m=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:h});if(m instanceof HTMLLinkElement)return m}});u&&document.head.appendChild(c)})}else{const s={fetchpriority:"high",type:(t==null?void 0:t.type)==="module"?"module":"text/javascript"};i.forEach(l=>{const{script:c,needAttach:u}=sdk.createScript({url:l,cb:()=>{},attrs:s,createScriptHook:(d,h)=>{const m=e.loaderHook.lifecycle.createScript.emit({url:d,attrs:h});if(m instanceof HTMLScriptElement)return m},needDeleteScript:!0});u&&document.head.appendChild(c)})}}}const ShareUtils={getRegisteredShare,getGlobalShareScope},GlobalUtils={Global,nativeGlobal,resetFederationGlobalInfo,setGlobalFederationInstance,getGlobalFederationConstructor,setGlobalFederationConstructor,getInfoWithoutType,getGlobalSnapshot,getTargetSnapshotInfoByModuleInfo,getGlobalSnapshotInfoByModuleInfo,setGlobalSnapshotInfoByModuleInfo,addGlobalSnapshot,getRemoteEntryExports,registerGlobalPlugins,getGlobalHostPlugins,getPreloaded,setPreloaded};var helpers={global:GlobalUtils,share:ShareUtils,utils:{matchRemoteWithNameAndExpose,preloadAssets,getRemoteInfo}};let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;try{e=await getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch{const n=getRemoteEntryUniqueKey(this.remoteInfo);e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading,uniqueKey:n})}return assert(e,`remoteEntryExports is undefined ${sdk.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,n,o){const{loadFactory:i=!0}=n||{loadFactory:!0},a=await this.getEntry();if(!this.inited){const d=this.host.shareScopeMap,h=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];h.length||h.push("default"),h.forEach(g=>{d[g]||(d[g]={})});const m=d[h[0]],_=[],y={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?h:this.remoteInfo.shareScope||"default"};Object.defineProperty(y,"shareScopeMap",{value:d,enumerable:!1});const p=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:m,remoteEntryInitOptions:y,initScope:_,remoteInfo:this.remoteInfo,origin:this.host});typeof(a==null?void 0:a.init)>"u"&&error(errorCodes$1.getShortErrorMsg(errorCodes$1.RUNTIME_002,errorCodes$1.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await a.init(p.shareScope,p.initScope,p.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(polyfills._extends({},p,{id:e,remoteSnapshot:o,remoteEntryExports:a}))}this.lib=a,this.inited=!0;let s;s=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:r,moduleInfo:this.remoteInfo}),s||(s=await a.get(r)),assert(s,`${getFMId(this.remoteInfo)} remote don't export ${r}.`);const l=processModuleAlias(this.remoteInfo.name,r),c=this.wraperFactory(s,l);return i?await c():c}wraperFactory(e,r){function n(o,i){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:i,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return n(o,r),o}:()=>{const o=e();return n(o,r),o}}constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}};class SyncHook{on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function n(...o){return r.remove(n),e.apply(null,o)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(n=>{r=n(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class AsyncHook extends SyncHook{emit(...e){let r;const n=Array.from(this.listeners);if(n.length>0){let o=0;const i=a=>a===!1?!1:o<n.length?Promise.resolve(n[o++].apply(null,e)).then(i):a;r=i()}return Promise.resolve(r)}}function checkReturnData(t,e){if(!isObject(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class SyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const n=r(e);if(checkReturnData(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){warn(n),this.onerror(n)}return e}constructor(e){super(),this.onerror=error,this.type=e}}class AsyncWaterfallHook extends SyncHook{emit(e){isObject(e)||error(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=a=>(warn(a),this.onerror(a),e),i=a=>{if(checkReturnData(e,a)){if(e=a,n<r.length)try{return Promise.resolve(r[n++](e)).then(i,o)}catch(s){return o(s)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(i(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=error,this.type=e}}class PluginSystem{applyPlugin(e,r){assert(isPlainObject(e),"Plugin configuration is invalid.");const n=e.name;assert(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply==null||e.apply.call(e,r),Object.keys(this.lifecycle).forEach(o=>{const i=e[o];i&&this.lifecycle[o].on(i)}))}removePlugin(e){assert(e,"A name is required.");const r=this.registerPlugins[e];assert(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(r[n])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function assignRemoteInfo(t,e){const r=getRemoteEntryInfoFromSnapshot(e);r.url||error(`The attribute remoteEntry of ${t.name} must not be undefined.`);let n=sdk.getResourceUrl(e,r.url);!sdk.isBrowserEnv()&&!n.startsWith("http")&&(n=`https:${n}`),t.type=r.type,t.entryGlobalName=r.globalName,t.entry=n,t.version=e.version,t.buildVersion=e.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:i,id:a}=t;if(!isRemoteInfoWithEntry(e)||!isPureRemoteEntry(e)){const{remoteSnapshot:s,globalSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:a});assignRemoteInfo(i,s);const c={remote:e,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:i,remote:e,remoteSnapshot:s,globalSnapshot:l});return u&&preloadAssets(i,o,u,!1),polyfills._extends({},t,{remoteSnapshot:s})}return t}}}function splitId(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function traverseModuleInfo(t,e,r,n,o={},i){const a=getFMId(e),{value:s}=getInfoWithoutType(t,a),l=i||s;if(l&&!sdk.isManifestProvider(l)&&(r(l,e,n),l.remotesInfo)){const c=Object.keys(l.remotesInfo);for(const u of c){if(o[u])continue;o[u]=!0;const d=splitId(u),h=l.remotesInfo[u];traverseModuleInfo(t,{name:d.name,version:h.matchedVersion},r,!1,o,void 0)}}}const isExisted=(t,e)=>document.querySelector(`${t}[${t==="link"?"href":"src"}="${e}"]`);function generatePreloadAssets(t,e,r,n,o){const i=[],a=[],s=[],l=new Set,c=new Set,{options:u}=t,{preloadConfig:d}=e,{depsRemote:h}=d;if(traverseModuleInfo(n,r,(p,g,I)=>{let S;if(I)S=d;else if(Array.isArray(h)){const M=h.find(N=>N.nameOrAlias===g.name||N.nameOrAlias===g.alias);if(!M)return;S=defaultPreloadArgs(M)}else if(h===!0)S=d;else return;const R=sdk.getResourceUrl(p,getRemoteEntryInfoFromSnapshot(p).url);R&&s.push({name:g.name,moduleInfo:{name:g.name,entry:R,type:"remoteEntryType"in p?p.remoteEntryType:"global",entryGlobalName:"globalName"in p?p.globalName:g.name,shareScope:"",version:"version"in p?p.version:void 0},url:R});let E="modules"in p?p.modules:[];const b=normalizePreloadExposes(S.exposes);if(b.length&&"modules"in p){var T;E=p==null||(T=p.modules)==null?void 0:T.reduce((M,N)=>((b==null?void 0:b.indexOf(N.moduleName))!==-1&&M.push(N),M),[])}function $(M){const N=M.map(v=>sdk.getResourceUrl(p,v));return S.filter?N.filter(S.filter):N}if(E){const M=E.length;for(let N=0;N<M;N++){const v=E[N],A=`${g.name}/${v.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:v.moduleName==="."?g.name:A,name:g.name,remoteSnapshot:p,preloadConfig:S,remote:g,origin:t}),!getPreloaded(A)&&(S.resourceCategory==="all"?(i.push(...$(v.assets.css.async)),i.push(...$(v.assets.css.sync)),a.push(...$(v.assets.js.async)),a.push(...$(v.assets.js.sync))):(S.resourceCategory="sync")&&(i.push(...$(v.assets.css.sync)),a.push(...$(v.assets.js.sync))),setPreloaded(A))}}},!0,{},o),o.shared&&o.shared.length>0){const p=(g,I)=>{const S=getRegisteredShare(t.shareScopeMap,I.sharedName,g,t.sharedHandler.hooks.lifecycle.resolveShare);S&&typeof S.lib=="function"&&(I.assets.js.sync.forEach(R=>{l.add(R)}),I.assets.css.sync.forEach(R=>{c.add(R)}))};o.shared.forEach(g=>{var I;const S=(I=u.shared)==null?void 0:I[g.sharedName];if(!S)return;const R=g.version?S.find(b=>b.version===g.version):S;if(!R)return;arrayOptions(R).forEach(b=>{p(b,g)})})}const _=a.filter(p=>!l.has(p)&&!isExisted("script",p));return{cssAssets:i.filter(p=>!c.has(p)&&!isExisted("link",p)),jsAssetsWithoutEntry:_,entryAssets:s.filter(p=>!isExisted("script",p.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:i,remoteSnapshot:a}=t;return sdk.isBrowserEnv()?isRemoteInfoWithEntry(o)&&isPureRemoteEntry(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(n,a),generatePreloadAssets(e,r,n,i,a)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function getGlobalRemoteInfo(t,e){const r=getGlobalSnapshotInfoByModuleInfo({name:e.name,version:e.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&getInfoWithoutType(r.remotesInfo,t.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:t.name,version:"version"in t?t.version:void 0})}}class SnapshotHandler{async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:n}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let i=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInsta