iobroker.vis-2-widgets-collection 1.8.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +28 -0
  2. package/io-package.json +29 -28
  3. package/package.json +17 -17
  4. package/widgets/vis-2-widgets-collection/customWidgets.js +2691 -2
  5. package/widgets/vis-2-widgets-collection/asset-manifest.json +0 -59
  6. package/widgets/vis-2-widgets-collection/customWidgets.js.map +0 -1
  7. package/widgets/vis-2-widgets-collection/img/prev-collection-checkbox.png +0 -0
  8. package/widgets/vis-2-widgets-collection/img/prev-collection-dialog.png +0 -0
  9. package/widgets/vis-2-widgets-collection/img/prev-collection-gauge.png +0 -0
  10. package/widgets/vis-2-widgets-collection/img/prev-collection-light.png +0 -0
  11. package/widgets/vis-2-widgets-collection/img/prev-collection-radio-group.png +0 -0
  12. package/widgets/vis-2-widgets-collection/img/prev-collection-select.png +0 -0
  13. package/widgets/vis-2-widgets-collection/index.html +0 -1
  14. package/widgets/vis-2-widgets-collection/static/js/main.61661d92.js +0 -2
  15. package/widgets/vis-2-widgets-collection/static/js/main.61661d92.js.map +0 -1
  16. package/widgets/vis-2-widgets-collection/static/js/node_modules_prop-types_index_js.7f922324.chunk.js +0 -2
  17. package/widgets/vis-2-widgets-collection/static/js/node_modules_prop-types_index_js.7f922324.chunk.js.map +0 -1
  18. package/widgets/vis-2-widgets-collection/static/js/node_modules_react_index_js.a5285de4.chunk.js +0 -3
  19. package/widgets/vis-2-widgets-collection/static/js/node_modules_react_index_js.a5285de4.chunk.js.LICENSE.txt +0 -9
  20. package/widgets/vis-2-widgets-collection/static/js/node_modules_react_index_js.a5285de4.chunk.js.map +0 -1
  21. package/widgets/vis-2-widgets-collection/static/js/src_ButtonGroupCollectionWidget_ButtonGroupCollectionWidget_jsx.6714917c.chunk.js +0 -2
  22. package/widgets/vis-2-widgets-collection/static/js/src_ButtonGroupCollectionWidget_ButtonGroupCollectionWidget_jsx.6714917c.chunk.js.map +0 -1
  23. package/widgets/vis-2-widgets-collection/static/js/src_CheckboxCollectionWidget_CheckboxCollectionWidget_jsx.45087583.chunk.js +0 -2
  24. package/widgets/vis-2-widgets-collection/static/js/src_CheckboxCollectionWidget_CheckboxCollectionWidget_jsx.45087583.chunk.js.map +0 -1
  25. package/widgets/vis-2-widgets-collection/static/js/src_DialogCollectionWidget_DialogCollectionWidget_jsx.bc8befed.chunk.js +0 -2
  26. package/widgets/vis-2-widgets-collection/static/js/src_DialogCollectionWidget_DialogCollectionWidget_jsx.bc8befed.chunk.js.map +0 -1
  27. package/widgets/vis-2-widgets-collection/static/js/src_GaugeCollectionWidget_GaugeCollectionWidget_jsx.6b7eda92.chunk.js +0 -2
  28. package/widgets/vis-2-widgets-collection/static/js/src_GaugeCollectionWidget_GaugeCollectionWidget_jsx.6b7eda92.chunk.js.map +0 -1
  29. package/widgets/vis-2-widgets-collection/static/js/src_LightCollectionWidget_LightCollectionWidget_jsx.fb54720e.chunk.js +0 -2
  30. package/widgets/vis-2-widgets-collection/static/js/src_LightCollectionWidget_LightCollectionWidget_jsx.fb54720e.chunk.js.map +0 -1
  31. package/widgets/vis-2-widgets-collection/static/js/src_RadioGroupCollectionWidget_RadioGroupCollectionWidget_jsx.c12bfcb8.chunk.js +0 -2
  32. package/widgets/vis-2-widgets-collection/static/js/src_RadioGroupCollectionWidget_RadioGroupCollectionWidget_jsx.c12bfcb8.chunk.js.map +0 -1
  33. package/widgets/vis-2-widgets-collection/static/js/src_SelectCollectionWidget_SelectCollectionWidget_jsx.a8694cbf.chunk.js +0 -2
  34. package/widgets/vis-2-widgets-collection/static/js/src_SelectCollectionWidget_SelectCollectionWidget_jsx.a8694cbf.chunk.js.map +0 -1
  35. package/widgets/vis-2-widgets-collection/static/js/src_StateCollectionWidget_StateCollectionWidget_jsx.f9a0cb99.chunk.js +0 -2
  36. package/widgets/vis-2-widgets-collection/static/js/src_StateCollectionWidget_StateCollectionWidget_jsx.f9a0cb99.chunk.js.map +0 -1
  37. package/widgets/vis-2-widgets-collection/static/js/src_SwitchCollectionWidget_SwitchCollectionWidget_jsx.a4aed4b6.chunk.js +0 -2
  38. package/widgets/vis-2-widgets-collection/static/js/src_SwitchCollectionWidget_SwitchCollectionWidget_jsx.a4aed4b6.chunk.js.map +0 -1
  39. package/widgets/vis-2-widgets-collection/static/js/src_components_CollectionDivider_jsx.bf1c1de5.chunk.js +0 -2
  40. package/widgets/vis-2-widgets-collection/static/js/src_components_CollectionDivider_jsx.bf1c1de5.chunk.js.map +0 -1
  41. package/widgets/vis-2-widgets-collection/static/js/src_translations_js.c2b86983.chunk.js +0 -2
  42. package/widgets/vis-2-widgets-collection/static/js/src_translations_js.c2b86983.chunk.js.map +0 -1
  43. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_canvas-gauges_gauge_min_js.d2cb37fb.chunk.js +0 -3
  44. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_canvas-gauges_gauge_min_js.d2cb37fb.chunk.js.LICENSE.txt +0 -25
  45. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_canvas-gauges_gauge_min_js.d2cb37fb.chunk.js.map +0 -1
  46. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_jaames_iro_dist_iro_es_js-node_modules_mui_icons-material_PowerSettingsNew_js.cffe4b84.chunk.js +0 -3
  47. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_jaames_iro_dist_iro_es_js-node_modules_mui_icons-material_PowerSettingsNew_js.cffe4b84.chunk.js.LICENSE.txt +0 -6
  48. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_jaames_iro_dist_iro_es_js-node_modules_mui_icons-material_PowerSettingsNew_js.cffe4b84.chunk.js.map +0 -1
  49. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f.bb47ef22.chunk.js +0 -3
  50. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f.bb47ef22.chunk.js.LICENSE.txt +0 -18
  51. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f.bb47ef22.chunk.js.map +0 -1
  52. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_Switch_Switch_js.928081a1.chunk.js +0 -2
  53. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_Switch_Switch_js.928081a1.chunk.js.map +0 -1
  54. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_index_js.8ba01614.chunk.js +0 -3
  55. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_index_js.8ba01614.chunk.js.LICENSE.txt +0 -7
  56. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_index_js.8ba01614.chunk.js.map +0 -1
  57. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js.d38263c1.chunk.js +0 -3
  58. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js.d38263c1.chunk.js.LICENSE.txt +0 -9
  59. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js.d38263c1.chunk.js.map +0 -1
  60. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987.9c21ae2e.chunk.js +0 -3
  61. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987.9c21ae2e.chunk.js.LICENSE.txt +0 -18
  62. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987.9c21ae2e.chunk.js.map +0 -1
  63. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4.116e9fa1.chunk.js +0 -2
  64. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4.116e9fa1.chunk.js.map +0 -1
  65. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_system_esm_index_js.b8618c63.chunk.js +0 -2
  66. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_mui_system_esm_index_js.b8618c63.chunk.js.map +0 -1
  67. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_react-dom_index_js.190f0c6e.chunk.js +0 -3
  68. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_react-dom_index_js.190f0c6e.chunk.js.LICENSE.txt +0 -19
  69. package/widgets/vis-2-widgets-collection/static/js/vendors-node_modules_react-dom_index_js.190f0c6e.chunk.js.map +0 -1
  70. package/widgets/vis-2-widgets-collection/static/media/colorWheel.275a183afdc7f1fdc3c81de08d07fe27.svg +0 -2
