UNPKG

starknetkit

Version:

<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>

30 lines (21 loc) 96.9 kB
"use strict";var te=Object.defineProperty,ne=(t,e,o)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,_=(t,e,o)=>(ne(t,typeof e!="symbol"?e+"":e,o),o),K=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)},N=(t,e,o)=>(K(t,e,"read from private field"),o?o.call(t):e.get(t)),T=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},B=(t,e,o,n)=>(K(t,e,"write to private field"),n?n.call(t,o):e.set(t,o),o),E=(t,e,o)=>(K(t,e,"access private method"),o);const generateUID=()=>`${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,shuffle=t=>{for(let e=t.length-1;e>0;e--){const o=Math.floor(Math.random()*(e+1));[t[e],t[o]]=[t[o],t[e]]}return t},pipe$1=(...t)=>e=>t.reduce((o,n)=>o.then(n),Promise.resolve(e));function ensureKeysArray(t){return Object.keys(t)}const ssrSafeWindow=typeof window<"u"?window:null;function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function isDebugMode$1(){return!!""}function isBrowserEnv$1(){return typeof window<"u"}const LOG_CATEGORY$1="[ Federation Runtime ]";function assert(t,e){t||error(e)}function error(t){throw t instanceof Error?(t.message=`${LOG_CATEGORY$1}: ${t.message}`,t):new Error(`${LOG_CATEGORY$1}: ${t}`)}function warn$1(t){t instanceof Error?(t.message=`${LOG_CATEGORY$1}: ${t.message}`,console.warn(t)):console.warn(`${LOG_CATEGORY$1}: ${t}`)}function addUniqueItem(t,e){return t.findIndex(o=>o===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")&&t.entry.includes(".js")}function safeToString$1(t){try{return JSON.stringify(t,null,2)}catch{return""}}function isObject(t){return t&&typeof t=="object"}const objectToString=Object.prototype.toString;function isPlainObject(t){return objectToString.call(t)==="[object Object]"}function _extends$1$1(){return _extends$1$1=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$1$1.apply(this,arguments)}function _object_without_properties_loose$1(t,e){if(t==null)return{};var o={},n=Object.keys(t),r,i;for(i=0;i<n.length;i++)r=n[i],!(e.indexOf(r)>=0)&&(o[r]=t[r]);return o}const nativeGlobal=(()=>{try{return new Function("return this")()}catch{return globalThis}})(),Global=nativeGlobal;function definePropertyGlobalVal(t,e,o){Object.defineProperty(t,e,{value:o,configurable:!1,writable:!0})}function includeOwnProperty(t,e){return Object.hasOwnProperty.call(t,e)}includeOwnProperty(globalThis,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(globalThis,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=globalThis.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(t){var e,o,n,r,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__)),(e=t.__FEDERATION__).__GLOBAL_PLUGIN__!=null||(e.__GLOBAL_PLUGIN__=[]),(o=t.__FEDERATION__).__INSTANCES__!=null||(o.__INSTANCES__=[]),(n=t.__FEDERATION__).moduleInfo!=null||(n.moduleInfo={}),(r=t.__FEDERATION__).__SHARE__!=null||(r.__SHARE__={}),(i=t.__FEDERATION__).__MANIFEST_LOADING__!=null||(i.__MANIFEST_LOADING__={}),(a=t.__FEDERATION__).__PRELOADED_MAP__!=null||(a.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(globalThis);setGlobalDefaultVal(nativeGlobal);function getGlobalFederationInstance(t,e){const o=getBuilderId();return globalThis.__FEDERATION__.__INSTANCES__.find(n=>!!(o&&n.options.id===getBuilderId()||n.options.name===t&&!n.options.version&&!e||n.options.name===t&&e&&n.options.version===e))}function setGlobalFederationInstance(t){globalThis.__FEDERATION__.__INSTANCES__.push(t)}function getGlobalFederationConstructor(){return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(t,e=isDebugMode$1()){e&&(globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.1.2")}function getInfoWithoutType(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const o=Object.keys(t);for(const n of o){const[r,i]=n.split(":"),a=`${r}:${e}`,s=t[a];if(s)return{value:s,key:a}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t,e)=>{const o=getFMId(t),n=getInfoWithoutType(e,o).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:r}=t,i=_object_without_properties_loose$1(t,["version"]),a=getFMId(i),s=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,a).value;if(s?.version===r)return s}},getGlobalSnapshotInfoByModuleInfo=t=>getTargetSnapshotInfoByModuleInfo(t,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t,e)=>{const o=getFMId(t);return nativeGlobal.__FEDERATION__.moduleInfo[o]=e,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t=>(nativeGlobal.__FEDERATION__.moduleInfo=_extends$1$1({},nativeGlobal.__FEDERATION__.moduleInfo,t),()=>{const e=Object.keys(t);for(const o of e)delete nativeGlobal.__FEDERATION__.moduleInfo[o]}),getRemoteEntryExports=(t,e)=>{const o=e||`__FEDERATION_${t}:custom__`,n=globalThis[o];return{remoteEntryKey:o,entryExports:n}},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=t=>globalThis.__FEDERATION__.__PRELOADED_MAP__.get(t),setPreloaded=t=>globalThis.__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((o,n)=>n(o),e)}function extractComparator(t){return t.match(parseRegex(comparator))}function combineVersion(t,e,o,n){const r=`${t}.${e}.${o}`;return n?`${r}-${n}`:r}function parseHyphen(t){return t.replace(parseRegex(hyphenRange),(e,o,n,r,i,a,s,c,l,u,h,g)=>(isXVersion(n)?o="":isXVersion(r)?o=`>=${n}.0.0`:isXVersion(i)?o=`>=${n}.${r}.0`:o=`>=${o}`,isXVersion(l)?c="":isXVersion(u)?c=`<${Number(l)+1}.0.0-0`:isXVersion(h)?c=`<${l}.${Number(u)+1}.0-0`:g?c=`<=${l}.${u}.${h}-${g}`:c=`<=${c}`,`${o} ${c}`.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),(o,n,r,i,a)=>isXVersion(n)?"":isXVersion(r)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?n==="0"?`>=${n}.${r}.0 <${n}.${Number(r)+1}.0-0`:`>=${n}.${r}.0 <${Number(n)+1}.0.0-0`:a?n==="0"?r==="0"?`>=${n}.${r}.${i}-${a} <${n}.${r}.${Number(i)+1}-0`:`>=${n}.${r}.${i}-${a} <${n}.${Number(r)+1}.0-0`:`>=${n}.${r}.${i}-${a} <${Number(n)+1}.0.0-0`:n==="0"?r==="0"?`>=${n}.${r}.${i} <${n}.${r}.${Number(i)+1}-0`:`>=${n}.${r}.${i} <${n}.${Number(r)+1}.0-0`:`>=${n}.${r}.${i} <${Number(n)+1}.0.0-0`)).join(" ")}function parseTildes(t){return t.trim().split(/\s+/).map(e=>e.replace(parseRegex(tilde),(o,n,r,i,a)=>isXVersion(n)?"":isXVersion(r)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?`>=${n}.${r}.0 <${n}.${Number(r)+1}.0-0`:a?`>=${n}.${r}.${i}-${a} <${n}.${Number(r)+1}.0-0`:`>=${n}.${r}.${i} <${n}.${Number(r)+1}.0-0`)).join(" ")}function parseXRanges(t){return t.split(/\s+/).map(e=>e.trim().replace(parseRegex(xRange),(o,n,r,i,a,s)=>{const c=isXVersion(r),l=c||isXVersion(i),u=l||isXVersion(a);return n==="="&&u&&(n=""),s="",c?n===">"||n==="<"?"<0.0.0-0":"*":n&&u?(l&&(i=0),a=0,n===">"?(n=">=",l?(r=Number(r)+1,i=0,a=0):(i=Number(i)+1,a=0)):n==="<="&&(n="<",l?r=Number(r)+1:i=Number(i)+1),n==="<"&&(s="-0"),`${n+r}.${i}.${a}${s}`):l?`>=${r}.0.0${s} <${Number(r)+1}.0.0-0`:u?`>=${r}.${i}.0${s} <${r}.${Number(i)+1}.0-0`:o})).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:o}=t,{preRelease:n}=e;if(o===void 0&&n)return 1;if(o&&n===void 0)return-1;if(o===void 0&&n===void 0)return 0;for(let r=0,i=o.length;r<=i;r++){const a=o[r],s=n[r];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 o=parseRange(e).split(" ").map(u=>parseComparatorString(u)).join(" ").split(/\s+/).map(u=>parseGTE0(u)),n=extractComparator(t);if(!n)return!1;const[,r,,i,a,s,c]=n,l={operator:r,version:combineVersion(i,a,s,c),major:i,minor:a,patch:s,preRelease:c?.split(".")};for(const u of o){const h=extractComparator(u);if(!h)return!1;const[,g,,p,d,m,M]=h,I={operator:g,version:combineVersion(p,d,m,M),major:p,minor:d,patch:m,preRelease:M?.split(".")};if(!compare(I,l))return!1}return!0}function _extends$6(){return _extends$6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$6.apply(this,arguments)}function formatShare(t,e){let o;return"get"in t?o=t.get:o=()=>Promise.resolve(t.lib),_extends$6({deps:[],useIn:[],from:e,loading:null},t,{shareConfig:_extends$6({requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1},t.shareConfig),get:o,loaded:"lib"in t?!0:void 0,scope:Array.isArray(t.scope)?t.scope:["default"],strategy:t.strategy||"version-first"})}function formatShareConfigs(t,e){return t?Object.keys(t).reduce((o,n)=>(o[n]=formatShare(t[n],e),o),{}):{}}function versionLt(t,e){const o=n=>{if(!Number.isNaN(Number(n))){const r=n.split(".");let i=n;for(let a=0;a<3-r.length;a++)i+=".0";return i}return n};return!!satisfy(o(t),`<=${o(e)}`)}const findVersion=(t,e,o,n)=>{const r=t[e][o],i=n||function(a,s){return versionLt(a,s)};return Object.keys(r).reduce((a,s)=>!a||i(a,s)||a==="0"?s:a,0)},isLoaded=t=>!!t.loaded||typeof t.lib=="function";function findSingletonVersionOrderByVersion(t,e,o){const n=t[e][o];return findVersion(t,e,o,function(r,i){return!isLoaded(n[r])&&versionLt(r,i)})}function findSingletonVersionOrderByLoaded(t,e,o){const n=t[e][o];return findVersion(t,e,o,function(r,i){return isLoaded(n[i])?isLoaded(n[r])?!!versionLt(r,i):!0:isLoaded(n[r])?!1:versionLt(r,i)})}function getFindShareFunction(t){return t==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t,e,o,n){if(!t)return;const{shareConfig:r,scope:i=DEFAULT_SCOPE,strategy:a}=o,s=Array.isArray(i)?i:[i];for(const c of s)if(r&&t[c]&&t[c][e]){const{requiredVersion:l}=r,u=getFindShareFunction(a)(t,c,e),h=()=>{if(r.singleton){if(typeof l=="string"&&!satisfy(u,l)){const p=`Version ${u} from ${u&&t[c][e][u].from} of shared singleton module ${e} does not satisfy the requirement of ${o.from} which needs ${l})`;r.strictVersion?error(p):warn$1(p)}return t[c][e][u]}else{if(l===!1||l==="*"||satisfy(u,l))return t[c][e][u];for(const[p,d]of Object.entries(t[c][e]))if(satisfy(p,l))return d}},g={shareScopeMap:t,scope:c,pkgName:e,version:u,GlobalFederation:Global.__FEDERATION__,resolver:h};return(n.emit(g)||g).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function _define_property$3(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",BROWSER_LOG_VALUE="1",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},_obj,NameTransformMap=(_obj={},_define_property$3(_obj,NameTransformSymbol.AT,"scope_"),_define_property$3(_obj,NameTransformSymbol.HYPHEN,"_"),_define_property$3(_obj,NameTransformSymbol.SLASH,"__"),_obj),_obj1;_obj1={},_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.AT],NameTransformSymbol.AT),_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.HYPHEN],NameTransformSymbol.HYPHEN),_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.SLASH],NameTransformSymbol.SLASH);var SEPARATOR=":";function isBrowserEnv(){return typeof window<"u"}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&!!FEDERATION_DEBUG}function _array_like_to_array$2(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}function _array_without_holes(t){if(Array.isArray(t))return _array_like_to_array$2(t)}function _class_call_check(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _create_class(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),t}function _define_property$2(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _iterable_to_array$1(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(t){return _array_without_holes(t)||_iterable_to_array$1(t)||_unsupported_iterable_to_array$2(t)||_non_iterable_spread()}function _unsupported_iterable_to_array$2(t,e){if(t){if(typeof t=="string")return _array_like_to_array$2(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _array_like_to_array$2(t,e)}}function safeToString(t){try{return JSON.stringify(t,null,2)}catch{return""}}var DEBUG_LOG="[ FEDERATION DEBUG ]";function safeGetLocalStorageItem(){try{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(BROWSER_LOG_KEY)===BROWSER_LOG_VALUE}catch{return typeof document<"u"}return!1}var Logger=function(){function t(e){_class_call_check(this,t),_define_property$2(this,"enable",!1),_define_property$2(this,"identifier",void 0),this.identifier=e||DEBUG_LOG,isBrowserEnv()&&safeGetLocalStorageItem()?this.enable=!0:isDebugMode()&&(this.enable=!0)}return _create_class(t,[{key:"info",value:function(e,o){if(this.enable){var n=safeToString(o)||"";isBrowserEnv()?console.info("%c ".concat(this.identifier,": ").concat(e," ").concat(n),"color:#3300CC"):console.info("\x1B[34m%s","".concat(this.identifier,": ").concat(e," ").concat(n?` `.concat(n):""))}}},{key:"logOriginalInfo",value:function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];if(this.enable)if(isBrowserEnv()){var r;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(r=console).log.apply(r,_to_consumable_array(o))}else{var i;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(i=console).log.apply(i,_to_consumable_array(o))}}}]),t}(),LOG_CATEGORY="[ Federation Runtime ]";new Logger;var composeKeyWithSeparator=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length?e.reduce(function(n,r){return r?n?"".concat(n).concat(SEPARATOR).concat(r):r:n},""):""},getResourceUrl=function(t,e){if("getPublicPath"in t){var o=new Function(t.getPublicPath)();return"".concat(o).concat(e)}else return"publicPath"in t?"".concat(t.publicPath).concat(e):(console.warn("Can not get resource url, if in debug mode, please ignore",t,e),"")},warn=function(t){console.warn("".concat(LOG_CATEGORY,": ").concat(t))};function _define_property$1(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _object_spread$1(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable}))),n.forEach(function(r){_define_property$1(t,r,o[r])})}return t}function ownKeys(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function _object_spread_props(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ownKeys(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))}),t}var simpleJoinRemoteEntry=function(t,e){if(!t)return e;var o=function(r){if(r===".")return"";if(r.startsWith("./"))return r.replace("./","");if(r.startsWith("/")){var i=r.slice(1);return i.endsWith("/")?i.slice(0,-1):i}return r},n=o(t);return n?n.endsWith("/")?"".concat(n).concat(e):"".concat(n,"/").concat(e):e};function generateSnapshotFromManifest(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,n,r=e.remotes,i=r===void 0?{}:r,a=e.overrides,s=a===void 0?{}:a,c=e.version,l,u=function(){return"publicPath"in t.metaData?t.metaData.publicPath:t.metaData.getPublicPath},h=Object.keys(s),g={};if(!Object.keys(i).length){var p;g=((p=t.remotes)===null||p===void 0?void 0:p.reduce(function(w,R){var U,W=R.federationContainerName;return h.includes(W)?U=s[W]:"version"in R?U=R.version:U=R.entry,w[W]={matchedVersion:U},w},{}))||{}}Object.keys(i).forEach(function(w){return g[w]={matchedVersion:h.includes(w)?s[w]:i[w]}});var d=t.metaData,m=d.remoteEntry,M=m.path,I=m.name,D=m.type,S=d.types,O=d.buildInfo.buildVersion,L=d.globalName,v=t.exposes,y={version:c||"",buildVersion:O,globalName:L,remoteEntry:simpleJoinRemoteEntry(M,I),remoteEntryType:D,remoteTypes:simpleJoinRemoteEntry(S.path,S.name),remoteTypesZip:S.zip||"",remoteTypesAPI:S.api||"",remotesInfo:g,shared:t?.shared.map(function(w){return{assets:w.assets,sharedName:w.name}}),modules:v?.map(function(w){return{moduleName:w.name,modulePath:w.path,assets:w.assets}})};if(!((o=t.metaData)===null||o===void 0)&&o.prefetchInterface){var A=t.metaData.prefetchInterface;y=_object_spread_props(_object_spread$1({},y),{prefetchInterface:A})}if(!((n=t.metaData)===null||n===void 0)&&n.prefetchEntry){var b=t.metaData.prefetchEntry,x=b.path,H=b.name,$=b.type;y=_object_spread_props(_object_spread$1({},y),{prefetchEntry:simpleJoinRemoteEntry(x,H),prefetchEntryType:$})}return"publicPath"in t.metaData?l=_object_spread_props(_object_spread$1({},y),{publicPath:u()}):l=_object_spread_props(_object_spread$1({},y),{getPublicPath:u()}),l}function isManifestProvider(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(MANIFEST_EXT))}function asyncGeneratorStep$1(t,e,o,n,r,i,a){try{var s=t[i](a),c=s.value}catch(l){o(l);return}s.done?e(c):Promise.resolve(c).then(n,r)}function _async_to_generator$1(t){return function(){var e=this,o=arguments;return new Promise(function(n,r){var i=t.apply(e,o);function a(c){asyncGeneratorStep$1(i,n,r,a,s,"next",c)}function s(c){asyncGeneratorStep$1(i,n,r,a,s,"throw",c)}a(void 0)})}}function _instanceof(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _ts_generator$1(t,e){var o,n,r,i,a={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return c([l,u])}}function c(l){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(r=l[0]&2?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(l[0]===6&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(u){l=[6,u],n=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function safeWrapper(t,e){return _safeWrapper.apply(this,arguments)}function _safeWrapper(){return _safeWrapper=_async_to_generator$1(function(t,e){var o,n;return _ts_generator$1(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t()];case 1:return o=r.sent(),[2,o];case 2:return n=r.sent(),!e&&warn(n),[2];case 3:return[2]}})}),_safeWrapper.apply(this,arguments)}function isStaticResourcesEqual(t,e){var o=/^(https?:)?\/\//i,n=t.replace(o,"").replace(/\/$/,""),r=e.replace(o,"").replace(/\/$/,"");return n===r}function createScript(t,e,o,n){for(var r=null,i=!0,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var c=a[s],l=c.getAttribute("src");if(l&&isStaticResourcesEqual(l,t)){r=c,i=!1;break}}if(!r&&(r=document.createElement("script"),r.type="text/javascript",r.src=t,n)){var u=n(t);_instanceof(u,HTMLScriptElement)&&(r=u)}o&&Object.keys(o).forEach(function(g){r&&(g==="async"||g==="defer"?r[g]=o[g]:r.setAttribute(g,o[g]))});var h=function(g,p){if(r&&(r.onerror=null,r.onload=null,safeWrapper(function(){r!=null&&r.parentNode&&r.parentNode.removeChild(r)}),g)){var d=g(p);return e(),d}e()};return r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),{script:r,needAttach:i}}function createLink(t,e){for(var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,r=null,i=!0,a=document.getElementsByTagName("link"),s=0;s<a.length;s++){var c=a[s],l=c.getAttribute("href"),u=c.getAttribute("ref");if(l&&isStaticResourcesEqual(l,t)&&u===o.ref){r=c,i=!1;break}}if(!r&&(r=document.createElement("link"),r.setAttribute("href",t),n)){var h=n(t);_instanceof(h,HTMLLinkElement)&&(r=h)}o&&Object.keys(o).forEach(function(p){r&&r.setAttribute(p,o[p])});var g=function(p,d){if(r&&(r.onerror=null,r.onload=null,safeWrapper(function(){r!=null&&r.parentNode&&r.parentNode.removeChild(r)}),p)){var m=p(d);return e(),m}e()};return r.onerror=g.bind(null,r.onerror),r.onload=g.bind(null,r.onload),{link:r,needAttach:i}}function loadScript(t,e){var o=e.attrs,n=e.createScriptHook;return new Promise(function(r,i){var a=createScript(t,r,o,n),s=a.script,c=a.needAttach;c&&document.getElementsByTagName("head")[0].appendChild(s)})}function _array_like_to_array(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}function _array_with_holes(t){if(Array.isArray(t))return t}function asyncGeneratorStep(t,e,o,n,r,i,a){try{var s=t[i](a),c=s.value}catch(l){o(l);return}s.done?e(c):Promise.resolve(c).then(n,r)}function _async_to_generator(t){return function(){var e=this,o=arguments;return new Promise(function(n,r){var i=t.apply(e,o);function a(c){asyncGeneratorStep(i,n,r,a,s,"next",c)}function s(c){asyncGeneratorStep(i,n,r,a,s,"throw",c)}a(void 0)})}}function _iterable_to_array_limit(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],r=!0,i=!1,a,s;try{for(o=o.call(t);!(r=(a=o.next()).done)&&(n.push(a.value),!(e&&n.length===e));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw s}}return n}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(t,e){return _array_with_holes(t)||_iterable_to_array_limit(t,e)||_unsupported_iterable_to_array(t,e)||_non_iterable_rest()}function _unsupported_iterable_to_array(t,e){if(t){if(typeof t=="string")return _array_like_to_array(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _array_like_to_array(t,e)}}function _ts_generator(t,e){var o,n,r,i,a={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return c([l,u])}}function c(l){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(r=l[0]&2?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(l[0]===6&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(u){l=[6,u],n=0}finally{o=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function importNodeModule(t){if(!t)throw new Error("import specifier is required");var e=new Function("name","return import(name)");return e(t).then(function(o){return o.default}).catch(function(o){throw console.error("Error importing module ".concat(t,":"),o),o})}function createScriptNode(url,cb,attrs,createScriptHook){if(createScriptHook){var hookResult=createScriptHook(url);hookResult&&typeof hookResult=="object"&&"url"in hookResult&&(url=hookResult.url)}var urlObj;try{urlObj=new URL(url)}catch(t){console.error("Error constructing URL:",t),cb(new Error("Invalid URL: ".concat(t)));return}var getFetch=function(){var t=_async_to_generator(function(){var e;return _ts_generator(this,function(o){switch(o.label){case 0:return typeof fetch>"u"?[4,importNodeModule("node-fetch")]:[3,2];case 1:return e=o.sent(),[2,e?.default||e];case 2:return[2,fetch];case 3:return[2]}})});return function(){return t.apply(this,arguments)}}();console.log("fetching",urlObj.href),getFetch().then(function(f){f(urlObj.href).then(function(t){return t.text()}).then(function(){var _ref=_async_to_generator(function(data){var _ref,path,vm,scriptContext,urlDirname,filename,script,exportedInterface,container;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all([importNodeModule("path"),importNodeModule("vm")])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),path=_ref[0],vm=_ref[1],scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);try{if(script=new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data,` })`),filename),script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename),exportedInterface=scriptContext.module.exports||scriptContext.exports,attrs&&exportedInterface&&attrs.globalName)return container=exportedInterface[attrs.globalName]||exportedInterface,cb(void 0,container),[2];cb(void 0,exportedInterface)}catch(t){cb(new Error("Script execution error: ".concat(t)))}return[2]}})});return function(t){return _ref.apply(this,arguments)}}()).catch(function(t){cb(t)})})}function loadScriptNode(t,e){return new Promise(function(o,n){createScriptNode(t,function(r,i){if(r)n(r);else{var a,s,c=(e==null||(a=e.attrs)===null||a===void 0?void 0:a.globalName)||"__FEDERATION_".concat(e==null||(s=e.attrs)===null||s===void 0?void 0:s.name,":custom__"),l=globalThis[c]=i;o(l)}},e.attrs,e.createScriptHook)})}function matchRemoteWithNameAndExpose(t,e){for(const o of t){const n=e.startsWith(o.name);let r=e.replace(o.name,"");if(n){if(r.startsWith("/")){const s=o.name;return r=`.${r}`,{pkgNameOrAlias:s,expose:r,remote:o}}else if(r==="")return{pkgNameOrAlias:o.name,expose:".",remote:o}}const i=o.alias&&e.startsWith(o.alias);let a=o.alias&&e.replace(o.alias,"");if(o.alias&&i){if(a&&a.startsWith("/")){const s=o.alias;return a=`.${a}`,{pkgNameOrAlias:s,expose:a,remote:o}}else if(a==="")return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function matchRemote(t,e){for(const o of t)if(e===o.name||o.alias&&e===o.alias)return o}function registerPlugins(t,e){const o=getGlobalHostPlugins();o.length>0&&o.forEach(n=>{t!=null&&t.find(r=>r.name!==n.name)&&t.push(n)}),t&&t.length>0&&t.forEach(n=>{e.forEach(r=>{r.applyPlugin(n)})})}function _extends$5(){return _extends$5=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$5.apply(this,arguments)}async function loadEsmEntry({entry:t,remoteEntryExports:e}){return new Promise((o,n)=>{try{e?o(e):new Function("callbacks",`import("${t}").then(callbacks[0]).catch(callbacks[1])`)([o,n])}catch(r){n(r)}})}async function loadEntryScript({name:t,globalName:e,entry:o,createScriptHook:n}){const{entryExports:r}=getRemoteEntryExports(t,e);return r||(typeof document>"u"?loadScriptNode(o,{attrs:{name:t,globalName:e},createScriptHook:n}).then(()=>{const{remoteEntryKey:i,entryExports:a}=getRemoteEntryExports(t,e);return assert(a,` Unable to use the ${t}'s '${o}' URL with ${i}'s globalName to get remoteEntry exports. Possible reasons could be: 1. '${o}' is not the correct URL, or the remoteEntry resource or name is incorrect. 2. ${i} cannot be used to get remoteEntry exports in the window object. `),a}).catch(i=>i):loadScript(o,{attrs:{},createScriptHook:n}).then(()=>{const{remoteEntryKey:i,entryExports:a}=getRemoteEntryExports(t,e);return assert(a,` Unable to use the ${t}'s '${o}' URL with ${i}'s globalName to get remoteEntry exports. Possible reasons could be: 1. '${o}' is not the correct URL, or the remoteEntry resource or name is incorrect. 2. ${i} cannot be used to get remoteEntry exports in the window object. `),a}).catch(i=>i))}function getRemoteEntryUniqueKey(t){const{entry:e,name:o}=t;return composeKeyWithSeparator(o,e)}async function getRemoteEntry({remoteEntryExports:t,remoteInfo:e,createScriptHook:o}){const{entry:n,name:r,type:i,entryGlobalName:a}=e,s=getRemoteEntryUniqueKey(e);return t||(globalLoading[s]||(i==="esm"?globalLoading[s]=loadEsmEntry({entry:n,remoteEntryExports:t}):globalLoading[s]=loadEntryScript({name:r,globalName:a,entry:n,createScriptHook:o})),globalLoading[s])}function getRemoteInfo(t){return _extends$5({},t,{entry:"entry"in t?t.entry:"",type:t.type||DEFAULT_REMOTE_TYPE,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||DEFAULT_SCOPE})}function _extends$4(){return _extends$4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$4.apply(this,arguments)}let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await getRemoteEntry({remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,createScriptHook:e=>{const o=this.host.loaderHook.lifecycle.createScript.emit({url:e});if(typeof document>"u"||o instanceof HTMLScriptElement)return o}});return assert(t,`remoteEntryExports is undefined ${safeToString$1(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async get(t,e){const{loadFactory:o=!0}=e||{loadFactory:!0},n=await this.getEntry();if(!this.inited){const i=this.host.shareScopeMap,a=this.remoteInfo.shareScope||"default";i[a]||(i[a]={});const s=i[a],c=[],l={version:this.remoteInfo.version||""};Object.defineProperty(l,"hostId",{value:this.host.options.id||this.host.name,enumerable:!1});const u=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:l,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});await n.init(u.shareScope,u.initScope,u.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(_extends$4({},u,{remoteEntryExports:n}))}this.lib=n,this.inited=!0;const r=await n.get(t);return assert(r,`${getFMId(this.remoteInfo)} remote don't export ${t}.`),o?await r():r}constructor({remoteInfo:t,host:e}){this.inited=!1,this.lib=void 0,this.remoteInfo=t,this.host=e}};class SyncHook{on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const o=this;this.on(function n(...r){return o.remove(n),e.apply(null,r)})}emit(...e){let o;return this.listeners.size>0&&this.listeners.forEach(n=>{o=n(...e)}),o}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 o;const n=Array.from(this.listeners);if(n.length>0){let r=0;const i=a=>a===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(i):a;o=i()}return Promise.resolve(o)}}function checkReturnData(t,e){if(!isObject(e))return!1;if(t!==e){for(const o in t)if(!(o 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 o of this.listeners)try{const n=o(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$1(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 o=Array.from(this.listeners);if(o.length>0){let n=0;const r=a=>(warn$1(a),this.onerror(a),e),i=a=>{if(checkReturnData(e,a)){if(e=a,n<o.length)try{return Promise.resolve(o[n++](e)).then(i,r)}catch(s){return r(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){assert(isPlainObject(e),"Plugin configuration is invalid.");const o=e.name;assert(o,"A name must be provided by the plugin."),this.registerPlugins[o]||(this.registerPlugins[o]=e,Object.keys(this.lifecycle).forEach(n=>{const r=e[n];r&&this.lifecycle[n].on(r)}))}removePlugin(e){assert(e,"A name is required.");const o=this.registerPlugins[e];assert(o,`The plugin "${e}" is not registered.`),Object.keys(o).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(o[n])})}inherit({lifecycle:e,registerPlugins:o}){Object.keys(e).forEach(n=>{assert(!this.lifecycle[n],`The hook "${n}" has a conflict and cannot be inherited.`),this.lifecycle[n]=e[n]}),Object.keys(o).forEach(n=>{assert(!this.registerPlugins[n],`The plugin "${n}" has a conflict and cannot be inherited.`),this.applyPlugin(o[n])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function _extends$3(){return _extends$3=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$3.apply(this,arguments)}function defaultPreloadArgs(t){return _extends$3({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},t)}function formatPreloadArgs(t,e){return e.map(o=>{const n=matchRemote(t,o.nameOrAlias);return assert(n,`Unable to preload ${o.nameOrAlias} as it is not included in ${!n&&safeToString$1({remoteInfo:n,remotes:t})}`),{remote:n,preloadConfig:defaultPreloadArgs(o)}})}function normalizePreloadExposes(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function preloadAssets(t,e,o){const{cssAssets:n,jsAssetsWithoutEntry:r,entryAssets:i}=o;if(e.options.inBrowser){i.forEach(s=>{const{moduleInfo:c}=s,l=e.moduleCache.get(t.name);getRemoteEntry(l?{remoteInfo:c,remoteEntryExports:l.remoteEntryExports,createScriptHook:u=>{const h=e.loaderHook.lifecycle.createScript.emit({url:u});if(h instanceof HTMLScriptElement)return h}}:{remoteInfo:c,remoteEntryExports:void 0,createScriptHook:u=>{const h=e.loaderHook.lifecycle.createScript.emit({url:u});if(h instanceof HTMLScriptElement)return h}})});const a=document.createDocumentFragment();n.forEach(s=>{const{link:c,needAttach:l}=createLink(s,()=>{},{rel:"preload",as:"style"},u=>{const h=e.loaderHook.lifecycle.createLink.emit({url:u});if(h instanceof HTMLLinkElement)return h});l&&a.appendChild(c)}),r.forEach(s=>{const{link:c,needAttach:l}=createLink(s,()=>{},{rel:"preload",as:"script"},u=>{const h=e.loaderHook.lifecycle.createLink.emit({url:u});if(h instanceof HTMLLinkElement)return h});l&&document.head.appendChild(c)}),document.head.appendChild(a)}}function _extends$2(){return _extends$2=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$2.apply(this,arguments)}function assignRemoteInfo(t,e){(!("remoteEntry"in e)||!e.remoteEntry)&&error(`The attribute remoteEntry of ${name} must not be undefined.`);const{remoteEntry:o}=e,n=getResourceUrl(e,o);t.type=e.remoteEntryType,t.entryGlobalName=e.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:o,expose:n,origin:r,remoteInfo:i}=t;if(!isRemoteInfoWithEntry(e)||!isPureRemoteEntry(e)){const{remoteSnapshot:a,globalSnapshot:s}=await r.snapshotHandler.loadRemoteSnapshotInfo(e);assignRemoteInfo(i,a);const c={remote:e,preloadConfig:{nameOrAlias:o,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},l=await r.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:c,remoteInfo:i,remote:e,remoteSnapshot:a,globalSnapshot:s});return l&&preloadAssets(i,r,l),_extends$2({},t,{remoteSnapshot:a})}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,o,n,r={},i){const a=getFMId(e),{value:s}=getInfoWithoutType(t,a),c=i||s;if(c&&!isManifestProvider(c)&&(o(c,e,n),c.remotesInfo)){const l=Object.keys(c.remotesInfo);for(const u of l){if(r[u])continue;r[u]=!0;const h=splitId(u),g=c.remotesInfo[u];traverseModuleInfo(t,{name:h.name,version:g.matchedVersion},o,!1,r,void 0)}}}function generatePreloadAssets(t,e,o,n,r){const i=[],a=[],s=[],c=new Set,l=new Set,{options:u}=t,{preloadConfig:h}=e,{depsRemote:g}=h;traverseModuleInfo(n,o,(d,m,M)=>{let I;if(M)I=h;else if(Array.isArray(g)){const y=g.find(A=>A.nameOrAlias===m.name||A.nameOrAlias===m.alias);if(!y)return;I=defaultPreloadArgs(y)}else if(g===!0)I=h;else return;const D=getResourceUrl(d,"remoteEntry"in d?d.remoteEntry:"");D&&s.push({name:m.name,moduleInfo:{name:m.name,entry:D,type:"remoteEntryType"in d?d.remoteEntryType:"global",entryGlobalName:"globalName"in d?d.globalName:m.name,shareScope:"",version:"version"in d?d.version:void 0},url:D});let S="modules"in d?d.modules:[];const O=normalizePreloadExposes(I.exposes);if(O.length&&"modules"in d){var L;S=d==null||(L=d.modules)==null?void 0:L.reduce((y,A)=>(O?.indexOf(A.moduleName)!==-1&&y.push(A),y),[])}function v(y){const A=y.map(b=>getResourceUrl(d,b));return I.filter?A.filter(I.filter):A}if(S){const y=S.length;for(let A=0;A<y;A++){const b=S[A],x=`${m.name}/${b.moduleName}`;t.hooks.lifecycle.handlePreloadModule.emit({id:b.moduleName==="."?m.name:x,name:m.name,remoteSnapshot:d,preloadConfig:I,remote:m,origin:t}),!getPreloaded(x)&&(I.resourceCategory==="all"?(i.push(...v(b.assets.css.async)),i.push(...v(b.assets.css.sync)),a.push(...v(b.assets.js.async)),a.push(...v(b.assets.js.sync))):(I.resourceCategory="sync")&&(i.push(...v(b.assets.css.sync)),a.push(...v(b.assets.js.sync))),setPreloaded(x))}}},!0,{},r),r.shared&&r.shared.forEach(d=>{var m;const M=(m=u.shared)==null?void 0:m[d.sharedName];if(!M)return;const I=getRegisteredShare(t.shareScopeMap,d.sharedName,M,t.hooks.lifecycle.resolveShare);I&&typeof I.lib=="function"&&(d.assets.js.sync.forEach(D=>{c.add(D)}),d.assets.css.sync.forEach(D=>{l.add(D)}))});const p=a.filter(d=>!c.has(d));return{cssAssets:i.filter(d=>!l.has(d)),jsAssetsWithoutEntry:p,entryAssets:s}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:o,remoteInfo:n,remote:r,globalSnapshot:i,remoteSnapshot:a}=t;return isRemoteInfoWithEntry(r)&&isPureRemoteEntry(r)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:r.name,url:r.entry,moduleInfo:{name:n.name,entry:r.entry,type:"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(n,a),generatePreloadAssets(e,o,n,i,a))}}};function _extends$1(){return _extends$1=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends$1.apply(this,arguments)}class SnapshotHandler{async loadSnapshot(e){const{options:o}=this.HostInstance,{hostGlobalSnapshot:n,remoteSnapshot:r,globalSnapshot:i}=this.getGlobalRemoteInfo(e),{remoteSnapshot:a,globalSnapshot:s}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:n,remoteSnapshot:r,globalSnapshot:i});return{remoteSnapshot:a,globalSnapshot:s}}async loadRemoteSnapshotInfo(e){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let n=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},addGlobalSnapshot({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!getInfoWithoutType(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo=_extends$1({},n?.remotesInfo,{[e.name]:{matchedVersion:"version"in e?e.version:e.entry}}));const{hostGlobalSnapshot:r,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:s,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:r,remoteSnapshot:i,globalSnapshot:a});if(s)if(isManifestProvider(s)){const l=await this.getManifestJson(s.remoteEntry,e,{}),u=setGlobalSnapshotInfoByModuleInfo(_extends$1({},e,{entry:s.remoteEntry}),l);return{remoteSnapshot:l,globalSnapshot:u}}else{const{remoteSnapshot:l}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:s,from:"global"});return{remoteSnapshot:l,globalSnapshot:c}}else if(isRemoteInfoWithEntry(e)){const l=await this.getManifestJson(e.entry,e,{}),u=setGlobalSnapshotInfoByModuleInfo(e,l),{remoteSnapshot:h}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});return{remoteSnapshot:h,globalSnapshot:u}}else error(` Cannot get remoteSnapshot with the name: '${e.name}', version: '${e.version}' from __FEDERATION__.moduleInfo. The following reasons may be causing the problem: 1. The Deploy platform did not deliver the correct data. You can use __FEDERATION__.moduleInfo to check the remoteInfo. 2. The remote '${e.name}' version '${e.version}' is not released. The transformed module info: ${JSON.stringify(c)} `)}getGlobalRemoteInfo(e){const o=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version}),n=o&&"remotesInfo"in o&&o.remotesInfo&&getInfoWithoutType(o.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:e.name,version:"version"in e?e.version:void 0})}}async getManifestJson(e,o,n){const r=async()=>{let a=this.manifestCache.get(e);if(a)return a;try{let s=await this.loaderHook.lifecycle.fetch.emit(e,{});return(!s||!(s instanceof Response))&&(s=await fetch(e,{})),a=await s.json(),assert(a.metaData&&a.exposes&&a.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,a),a}catch(s){error(`Failed to get manifestJson for ${o.name}. The manifest URL is ${e}. Please ensure that the manifestUrl is accessible. Error message: ${s}`)}},i=async()=>{const a=await r(),s=generateSnapshotFromManifest(a,{version:e}),{remoteSnapshot:c}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:o,manifestJson:a,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return c};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(a=>a)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new PluginSystem({beforeLoadRemoteSnapshot:new AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new AsyncWaterfallHook("loadRemoteSnapshot")}),this.manifestLoading=Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},_extends.apply(this,arguments)}function _object_without_properties_loose(t,e){if(t==null)return{};var o={},n=Object.keys(t),r,i;for(i=0;i<n.length;i++)r=n[i],!(e.indexOf(r)>=0)&&(o[r]=t[r]);return o}class FederationHost{_setGlobalShareScopeMap(){const e=getGlobalShareScope(),o=this.options.id||this.options.name;o&&!e[o]&&(e[o]=this.shareScopeMap)}initOptions(e){this.registerPlugins(e.plugins);const o=this.formatOptions(this.options,e);return this.options=o,o}async loadShare(e,o){var n;const r=Object.assign({},(n=this.options.shared)==null?void 0:n[e],o);r!=null&&r.scope&&await Promise.all(r.scope.map(async l=>{await Promise.all(this.initializeSharing(l,r.strategy))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:this.options.shared,origin:this}),{shareInfo:a}=i;assert(a,`Cannot find ${e} Share in the ${this.options.name}. Please ensure that the ${e} Share parameters have been injected`);const s=getRegisteredShare(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare),c=l=>{l.useIn||(l.useIn=[]),addUniqueItem(l.useIn,this.options.name)};if(s&&s.lib)return c(s),s.lib;if(s&&s.loading&&!s.loaded){const l=await s.loading;return s.loaded=!0,s.lib||(s.lib=l),c(s),l}else if(s){const l=(async()=>{const u=await s.get();a.lib=u,a.loaded=!0,c(a);const h=getRegisteredShare(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return h&&(h.lib=u,h.loaded=!0),u})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:this.options.name,lib:null,loading:l}),l}else{if(o)return!1;const l=(async()=>{const u=await a.get();a.lib=u,a.loaded=!0,c(a);const h=getRegisteredShare(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare);return h&&(h.lib=u,h.loaded=!0),u})();return this.s