@@ -1,2 +1,2691 @@
1
- var vis2CollectionWidget;(()=>{"use strict";var e={4727:(e,_,s)=>{var o={"./StateCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_StateCollectionWidget_StateCollectionWidget_jsx")]).then((()=>()=>s(2132))),"./SliderCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx")]).then((()=>()=>s(2127))),"./ButtonGroupCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_ButtonGroupCollectionWidget_ButtonGroupCollectionWidget_jsx")]).then((()=>()=>s(3190))),"./translations":()=>s.e("src_translations_js").then((()=>()=>s(5850))),"./SwitchCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("vendors-node_modules_mui_material_Switch_Switch_js"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_SwitchCollectionWidget_SwitchCollectionWidget_jsx")]).then((()=>()=>s(4801))),"./CheckboxCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_CheckboxCollectionWidget_CheckboxCollectionWidget_jsx")]).then((()=>()=>s(6047))),"./DialogCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_DialogCollectionWidget_DialogCollectionWidget_jsx")]).then((()=>()=>s(2840))),"./SelectCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_SelectCollectionWidget_SelectCollectionWidget_jsx")]).then((()=>()=>s(7903))),"./RadioGroupCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_RadioGroupCollectionWidget_RadioGroupCollectionWidget_jsx")]).then((()=>()=>s(3810))),"./GaugeCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("vendors-node_modules_canvas-gauges_gauge_min_js"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_GaugeCollectionWidget_GaugeCollectionWidget_jsx")]).then((()=>()=>s(2435))),"./LightCollectionWidget":()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f"),s.e("vendors-node_modules_jaames_iro_dist_iro_es_js-node_modules_mui_icons-material_PowerSettingsNew_js"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4"),s.e("src_components_CollectionDivider_jsx"),s.e("src_LightCollectionWidget_LightCollectionWidget_jsx")]).then((()=>()=>s(3269)))},t=(e,_)=>(s.R=_,_=s.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),s.R=void 0,_),i=(e,_)=>{if(s.S){var o="default",t=s.S[o];if(t&&t!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return s.S[o]=e,s.I(o,_)}};s.d(_,{get:()=>t,init:()=>i})}},_={};function s(o){var t=_[o];if(void 0!==t)return t.exports;var i=_[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.exports}s.m=e,s.c=_,s.n=e=>{var _=e&&e.__esModule?()=>e.default:()=>e;return s.d(_,{a:_}),_},s.d=(e,_)=>{for(var o in _)s.o(_,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:_[o]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((_,o)=>(s.f[o](e,_),_)),[])),s.u=e=>"static/js/"+e+"."+{"vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987":"9c21ae2e","vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js":"d38263c1","vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4":"116e9fa1","vendors-node_modules_mui_material_Switch_Switch_js":"928081a1","vendors-node_modules_mui_material_index_js":"8ba01614","vendors-node_modules_mui_system_esm_index_js":"b8618c63","node_modules_prop-types_index_js":"7f922324","vendors-node_modules_react-dom_index_js":"190f0c6e",node_modules_react_index_js:"a5285de4","vendors-node_modules_mui_icons-material_Delete_js-node_modules_rxjs_dist_esm5_internal_Subjec-42397f":"bb47ef22",src_components_CollectionDivider_jsx:"bf1c1de5",src_StateCollectionWidget_StateCollectionWidget_jsx:"f9a0cb99",src_ButtonGroupCollectionWidget_ButtonGroupCollectionWidget_jsx:"6714917c",src_translations_js:"c2b86983",src_SwitchCollectionWidget_SwitchCollectionWidget_jsx:"a4aed4b6",src_CheckboxCollectionWidget_CheckboxCollectionWidget_jsx:"45087583",src_DialogCollectionWidget_DialogCollectionWidget_jsx:"bc8befed",src_SelectCollectionWidget_SelectCollectionWidget_jsx:"a8694cbf",src_RadioGroupCollectionWidget_RadioGroupCollectionWidget_jsx:"c12bfcb8","vendors-node_modules_canvas-gauges_gauge_min_js":"d2cb37fb",src_GaugeCollectionWidget_GaugeCollectionWidget_jsx:"6b7eda92","vendors-node_modules_jaames_iro_dist_iro_es_js-node_modules_mui_icons-material_PowerSettingsNew_js":"cffe4b84",src_LightCollectionWidget_LightCollectionWidget_jsx:"fb54720e"}[e]+".chunk.js",s.miniCssF=e=>{},s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),s.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),(()=>{var e={},_="iobroker.vis-widgets-react-collection:";s.l=(o,t,i,n)=>{if(e[o])e[o].push(t);else{var r,d;if(void 0!==i)for(var l=document.getElementsByTagName("script"),a=0;a<l.length;a++){var u=l[a];if(u.getAttribute("src")==o||u.getAttribute("data-webpack")==_+i){r=u;break}}r||(d=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack",_+i),r.src=o),e[o]=[t];var m=(_,s)=>{r.onerror=r.onload=null,clearTimeout(c);var t=e[o];if(delete e[o],r.parentNode&&r.parentNode.removeChild(r),t&&t.forEach((e=>e(s))),_)return _(s)},c=setTimeout(m.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=m.bind(null,r.onerror),r.onload=m.bind(null,r.onload),d&&document.head.appendChild(r)}}})(),s.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{s.S={};var e={},_={};s.I=(o,t)=>{t||(t=[]);var i=_[o];if(i||(i=_[o]={}),!(t.indexOf(i)>=0)){if(t.push(i),e[o])return e[o];s.o(s.S,o)||(s.S[o]={});var n=s.S[o],r="iobroker.vis-widgets-react-collection",d=(e,_,s,o)=>{var t=n[e]=n[e]||{},i=t[_];(!i||!i.loaded&&(!o!=!i.eager?o:r>i.from))&&(t[_]={get:s,from:r,eager:!!o})},l=[];if("default"===o)d("@mui/material","*",(()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_material_styles_useTheme_js-node_modules_mui_material_utils_index_js"),s.e("vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4"),s.e("vendors-node_modules_mui_material_Switch_Switch_js"),s.e("vendors-node_modules_mui_material_index_js"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types"),s.e("webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4")]).then((()=>()=>s(4999))))),d("@mui/system","*",(()=>Promise.all([s.e("vendors-node_modules_mui_styled-engine_index_js-node_modules_mui_system_esm_DefaultPropsProvi-fe7987"),s.e("vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4"),s.e("vendors-node_modules_mui_system_esm_index_js"),s.e("webpack_sharing_consume_default_react_react"),s.e("webpack_sharing_consume_default_prop-types_prop-types")]).then((()=>()=>s(1200))))),d("prop-types","*",(()=>s.e("node_modules_prop-types_index_js").then((()=>()=>s(5173))))),d("react-dom","*",(()=>Promise.all([s.e("vendors-node_modules_react-dom_index_js"),s.e("webpack_sharing_consume_default_react_react")]).then((()=>()=>s(7950))))),d("react","*",(()=>s.e("node_modules_react_index_js").then((()=>()=>s(5043)))));return l.length?e[o]=Promise.all(l).then((()=>e[o]=1)):e[o]=1}}})(),(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var _=s.g.document;if(!e&&_&&(_.currentScript&&"SCRIPT"===_.currentScript.tagName.toUpperCase()&&(e=_.currentScript.src),!e)){var o=_.getElementsByTagName("script");if(o.length)for(var t=o.length-1;t>-1&&(!e||!/^http(s?):/.test(e));)e=o[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e=e=>{var _=e=>e.split(".").map((e=>+e==e?+e:e)),s=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=s[1]?_(s[1]):[];return s[2]&&(o.length++,o.push.apply(o,_(s[2]))),s[3]&&(o.push([]),o.push.apply(o,_(s[3]))),o},_=(_,s)=>{_=e(_),s=e(s);for(var o=0;;){if(o>=_.length)return o<s.length&&"u"!=(typeof s[o])[0];var t=_[o],i=(typeof t)[0];if(o>=s.length)return"u"==i;var n=s[o],r=(typeof n)[0];if(i!=r)return"o"==i&&"n"==r||"s"==r||"u"==i;if("o"!=i&&"u"!=i&&t!=n)return t<n;o++}},o=e=>{var _=e[0],s="";if(1===e.length)return"*";if(_+.5){s+=0==_?">=":-1==_?"<":1==_?"^":2==_?"~":_>0?"=":"!=";for(var t=1,i=1;i<e.length;i++)t--,s+="u"==(typeof(r=e[i]))[0]?"-":(t>0?".":"")+(t=2,r);return s}var n=[];for(i=1;i<e.length;i++){var r=e[i];n.push(0===r?"not("+d()+")":1===r?"("+d()+" || "+d()+")":2===r?n.pop()+" "+n.pop():o(r))}return d();function d(){return n.pop().replace(/^\((.+)\)$/,"$1")}},t=(_,s)=>{if(0 in _){s=e(s);var o=_[0],i=o<0;i&&(o=-o-1);for(var n=0,r=1,d=!0;;r++,n++){var l,a,u=r<_.length?(typeof _[r])[0]:"";if(n>=s.length||"o"==(a=(typeof(l=s[n]))[0]))return!d||("u"==u?r>o&&!i:""==u!=i);if("u"==a){if(!d||"u"!=u)return!1}else if(d)if(u==a)if(r<=o){if(l!=_[r])return!1}else{if(i?l>_[r]:l<_[r])return!1;l!=_[r]&&(d=!1)}else if("s"!=u&&"n"!=u){if(i||r<=o)return!1;d=!1,r--}else{if(r<=o||a<u!=i)return!1;d=!1}else"s"!=u&&"n"!=u&&(d=!1,r--)}}var m=[],c=m.pop.bind(m);for(n=1;n<_.length;n++){var p=_[n];m.push(1==p?c()|c():2==p?c()&c():p?t(p,s):!c())}return!!c()},i=(e,_)=>e&&s.o(e,_),n=e=>(e.loaded=1,e.get()),r=e=>Object.keys(e).reduce(((_,s)=>(e[s].eager&&(_[s]=e[s]),_)),{}),d=(e,s,o)=>{var t=o?r(e[s]):e[s];return Object.keys(t).reduce(((e,s)=>!e||!t[e].loaded&&_(e,s)?s:e),0)},l=(e,_,s,t)=>"Unsatisfied version "+s+" from "+(s&&e[_][s].from)+" of shared singleton module "+_+" (required "+o(t)+")",a=e=>{throw new Error(e)},u=e=>{"undefined"!==typeof console&&console.warn&&console.warn(e)},m=e=>function(_,o,t,i,n){var r=s.I(_);return r&&r.then&&!t?r.then(e.bind(e,_,s.S[_],o,!1,i,n)):e(_,s.S[_],o,t,i,n)},c=(e,_,s)=>s?s():((e,_)=>a("Shared module "+_+" doesn't exist in shared scope "+e))(e,_),p=m(((e,_,s,o,r,a)=>{if(!i(_,s))return c(e,s,a);var m=d(_,s,o);return t(r,m)||u(l(_,s,m,r)),n(_[s][m])})),f={},g={8437:()=>p("default","react",!1,[0],(()=>s.e("node_modules_react_index_js").then((()=>()=>s(5043))))),5973:()=>p("default","prop-types",!1,[0],(()=>s.e("node_modules_prop-types_index_js").then((()=>()=>s(5173))))),8565:()=>p("default","@mui/system",!1,[0],(()=>Promise.all([s.e("vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4"),s.e("vendors-node_modules_mui_system_esm_index_js")]).then((()=>()=>s(1200))))),3479:()=>p("default","react-dom",!1,[0],(()=>s.e("vendors-node_modules_react-dom_index_js").then((()=>()=>s(7950))))),7085:()=>p("default","@mui/material",!1,[0],(()=>Promise.all([s.e("vendors-node_modules_mui_system_esm_RtlProvider_index_js-node_modules_mui_system_esm_Unstable-9da0e4"),s.e("vendors-node_modules_mui_material_Switch_Switch_js"),s.e("vendors-node_modules_mui_material_index_js")]).then((()=>()=>s(4999)))))},h={webpack_sharing_consume_default_react_react:[8437],"webpack_sharing_consume_default_prop-types_prop-types":[5973],"webpack_sharing_consume_default_mui_system_mui_system-webpack_sharing_consume_default_react-d-dde2d4":[8565,3479],src_components_CollectionDivider_jsx:[7085]},v={};s.f.consumes=(e,_)=>{s.o(h,e)&&h[e].forEach((e=>{if(s.o(f,e))return _.push(f[e]);if(!v[e]){var o=_=>{f[e]=0,s.m[e]=o=>{delete s.c[e],o.exports=_()}};v[e]=!0;var t=_=>{delete f[e],s.m[e]=o=>{throw delete s.c[e],_}};try{var i=g[e]();i.then?_.push(f[e]=i.then(o).catch(t)):o(i)}catch(n){t(n)}}}))}})(),(()=>{var e={vis2CollectionWidget:0};s.f.j=(_,o)=>{var t=s.o(e,_)?e[_]:void 0;if(0!==t)if(t)o.push(t[2]);else if(/^webpack_sharing_consume_default_(mui_system_mui_system\-webpack_sharing_consume_default_react\-d\-dde2d4|prop\-types_prop\-types|react_react)$/.test(_))e[_]=0;else{var i=new Promise(((s,o)=>t=e[_]=[s,o]));o.push(t[2]=i);var n=s.p+s.u(_),r=new Error;s.l(n,(o=>{if(s.o(e,_)&&(0!==(t=e[_])&&(e[_]=void 0),t)){var i=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;r.message="Loading chunk "+_+" failed.\n("+i+": "+n+")",r.name="ChunkLoadError",r.type=i,r.request=n,t[1](r)}}),"chunk-"+_,_)}};var _=(_,o)=>{var t,i,n=o[0],r=o[1],d=o[2],l=0;if(n.some((_=>0!==e[_]))){for(t in r)s.o(r,t)&&(s.m[t]=r[t]);if(d)d(s)}for(_&&_(o);l<n.length;l++)i=n[l],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0},o=self.webpackChunkiobroker_vis_widgets_react_collection=self.webpackChunkiobroker_vis_widgets_react_collection||[];o.forEach(_.bind(null,0)),o.push=_.bind(null,o.push.bind(o))})();var o=s(4727);vis2CollectionWidget=o})();
2
- //# sourceMappingURL=customWidgets.js.map
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-BEpFHtMA.js","./assets/_commonjsHelpers-Cpj98o6Y.js","./assets/index-DMBzzD-N.js","./assets/vis2CollectionWidget__loadShare__react__loadShare__-L1bZe9z4.js","./assets/vis2CollectionWidget__mf_v__runtimeInit__mf_v__-Cugi9Gwb.js"])))=>i.map(i=>d[i]);
2
+ import exposesMap, { __tla as __tla_0 } from "./assets/virtualExposes-B50cAOvG.js";
3
+ import { _ as __vitePreload } from "./assets/preload-helper-PPVm8Dsz.js";
4
+ import { v as vis2CollectionWidget__mf_v__runtimeInit__mf_v__ } from "./assets/vis2CollectionWidget__mf_v__runtimeInit__mf_v__-Cugi9Gwb.js";
5
+ let getExposes, init;
6
+ let __tla = Promise.all([
7
+ (() => {
8
+ try {
9
+ return __tla_0;
10
+ } catch {
11
+ }
12
+ })()
13
+ ]).then(async () => {
14
+ var index_cjs$2 = {}, index_cjs$1 = {}, define_process_env_default = {};
15
+ const FederationModuleManifest = "federation-manifest.json", MANIFEST_EXT = ".json", BROWSER_LOG_KEY = "FEDERATION_DEBUG", NameTransformSymbol = {
16
+ AT: "@",
17
+ HYPHEN: "-",
18
+ SLASH: "/"
19
+ }, NameTransformMap = {
20
+ [NameTransformSymbol.AT]: "scope_",
21
+ [NameTransformSymbol.HYPHEN]: "_",
22
+ [NameTransformSymbol.SLASH]: "__"
23
+ }, EncodedNameTransformMap = {
24
+ [NameTransformMap[NameTransformSymbol.AT]]: NameTransformSymbol.AT,
25
+ [NameTransformMap[NameTransformSymbol.HYPHEN]]: NameTransformSymbol.HYPHEN,
26
+ [NameTransformMap[NameTransformSymbol.SLASH]]: NameTransformSymbol.SLASH
27
+ }, SEPARATOR = ":", ManifestFileName = "mf-manifest.json", StatsFileName = "mf-stats.json", MFModuleType = {
28
+ NPM: "npm",
29
+ APP: "app"
30
+ }, MODULE_DEVTOOL_IDENTIFIER = "__MF_DEVTOOLS_MODULE_INFO__", ENCODE_NAME_PREFIX = "ENCODE_NAME_PREFIX", TEMP_DIR = ".federation", MFPrefetchCommon = {
31
+ identifier: "MFDataPrefetch",
32
+ globalKey: "__PREFETCH__",
33
+ library: "mf-data-prefetch",
34
+ exportsKey: "__PREFETCH_EXPORTS__",
35
+ fileName: "bootstrap.js"
36
+ };
37
+ var ContainerPlugin = Object.freeze({
38
+ __proto__: null
39
+ }), ContainerReferencePlugin = Object.freeze({
40
+ __proto__: null
41
+ }), ModuleFederationPlugin = Object.freeze({
42
+ __proto__: null
43
+ }), SharePlugin = Object.freeze({
44
+ __proto__: null
45
+ });
46
+ function isBrowserEnv() {
47
+ return typeof window < "u" && typeof window.document < "u";
48
+ }
49
+ function isReactNativeEnv() {
50
+ return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
51
+ }
52
+ function isBrowserDebug() {
53
+ try {
54
+ if (isBrowserEnv() && window.localStorage) return !!localStorage.getItem(BROWSER_LOG_KEY);
55
+ } catch {
56
+ return false;
57
+ }
58
+ return false;
59
+ }
60
+ function isDebugMode() {
61
+ 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 ? true : isBrowserDebug();
62
+ }
63
+ const getProcessEnv = function() {
64
+ return typeof process < "u" && define_process_env_default ? define_process_env_default : {};
65
+ }, LOG_CATEGORY$1 = "[ Federation Runtime ]", parseEntry = (t, e, r = SEPARATOR) => {
66
+ const o = t.split(r), n = getProcessEnv().NODE_ENV === "development" && e, a = "*", s = (i) => i.startsWith("http") || i.includes(MANIFEST_EXT);
67
+ if (o.length >= 2) {
68
+ let [i, ...c] = o;
69
+ t.startsWith(r) && (i = o.slice(0, 2).join(r), c = [
70
+ n || o.slice(2).join(r)
71
+ ]);
72
+ let l = n || c.join(r);
73
+ return s(l) ? {
74
+ name: i,
75
+ entry: l
76
+ } : {
77
+ name: i,
78
+ version: l || a
79
+ };
80
+ } else if (o.length === 1) {
81
+ const [i] = o;
82
+ return n && s(n) ? {
83
+ name: i,
84
+ entry: n
85
+ } : {
86
+ name: i,
87
+ version: n || a
88
+ };
89
+ } else throw `Invalid entry value: ${t}`;
90
+ }, composeKeyWithSeparator = function(...t) {
91
+ return t.length ? t.reduce((e, r) => r ? e ? `${e}${SEPARATOR}${r}` : r : e, "") : "";
92
+ }, encodeName = function(t, e = "", r = false) {
93
+ try {
94
+ const o = r ? ".js" : "";
95
+ 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])}${o}`;
96
+ } catch (o) {
97
+ throw o;
98
+ }
99
+ }, decodeName = function(t, e, r) {
100
+ try {
101
+ let o = t;
102
+ if (e) {
103
+ if (!o.startsWith(e)) return o;
104
+ o = o.replace(new RegExp(e, "g"), "");
105
+ }
106
+ return o = o.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 && (o = o.replace(".js", "")), o;
107
+ } catch (o) {
108
+ throw o;
109
+ }
110
+ }, generateExposeFilename = (t, e) => {
111
+ if (!t) return "";
112
+ let r = t;
113
+ return r === "." && (r = "default_export"), r.startsWith("./") && (r = r.replace("./", "")), encodeName(r, "__federation_expose_", e);
114
+ }, generateShareFilename = (t, e) => t ? encodeName(t, "__federation_shared_", e) : "", getResourceUrl = (t, e) => {
115
+ if ("getPublicPath" in t) {
116
+ let r;
117
+ return t.getPublicPath.startsWith("function") ? r = new Function("return " + t.getPublicPath)()() : r = new Function(t.getPublicPath)(), `${r}${e}`;
118
+ } 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), "");
119
+ }, assert$1 = (t, e) => {
120
+ t || error$1(e);
121
+ }, error$1 = (t) => {
122
+ throw new Error(`${LOG_CATEGORY$1}: ${t}`);
123
+ }, warn$1 = (t) => {
124
+ console.warn(`${LOG_CATEGORY$1}: ${t}`);
125
+ };
126
+ function safeToString(t) {
127
+ try {
128
+ return JSON.stringify(t, null, 2);
129
+ } catch {
130
+ return "";
131
+ }
132
+ }
133
+ const VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
134
+ function isRequiredVersion(t) {
135
+ return VERSION_PATTERN_REGEXP.test(t);
136
+ }
137
+ const simpleJoinRemoteEntry = (t, e) => {
138
+ if (!t) return e;
139
+ const o = ((n) => {
140
+ if (n === ".") return "";
141
+ if (n.startsWith("./")) return n.replace("./", "");
142
+ if (n.startsWith("/")) {
143
+ const a = n.slice(1);
144
+ return a.endsWith("/") ? a.slice(0, -1) : a;
145
+ }
146
+ return n;
147
+ })(t);
148
+ return o ? o.endsWith("/") ? `${o}${e}` : `${o}/${e}` : e;
149
+ };
150
+ function inferAutoPublicPath(t) {
151
+ return t.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
152
+ }
153
+ function generateSnapshotFromManifest(t, e = {}) {
154
+ var _a, _b, _c;
155
+ const { remotes: r = {}, overrides: o = {}, version: n } = e;
156
+ let a;
157
+ const s = () => "publicPath" in t.metaData ? t.metaData.publicPath === "auto" && n ? inferAutoPublicPath(n) : t.metaData.publicPath : t.metaData.getPublicPath, i = Object.keys(o);
158
+ let c = {};
159
+ Object.keys(r).length || (c = ((_a = t.remotes) == null ? void 0 : _a.reduce((E, b) => {
160
+ let R;
161
+ const S = b.federationContainerName;
162
+ return i.includes(S) ? R = o[S] : "version" in b ? R = b.version : R = b.entry, E[S] = {
163
+ matchedVersion: R
164
+ }, E;
165
+ }, {})) || {}), Object.keys(r).forEach((E) => c[E] = {
166
+ matchedVersion: i.includes(E) ? o[E] : r[E]
167
+ });
168
+ const { remoteEntry: { path: l, name: d, type: h }, types: u = {
169
+ path: "",
170
+ name: "",
171
+ zip: "",
172
+ api: ""
173
+ }, buildInfo: { buildVersion: p }, globalName: _, ssrRemoteEntry: g } = t.metaData, { exposes: m } = t;
174
+ let y = {
175
+ version: n || "",
176
+ buildVersion: p,
177
+ globalName: _,
178
+ remoteEntry: simpleJoinRemoteEntry(l, d),
179
+ remoteEntryType: h,
180
+ remoteTypes: simpleJoinRemoteEntry(u.path, u.name),
181
+ remoteTypesZip: u.zip || "",
182
+ remoteTypesAPI: u.api || "",
183
+ remotesInfo: c,
184
+ shared: t == null ? void 0 : t.shared.map((E) => ({
185
+ assets: E.assets,
186
+ sharedName: E.name,
187
+ version: E.version
188
+ })),
189
+ modules: m == null ? void 0 : m.map((E) => ({
190
+ moduleName: E.name,
191
+ modulePath: E.path,
192
+ assets: E.assets
193
+ }))
194
+ };
195
+ if ((_b = t.metaData) == null ? void 0 : _b.prefetchInterface) {
196
+ const E = t.metaData.prefetchInterface;
197
+ y = {
198
+ ...y,
199
+ prefetchInterface: E
200
+ };
201
+ }
202
+ if ((_c = t.metaData) == null ? void 0 : _c.prefetchEntry) {
203
+ const { path: E, name: b, type: R } = t.metaData.prefetchEntry;
204
+ y = {
205
+ ...y,
206
+ prefetchEntry: simpleJoinRemoteEntry(E, b),
207
+ prefetchEntryType: R
208
+ };
209
+ }
210
+ if ("publicPath" in t.metaData ? a = {
211
+ ...y,
212
+ publicPath: s(),
213
+ ssrPublicPath: t.metaData.ssrPublicPath
214
+ } : a = {
215
+ ...y,
216
+ getPublicPath: s()
217
+ }, g) {
218
+ const E = simpleJoinRemoteEntry(g.path, g.name);
219
+ a.ssrRemoteEntry = E, a.ssrRemoteEntryType = g.type || "commonjs-module";
220
+ }
221
+ return a;
222
+ }
223
+ function isManifestProvider(t) {
224
+ return !!("remoteEntry" in t && t.remoteEntry.includes(MANIFEST_EXT));
225
+ }
226
+ function getManifestFileName(t) {
227
+ if (!t) return {
228
+ statsFileName: StatsFileName,
229
+ manifestFileName: ManifestFileName
230
+ };
231
+ let e = typeof t == "boolean" ? "" : t.filePath || "", r = typeof t == "boolean" ? "" : t.fileName || "";
232
+ const o = ".json", n = (c) => c.endsWith(o) ? c : `${c}${o}`, a = (c, l) => c.replace(o, `${l}${o}`), s = r ? n(r) : ManifestFileName, i = r ? a(s, "-stats") : StatsFileName;
233
+ return {
234
+ statsFileName: simpleJoinRemoteEntry(e, i),
235
+ manifestFileName: simpleJoinRemoteEntry(e, s)
236
+ };
237
+ }
238
+ const PREFIX = "[ Module Federation ]", DEFAULT_DELEGATE = console, LOGGER_STACK_SKIP_TOKENS = [
239
+ "logger.ts",
240
+ "logger.js",
241
+ "captureStackTrace",
242
+ "Logger.emit",
243
+ "Logger.log",
244
+ "Logger.info",
245
+ "Logger.warn",
246
+ "Logger.error",
247
+ "Logger.debug"
248
+ ];
249
+ function captureStackTrace() {
250
+ try {
251
+ const t = new Error().stack;
252
+ if (!t) return;
253
+ const [, ...e] = t.split(`
254
+ `), r = e.filter((n) => !LOGGER_STACK_SKIP_TOKENS.some((a) => n.includes(a)));
255
+ return r.length ? `Stack trace:
256
+ ${r.slice(0, 5).join(`
257
+ `)}` : void 0;
258
+ } catch {
259
+ return;
260
+ }
261
+ }
262
+ class Logger {
263
+ constructor(e, r = DEFAULT_DELEGATE) {
264
+ this.prefix = e, this.delegate = r ?? DEFAULT_DELEGATE;
265
+ }
266
+ setPrefix(e) {
267
+ this.prefix = e;
268
+ }
269
+ setDelegate(e) {
270
+ this.delegate = e ?? DEFAULT_DELEGATE;
271
+ }
272
+ emit(e, r) {
273
+ const o = this.delegate, a = isDebugMode() ? captureStackTrace() : void 0, s = a ? [
274
+ ...r,
275
+ a
276
+ ] : r, i = (() => {
277
+ switch (e) {
278
+ case "log":
279
+ return [
280
+ "log",
281
+ "info"
282
+ ];
283
+ case "info":
284
+ return [
285
+ "info",
286
+ "log"
287
+ ];
288
+ case "warn":
289
+ return [
290
+ "warn",
291
+ "info",
292
+ "log"
293
+ ];
294
+ case "error":
295
+ return [
296
+ "error",
297
+ "warn",
298
+ "log"
299
+ ];
300
+ default:
301
+ return [
302
+ "debug",
303
+ "log"
304
+ ];
305
+ }
306
+ })();
307
+ for (const c of i) {
308
+ const l = o[c];
309
+ if (typeof l == "function") {
310
+ l.call(o, this.prefix, ...s);
311
+ return;
312
+ }
313
+ }
314
+ for (const c of i) {
315
+ const l = DEFAULT_DELEGATE[c];
316
+ if (typeof l == "function") {
317
+ l.call(DEFAULT_DELEGATE, this.prefix, ...s);
318
+ return;
319
+ }
320
+ }
321
+ }
322
+ log(...e) {
323
+ this.emit("log", e);
324
+ }
325
+ warn(...e) {
326
+ this.emit("warn", e);
327
+ }
328
+ error(...e) {
329
+ this.emit("error", e);
330
+ }
331
+ success(...e) {
332
+ this.emit("info", e);
333
+ }
334
+ info(...e) {
335
+ this.emit("info", e);
336
+ }
337
+ ready(...e) {
338
+ this.emit("info", e);
339
+ }
340
+ debug(...e) {
341
+ isDebugMode() && this.emit("debug", e);
342
+ }
343
+ }
344
+ function createLogger(t) {
345
+ return new Logger(t);
346
+ }
347
+ function createInfrastructureLogger(t) {
348
+ const e = new Logger(t);
349
+ return Object.defineProperty(e, "__mf_infrastructure_logger__", {
350
+ value: true,
351
+ enumerable: false,
352
+ configurable: false
353
+ }), e;
354
+ }
355
+ function bindLoggerToCompiler(t, e, r) {
356
+ if (t.__mf_infrastructure_logger__ && (e == null ? void 0 : e.getInfrastructureLogger)) try {
357
+ const o = e.getInfrastructureLogger(r);
358
+ o && typeof o == "object" && (typeof o.log == "function" || typeof o.info == "function" || typeof o.warn == "function" || typeof o.error == "function") && t.setDelegate(o);
359
+ } catch {
360
+ t.setDelegate(void 0);
361
+ }
362
+ }
363
+ const logger$1 = createLogger(PREFIX), infrastructureLogger = createInfrastructureLogger(PREFIX);
364
+ async function safeWrapper$1(t, e) {
365
+ try {
366
+ return await t();
367
+ } catch (r) {
368
+ !e && warn$1(r);
369
+ return;
370
+ }
371
+ }
372
+ function isStaticResourcesEqual$1(t, e) {
373
+ const r = /^(https?:)?\/\//i, o = t.replace(r, "").replace(/\/$/, ""), n = e.replace(r, "").replace(/\/$/, "");
374
+ return o === n;
375
+ }
376
+ function createScript(t) {
377
+ let e = null, r = true, o = 2e4, n;
378
+ const a = document.getElementsByTagName("script");
379
+ for (let i = 0; i < a.length; i++) {
380
+ const c = a[i], l = c.getAttribute("src");
381
+ if (l && isStaticResourcesEqual$1(l, t.url)) {
382
+ e = c, r = false;
383
+ break;
384
+ }
385
+ }
386
+ if (!e) {
387
+ const i = t.attrs;
388
+ e = document.createElement("script"), e.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
389
+ let c;
390
+ t.createScriptHook && (c = t.createScriptHook(t.url, t.attrs), c instanceof HTMLScriptElement ? e = c : typeof c == "object" && ("script" in c && c.script && (e = c.script), "timeout" in c && c.timeout && (o = c.timeout))), e.src || (e.src = t.url), i && !c && Object.keys(i).forEach((l) => {
391
+ e && (l === "async" || l === "defer" ? e[l] = i[l] : e.getAttribute(l) || e.setAttribute(l, i[l]));
392
+ });
393
+ }
394
+ const s = async (i, c) => {
395
+ clearTimeout(n);
396
+ const l = () => {
397
+ (c == null ? void 0 : c.type) === "error" ? (t == null ? void 0 : t.onErrorCallback) && (t == null ? void 0 : t.onErrorCallback(c)) : (t == null ? void 0 : t.cb) && (t == null ? void 0 : t.cb());
398
+ };
399
+ if (e && (e.onerror = null, e.onload = null, safeWrapper$1(() => {
400
+ const { needDeleteScript: d = true } = t;
401
+ d && (e == null ? void 0 : e.parentNode) && e.parentNode.removeChild(e);
402
+ }), i && typeof i == "function")) {
403
+ const d = i(c);
404
+ if (d instanceof Promise) {
405
+ const h = await d;
406
+ return l(), h;
407
+ }
408
+ return l(), d;
409
+ }
410
+ l();
411
+ };
412
+ return e.onerror = s.bind(null, e.onerror), e.onload = s.bind(null, e.onload), n = setTimeout(() => {
413
+ s(null, new Error(`Remote script "${t.url}" time-outed.`));
414
+ }, o), {
415
+ script: e,
416
+ needAttach: r
417
+ };
418
+ }
419
+ function createLink(t) {
420
+ let e = null, r = true;
421
+ const o = document.getElementsByTagName("link");
422
+ for (let a = 0; a < o.length; a++) {
423
+ const s = o[a], i = s.getAttribute("href"), c = s.getAttribute("rel");
424
+ if (i && isStaticResourcesEqual$1(i, t.url) && c === t.attrs.rel) {
425
+ e = s, r = false;
426
+ break;
427
+ }
428
+ }
429
+ if (!e) {
430
+ e = document.createElement("link"), e.setAttribute("href", t.url);
431
+ let a;
432
+ const s = t.attrs;
433
+ t.createLinkHook && (a = t.createLinkHook(t.url, s), a instanceof HTMLLinkElement && (e = a)), s && !a && Object.keys(s).forEach((i) => {
434
+ e && !e.getAttribute(i) && e.setAttribute(i, s[i]);
435
+ });
436
+ }
437
+ const n = (a, s) => {
438
+ const i = () => {
439
+ (s == null ? void 0 : s.type) === "error" ? (t == null ? void 0 : t.onErrorCallback) && (t == null ? void 0 : t.onErrorCallback(s)) : (t == null ? void 0 : t.cb) && (t == null ? void 0 : t.cb());
440
+ };
441
+ if (e && (e.onerror = null, e.onload = null, safeWrapper$1(() => {
442
+ const { needDeleteLink: c = true } = t;
443
+ c && (e == null ? void 0 : e.parentNode) && e.parentNode.removeChild(e);
444
+ }), a)) {
445
+ const c = a(s);
446
+ return i(), c;
447
+ }
448
+ i();
449
+ };
450
+ return e.onerror = n.bind(null, e.onerror), e.onload = n.bind(null, e.onload), {
451
+ link: e,
452
+ needAttach: r
453
+ };
454
+ }
455
+ function loadScript(t, e) {
456
+ const { attrs: r = {}, createScriptHook: o } = e;
457
+ return new Promise((n, a) => {
458
+ const { script: s, needAttach: i } = createScript({
459
+ url: t,
460
+ cb: n,
461
+ onErrorCallback: a,
462
+ attrs: {
463
+ fetchpriority: "high",
464
+ ...r
465
+ },
466
+ createScriptHook: o,
467
+ needDeleteScript: true
468
+ });
469
+ i && document.head.appendChild(s);
470
+ });
471
+ }
472
+ const sdkImportCache = /* @__PURE__ */ new Map();
473
+ function importNodeModule(t) {
474
+ if (!t) throw new Error("import specifier is required");
475
+ if (sdkImportCache.has(t)) return sdkImportCache.get(t);
476
+ const r = new Function("name", "return import(name)")(t).then((o) => o).catch((o) => {
477
+ throw console.error(`Error importing module ${t}:`, o), sdkImportCache.delete(t), o;
478
+ });
479
+ return sdkImportCache.set(t, r), r;
480
+ }
481
+ const loadNodeFetch = async () => {
482
+ const t = await importNodeModule("node-fetch");
483
+ return t.default || t;
484
+ }, lazyLoaderHookFetch = async (t, e, r) => {
485
+ const n = await ((a, s) => r.lifecycle.fetch.emit(a, s))(t, e || {});
486
+ return !n || !(n instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(t, e || {}) : n;
487
+ }, createScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {
488
+ if (loaderHook == null ? void 0 : loaderHook.createScriptHook) {
489
+ const t = loaderHook.createScriptHook(url);
490
+ t && typeof t == "object" && "url" in t && (url = t.url);
491
+ }
492
+ let urlObj;
493
+ try {
494
+ urlObj = new URL(url);
495
+ } catch (t) {
496
+ console.error("Error constructing URL:", t), cb(new Error(`Invalid URL: ${t}`));
497
+ return;
498
+ }
499
+ const getFetch = async () => (loaderHook == null ? void 0 : loaderHook.fetch) ? (t, e) => lazyLoaderHookFetch(t, e, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
500
+ var _a;
501
+ try {
502
+ const res = await f(urlObj.href), data = await res.text(), [path, vm] = await Promise.all([
503
+ importNodeModule("path"),
504
+ importNodeModule("vm")
505
+ ]), scriptContext = {
506
+ exports: {},
507
+ module: {
508
+ exports: {}
509
+ }
510
+ }, urlDirname = urlObj.pathname.split("/").slice(0, -1).join("/"), filename = path.basename(urlObj.pathname), script = new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
511
+ })`, {
512
+ filename,
513
+ importModuleDynamically: ((_a = vm.constants) == null ? void 0 : _a.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? importNodeModule
514
+ });
515
+ script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
516
+ const exportedInterface = scriptContext.module.exports || scriptContext.exports;
517
+ if (attrs && exportedInterface && attrs.globalName) {
518
+ const t = exportedInterface[attrs.globalName] || exportedInterface;
519
+ cb(void 0, t);
520
+ return;
521
+ }
522
+ cb(void 0, exportedInterface);
523
+ } catch (t) {
524
+ cb(t instanceof Error ? t : new Error(`Script execution error: ${t}`));
525
+ }
526
+ };
527
+ getFetch().then(async (t) => {
528
+ if ((attrs == null ? void 0 : attrs.type) === "esm" || (attrs == null ? void 0 : attrs.type) === "module") return loadModule(urlObj.href, {
529
+ fetch: t,
530
+ vm: await importNodeModule("vm")
531
+ }).then(async (e) => {
532
+ await e.evaluate(), cb(void 0, e.namespace);
533
+ }).catch((e) => {
534
+ cb(e instanceof Error ? e : new Error(`Script execution error: ${e}`));
535
+ });
536
+ handleScriptFetch(t, urlObj);
537
+ }).catch((t) => {
538
+ cb(t);
539
+ });
540
+ } : (t, e, r, o) => {
541
+ e(new Error("createScriptNode is disabled in non-Node.js environment"));
542
+ }, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (t, e) => new Promise((r, o) => {
543
+ createScriptNode(t, (n, a) => {
544
+ var _a, _b;
545
+ if (n) o(n);
546
+ else {
547
+ const s = ((_a = e == null ? void 0 : e.attrs) == null ? void 0 : _a.globalName) || `__FEDERATION_${(_b = e == null ? void 0 : e.attrs) == null ? void 0 : _b.name}:custom__`, i = globalThis[s] = a;
548
+ r(i);
549
+ }
550
+ }, e.attrs, e.loaderHook);
551
+ }) : (t, e) => {
552
+ throw new Error("loadScriptNode is disabled in non-Node.js environment");
553
+ }, esmModuleCache = /* @__PURE__ */ new Map();
554
+ async function loadModule(t, e) {
555
+ if (esmModuleCache.has(t)) return esmModuleCache.get(t);
556
+ const { fetch: r, vm: o } = e, a = await (await r(t)).text(), s = new o.SourceTextModule(a, {
557
+ importModuleDynamically: async (i, c) => {
558
+ const l = new URL(i, t).href;
559
+ return loadModule(l, e);
560
+ }
561
+ });
562
+ return esmModuleCache.set(t, s), await s.link(async (i) => {
563
+ const c = new URL(i, t).href;
564
+ return await loadModule(c, e);
565
+ }), s;
566
+ }
567
+ function normalizeOptions(t, e, r) {
568
+ return function(o) {
569
+ if (o === false) return false;
570
+ if (typeof o > "u") return t ? e : false;
571
+ if (o === true) return e;
572
+ if (o && typeof o == "object") return {
573
+ ...e,
574
+ ...o
575
+ };
576
+ throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof o}`);
577
+ };
578
+ }
579
+ const createModuleFederationConfig = (t) => t;
580
+ index_cjs$1.BROWSER_LOG_KEY = BROWSER_LOG_KEY;
581
+ index_cjs$1.ENCODE_NAME_PREFIX = ENCODE_NAME_PREFIX;
582
+ index_cjs$1.EncodedNameTransformMap = EncodedNameTransformMap;
583
+ index_cjs$1.FederationModuleManifest = FederationModuleManifest;
584
+ index_cjs$1.MANIFEST_EXT = MANIFEST_EXT;
585
+ index_cjs$1.MFModuleType = MFModuleType;
586
+ index_cjs$1.MFPrefetchCommon = MFPrefetchCommon;
587
+ index_cjs$1.MODULE_DEVTOOL_IDENTIFIER = MODULE_DEVTOOL_IDENTIFIER;
588
+ index_cjs$1.ManifestFileName = ManifestFileName;
589
+ index_cjs$1.NameTransformMap = NameTransformMap;
590
+ index_cjs$1.NameTransformSymbol = NameTransformSymbol;
591
+ index_cjs$1.SEPARATOR = SEPARATOR;
592
+ index_cjs$1.StatsFileName = StatsFileName;
593
+ index_cjs$1.TEMP_DIR = TEMP_DIR;
594
+ index_cjs$1.assert = assert$1;
595
+ index_cjs$1.bindLoggerToCompiler = bindLoggerToCompiler;
596
+ index_cjs$1.composeKeyWithSeparator = composeKeyWithSeparator;
597
+ index_cjs$1.containerPlugin = ContainerPlugin;
598
+ index_cjs$1.containerReferencePlugin = ContainerReferencePlugin;
599
+ index_cjs$1.createInfrastructureLogger = createInfrastructureLogger;
600
+ index_cjs$1.createLink = createLink;
601
+ index_cjs$1.createLogger = createLogger;
602
+ index_cjs$1.createModuleFederationConfig = createModuleFederationConfig;
603
+ index_cjs$1.createScript = createScript;
604
+ index_cjs$1.createScriptNode = createScriptNode;
605
+ index_cjs$1.decodeName = decodeName;
606
+ index_cjs$1.encodeName = encodeName;
607
+ index_cjs$1.error = error$1;
608
+ index_cjs$1.generateExposeFilename = generateExposeFilename;
609
+ index_cjs$1.generateShareFilename = generateShareFilename;
610
+ index_cjs$1.generateSnapshotFromManifest = generateSnapshotFromManifest;
611
+ index_cjs$1.getManifestFileName = getManifestFileName;
612
+ index_cjs$1.getProcessEnv = getProcessEnv;
613
+ index_cjs$1.getResourceUrl = getResourceUrl;
614
+ index_cjs$1.inferAutoPublicPath = inferAutoPublicPath;
615
+ index_cjs$1.infrastructureLogger = infrastructureLogger;
616
+ index_cjs$1.isBrowserEnv = isBrowserEnv;
617
+ index_cjs$1.isDebugMode = isDebugMode;
618
+ index_cjs$1.isManifestProvider = isManifestProvider;
619
+ index_cjs$1.isReactNativeEnv = isReactNativeEnv;
620
+ index_cjs$1.isRequiredVersion = isRequiredVersion;
621
+ index_cjs$1.isStaticResourcesEqual = isStaticResourcesEqual$1;
622
+ index_cjs$1.loadScript = loadScript;
623
+ index_cjs$1.loadScriptNode = loadScriptNode;
624
+ index_cjs$1.logger = logger$1;
625
+ index_cjs$1.moduleFederationPlugin = ModuleFederationPlugin;
626
+ index_cjs$1.normalizeOptions = normalizeOptions;
627
+ index_cjs$1.parseEntry = parseEntry;
628
+ index_cjs$1.safeToString = safeToString;
629
+ index_cjs$1.safeWrapper = safeWrapper$1;
630
+ index_cjs$1.sharePlugin = SharePlugin;
631
+ index_cjs$1.simpleJoinRemoteEntry = simpleJoinRemoteEntry;
632
+ index_cjs$1.warn = warn$1;
633
+ var index_cjs = {};
634
+ 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, o) => {
635
+ const n = [
636
+ `${[
637
+ e[t]
638
+ ]} #${t}`
639
+ ];
640
+ return r && n.push(`args: ${JSON.stringify(r)}`), n.push(getDocsUrl(t)), o && n.push(`Original Error Message:
641
+ ${o}`), n.join(`
642
+ `);
643
+ }, runtimeDescMap = {
644
+ [RUNTIME_001]: "Failed to get remoteEntry exports.",
645
+ [RUNTIME_002]: 'The remote entry interface does not contain "init"',
646
+ [RUNTIME_003]: "Failed to get manifest.",
647
+ [RUNTIME_004]: "Failed to locate remote.",
648
+ [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
649
+ [RUNTIME_006]: "Invalid loadShareSync function call from runtime",
650
+ [RUNTIME_007]: "Failed to get remote snapshot.",
651
+ [RUNTIME_008]: "Failed to load script resources.",
652
+ [RUNTIME_009]: "Please call createInstance first."
653
+ }, typeDescMap = {
654
+ [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."
655
+ }, buildDescMap = {
656
+ [BUILD_001]: "Failed to find expose module.",
657
+ [BUILD_002]: "PublicPath is required in prod mode."
658
+ }, errorDescMap = {
659
+ ...runtimeDescMap,
660
+ ...typeDescMap,
661
+ ...buildDescMap
662
+ };
663
+ index_cjs.BUILD_001 = BUILD_001;
664
+ index_cjs.BUILD_002 = BUILD_002;
665
+ index_cjs.RUNTIME_001 = RUNTIME_001;
666
+ index_cjs.RUNTIME_002 = RUNTIME_002;
667
+ index_cjs.RUNTIME_003 = RUNTIME_003;
668
+ index_cjs.RUNTIME_004 = RUNTIME_004;
669
+ index_cjs.RUNTIME_005 = RUNTIME_005;
670
+ index_cjs.RUNTIME_006 = RUNTIME_006;
671
+ index_cjs.RUNTIME_007 = RUNTIME_007;
672
+ index_cjs.RUNTIME_008 = RUNTIME_008;
673
+ index_cjs.RUNTIME_009 = RUNTIME_009;
674
+ index_cjs.TYPE_001 = TYPE_001;
675
+ index_cjs.buildDescMap = buildDescMap;
676
+ index_cjs.errorDescMap = errorDescMap;
677
+ index_cjs.getShortErrorMsg = getShortErrorMsg;
678
+ index_cjs.runtimeDescMap = runtimeDescMap;
679
+ index_cjs.typeDescMap = typeDescMap;
680
+ var sdk = index_cjs$1, errorCodes = index_cjs;
681
+ const LOG_CATEGORY = "[ Federation Runtime ]", logger = sdk.createLogger(LOG_CATEGORY);
682
+ function assert(t, e) {
683
+ t || error(e);
684
+ }
685
+ function error(t) {
686
+ throw t instanceof Error ? (t.message.startsWith(LOG_CATEGORY) || (t.message = `${LOG_CATEGORY}: ${t.message}`), t) : new Error(`${LOG_CATEGORY}: ${t}`);
687
+ }
688
+ function warn(t) {
689
+ t instanceof Error && (t.message.startsWith(LOG_CATEGORY) || (t.message = `${LOG_CATEGORY}: ${t.message}`)), logger.warn(t);
690
+ }
691
+ function addUniqueItem(t, e) {
692
+ return t.findIndex((r) => r === e) === -1 && t.push(e), t;
693
+ }
694
+ function getFMId(t) {
695
+ return "version" in t && t.version ? `${t.name}:${t.version}` : "entry" in t && t.entry ? `${t.name}:${t.entry}` : `${t.name}`;
696
+ }
697
+ function isRemoteInfoWithEntry(t) {
698
+ return typeof t.entry < "u";
699
+ }
700
+ function isPureRemoteEntry(t) {
701
+ return !t.entry.includes(".json");
702
+ }
703
+ async function safeWrapper(t, e) {
704
+ try {
705
+ return await t();
706
+ } catch (r) {
707
+ !e && warn(r);
708
+ return;
709
+ }
710
+ }
711
+ function isObject(t) {
712
+ return t && typeof t == "object";
713
+ }
714
+ const objectToString = Object.prototype.toString;
715
+ function isPlainObject(t) {
716
+ return objectToString.call(t) === "[object Object]";
717
+ }
718
+ function isStaticResourcesEqual(t, e) {
719
+ const r = /^(https?:)?\/\//i, o = t.replace(r, "").replace(/\/$/, ""), n = e.replace(r, "").replace(/\/$/, "");
720
+ return o === n;
721
+ }
722
+ function arrayOptions(t) {
723
+ return Array.isArray(t) ? t : [
724
+ t
725
+ ];
726
+ }
727
+ function getRemoteEntryInfoFromSnapshot(t) {
728
+ const e = {
729
+ url: "",
730
+ type: "global",
731
+ globalName: ""
732
+ };
733
+ return sdk.isBrowserEnv() || sdk.isReactNativeEnv() ? "remoteEntry" in t ? {
734
+ url: t.remoteEntry,
735
+ type: t.remoteEntryType,
736
+ globalName: t.globalName
737
+ } : e : "ssrRemoteEntry" in t ? {
738
+ url: t.ssrRemoteEntry || e.url,
739
+ type: t.ssrRemoteEntryType || e.type,
740
+ globalName: t.globalName
741
+ } : e;
742
+ }
743
+ const processModuleAlias = (t, e) => {
744
+ let r;
745
+ return t.endsWith("/") ? r = t.slice(0, -1) : r = t, e.startsWith(".") && (e = e.slice(1)), r = r + e, r;
746
+ }, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
747
+ try {
748
+ return document.defaultView;
749
+ } catch {
750
+ return CurrentGlobal;
751
+ }
752
+ })(), Global = nativeGlobal;
753
+ function definePropertyGlobalVal(t, e, r) {
754
+ Object.defineProperty(t, e, {
755
+ value: r,
756
+ configurable: false,
757
+ writable: true
758
+ });
759
+ }
760
+ function includeOwnProperty(t, e) {
761
+ return Object.hasOwnProperty.call(t, e);
762
+ }
763
+ includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
764
+ const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
765
+ function setGlobalDefaultVal(t) {
766
+ includeOwnProperty(t, "__VMOK__") && !includeOwnProperty(t, "__FEDERATION__") && definePropertyGlobalVal(t, "__FEDERATION__", t.__VMOK__), includeOwnProperty(t, "__FEDERATION__") || (definePropertyGlobalVal(t, "__FEDERATION__", {
767
+ __GLOBAL_PLUGIN__: [],
768
+ __INSTANCES__: [],
769
+ moduleInfo: {},
770
+ __SHARE__: {},
771
+ __MANIFEST_LOADING__: {},
772
+ __PRELOADED_MAP__: /* @__PURE__ */ new Map()
773
+ }), definePropertyGlobalVal(t, "__VMOK__", t.__FEDERATION__)), t.__FEDERATION__.__GLOBAL_PLUGIN__ ??= [], t.__FEDERATION__.__INSTANCES__ ??= [], t.__FEDERATION__.moduleInfo ??= {}, t.__FEDERATION__.__SHARE__ ??= {}, t.__FEDERATION__.__MANIFEST_LOADING__ ??= {}, t.__FEDERATION__.__PRELOADED_MAP__ ??= /* @__PURE__ */ new Map();
774
+ }
775
+ setGlobalDefaultVal(CurrentGlobal);
776
+ setGlobalDefaultVal(nativeGlobal);
777
+ function resetFederationGlobalInfo() {
778
+ CurrentGlobal.__FEDERATION__.__GLOBAL_PLUGIN__ = [], CurrentGlobal.__FEDERATION__.__INSTANCES__ = [], CurrentGlobal.__FEDERATION__.moduleInfo = {}, CurrentGlobal.__FEDERATION__.__SHARE__ = {}, CurrentGlobal.__FEDERATION__.__MANIFEST_LOADING__ = {}, Object.keys(globalLoading).forEach((t) => {
779
+ delete globalLoading[t];
780
+ });
781
+ }
782
+ function setGlobalFederationInstance(t) {
783
+ CurrentGlobal.__FEDERATION__.__INSTANCES__.push(t);
784
+ }
785
+ function getGlobalFederationConstructor() {
786
+ return CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
787
+ }
788
+ function setGlobalFederationConstructor(t, e = sdk.isDebugMode()) {
789
+ e && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = t, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.21.6");
790
+ }
791
+ function getInfoWithoutType(t, e) {
792
+ if (typeof e == "string") {
793
+ if (t[e]) return {
794
+ value: t[e],
795
+ key: e
796
+ };
797
+ {
798
+ const o = Object.keys(t);
799
+ for (const n of o) {
800
+ const [a, s] = n.split(":"), i = `${a}:${e}`, c = t[i];
801
+ if (c) return {
802
+ value: c,
803
+ key: i
804
+ };
805
+ }
806
+ return {
807
+ value: void 0,
808
+ key: e
809
+ };
810
+ }
811
+ } else throw new Error("key must be string");
812
+ }
813
+ const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (t, e) => {
814
+ const r = getFMId(t), o = getInfoWithoutType(e, r).value;
815
+ if (o && !o.version && "version" in t && t.version && (o.version = t.version), o) return o;
816
+ if ("version" in t && t.version) {
817
+ const { version: n, ...a } = t, s = getFMId(a), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, s).value;
818
+ if ((i == null ? void 0 : i.version) === n) return i;
819
+ }
820
+ }, getGlobalSnapshotInfoByModuleInfo = (t) => getTargetSnapshotInfoByModuleInfo(t, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (t, e) => {
821
+ const r = getFMId(t);
822
+ return nativeGlobal.__FEDERATION__.moduleInfo[r] = e, nativeGlobal.__FEDERATION__.moduleInfo;
823
+ }, addGlobalSnapshot = (t) => (nativeGlobal.__FEDERATION__.moduleInfo = {
824
+ ...nativeGlobal.__FEDERATION__.moduleInfo,
825
+ ...t
826
+ }, () => {
827
+ const e = Object.keys(t);
828
+ for (const r of e) delete nativeGlobal.__FEDERATION__.moduleInfo[r];
829
+ }), getRemoteEntryExports = (t, e) => {
830
+ const r = e || `__FEDERATION_${t}:custom__`, o = CurrentGlobal[r];
831
+ return {
832
+ remoteEntryKey: r,
833
+ entryExports: o
834
+ };
835
+ }, registerGlobalPlugins = (t) => {
836
+ const { __GLOBAL_PLUGIN__: e } = nativeGlobal.__FEDERATION__;
837
+ t.forEach((r) => {
838
+ e.findIndex((o) => o.name === r.name) === -1 ? e.push(r) : warn(`The plugin ${r.name} has been registered.`);
839
+ });
840
+ }, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (t) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(t), setPreloaded = (t) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(t, true), 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*$";
841
+ function parseRegex(t) {
842
+ return new RegExp(t);
843
+ }
844
+ function isXVersion(t) {
845
+ return !t || t.toLowerCase() === "x" || t === "*";
846
+ }
847
+ function pipe(...t) {
848
+ return (e) => t.reduce((r, o) => o(r), e);
849
+ }
850
+ function extractComparator(t) {
851
+ return t.match(parseRegex(comparator));
852
+ }
853
+ function combineVersion(t, e, r, o) {
854
+ const n = `${t}.${e}.${r}`;
855
+ return o ? `${n}-${o}` : n;
856
+ }
857
+ function parseHyphen(t) {
858
+ return t.replace(parseRegex(hyphenRange), (e, r, o, n, a, s, i, c, l, d, h, u) => (isXVersion(o) ? r = "" : isXVersion(n) ? r = `>=${o}.0.0` : isXVersion(a) ? r = `>=${o}.${n}.0` : r = `>=${r}`, isXVersion(l) ? c = "" : isXVersion(d) ? c = `<${Number(l) + 1}.0.0-0` : isXVersion(h) ? c = `<${l}.${Number(d) + 1}.0-0` : u ? c = `<=${l}.${d}.${h}-${u}` : c = `<=${c}`, `${r} ${c}`.trim()));
859
+ }
860
+ function parseComparatorTrim(t) {
861
+ return t.replace(parseRegex(comparatorTrim), "$1$2$3");
862
+ }
863
+ function parseTildeTrim(t) {
864
+ return t.replace(parseRegex(tildeTrim), "$1~");
865
+ }
866
+ function parseCaretTrim(t) {
867
+ return t.replace(parseRegex(caretTrim), "$1^");
868
+ }
869
+ function parseCarets(t) {
870
+ return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(caret), (r, o, n, a, s) => isXVersion(o) ? "" : isXVersion(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(a) ? o === "0" ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.0 <${Number(o) + 1}.0.0-0` : s ? o === "0" ? n === "0" ? `>=${o}.${n}.${a}-${s} <${o}.${n}.${Number(a) + 1}-0` : `>=${o}.${n}.${a}-${s} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${a}-${s} <${Number(o) + 1}.0.0-0` : o === "0" ? n === "0" ? `>=${o}.${n}.${a} <${o}.${n}.${Number(a) + 1}-0` : `>=${o}.${n}.${a} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${a} <${Number(o) + 1}.0.0-0`)).join(" ");
871
+ }
872
+ function parseTildes(t) {
873
+ return t.trim().split(/\s+/).map((e) => e.replace(parseRegex(tilde), (r, o, n, a, s) => isXVersion(o) ? "" : isXVersion(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : isXVersion(a) ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : s ? `>=${o}.${n}.${a}-${s} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${a} <${o}.${Number(n) + 1}.0-0`)).join(" ");
874
+ }
875
+ function parseXRanges(t) {
876
+ return t.split(/\s+/).map((e) => e.trim().replace(parseRegex(xRange), (r, o, n, a, s, i) => {
877
+ const c = isXVersion(n), l = c || isXVersion(a), d = l || isXVersion(s);
878
+ return o === "=" && d && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && d ? (l && (a = 0), s = 0, o === ">" ? (o = ">=", l ? (n = Number(n) + 1, a = 0, s = 0) : (a = Number(a) + 1, s = 0)) : o === "<=" && (o = "<", l ? n = Number(n) + 1 : a = Number(a) + 1), o === "<" && (i = "-0"), `${o + n}.${a}.${s}${i}`) : l ? `>=${n}.0.0${i} <${Number(n) + 1}.0.0-0` : d ? `>=${n}.${a}.0${i} <${n}.${Number(a) + 1}.0-0` : r;
879
+ })).join(" ");
880
+ }
881
+ function parseStar(t) {
882
+ return t.trim().replace(parseRegex(star), "");
883
+ }
884
+ function parseGTE0(t) {
885
+ return t.trim().replace(parseRegex(gte0), "");
886
+ }
887
+ function compareAtom(t, e) {
888
+ return t = Number(t) || t, e = Number(e) || e, t > e ? 1 : t === e ? 0 : -1;
889
+ }
890
+ function comparePreRelease(t, e) {
891
+ const { preRelease: r } = t, { preRelease: o } = e;
892
+ if (r === void 0 && o) return 1;
893
+ if (r && o === void 0) return -1;
894
+ if (r === void 0 && o === void 0) return 0;
895
+ for (let n = 0, a = r.length; n <= a; n++) {
896
+ const s = r[n], i = o[n];
897
+ if (s !== i) return s === void 0 && i === void 0 ? 0 : s ? i ? compareAtom(s, i) : -1 : 1;
898
+ }
899
+ return 0;
900
+ }
901
+ function compareVersion(t, e) {
902
+ return compareAtom(t.major, e.major) || compareAtom(t.minor, e.minor) || compareAtom(t.patch, e.patch) || comparePreRelease(t, e);
903
+ }
904
+ function eq(t, e) {
905
+ return t.version === e.version;
906
+ }
907
+ function compare(t, e) {
908
+ switch (t.operator) {
909
+ case "":
910
+ case "=":
911
+ return eq(t, e);
912
+ case ">":
913
+ return compareVersion(t, e) < 0;
914
+ case ">=":
915
+ return eq(t, e) || compareVersion(t, e) < 0;
916
+ case "<":
917
+ return compareVersion(t, e) > 0;
918
+ case "<=":
919
+ return eq(t, e) || compareVersion(t, e) > 0;
920
+ case void 0:
921
+ return true;
922
+ default:
923
+ return false;
924
+ }
925
+ }
926
+ function parseComparatorString(t) {
927
+ return pipe(parseCarets, parseTildes, parseXRanges, parseStar)(t);
928
+ }
929
+ function parseRange(t) {
930
+ return pipe(parseHyphen, parseComparatorTrim, parseTildeTrim, parseCaretTrim)(t.trim()).split(/\s+/).join(" ");
931
+ }
932
+ function satisfy(t, e) {
933
+ if (!t) return false;
934
+ const r = extractComparator(t);
935
+ if (!r) return false;
936
+ const [, o, , n, a, s, i] = r, c = {
937
+ operator: o,
938
+ version: combineVersion(n, a, s, i),
939
+ major: n,
940
+ minor: a,
941
+ patch: s,
942
+ preRelease: i == null ? void 0 : i.split(".")
943
+ }, l = e.split("||");
944
+ for (const d of l) {
945
+ const h = d.trim();
946
+ if (!h || h === "*" || h === "x") return true;
947
+ try {
948
+ const u = parseRange(h);
949
+ if (!u.trim()) return true;
950
+ const p = u.split(" ").map((m) => parseComparatorString(m)).join(" ");
951
+ if (!p.trim()) return true;
952
+ const _ = p.split(/\s+/).map((m) => parseGTE0(m)).filter(Boolean);
953
+ if (_.length === 0) continue;
954
+ let g = true;
955
+ for (const m of _) {
956
+ const y = extractComparator(m);
957
+ if (!y) {
958
+ g = false;
959
+ break;
960
+ }
961
+ const [, E, , b, R, S, M] = y, I = {
962
+ operator: E,
963
+ version: combineVersion(b, R, S, M),
964
+ major: b,
965
+ minor: R,
966
+ patch: S,
967
+ preRelease: M == null ? void 0 : M.split(".")
968
+ };
969
+ if (!compare(I, c)) {
970
+ g = false;
971
+ break;
972
+ }
973
+ }
974
+ if (g) return true;
975
+ } catch (u) {
976
+ console.error(`[semver] Error processing range part "${h}":`, u);
977
+ continue;
978
+ }
979
+ }
980
+ return false;
981
+ }
982
+ function formatShare(t, e, r, o) {
983
+ let n;
984
+ return "get" in t ? n = t.get : "lib" in t ? n = () => Promise.resolve(t.lib) : n = () => Promise.resolve(() => {
985
+ throw new Error(`Can not get shared '${r}'!`);
986
+ }), {
987
+ deps: [],
988
+ useIn: [],
989
+ from: e,
990
+ loading: null,
991
+ ...t,
992
+ shareConfig: {
993
+ requiredVersion: `^${t.version}`,
994
+ singleton: false,
995
+ eager: false,
996
+ strictVersion: false,
997
+ ...t.shareConfig
998
+ },
999
+ get: n,
1000
+ loaded: (t == null ? void 0 : t.loaded) || "lib" in t ? true : void 0,
1001
+ version: t.version ?? "0",
1002
+ scope: Array.isArray(t.scope) ? t.scope : [
1003
+ t.scope ?? "default"
1004
+ ],
1005
+ strategy: (t.strategy ?? o) || "version-first"
1006
+ };
1007
+ }
1008
+ function formatShareConfigs(t, e) {
1009
+ const r = e.shared || {}, o = e.name, n = Object.keys(r).reduce((s, i) => {
1010
+ const c = arrayOptions(r[i]);
1011
+ return s[i] = s[i] || [], c.forEach((l) => {
1012
+ s[i].push(formatShare(l, o, i, e.shareStrategy));
1013
+ }), s;
1014
+ }, {}), a = {
1015
+ ...t.shared
1016
+ };
1017
+ return Object.keys(n).forEach((s) => {
1018
+ a[s] ? n[s].forEach((i) => {
1019
+ a[s].find((l) => l.version === i.version) || a[s].push(i);
1020
+ }) : a[s] = n[s];
1021
+ }), {
1022
+ shared: a,
1023
+ shareInfos: n
1024
+ };
1025
+ }
1026
+ function versionLt(t, e) {
1027
+ const r = (o) => {
1028
+ if (!Number.isNaN(Number(o))) {
1029
+ const a = o.split(".");
1030
+ let s = o;
1031
+ for (let i = 0; i < 3 - a.length; i++) s += ".0";
1032
+ return s;
1033
+ }
1034
+ return o;
1035
+ };
1036
+ return !!satisfy(r(t), `<=${r(e)}`);
1037
+ }
1038
+ const findVersion = (t, e) => {
1039
+ const r = e || function(o, n) {
1040
+ return versionLt(o, n);
1041
+ };
1042
+ return Object.keys(t).reduce((o, n) => !o || r(o, n) || o === "0" ? n : o, 0);
1043
+ }, isLoaded = (t) => !!t.loaded || typeof t.lib == "function", isLoading = (t) => !!t.loading;
1044
+ function findSingletonVersionOrderByVersion(t, e, r) {
1045
+ const o = t[e][r], n = function(a, s) {
1046
+ return !isLoaded(o[a]) && versionLt(a, s);
1047
+ };
1048
+ return findVersion(t[e][r], n);
1049
+ }
1050
+ function findSingletonVersionOrderByLoaded(t, e, r) {
1051
+ const o = t[e][r], n = function(a, s) {
1052
+ const i = (c) => isLoaded(c) || isLoading(c);
1053
+ return i(o[s]) ? i(o[a]) ? !!versionLt(a, s) : true : i(o[a]) ? false : versionLt(a, s);
1054
+ };
1055
+ return findVersion(t[e][r], n);
1056
+ }
1057
+ function getFindShareFunction(t) {
1058
+ return t === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
1059
+ }
1060
+ function getRegisteredShare(t, e, r, o) {
1061
+ if (!t) return;
1062
+ const { shareConfig: n, scope: a = DEFAULT_SCOPE, strategy: s } = r, i = Array.isArray(a) ? a : [
1063
+ a
1064
+ ];
1065
+ for (const c of i) if (n && t[c] && t[c][e]) {
1066
+ const { requiredVersion: l } = n, h = getFindShareFunction(s)(t, c, e), u = () => {
1067
+ if (n.singleton) {
1068
+ if (typeof l == "string" && !satisfy(h, l)) {
1069
+ const g = `Version ${h} from ${h && t[c][e][h].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${l})`;
1070
+ n.strictVersion ? error(g) : warn(g);
1071
+ }
1072
+ return t[c][e][h];
1073
+ } else {
1074
+ if (l === false || l === "*" || satisfy(h, l)) return t[c][e][h];
1075
+ for (const [g, m] of Object.entries(t[c][e])) if (satisfy(g, l)) return m;
1076
+ }
1077
+ }, p = {
1078
+ shareScopeMap: t,
1079
+ scope: c,
1080
+ pkgName: e,
1081
+ version: h,
1082
+ GlobalFederation: Global.__FEDERATION__,
1083
+ resolver: u
1084
+ };
1085
+ return (o.emit(p) || p).resolver();
1086
+ }
1087
+ }
1088
+ function getGlobalShareScope() {
1089
+ return Global.__FEDERATION__.__SHARE__;
1090
+ }
1091
+ function getTargetSharedOptions(t) {
1092
+ const { pkgName: e, extraOptions: r, shareInfos: o } = t, n = (s) => {
1093
+ if (!s) return;
1094
+ const i = {};
1095
+ s.forEach((d) => {
1096
+ i[d.version] = d;
1097
+ });
1098
+ const l = findVersion(i, function(d, h) {
1099
+ return !isLoaded(i[d]) && versionLt(d, h);
1100
+ });
1101
+ return i[l];
1102
+ }, a = (r == null ? void 0 : r.resolver) ?? n;
1103
+ return Object.assign({}, a(o[e]), r == null ? void 0 : r.customShareInfo);
1104
+ }
1105
+ function getBuilderId$1() {
1106
+ return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1107
+ }
1108
+ function matchRemoteWithNameAndExpose(t, e) {
1109
+ for (const r of t) {
1110
+ const o = e.startsWith(r.name);
1111
+ let n = e.replace(r.name, "");
1112
+ if (o) {
1113
+ if (n.startsWith("/")) {
1114
+ const i = r.name;
1115
+ return n = `.${n}`, {
1116
+ pkgNameOrAlias: i,
1117
+ expose: n,
1118
+ remote: r
1119
+ };
1120
+ } else if (n === "") return {
1121
+ pkgNameOrAlias: r.name,
1122
+ expose: ".",
1123
+ remote: r
1124
+ };
1125
+ }
1126
+ const a = r.alias && e.startsWith(r.alias);
1127
+ let s = r.alias && e.replace(r.alias, "");
1128
+ if (r.alias && a) {
1129
+ if (s && s.startsWith("/")) {
1130
+ const i = r.alias;
1131
+ return s = `.${s}`, {
1132
+ pkgNameOrAlias: i,
1133
+ expose: s,
1134
+ remote: r
1135
+ };
1136
+ } else if (s === "") return {
1137
+ pkgNameOrAlias: r.alias,
1138
+ expose: ".",
1139
+ remote: r
1140
+ };
1141
+ }
1142
+ }
1143
+ }
1144
+ function matchRemote(t, e) {
1145
+ for (const r of t) if (e === r.name || r.alias && e === r.alias) return r;
1146
+ }
1147
+ function registerPlugins(t, e) {
1148
+ const r = getGlobalHostPlugins(), o = [
1149
+ e.hooks,
1150
+ e.remoteHandler.hooks,
1151
+ e.sharedHandler.hooks,
1152
+ e.snapshotHandler.hooks,
1153
+ e.loaderHook,
1154
+ e.bridgeHook
1155
+ ];
1156
+ return r.length > 0 && r.forEach((n) => {
1157
+ (t == null ? void 0 : t.find((a) => a.name !== n.name)) && t.push(n);
1158
+ }), t && t.length > 0 && t.forEach((n) => {
1159
+ o.forEach((a) => {
1160
+ a.applyPlugin(n, e);
1161
+ });
1162
+ }), t;
1163
+ }
1164
+ const importCallback = ".then(callbacks[0]).catch(callbacks[1])";
1165
+ async function loadEsmEntry({ entry: t, remoteEntryExports: e }) {
1166
+ return new Promise((r, o) => {
1167
+ try {
1168
+ e ? r(e) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${t}")${importCallback}`)([
1169
+ r,
1170
+ o
1171
+ ]) : import(t).then(async (m) => {
1172
+ await m.__tla;
1173
+ return m;
1174
+ }).then(r).catch(o);
1175
+ } catch (n) {
1176
+ o(n);
1177
+ }
1178
+ });
1179
+ }
1180
+ async function loadSystemJsEntry({ entry: t, remoteEntryExports: e }) {
1181
+ return new Promise((r, o) => {
1182
+ try {
1183
+ e ? r(e) : typeof __system_context__ > "u" ? System.import(t).then(r).catch(o) : new Function("callbacks", `System.import("${t}")${importCallback}`)([
1184
+ r,
1185
+ o
1186
+ ]);
1187
+ } catch (n) {
1188
+ o(n);
1189
+ }
1190
+ });
1191
+ }
1192
+ function handleRemoteEntryLoaded(t, e, r) {
1193
+ const { remoteEntryKey: o, entryExports: n } = getRemoteEntryExports(t, e);
1194
+ return assert(n, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_001, errorCodes.runtimeDescMap, {
1195
+ remoteName: t,
1196
+ remoteEntryUrl: r,
1197
+ remoteEntryKey: o
1198
+ })), n;
1199
+ }
1200
+ async function loadEntryScript({ name: t, globalName: e, entry: r, loaderHook: o, getEntryUrl: n }) {
1201
+ const { entryExports: a } = getRemoteEntryExports(t, e);
1202
+ if (a) return a;
1203
+ const s = n ? n(r) : r;
1204
+ return sdk.loadScript(s, {
1205
+ attrs: {},
1206
+ createScriptHook: (i, c) => {
1207
+ const l = o.lifecycle.createScript.emit({
1208
+ url: i,
1209
+ attrs: c
1210
+ });
1211
+ if (l && (l instanceof HTMLScriptElement || "script" in l || "timeout" in l)) return l;
1212
+ }
1213
+ }).then(() => handleRemoteEntryLoaded(t, e, r)).catch((i) => {
1214
+ throw assert(void 0, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_008, errorCodes.runtimeDescMap, {
1215
+ remoteName: t,
1216
+ resourceUrl: r
1217
+ })), i;
1218
+ });
1219
+ }
1220
+ async function loadEntryDom({ remoteInfo: t, remoteEntryExports: e, loaderHook: r, getEntryUrl: o }) {
1221
+ const { entry: n, entryGlobalName: a, name: s, type: i } = t;
1222
+ switch (i) {
1223
+ case "esm":
1224
+ case "module":
1225
+ return loadEsmEntry({
1226
+ entry: n,
1227
+ remoteEntryExports: e
1228
+ });
1229
+ case "system":
1230
+ return loadSystemJsEntry({
1231
+ entry: n,
1232
+ remoteEntryExports: e
1233
+ });
1234
+ default:
1235
+ return loadEntryScript({
1236
+ entry: n,
1237
+ globalName: a,
1238
+ name: s,
1239
+ loaderHook: r,
1240
+ getEntryUrl: o
1241
+ });
1242
+ }
1243
+ }
1244
+ async function loadEntryNode({ remoteInfo: t, loaderHook: e }) {
1245
+ const { entry: r, entryGlobalName: o, name: n, type: a } = t, { entryExports: s } = getRemoteEntryExports(n, o);
1246
+ return s || sdk.loadScriptNode(r, {
1247
+ attrs: {
1248
+ name: n,
1249
+ globalName: o,
1250
+ type: a
1251
+ },
1252
+ loaderHook: {
1253
+ createScriptHook: (i, c = {}) => {
1254
+ const l = e.lifecycle.createScript.emit({
1255
+ url: i,
1256
+ attrs: c
1257
+ });
1258
+ if (l && "url" in l) return l;
1259
+ }
1260
+ }
1261
+ }).then(() => handleRemoteEntryLoaded(n, o, r)).catch((i) => {
1262
+ throw i;
1263
+ });
1264
+ }
1265
+ function getRemoteEntryUniqueKey(t) {
1266
+ const { entry: e, name: r } = t;
1267
+ return sdk.composeKeyWithSeparator(r, e);
1268
+ }
1269
+ async function getRemoteEntry(t) {
1270
+ const { origin: e, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, _inErrorHandling: a = false } = t, s = getRemoteEntryUniqueKey(o);
1271
+ if (r) return r;
1272
+ if (!globalLoading[s]) {
1273
+ const i = e.remoteHandler.hooks.lifecycle.loadEntry, c = e.loaderHook;
1274
+ globalLoading[s] = i.emit({
1275
+ loaderHook: c,
1276
+ remoteInfo: o,
1277
+ remoteEntryExports: r
1278
+ }).then((l) => l || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : sdk.isBrowserEnv()) ? loadEntryDom({
1279
+ remoteInfo: o,
1280
+ remoteEntryExports: r,
1281
+ loaderHook: c,
1282
+ getEntryUrl: n
1283
+ }) : loadEntryNode({
1284
+ remoteInfo: o,
1285
+ loaderHook: c
1286
+ }))).catch(async (l) => {
1287
+ const d = getRemoteEntryUniqueKey(o);
1288
+ if (l instanceof Error && l.message.includes(errorCodes.RUNTIME_008) && !a) {
1289
+ const u = (_) => getRemoteEntry({
1290
+ ..._,
1291
+ _inErrorHandling: true
1292
+ }), p = await e.loaderHook.lifecycle.loadEntryError.emit({
1293
+ getRemoteEntry: u,
1294
+ origin: e,
1295
+ remoteInfo: o,
1296
+ remoteEntryExports: r,
1297
+ globalLoading,
1298
+ uniqueKey: d
1299
+ });
1300
+ if (p) return p;
1301
+ }
1302
+ throw l;
1303
+ });
1304
+ }
1305
+ return globalLoading[s];
1306
+ }
1307
+ function getRemoteInfo(t) {
1308
+ return {
1309
+ ...t,
1310
+ entry: "entry" in t ? t.entry : "",
1311
+ type: t.type || DEFAULT_REMOTE_TYPE,
1312
+ entryGlobalName: t.entryGlobalName || t.name,
1313
+ shareScope: t.shareScope || DEFAULT_SCOPE
1314
+ };
1315
+ }
1316
+ function defaultPreloadArgs(t) {
1317
+ return {
1318
+ resourceCategory: "sync",
1319
+ share: true,
1320
+ depsRemote: true,
1321
+ prefetchInterface: false,
1322
+ ...t
1323
+ };
1324
+ }
1325
+ function formatPreloadArgs(t, e) {
1326
+ return e.map((r) => {
1327
+ const o = matchRemote(t, r.nameOrAlias);
1328
+ return assert(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && sdk.safeToString({
1329
+ remoteInfo: o,
1330
+ remotes: t
1331
+ })}`), {
1332
+ remote: o,
1333
+ preloadConfig: defaultPreloadArgs(r)
1334
+ };
1335
+ });
1336
+ }
1337
+ function normalizePreloadExposes(t) {
1338
+ return t ? t.map((e) => e === "." ? e : e.startsWith("./") ? e.replace("./", "") : e) : [];
1339
+ }
1340
+ function preloadAssets(t, e, r, o = true) {
1341
+ const { cssAssets: n, jsAssetsWithoutEntry: a, entryAssets: s } = r;
1342
+ if (e.options.inBrowser) {
1343
+ if (s.forEach((i) => {
1344
+ const { moduleInfo: c } = i, l = e.moduleCache.get(t.name);
1345
+ getRemoteEntry(l ? {
1346
+ origin: e,
1347
+ remoteInfo: c,
1348
+ remoteEntryExports: l.remoteEntryExports
1349
+ } : {
1350
+ origin: e,
1351
+ remoteInfo: c,
1352
+ remoteEntryExports: void 0
1353
+ });
1354
+ }), o) {
1355
+ const i = {
1356
+ rel: "preload",
1357
+ as: "style"
1358
+ };
1359
+ n.forEach((c) => {
1360
+ const { link: l, needAttach: d } = sdk.createLink({
1361
+ url: c,
1362
+ cb: () => {
1363
+ },
1364
+ attrs: i,
1365
+ createLinkHook: (h, u) => {
1366
+ const p = e.loaderHook.lifecycle.createLink.emit({
1367
+ url: h,
1368
+ attrs: u
1369
+ });
1370
+ if (p instanceof HTMLLinkElement) return p;
1371
+ }
1372
+ });
1373
+ d && document.head.appendChild(l);
1374
+ });
1375
+ } else {
1376
+ const i = {
1377
+ rel: "stylesheet",
1378
+ type: "text/css"
1379
+ };
1380
+ n.forEach((c) => {
1381
+ const { link: l, needAttach: d } = sdk.createLink({
1382
+ url: c,
1383
+ cb: () => {
1384
+ },
1385
+ attrs: i,
1386
+ createLinkHook: (h, u) => {
1387
+ const p = e.loaderHook.lifecycle.createLink.emit({
1388
+ url: h,
1389
+ attrs: u
1390
+ });
1391
+ if (p instanceof HTMLLinkElement) return p;
1392
+ },
1393
+ needDeleteLink: false
1394
+ });
1395
+ d && document.head.appendChild(l);
1396
+ });
1397
+ }
1398
+ if (o) {
1399
+ const i = {
1400
+ rel: "preload",
1401
+ as: "script"
1402
+ };
1403
+ a.forEach((c) => {
1404
+ const { link: l, needAttach: d } = sdk.createLink({
1405
+ url: c,
1406
+ cb: () => {
1407
+ },
1408
+ attrs: i,
1409
+ createLinkHook: (h, u) => {
1410
+ const p = e.loaderHook.lifecycle.createLink.emit({
1411
+ url: h,
1412
+ attrs: u
1413
+ });
1414
+ if (p instanceof HTMLLinkElement) return p;
1415
+ }
1416
+ });
1417
+ d && document.head.appendChild(l);
1418
+ });
1419
+ } else {
1420
+ const i = {
1421
+ fetchpriority: "high",
1422
+ type: (t == null ? void 0 : t.type) === "module" ? "module" : "text/javascript"
1423
+ };
1424
+ a.forEach((c) => {
1425
+ const { script: l, needAttach: d } = sdk.createScript({
1426
+ url: c,
1427
+ cb: () => {
1428
+ },
1429
+ attrs: i,
1430
+ createScriptHook: (h, u) => {
1431
+ const p = e.loaderHook.lifecycle.createScript.emit({
1432
+ url: h,
1433
+ attrs: u
1434
+ });
1435
+ if (p instanceof HTMLScriptElement) return p;
1436
+ },
1437
+ needDeleteScript: true
1438
+ });
1439
+ d && document.head.appendChild(l);
1440
+ });
1441
+ }
1442
+ }
1443
+ }
1444
+ const ShareUtils = {
1445
+ getRegisteredShare,
1446
+ getGlobalShareScope
1447
+ }, GlobalUtils = {
1448
+ Global,
1449
+ nativeGlobal,
1450
+ resetFederationGlobalInfo,
1451
+ setGlobalFederationInstance,
1452
+ getGlobalFederationConstructor,
1453
+ setGlobalFederationConstructor,
1454
+ getInfoWithoutType,
1455
+ getGlobalSnapshot,
1456
+ getTargetSnapshotInfoByModuleInfo,
1457
+ getGlobalSnapshotInfoByModuleInfo,
1458
+ setGlobalSnapshotInfoByModuleInfo,
1459
+ addGlobalSnapshot,
1460
+ getRemoteEntryExports,
1461
+ registerGlobalPlugins,
1462
+ getGlobalHostPlugins,
1463
+ getPreloaded,
1464
+ setPreloaded
1465
+ };
1466
+ var helpers = {
1467
+ global: GlobalUtils,
1468
+ share: ShareUtils,
1469
+ utils: {
1470
+ matchRemoteWithNameAndExpose,
1471
+ preloadAssets,
1472
+ getRemoteInfo
1473
+ }
1474
+ };
1475
+ class Module {
1476
+ constructor({ remoteInfo: e, host: r }) {
1477
+ this.inited = false, this.lib = void 0, this.remoteInfo = e, this.host = r;
1478
+ }
1479
+ async getEntry() {
1480
+ if (this.remoteEntryExports) return this.remoteEntryExports;
1481
+ let e;
1482
+ return e = await getRemoteEntry({
1483
+ origin: this.host,
1484
+ remoteInfo: this.remoteInfo,
1485
+ remoteEntryExports: this.remoteEntryExports
1486
+ }), assert(e, `remoteEntryExports is undefined
1487
+ ${sdk.safeToString(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
1488
+ }
1489
+ async get(e, r, o, n) {
1490
+ const { loadFactory: a = true } = o || {
1491
+ loadFactory: true
1492
+ }, s = await this.getEntry();
1493
+ if (!this.inited) {
1494
+ const h = this.host.shareScopeMap, u = Array.isArray(this.remoteInfo.shareScope) ? this.remoteInfo.shareScope : [
1495
+ this.remoteInfo.shareScope
1496
+ ];
1497
+ u.length || u.push("default"), u.forEach((y) => {
1498
+ h[y] || (h[y] = {});
1499
+ });
1500
+ const p = h[u[0]], _ = [], g = {
1501
+ version: this.remoteInfo.version || "",
1502
+ shareScopeKeys: Array.isArray(this.remoteInfo.shareScope) ? u : this.remoteInfo.shareScope || "default"
1503
+ };
1504
+ Object.defineProperty(g, "shareScopeMap", {
1505
+ value: h,
1506
+ enumerable: false
1507
+ });
1508
+ const m = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1509
+ shareScope: p,
1510
+ remoteEntryInitOptions: g,
1511
+ initScope: _,
1512
+ remoteInfo: this.remoteInfo,
1513
+ origin: this.host
1514
+ });
1515
+ typeof (s == null ? void 0 : s.init) > "u" && error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_002, errorCodes.runtimeDescMap, {
1516
+ hostName: this.host.name,
1517
+ remoteName: this.remoteInfo.name,
1518
+ remoteEntryUrl: this.remoteInfo.entry,
1519
+ remoteEntryKey: this.remoteInfo.entryGlobalName
1520
+ })), await s.init(m.shareScope, m.initScope, m.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
1521
+ ...m,
1522
+ id: e,
1523
+ remoteSnapshot: n,
1524
+ remoteEntryExports: s
1525
+ });
1526
+ }
1527
+ this.lib = s, this.inited = true;
1528
+ let i;
1529
+ i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1530
+ remoteEntryExports: s,
1531
+ expose: r,
1532
+ moduleInfo: this.remoteInfo
1533
+ }), i || (i = await s.get(r)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${r}.`);
1534
+ const c = processModuleAlias(this.remoteInfo.name, r), l = this.wraperFactory(i, c);
1535
+ return a ? await l() : l;
1536
+ }
1537
+ wraperFactory(e, r) {
1538
+ function o(n, a) {
1539
+ n && typeof n == "object" && Object.isExtensible(n) && !Object.getOwnPropertyDescriptor(n, /* @__PURE__ */ Symbol.for("mf_module_id")) && Object.defineProperty(n, /* @__PURE__ */ Symbol.for("mf_module_id"), {
1540
+ value: a,
1541
+ enumerable: false
1542
+ });
1543
+ }
1544
+ return e instanceof Promise ? async () => {
1545
+ const n = await e();
1546
+ return o(n, r), n;
1547
+ } : () => {
1548
+ const n = e();
1549
+ return o(n, r), n;
1550
+ };
1551
+ }
1552
+ }
1553
+ class SyncHook {
1554
+ constructor(e) {
1555
+ this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
1556
+ }
1557
+ on(e) {
1558
+ typeof e == "function" && this.listeners.add(e);
1559
+ }
1560
+ once(e) {
1561
+ const r = this;
1562
+ this.on(function o(...n) {
1563
+ return r.remove(o), e.apply(null, n);
1564
+ });
1565
+ }
1566
+ emit(...e) {
1567
+ let r;
1568
+ return this.listeners.size > 0 && this.listeners.forEach((o) => {
1569
+ r = o(...e);
1570
+ }), r;
1571
+ }
1572
+ remove(e) {
1573
+ this.listeners.delete(e);
1574
+ }
1575
+ removeAll() {
1576
+ this.listeners.clear();
1577
+ }
1578
+ }
1579
+ class AsyncHook extends SyncHook {
1580
+ emit(...e) {
1581
+ let r;
1582
+ const o = Array.from(this.listeners);
1583
+ if (o.length > 0) {
1584
+ let n = 0;
1585
+ const a = (s) => s === false ? false : n < o.length ? Promise.resolve(o[n++].apply(null, e)).then(a) : s;
1586
+ r = a();
1587
+ }
1588
+ return Promise.resolve(r);
1589
+ }
1590
+ }
1591
+ function checkReturnData(t, e) {
1592
+ if (!isObject(e)) return false;
1593
+ if (t !== e) {
1594
+ for (const r in t) if (!(r in e)) return false;
1595
+ }
1596
+ return true;
1597
+ }
1598
+ class SyncWaterfallHook extends SyncHook {
1599
+ constructor(e) {
1600
+ super(), this.onerror = error, this.type = e;
1601
+ }
1602
+ emit(e) {
1603
+ isObject(e) || error(`The data for the "${this.type}" hook should be an object.`);
1604
+ for (const r of this.listeners) try {
1605
+ const o = r(e);
1606
+ if (checkReturnData(e, o)) e = o;
1607
+ else {
1608
+ this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1609
+ break;
1610
+ }
1611
+ } catch (o) {
1612
+ warn(o), this.onerror(o);
1613
+ }
1614
+ return e;
1615
+ }
1616
+ }
1617
+ class AsyncWaterfallHook extends SyncHook {
1618
+ constructor(e) {
1619
+ super(), this.onerror = error, this.type = e;
1620
+ }
1621
+ emit(e) {
1622
+ isObject(e) || error(`The response data for the "${this.type}" hook must be an object.`);
1623
+ const r = Array.from(this.listeners);
1624
+ if (r.length > 0) {
1625
+ let o = 0;
1626
+ const n = (s) => (warn(s), this.onerror(s), e), a = (s) => {
1627
+ if (checkReturnData(e, s)) {
1628
+ if (e = s, o < r.length) try {
1629
+ return Promise.resolve(r[o++](e)).then(a, n);
1630
+ } catch (i) {
1631
+ return n(i);
1632
+ }
1633
+ } else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
1634
+ return e;
1635
+ };
1636
+ return Promise.resolve(a(e));
1637
+ }
1638
+ return Promise.resolve(e);
1639
+ }
1640
+ }
1641
+ class PluginSystem {
1642
+ constructor(e) {
1643
+ this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
1644
+ }
1645
+ applyPlugin(e, r) {
1646
+ var _a;
1647
+ assert(isPlainObject(e), "Plugin configuration is invalid.");
1648
+ const o = e.name;
1649
+ assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = e, (_a = e.apply) == null ? void 0 : _a.call(e, r), Object.keys(this.lifecycle).forEach((n) => {
1650
+ const a = e[n];
1651
+ a && this.lifecycle[n].on(a);
1652
+ }));
1653
+ }
1654
+ removePlugin(e) {
1655
+ assert(e, "A name is required.");
1656
+ const r = this.registerPlugins[e];
1657
+ assert(r, `The plugin "${e}" is not registered.`), Object.keys(r).forEach((o) => {
1658
+ o !== "name" && this.lifecycle[o].remove(r[o]);
1659
+ });
1660
+ }
1661
+ }
1662
+ function assignRemoteInfo(t, e) {
1663
+ const r = getRemoteEntryInfoFromSnapshot(e);
1664
+ r.url || error(`The attribute remoteEntry of ${t.name} must not be undefined.`);
1665
+ let o = sdk.getResourceUrl(e, r.url);
1666
+ !sdk.isBrowserEnv() && !o.startsWith("http") && (o = `https:${o}`), t.type = r.type, t.entryGlobalName = r.globalName, t.entry = o, t.version = e.version, t.buildVersion = e.buildVersion;
1667
+ }
1668
+ function snapshotPlugin() {
1669
+ return {
1670
+ name: "snapshot-plugin",
1671
+ async afterResolve(t) {
1672
+ const { remote: e, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: a, id: s } = t;
1673
+ if (!isRemoteInfoWithEntry(e) || !isPureRemoteEntry(e)) {
1674
+ const { remoteSnapshot: i, globalSnapshot: c } = await n.snapshotHandler.loadRemoteSnapshotInfo({
1675
+ moduleInfo: e,
1676
+ id: s
1677
+ });
1678
+ assignRemoteInfo(a, i);
1679
+ const l = {
1680
+ remote: e,
1681
+ preloadConfig: {
1682
+ nameOrAlias: r,
1683
+ exposes: [
1684
+ o
1685
+ ],
1686
+ resourceCategory: "sync",
1687
+ share: false,
1688
+ depsRemote: false
1689
+ }
1690
+ }, d = await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1691
+ origin: n,
1692
+ preloadOptions: l,
1693
+ remoteInfo: a,
1694
+ remote: e,
1695
+ remoteSnapshot: i,
1696
+ globalSnapshot: c
1697
+ });
1698
+ return d && preloadAssets(a, n, d, false), {
1699
+ ...t,
1700
+ remoteSnapshot: i
1701
+ };
1702
+ }
1703
+ return t;
1704
+ }
1705
+ };
1706
+ }
1707
+ function splitId(t) {
1708
+ const e = t.split(":");
1709
+ return e.length === 1 ? {
1710
+ name: e[0],
1711
+ version: void 0
1712
+ } : e.length === 2 ? {
1713
+ name: e[0],
1714
+ version: e[1]
1715
+ } : {
1716
+ name: e[1],
1717
+ version: e[2]
1718
+ };
1719
+ }
1720
+ function traverseModuleInfo(t, e, r, o, n = {}, a) {
1721
+ const s = getFMId(e), { value: i } = getInfoWithoutType(t, s), c = a || i;
1722
+ if (c && !sdk.isManifestProvider(c) && (r(c, e, o), c.remotesInfo)) {
1723
+ const l = Object.keys(c.remotesInfo);
1724
+ for (const d of l) {
1725
+ if (n[d]) continue;
1726
+ n[d] = true;
1727
+ const h = splitId(d), u = c.remotesInfo[d];
1728
+ traverseModuleInfo(t, {
1729
+ name: h.name,
1730
+ version: u.matchedVersion
1731
+ }, r, false, n, void 0);
1732
+ }
1733
+ }
1734
+ }
1735
+ const isExisted = (t, e) => document.querySelector(`${t}[${t === "link" ? "href" : "src"}="${e}"]`);
1736
+ function generatePreloadAssets(t, e, r, o, n) {
1737
+ const a = [], s = [], i = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: d } = t, { preloadConfig: h } = e, { depsRemote: u } = h;
1738
+ if (traverseModuleInfo(o, r, (m, y, E) => {
1739
+ var _a;
1740
+ let b;
1741
+ if (E) b = h;
1742
+ else if (Array.isArray(u)) {
1743
+ const N = u.find((T) => T.nameOrAlias === y.name || T.nameOrAlias === y.alias);
1744
+ if (!N) return;
1745
+ b = defaultPreloadArgs(N);
1746
+ } else if (u === true) b = h;
1747
+ else return;
1748
+ const R = sdk.getResourceUrl(m, getRemoteEntryInfoFromSnapshot(m).url);
1749
+ R && i.push({
1750
+ name: y.name,
1751
+ moduleInfo: {
1752
+ name: y.name,
1753
+ entry: R,
1754
+ type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1755
+ entryGlobalName: "globalName" in m ? m.globalName : y.name,
1756
+ shareScope: "",
1757
+ version: "version" in m ? m.version : void 0
1758
+ },
1759
+ url: R
1760
+ });
1761
+ let S = "modules" in m ? m.modules : [];
1762
+ const M = normalizePreloadExposes(b.exposes);
1763
+ M.length && "modules" in m && (S = (_a = m == null ? void 0 : m.modules) == null ? void 0 : _a.reduce((N, T) => ((M == null ? void 0 : M.indexOf(T.moduleName)) !== -1 && N.push(T), N), []));
1764
+ function I(N) {
1765
+ const T = N.map(($) => sdk.getResourceUrl(m, $));
1766
+ return b.filter ? T.filter(b.filter) : T;
1767
+ }
1768
+ if (S) {
1769
+ const N = S.length;
1770
+ for (let T = 0; T < N; T++) {
1771
+ const $ = S[T], A = `${y.name}/${$.moduleName}`;
1772
+ t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1773
+ id: $.moduleName === "." ? y.name : A,
1774
+ name: y.name,
1775
+ remoteSnapshot: m,
1776
+ preloadConfig: b,
1777
+ remote: y,
1778
+ origin: t
1779
+ }), !getPreloaded(A) && (b.resourceCategory === "all" ? (a.push(...I($.assets.css.async)), a.push(...I($.assets.css.sync)), s.push(...I($.assets.js.async)), s.push(...I($.assets.js.sync))) : (b.resourceCategory = "sync") && (a.push(...I($.assets.css.sync)), s.push(...I($.assets.js.sync))), setPreloaded(A));
1780
+ }
1781
+ }
1782
+ }, true, {}, n), n.shared && n.shared.length > 0) {
1783
+ const m = (y, E) => {
1784
+ const b = getRegisteredShare(t.shareScopeMap, E.sharedName, y, t.sharedHandler.hooks.lifecycle.resolveShare);
1785
+ b && typeof b.lib == "function" && (E.assets.js.sync.forEach((R) => {
1786
+ c.add(R);
1787
+ }), E.assets.css.sync.forEach((R) => {
1788
+ l.add(R);
1789
+ }));
1790
+ };
1791
+ n.shared.forEach((y) => {
1792
+ var _a;
1793
+ const E = (_a = d.shared) == null ? void 0 : _a[y.sharedName];
1794
+ if (!E) return;
1795
+ const b = y.version ? E.find((S) => S.version === y.version) : E;
1796
+ if (!b) return;
1797
+ arrayOptions(b).forEach((S) => {
1798
+ m(S, y);
1799
+ });
1800
+ });
1801
+ }
1802
+ const _ = s.filter((m) => !c.has(m) && !isExisted("script", m));
1803
+ return {
1804
+ cssAssets: a.filter((m) => !l.has(m) && !isExisted("link", m)),
1805
+ jsAssetsWithoutEntry: _,
1806
+ entryAssets: i.filter((m) => !isExisted("script", m.url))
1807
+ };
1808
+ }
1809
+ const generatePreloadAssetsPlugin = function() {
1810
+ return {
1811
+ name: "generate-preload-assets-plugin",
1812
+ async generatePreloadAssets(t) {
1813
+ const { origin: e, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: a, remoteSnapshot: s } = t;
1814
+ return sdk.isBrowserEnv() ? isRemoteInfoWithEntry(n) && isPureRemoteEntry(n) ? {
1815
+ cssAssets: [],
1816
+ jsAssetsWithoutEntry: [],
1817
+ entryAssets: [
1818
+ {
1819
+ name: n.name,
1820
+ url: n.entry,
1821
+ moduleInfo: {
1822
+ name: o.name,
1823
+ entry: n.entry,
1824
+ type: o.type || "global",
1825
+ entryGlobalName: "",
1826
+ shareScope: ""
1827
+ }
1828
+ }
1829
+ ]
1830
+ } : (assignRemoteInfo(o, s), generatePreloadAssets(e, r, o, a, s)) : {
1831
+ cssAssets: [],
1832
+ jsAssetsWithoutEntry: [],
1833
+ entryAssets: []
1834
+ };
1835
+ }
1836
+ };
1837
+ };
1838
+ function getGlobalRemoteInfo(t, e) {
1839
+ const r = getGlobalSnapshotInfoByModuleInfo({
1840
+ name: e.name,
1841
+ version: e.options.version
1842
+ }), o = r && "remotesInfo" in r && r.remotesInfo && getInfoWithoutType(r.remotesInfo, t.name).value;
1843
+ return o && o.matchedVersion ? {
1844
+ hostGlobalSnapshot: r,
1845
+ globalSnapshot: getGlobalSnapshot(),
1846
+ remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1847
+ name: t.name,
1848
+ version: o.matchedVersion
1849
+ })
1850
+ } : {
1851
+ hostGlobalSnapshot: void 0,
1852
+ globalSnapshot: getGlobalSnapshot(),
1853
+ remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
1854
+ name: t.name,
1855
+ version: "version" in t ? t.version : void 0
1856
+ })
1857
+ };
1858
+ }
1859
+ class SnapshotHandler {
1860
+ constructor(e) {
1861
+ this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new PluginSystem({
1862
+ beforeLoadRemoteSnapshot: new AsyncHook("beforeLoadRemoteSnapshot"),
1863
+ loadSnapshot: new AsyncWaterfallHook("loadGlobalSnapshot"),
1864
+ loadRemoteSnapshot: new AsyncWaterfallHook("loadRemoteSnapshot"),
1865
+ afterLoadSnapshot: new AsyncWaterfallHook("afterLoadSnapshot")
1866
+ }), this.manifestLoading = Global.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1867
+ }
1868
+ async loadRemoteSnapshotInfo({ moduleInfo: e, id: r, expose: o }) {
1869
+ const { options: n } = this.HostInstance;
1870
+ await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1871
+ options: n,
1872
+ moduleInfo: e
1873
+ });
1874
+ let a = getGlobalSnapshotInfoByModuleInfo({
1875
+ name: this.HostInstance.options.name,
1876
+ version: this.HostInstance.options.version
1877
+ });
1878
+ a || (a = {
1879
+ version: this.HostInstance.options.version || "",
1880
+ remoteEntry: "",
1881
+ remotesInfo: {}
1882
+ }, addGlobalSnapshot({
1883
+ [this.HostInstance.options.name]: a
1884
+ })), a && "remotesInfo" in a && !getInfoWithoutType(a.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (a.remotesInfo = {
1885
+ ...a == null ? void 0 : a.remotesInfo,
1886
+ [e.name]: {
1887
+ matchedVersion: "version" in e ? e.version : e.entry
1888
+ }
1889
+ });
1890
+ const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: c } = this.getGlobalRemoteInfo(e), { remoteSnapshot: l, globalSnapshot: d } = await this.hooks.lifecycle.loadSnapshot.emit({
1891
+ options: n,
1892
+ moduleInfo: e,
1893
+ hostGlobalSnapshot: s,
1894
+ remoteSnapshot: i,
1895
+ globalSnapshot: c
1896
+ });
1897
+ let h, u;
1898
+ if (l) if (sdk.isManifestProvider(l)) {
1899
+ const p = sdk.isBrowserEnv() ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", _ = await this.getManifestJson(p, e, {}), g = setGlobalSnapshotInfoByModuleInfo({
1900
+ ...e,
1901
+ entry: p
1902
+ }, _);
1903
+ h = _, u = g;
1904
+ } else {
1905
+ const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1906
+ options: this.HostInstance.options,
1907
+ moduleInfo: e,
1908
+ remoteSnapshot: l,
1909
+ from: "global"
1910
+ });
1911
+ h = p, u = d;
1912
+ }
1913
+ else if (isRemoteInfoWithEntry(e)) {
1914
+ const p = await this.getManifestJson(e.entry, e, {}), _ = setGlobalSnapshotInfoByModuleInfo(e, p), { remoteSnapshot: g } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1915
+ options: this.HostInstance.options,
1916
+ moduleInfo: e,
1917
+ remoteSnapshot: p,
1918
+ from: "global"
1919
+ });
1920
+ h = g, u = _;
1921
+ } else error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_007, errorCodes.runtimeDescMap, {
1922
+ hostName: e.name,
1923
+ hostVersion: e.version,
1924
+ globalSnapshot: JSON.stringify(d)
1925
+ }));
1926
+ return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1927
+ id: r,
1928
+ host: this.HostInstance,
1929
+ options: n,
1930
+ moduleInfo: e,
1931
+ remoteSnapshot: h
1932
+ }), {
1933
+ remoteSnapshot: h,
1934
+ globalSnapshot: u
1935
+ };
1936
+ }
1937
+ getGlobalRemoteInfo(e) {
1938
+ return getGlobalRemoteInfo(e, this.HostInstance);
1939
+ }
1940
+ async getManifestJson(e, r, o) {
1941
+ const n = async () => {
1942
+ let s = this.manifestCache.get(e);
1943
+ if (s) return s;
1944
+ try {
1945
+ let i = await this.loaderHook.lifecycle.fetch.emit(e, {});
1946
+ (!i || !(i instanceof Response)) && (i = await fetch(e, {})), s = await i.json();
1947
+ } catch (i) {
1948
+ s = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1949
+ id: e,
1950
+ error: i,
1951
+ from: "runtime",
1952
+ lifecycle: "afterResolve",
1953
+ origin: this.HostInstance
1954
+ }), s || (delete this.manifestLoading[e], error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_003, errorCodes.runtimeDescMap, {
1955
+ manifestUrl: e,
1956
+ moduleName: r.name,
1957
+ hostName: this.HostInstance.options.name
1958
+ }, `${i}`)));
1959
+ }
1960
+ return assert(s.metaData && s.exposes && s.shared, `${e} is not a federation manifest`), this.manifestCache.set(e, s), s;
1961
+ }, a = async () => {
1962
+ const s = await n(), i = sdk.generateSnapshotFromManifest(s, {
1963
+ version: e
1964
+ }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1965
+ options: this.HostInstance.options,
1966
+ moduleInfo: r,
1967
+ manifestJson: s,
1968
+ remoteSnapshot: i,
1969
+ manifestUrl: e,
1970
+ from: "manifest"
1971
+ });
1972
+ return c;
1973
+ };
1974
+ return this.manifestLoading[e] || (this.manifestLoading[e] = a().then((s) => s)), this.manifestLoading[e];
1975
+ }
1976
+ }
1977
+ class SharedHandler {
1978
+ constructor(e) {
1979
+ this.hooks = new PluginSystem({
1980
+ afterResolve: new AsyncWaterfallHook("afterResolve"),
1981
+ beforeLoadShare: new AsyncWaterfallHook("beforeLoadShare"),
1982
+ loadShare: new AsyncHook(),
1983
+ resolveShare: new SyncWaterfallHook("resolveShare"),
1984
+ initContainerShareScopeMap: new SyncWaterfallHook("initContainerShareScopeMap")
1985
+ }), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
1986
+ }
1987
+ registerShared(e, r) {
1988
+ const { shareInfos: o, shared: n } = formatShareConfigs(e, r);
1989
+ return Object.keys(o).forEach((s) => {
1990
+ o[s].forEach((c) => {
1991
+ c.scope.forEach((l) => {
1992
+ var _a;
1993
+ ((_a = this.shareScopeMap[l]) == null ? void 0 : _a[s]) || this.setShared({
1994
+ pkgName: s,
1995
+ lib: c.lib,
1996
+ get: c.get,
1997
+ loaded: c.loaded || !!c.lib,
1998
+ shared: c,
1999
+ from: r.name
2000
+ });
2001
+ });
2002
+ });
2003
+ }), {
2004
+ shareInfos: o,
2005
+ shared: n
2006
+ };
2007
+ }
2008
+ async loadShare(e, r) {
2009
+ const { host: o } = this, n = getTargetSharedOptions({
2010
+ pkgName: e,
2011
+ extraOptions: r,
2012
+ shareInfos: o.options.shared
2013
+ });
2014
+ (n == null ? void 0 : n.scope) && await Promise.all(n.scope.map(async (l) => {
2015
+ await Promise.all(this.initializeSharing(l, {
2016
+ strategy: n.strategy
2017
+ }));
2018
+ }));
2019
+ const a = await this.hooks.lifecycle.beforeLoadShare.emit({
2020
+ pkgName: e,
2021
+ shareInfo: n,
2022
+ shared: o.options.shared,
2023
+ origin: o
2024
+ }), { shareInfo: s } = a;
2025
+ assert(s, `Cannot find ${e} Share in the ${o.options.name}. Please ensure that the ${e} Share parameters have been injected`);
2026
+ const i = getRegisteredShare(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare), c = (l) => {
2027
+ l.useIn || (l.useIn = []), addUniqueItem(l.useIn, o.options.name);
2028
+ };
2029
+ if (i && i.lib) return c(i), i.lib;
2030
+ if (i && i.loading && !i.loaded) {
2031
+ const l = await i.loading;
2032
+ return i.loaded = true, i.lib || (i.lib = l), c(i), l;
2033
+ } else if (i) {
2034
+ const d = (async () => {
2035
+ const h = await i.get();
2036
+ return c(i), i.loaded = true, i.lib = h, h;
2037
+ })();
2038
+ return this.setShared({
2039
+ pkgName: e,
2040
+ loaded: false,
2041
+ shared: i,
2042
+ from: o.options.name,
2043
+ lib: null,
2044
+ loading: d
2045
+ }), d;
2046
+ } else {
2047
+ if (r == null ? void 0 : r.customShareInfo) return false;
2048
+ const d = (async () => {
2049
+ const h = await s.get();
2050
+ s.lib = h, s.loaded = true, c(s);
2051
+ const u = getRegisteredShare(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare);
2052
+ return u && (u.lib = h, u.loaded = true, u.from = s.from), h;
2053
+ })();
2054
+ return this.setShared({
2055
+ pkgName: e,
2056
+ loaded: false,
2057
+ shared: s,
2058
+ from: o.options.name,
2059
+ lib: null,
2060
+ loading: d
2061
+ }), d;
2062
+ }
2063
+ }
2064
+ initializeSharing(e = DEFAULT_SCOPE, r) {
2065
+ const { host: o } = this, n = r == null ? void 0 : r.from, a = r == null ? void 0 : r.strategy;
2066
+ let s = r == null ? void 0 : r.initScope;
2067
+ const i = [];
2068
+ if (n !== "build") {
2069
+ const { initTokens: _ } = this;
2070
+ s || (s = []);
2071
+ let g = _[e];
2072
+ if (g || (g = _[e] = {
2073
+ from: this.host.name
2074
+ }), s.indexOf(g) >= 0) return i;
2075
+ s.push(g);
2076
+ }
2077
+ const c = this.shareScopeMap, l = o.options.name;
2078
+ c[e] || (c[e] = {});
2079
+ const d = c[e], h = (_, g) => {
2080
+ var _a;
2081
+ const { version: m, eager: y } = g;
2082
+ d[_] = d[_] || {};
2083
+ const E = d[_], b = E[m], R = !!(b && (b.eager || ((_a = b.shareConfig) == null ? void 0 : _a.eager)));
2084
+ (!b || b.strategy !== "loaded-first" && !b.loaded && (!y != !R ? y : l > b.from)) && (E[m] = g);
2085
+ }, u = (_) => _ && _.init && _.init(c[e], s), p = async (_) => {
2086
+ const { module: g } = await o.remoteHandler.getRemoteModuleAndOptions({
2087
+ id: _
2088
+ });
2089
+ if (g.getEntry) {
2090
+ let m;
2091
+ try {
2092
+ m = await g.getEntry();
2093
+ } catch (y) {
2094
+ m = await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2095
+ id: _,
2096
+ error: y,
2097
+ from: "runtime",
2098
+ lifecycle: "beforeLoadShare",
2099
+ origin: o
2100
+ });
2101
+ }
2102
+ g.inited || (await u(m), g.inited = true);
2103
+ }
2104
+ };
2105
+ return Object.keys(o.options.shared).forEach((_) => {
2106
+ o.options.shared[_].forEach((m) => {
2107
+ m.scope.includes(e) && h(_, m);
2108
+ });
2109
+ }), (o.options.shareStrategy === "version-first" || a === "version-first") && o.options.remotes.forEach((_) => {
2110
+ _.shareScope === e && i.push(p(_.name));
2111
+ }), i;
2112
+ }
2113
+ loadShareSync(e, r) {
2114
+ const { host: o } = this, n = getTargetSharedOptions({
2115
+ pkgName: e,
2116
+ extraOptions: r,
2117
+ shareInfos: o.options.shared
2118
+ });
2119
+ (n == null ? void 0 : n.scope) && n.scope.forEach((i) => {
2120
+ this.initializeSharing(i, {
2121
+ strategy: n.strategy
2122
+ });
2123
+ });
2124
+ const a = getRegisteredShare(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare), s = (i) => {
2125
+ i.useIn || (i.useIn = []), addUniqueItem(i.useIn, o.options.name);
2126
+ };
2127
+ if (a) {
2128
+ if (typeof a.lib == "function") return s(a), a.loaded || (a.loaded = true, a.from === o.options.name && (n.loaded = true)), a.lib;
2129
+ if (typeof a.get == "function") {
2130
+ const i = a.get();
2131
+ if (!(i instanceof Promise)) return s(a), this.setShared({
2132
+ pkgName: e,
2133
+ loaded: true,
2134
+ from: o.options.name,
2135
+ lib: i,
2136
+ shared: a
2137
+ }), i;
2138
+ }
2139
+ }
2140
+ if (n.lib) return n.loaded || (n.loaded = true), n.lib;
2141
+ if (n.get) {
2142
+ const i = n.get();
2143
+ if (i instanceof Promise) {
2144
+ const c = (r == null ? void 0 : r.from) === "build" ? errorCodes.RUNTIME_005 : errorCodes.RUNTIME_006;
2145
+ throw new Error(errorCodes.getShortErrorMsg(c, errorCodes.runtimeDescMap, {
2146
+ hostName: o.options.name,
2147
+ sharedPkgName: e
2148
+ }));
2149
+ }
2150
+ return n.lib = i, this.setShared({
2151
+ pkgName: e,
2152
+ loaded: true,
2153
+ from: o.options.name,
2154
+ lib: n.lib,
2155
+ shared: n
2156
+ }), n.lib;
2157
+ }
2158
+ throw new Error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_006, errorCodes.runtimeDescMap, {
2159
+ hostName: o.options.name,
2160
+ sharedPkgName: e
2161
+ }));
2162
+ }
2163
+ initShareScopeMap(e, r, o = {}) {
2164
+ const { host: n } = this;
2165
+ this.shareScopeMap[e] = r, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2166
+ shareScope: r,
2167
+ options: n.options,
2168
+ origin: n,
2169
+ scopeName: e,
2170
+ hostShareScopeMap: o.hostShareScopeMap
2171
+ });
2172
+ }
2173
+ setShared({ pkgName: e, shared: r, from: o, lib: n, loading: a, loaded: s, get: i }) {
2174
+ const { version: c, scope: l = "default", ...d } = r;
2175
+ (Array.isArray(l) ? l : [
2176
+ l
2177
+ ]).forEach((u) => {
2178
+ if (this.shareScopeMap[u] || (this.shareScopeMap[u] = {}), this.shareScopeMap[u][e] || (this.shareScopeMap[u][e] = {}), !this.shareScopeMap[u][e][c]) {
2179
+ this.shareScopeMap[u][e][c] = {
2180
+ version: c,
2181
+ scope: [
2182
+ u
2183
+ ],
2184
+ ...d,
2185
+ lib: n,
2186
+ loaded: s,
2187
+ loading: a
2188
+ }, i && (this.shareScopeMap[u][e][c].get = i);
2189
+ return;
2190
+ }
2191
+ const p = this.shareScopeMap[u][e][c];
2192
+ a && !p.loading && (p.loading = a), s && !p.loaded && (p.loaded = s), o && p.from !== o && (p.from = o);
2193
+ });
2194
+ }
2195
+ _setGlobalShareScopeMap(e) {
2196
+ const r = getGlobalShareScope(), o = e.id || e.name;
2197
+ o && !r[o] && (r[o] = this.shareScopeMap);
2198
+ }
2199
+ }
2200
+ class RemoteHandler {
2201
+ constructor(e) {
2202
+ this.hooks = new PluginSystem({
2203
+ beforeRegisterRemote: new SyncWaterfallHook("beforeRegisterRemote"),
2204
+ registerRemote: new SyncWaterfallHook("registerRemote"),
2205
+ beforeRequest: new AsyncWaterfallHook("beforeRequest"),
2206
+ onLoad: new AsyncHook("onLoad"),
2207
+ handlePreloadModule: new SyncHook("handlePreloadModule"),
2208
+ errorLoadRemote: new AsyncHook("errorLoadRemote"),
2209
+ beforePreloadRemote: new AsyncHook("beforePreloadRemote"),
2210
+ generatePreloadAssets: new AsyncHook("generatePreloadAssets"),
2211
+ afterPreloadRemote: new AsyncHook(),
2212
+ loadEntry: new AsyncHook()
2213
+ }), this.host = e, this.idToRemoteMap = {};
2214
+ }
2215
+ formatAndRegisterRemote(e, r) {
2216
+ return (r.remotes || []).reduce((n, a) => (this.registerRemote(a, n, {
2217
+ force: false
2218
+ }), n), e.remotes);
2219
+ }
2220
+ setIdToRemoteMap(e, r) {
2221
+ const { remote: o, expose: n } = r, { name: a, alias: s } = o;
2222
+ if (this.idToRemoteMap[e] = {
2223
+ name: o.name,
2224
+ expose: n
2225
+ }, s && e.startsWith(a)) {
2226
+ const i = e.replace(a, s);
2227
+ this.idToRemoteMap[i] = {
2228
+ name: o.name,
2229
+ expose: n
2230
+ };
2231
+ return;
2232
+ }
2233
+ if (s && e.startsWith(s)) {
2234
+ const i = e.replace(s, a);
2235
+ this.idToRemoteMap[i] = {
2236
+ name: o.name,
2237
+ expose: n
2238
+ };
2239
+ }
2240
+ }
2241
+ async loadRemote(e, r) {
2242
+ const { host: o } = this;
2243
+ try {
2244
+ const { loadFactory: n = true } = r || {
2245
+ loadFactory: true
2246
+ }, { module: a, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2247
+ id: e
2248
+ }), { pkgNameOrAlias: c, remote: l, expose: d, id: h, remoteSnapshot: u } = i, p = await a.get(h, d, r, u), _ = await this.hooks.lifecycle.onLoad.emit({
2249
+ id: h,
2250
+ pkgNameOrAlias: c,
2251
+ expose: d,
2252
+ exposeModule: n ? p : void 0,
2253
+ exposeModuleFactory: n ? void 0 : p,
2254
+ remote: l,
2255
+ options: s,
2256
+ moduleInstance: a,
2257
+ origin: o
2258
+ });
2259
+ return this.setIdToRemoteMap(e, i), typeof _ == "function" ? _ : p;
2260
+ } catch (n) {
2261
+ const { from: a = "runtime" } = r || {
2262
+ from: "runtime"
2263
+ }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
2264
+ id: e,
2265
+ error: n,
2266
+ from: a,
2267
+ lifecycle: "onLoad",
2268
+ origin: o
2269
+ });
2270
+ if (!s) throw n;
2271
+ return s;
2272
+ }
2273
+ }
2274
+ async preloadRemote(e) {
2275
+ const { host: r } = this;
2276
+ await this.hooks.lifecycle.beforePreloadRemote.emit({
2277
+ preloadOps: e,
2278
+ options: r.options,
2279
+ origin: r
2280
+ });
2281
+ const o = formatPreloadArgs(r.options.remotes, e);
2282
+ await Promise.all(o.map(async (n) => {
2283
+ const { remote: a } = n, s = getRemoteInfo(a), { globalSnapshot: i, remoteSnapshot: c } = await r.snapshotHandler.loadRemoteSnapshotInfo({
2284
+ moduleInfo: a
2285
+ }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
2286
+ origin: r,
2287
+ preloadOptions: n,
2288
+ remote: a,
2289
+ remoteInfo: s,
2290
+ globalSnapshot: i,
2291
+ remoteSnapshot: c
2292
+ });
2293
+ l && preloadAssets(s, r, l);
2294
+ }));
2295
+ }
2296
+ registerRemotes(e, r) {
2297
+ const { host: o } = this;
2298
+ e.forEach((n) => {
2299
+ this.registerRemote(n, o.options.remotes, {
2300
+ force: r == null ? void 0 : r.force
2301
+ });
2302
+ });
2303
+ }
2304
+ async getRemoteModuleAndOptions(e) {
2305
+ const { host: r } = this, { id: o } = e;
2306
+ let n;
2307
+ try {
2308
+ n = await this.hooks.lifecycle.beforeRequest.emit({
2309
+ id: o,
2310
+ options: r.options,
2311
+ origin: r
2312
+ });
2313
+ } catch (_) {
2314
+ if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
2315
+ id: o,
2316
+ options: r.options,
2317
+ origin: r,
2318
+ from: "runtime",
2319
+ error: _,
2320
+ lifecycle: "beforeRequest"
2321
+ }), !n) throw _;
2322
+ }
2323
+ const { id: a } = n, s = matchRemoteWithNameAndExpose(r.options.remotes, a);
2324
+ assert(s, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_004, errorCodes.runtimeDescMap, {
2325
+ hostName: r.options.name,
2326
+ requestId: a
2327
+ }));
2328
+ const { remote: i } = s, c = getRemoteInfo(i), l = await r.sharedHandler.hooks.lifecycle.afterResolve.emit({
2329
+ id: a,
2330
+ ...s,
2331
+ options: r.options,
2332
+ origin: r,
2333
+ remoteInfo: c
2334
+ }), { remote: d, expose: h } = l;
2335
+ assert(d && h, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2336
+ let u = r.moduleCache.get(d.name);
2337
+ const p = {
2338
+ host: r,
2339
+ remoteInfo: c
2340
+ };
2341
+ return u || (u = new Module(p), r.moduleCache.set(d.name, u)), {
2342
+ module: u,
2343
+ moduleOptions: p,
2344
+ remoteMatchInfo: l
2345
+ };
2346
+ }
2347
+ registerRemote(e, r, o) {
2348
+ const { host: n } = this, a = () => {
2349
+ if (e.alias) {
2350
+ const i = r.find((c) => {
2351
+ var _a;
2352
+ return e.alias && (c.name.startsWith(e.alias) || ((_a = c.alias) == null ? void 0 : _a.startsWith(e.alias)));
2353
+ });
2354
+ assert(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2355
+ }
2356
+ "entry" in e && sdk.isBrowserEnv() && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = DEFAULT_SCOPE), e.type || (e.type = DEFAULT_REMOTE_TYPE);
2357
+ };
2358
+ this.hooks.lifecycle.beforeRegisterRemote.emit({
2359
+ remote: e,
2360
+ origin: n
2361
+ });
2362
+ const s = r.find((i) => i.name === e.name);
2363
+ if (!s) a(), r.push(e), this.hooks.lifecycle.registerRemote.emit({
2364
+ remote: e,
2365
+ origin: n
2366
+ });
2367
+ else {
2368
+ const i = [
2369
+ `The remote "${e.name}" is already registered.`,
2370
+ "Please note that overriding it may cause unexpected errors."
2371
+ ];
2372
+ (o == null ? void 0 : o.force) && (this.removeRemote(s), a(), r.push(e), this.hooks.lifecycle.registerRemote.emit({
2373
+ remote: e,
2374
+ origin: n
2375
+ }), sdk.warn(i.join(" ")));
2376
+ }
2377
+ }
2378
+ removeRemote(e) {
2379
+ var _a;
2380
+ try {
2381
+ const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((s) => s.name === o);
2382
+ n !== -1 && r.options.remotes.splice(n, 1);
2383
+ const a = r.moduleCache.get(e.name);
2384
+ if (a) {
2385
+ const s = a.remoteInfo, i = s.entryGlobalName;
2386
+ CurrentGlobal[i] && (((_a = Object.getOwnPropertyDescriptor(CurrentGlobal, i)) == null ? void 0 : _a.configurable) ? delete CurrentGlobal[i] : CurrentGlobal[i] = void 0);
2387
+ const c = getRemoteEntryUniqueKey(a.remoteInfo);
2388
+ globalLoading[c] && delete globalLoading[c], r.snapshotHandler.manifestCache.delete(s.entry);
2389
+ let l = s.buildVersion ? sdk.composeKeyWithSeparator(s.name, s.buildVersion) : s.name;
2390
+ const d = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((u) => s.buildVersion ? u.options.id === l : u.name === l);
2391
+ if (d !== -1) {
2392
+ const u = CurrentGlobal.__FEDERATION__.__INSTANCES__[d];
2393
+ l = u.options.id || l;
2394
+ const p = getGlobalShareScope();
2395
+ let _ = true;
2396
+ const g = [];
2397
+ Object.keys(p).forEach((m) => {
2398
+ const y = p[m];
2399
+ y && Object.keys(y).forEach((E) => {
2400
+ const b = y[E];
2401
+ b && Object.keys(b).forEach((R) => {
2402
+ const S = b[R];
2403
+ S && Object.keys(S).forEach((M) => {
2404
+ const I = S[M];
2405
+ I && typeof I == "object" && I.from === s.name && (I.loaded || I.loading ? (I.useIn = I.useIn.filter((N) => N !== s.name), I.useIn.length ? _ = false : g.push([
2406
+ m,
2407
+ E,
2408
+ R,
2409
+ M
2410
+ ])) : g.push([
2411
+ m,
2412
+ E,
2413
+ R,
2414
+ M
2415
+ ]));
2416
+ });
2417
+ });
2418
+ });
2419
+ }), _ && (u.shareScopeMap = {}, delete p[l]), g.forEach(([m, y, E, b]) => {
2420
+ var _a2, _b, _c;
2421
+ (_c = (_b = (_a2 = p[m]) == null ? void 0 : _a2[y]) == null ? void 0 : _b[E]) == null ? true : delete _c[b];
2422
+ }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(d, 1);
2423
+ }
2424
+ const { hostGlobalSnapshot: h } = getGlobalRemoteInfo(e, r);
2425
+ if (h) {
2426
+ const u = h && "remotesInfo" in h && h.remotesInfo && getInfoWithoutType(h.remotesInfo, e.name).key;
2427
+ u && (delete h.remotesInfo[u], Global.__FEDERATION__.__MANIFEST_LOADING__[u] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[u]);
2428
+ }
2429
+ r.moduleCache.delete(e.name);
2430
+ }
2431
+ } catch (r) {
2432
+ logger.log("removeRemote fail: ", r);
2433
+ }
2434
+ }
2435
+ }
2436
+ const USE_SNAPSHOT = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;
2437
+ class ModuleFederation {
2438
+ constructor(e) {
2439
+ this.hooks = new PluginSystem({
2440
+ beforeInit: new SyncWaterfallHook("beforeInit"),
2441
+ init: new SyncHook(),
2442
+ beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
2443
+ initContainer: new AsyncWaterfallHook("initContainer")
2444
+ }), this.version = "0.21.6", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2445
+ getModuleInfo: new SyncHook(),
2446
+ createScript: new SyncHook(),
2447
+ createLink: new SyncHook(),
2448
+ fetch: new AsyncHook(),
2449
+ loadEntryError: new AsyncHook(),
2450
+ getModuleFactory: new AsyncHook()
2451
+ }), this.bridgeHook = new PluginSystem({
2452
+ beforeBridgeRender: new SyncHook(),
2453
+ afterBridgeRender: new SyncHook(),
2454
+ beforeBridgeDestroy: new SyncHook(),
2455
+ afterBridgeDestroy: new SyncHook()
2456
+ });
2457
+ const r = USE_SNAPSHOT ? [
2458
+ snapshotPlugin(),
2459
+ generatePreloadAssetsPlugin()
2460
+ ] : [], o = {
2461
+ id: getBuilderId$1(),
2462
+ name: e.name,
2463
+ plugins: r,
2464
+ remotes: [],
2465
+ shared: {},
2466
+ inBrowser: sdk.isBrowserEnv()
2467
+ };
2468
+ this.name = e.name, this.options = o, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
2469
+ ...o.plugins,
2470
+ ...e.plugins || []
2471
+ ]), this.options = this.formatOptions(o, e);
2472
+ }
2473
+ initOptions(e) {
2474
+ this.registerPlugins(e.plugins);
2475
+ const r = this.formatOptions(this.options, e);
2476
+ return this.options = r, r;
2477
+ }
2478
+ async loadShare(e, r) {
2479
+ return this.sharedHandler.loadShare(e, r);
2480
+ }
2481
+ loadShareSync(e, r) {
2482
+ return this.sharedHandler.loadShareSync(e, r);
2483
+ }
2484
+ initializeSharing(e = DEFAULT_SCOPE, r) {
2485
+ return this.sharedHandler.initializeSharing(e, r);
2486
+ }
2487
+ initRawContainer(e, r, o) {
2488
+ const n = getRemoteInfo({
2489
+ name: e,
2490
+ entry: r
2491
+ }), a = new Module({
2492
+ host: this,
2493
+ remoteInfo: n
2494
+ });
2495
+ return a.remoteEntryExports = o, this.moduleCache.set(e, a), a;
2496
+ }
2497
+ async loadRemote(e, r) {
2498
+ return this.remoteHandler.loadRemote(e, r);
2499
+ }
2500
+ async preloadRemote(e) {
2501
+ return this.remoteHandler.preloadRemote(e);
2502
+ }
2503
+ initShareScopeMap(e, r, o = {}) {
2504
+ this.sharedHandler.initShareScopeMap(e, r, o);
2505
+ }
2506
+ formatOptions(e, r) {
2507
+ const { shared: o } = formatShareConfigs(e, r), { userOptions: n, options: a } = this.hooks.lifecycle.beforeInit.emit({
2508
+ origin: this,
2509
+ userOptions: r,
2510
+ options: e,
2511
+ shareInfo: o
2512
+ }), s = this.remoteHandler.formatAndRegisterRemote(a, n), { shared: i } = this.sharedHandler.registerShared(a, n), c = [
2513
+ ...a.plugins
2514
+ ];
2515
+ n.plugins && n.plugins.forEach((d) => {
2516
+ c.includes(d) || c.push(d);
2517
+ });
2518
+ const l = {
2519
+ ...e,
2520
+ ...r,
2521
+ plugins: c,
2522
+ remotes: s,
2523
+ shared: i
2524
+ };
2525
+ return this.hooks.lifecycle.init.emit({
2526
+ origin: this,
2527
+ options: l
2528
+ }), l;
2529
+ }
2530
+ registerPlugins(e) {
2531
+ const r = registerPlugins(e, this);
2532
+ this.options.plugins = this.options.plugins.reduce((o, n) => (n && o && !o.find((a) => a.name === n.name) && o.push(n), o), r || []);
2533
+ }
2534
+ registerRemotes(e, r) {
2535
+ return this.remoteHandler.registerRemotes(e, r);
2536
+ }
2537
+ registerShared(e) {
2538
+ this.sharedHandler.registerShared(this.options, {
2539
+ ...this.options,
2540
+ shared: e
2541
+ });
2542
+ }
2543
+ }
2544
+ var index = Object.freeze({
2545
+ __proto__: null
2546
+ });
2547
+ index_cjs$2.loadScript = sdk.loadScript;
2548
+ index_cjs$2.loadScriptNode = sdk.loadScriptNode;
2549
+ index_cjs$2.CurrentGlobal = CurrentGlobal;
2550
+ index_cjs$2.Global = Global;
2551
+ index_cjs$2.Module = Module;
2552
+ index_cjs$2.ModuleFederation = ModuleFederation;
2553
+ index_cjs$2.addGlobalSnapshot = addGlobalSnapshot;
2554
+ index_cjs$2.assert = assert;
2555
+ index_cjs$2.getGlobalFederationConstructor = getGlobalFederationConstructor;
2556
+ index_cjs$2.getGlobalSnapshot = getGlobalSnapshot;
2557
+ index_cjs$2.getInfoWithoutType = getInfoWithoutType;
2558
+ index_cjs$2.getRegisteredShare = getRegisteredShare;
2559
+ index_cjs$2.getRemoteEntry = getRemoteEntry;
2560
+ index_cjs$2.getRemoteInfo = getRemoteInfo;
2561
+ index_cjs$2.helpers = helpers;
2562
+ index_cjs$2.isStaticResourcesEqual = isStaticResourcesEqual;
2563
+ index_cjs$2.matchRemoteWithNameAndExpose = matchRemoteWithNameAndExpose;
2564
+ index_cjs$2.registerGlobalPlugins = registerGlobalPlugins;
2565
+ index_cjs$2.resetFederationGlobalInfo = resetFederationGlobalInfo;
2566
+ index_cjs$2.safeWrapper = safeWrapper;
2567
+ index_cjs$2.satisfy = satisfy;
2568
+ index_cjs$2.setGlobalFederationConstructor = setGlobalFederationConstructor;
2569
+ index_cjs$2.setGlobalFederationInstance = setGlobalFederationInstance;
2570
+ index_cjs$2.types = index;
2571
+ var utils_cjs = {}, runtimeCore$1 = index_cjs$2;
2572
+ function getBuilderId() {
2573
+ return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
2574
+ }
2575
+ function getGlobalFederationInstance(t, e) {
2576
+ const r = getBuilderId();
2577
+ return runtimeCore$1.CurrentGlobal.__FEDERATION__.__INSTANCES__.find((o) => !!(r && o.options.id === r || o.options.name === t && !o.options.version && !e || o.options.name === t && e && o.options.version === e));
2578
+ }
2579
+ utils_cjs.getGlobalFederationInstance = getGlobalFederationInstance;
2580
+ var runtimeCore = index_cjs$2, utils = utils_cjs;
2581
+ function createInstance(t) {
2582
+ const e = runtimeCore.getGlobalFederationConstructor() || runtimeCore.ModuleFederation, r = new e(t);
2583
+ return runtimeCore.setGlobalFederationInstance(r), r;
2584
+ }
2585
+ let FederationInstance = null;
2586
+ function init$1(t) {
2587
+ const e = utils.getGlobalFederationInstance(t.name, t.version);
2588
+ return e ? (e.initOptions(t), FederationInstance || (FederationInstance = e), e) : (FederationInstance = createInstance(t), FederationInstance);
2589
+ }
2590
+ runtimeCore.setGlobalFederationConstructor(runtimeCore.ModuleFederation);
2591
+ runtimeCore.Module;
2592
+ runtimeCore.ModuleFederation;
2593
+ runtimeCore.getRemoteEntry;
2594
+ runtimeCore.getRemoteInfo;
2595
+ runtimeCore.loadScript;
2596
+ runtimeCore.loadScriptNode;
2597
+ runtimeCore.registerGlobalPlugins;
2598
+ var init_1 = init$1;
2599
+ const importMap = {
2600
+ react: async () => await __vitePreload(() => import("./assets/index-BEpFHtMA.js").then((e) => e.i), __vite__mapDeps([0,1]), import.meta.url),
2601
+ "react-dom": async () => await __vitePreload(() => import("./assets/index-DMBzzD-N.js").then(async (m) => {
2602
+ await m.__tla;
2603
+ return m;
2604
+ }).then((e) => e.i), __vite__mapDeps([2,1,3,4]), import.meta.url)
2605
+ }, usedShared = {
2606
+ react: {
2607
+ name: "react",
2608
+ version: "18.3.1",
2609
+ scope: [
2610
+ "default"
2611
+ ],
2612
+ loaded: false,
2613
+ from: "vis2CollectionWidget",
2614
+ async get() {
2615
+ usedShared.react.loaded = true;
2616
+ const { react: t } = importMap, r = {
2617
+ ...await t()
2618
+ };
2619
+ return Object.defineProperty(r, "__esModule", {
2620
+ value: true,
2621
+ enumerable: false
2622
+ }), function() {
2623
+ return r;
2624
+ };
2625
+ },
2626
+ shareConfig: {
2627
+ singleton: true,
2628
+ requiredVersion: "*"
2629
+ }
2630
+ },
2631
+ "react-dom": {
2632
+ name: "react-dom",
2633
+ version: "18.3.1",
2634
+ scope: [
2635
+ "default"
2636
+ ],
2637
+ loaded: false,
2638
+ from: "vis2CollectionWidget",
2639
+ async get() {
2640
+ usedShared["react-dom"].loaded = true;
2641
+ const { "react-dom": t } = importMap, r = {
2642
+ ...await t()
2643
+ };
2644
+ return Object.defineProperty(r, "__esModule", {
2645
+ value: true,
2646
+ enumerable: false
2647
+ }), function() {
2648
+ return r;
2649
+ };
2650
+ },
2651
+ shareConfig: {
2652
+ singleton: true,
2653
+ requiredVersion: "*"
2654
+ }
2655
+ }
2656
+ }, usedRemotes = [], initTokens = {}, shareScopeName = "default", mfName = "vis2CollectionWidget";
2657
+ init = async function(t = {}, e = []) {
2658
+ const r = init_1({
2659
+ name: mfName,
2660
+ remotes: usedRemotes,
2661
+ shared: usedShared,
2662
+ plugins: [],
2663
+ shareStrategy: "version-first"
2664
+ });
2665
+ var o = initTokens[shareScopeName];
2666
+ if (o || (o = initTokens[shareScopeName] = {
2667
+ from: mfName
2668
+ }), !(e.indexOf(o) >= 0)) {
2669
+ e.push(o), r.initShareScopeMap("default", t);
2670
+ try {
2671
+ await Promise.all(await r.initializeSharing("default", {
2672
+ strategy: "version-first",
2673
+ from: "build",
2674
+ initScope: e
2675
+ }));
2676
+ } catch (n) {
2677
+ console.error(n);
2678
+ }
2679
+ return vis2CollectionWidget__mf_v__runtimeInit__mf_v__.initResolve(r), r;
2680
+ }
2681
+ };
2682
+ getExposes = function(t) {
2683
+ if (!(t in exposesMap)) throw new Error(`Module ${t} does not exist in container.`);
2684
+ return exposesMap[t]().then((e) => () => e);
2685
+ };
2686
+ });
2687
+ export {
2688
+ __tla,
2689
+ getExposes as get,
2690
+ init
2691
+ };