@perses-dev/scatter-chart-plugin 0.7.0 → 0.8.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.
- package/__mf/css/async/759.9c79ef64.css +1 -0
- package/__mf/js/101.3314ba33.js +2 -0
- package/__mf/js/333.6a3b3c73.js +2 -0
- package/__mf/js/ScatterChart.86ae5555.js +5 -0
- package/__mf/js/async/109.f3e6d8b4.js +73 -0
- package/__mf/js/async/109.f3e6d8b4.js.LICENSE.txt +35 -0
- package/__mf/js/async/173.ab77c209.js +2 -0
- package/__mf/js/async/214.7983e65f.js +1 -0
- package/__mf/js/async/224.fc2a8424.js +1 -0
- package/__mf/js/async/238.16ecfee4.js +1 -0
- package/__mf/js/async/269.5bb64fce.js +2 -0
- package/__mf/js/async/288.3bee5f6d.js +7 -0
- package/__mf/js/async/{690.fec7e893.js.LICENSE.txt → 288.3bee5f6d.js.LICENSE.txt} +1 -19
- package/__mf/js/async/292.0026ffe2.js +1 -0
- package/__mf/js/async/356.7ea71e7e.js +147 -0
- package/__mf/js/async/356.7ea71e7e.js.LICENSE.txt +17 -0
- package/__mf/js/async/409.744b01b2.js +1 -0
- package/__mf/js/async/422.e34eaeff.js +1 -0
- package/__mf/js/async/488.064b892d.js +1 -0
- package/__mf/js/async/516.d0e99b34.js +2 -0
- package/__mf/js/async/580.d7eab327.js +2 -0
- package/__mf/js/async/651.4f472055.js +1 -0
- package/__mf/js/async/{770.da7255d0.js → 694.ea33534b.js} +1 -1
- package/__mf/js/async/738.580d645a.js +1 -0
- package/__mf/js/async/740.7c6f3f45.js +1 -0
- package/__mf/js/async/75.7a5ae496.js +1 -0
- package/__mf/js/async/770.f8131ccc.js +1 -0
- package/__mf/js/async/960.3781a1d1.js +2 -0
- package/__mf/js/async/964.dc115a62.js +2 -0
- package/__mf/js/async/981.6aa3d08a.js +2 -0
- package/__mf/js/async/981.6aa3d08a.js.LICENSE.txt +8 -0
- package/__mf/js/async/__federation_expose_ScatterChart.868aeff6.js +2 -0
- package/__mf/js/async/__federation_expose_ScatterChart.868aeff6.js.LICENSE.txt +9 -0
- package/__mf/js/async/lib-router.c387b50a.js +2 -0
- package/__mf/js/async/lib-router.c387b50a.js.LICENSE.txt +32 -0
- package/__mf/js/index.70f0e2e3.js +5 -0
- package/lib/ScatterChartPanel.d.ts +3 -10
- package/lib/ScatterChartPanel.d.ts.map +1 -1
- package/lib/ScatterChartPanel.js +7 -19
- package/lib/ScatterChartPanel.js.map +1 -1
- package/lib/Scatterplot.d.ts +3 -4
- package/lib/Scatterplot.d.ts.map +1 -1
- package/lib/Scatterplot.js +13 -4
- package/lib/Scatterplot.js.map +1 -1
- package/lib/cjs/ScatterChartPanel.js +7 -19
- package/lib/cjs/Scatterplot.js +13 -4
- package/lib/scatter-chart-model.d.ts +5 -0
- package/lib/scatter-chart-model.d.ts.map +1 -1
- package/lib/scatter-chart-model.js.map +1 -1
- package/mf-manifest.json +107 -46
- package/mf-stats.json +119 -46
- package/package.json +16 -5
- package/__mf/js/527.22e5486f.js +0 -2
- package/__mf/js/792.43788414.js +0 -6
- package/__mf/js/ScatterChart.41ec0a5a.js +0 -5
- package/__mf/js/async/150.4fc9e087.js +0 -2
- package/__mf/js/async/156.c11b1700.js +0 -1
- package/__mf/js/async/173.c19d3b98.js +0 -2
- package/__mf/js/async/564.e5b95c38.js +0 -2
- package/__mf/js/async/651.791f807e.js +0 -1
- package/__mf/js/async/690.fec7e893.js +0 -152
- package/__mf/js/async/694.903128f9.js +0 -1
- package/__mf/js/async/740.c78d3483.js +0 -1
- package/__mf/js/async/75.06e41df4.js +0 -1
- package/__mf/js/async/960.e791a996.js +0 -2
- package/__mf/js/async/964.34b88a18.js +0 -2
- package/__mf/js/async/__federation_expose_ScatterChart.ec1c47a4.js +0 -2
- package/__mf/js/index.46c0c48b.js +0 -1
- /package/__mf/css/async/{564.9c79ef64.css → 580.9c79ef64.css} +0 -0
- /package/__mf/js/{527.22e5486f.js.LICENSE.txt → 101.3314ba33.js.LICENSE.txt} +0 -0
- /package/__mf/js/{792.43788414.js.LICENSE.txt → 333.6a3b3c73.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{173.c19d3b98.js.LICENSE.txt → 173.ab77c209.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{564.e5b95c38.js.LICENSE.txt → 269.5bb64fce.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{150.4fc9e087.js.LICENSE.txt → 516.d0e99b34.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ScatterChart.ec1c47a4.js.LICENSE.txt → 580.d7eab327.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{960.e791a996.js.LICENSE.txt → 960.3781a1d1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{964.34b88a18.js.LICENSE.txt → 964.dc115a62.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(()=>{"use strict";var __webpack_modules__={51623:function(e,t){let r="RUNTIME-001",n="RUNTIME-002",o="RUNTIME-003",i="RUNTIME-004",a="RUNTIME-005",s="RUNTIME-006",l="RUNTIME-007",c="RUNTIME-008",u="RUNTIME-009",h="TYPE-001",f="BUILD-001",d="BUILD-002",p=e=>{let t=e.split("-")[0].toLowerCase();return`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t}/${e}`},m=(e,t,r,n)=>{let o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(p(e)),n&&o.push(`Original Error Message:
|
|
2
|
+
${n}`),o.join("\n")};function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let y={[r]:"Failed to get remoteEntry exports.",[n]:'The remote entry interface does not contain "init"',[o]:"Failed to get manifest.",[i]:"Failed to locate remote.",[a]:"Invalid loadShareSync function call from bundler runtime",[s]:"Invalid loadShareSync function call from runtime",[l]:"Failed to get remote snapshot.",[c]:"Failed to load script resources.",[u]:"Please call createInstance first."},_={[h]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},E={[f]:"Failed to find expose module.",[d]:"PublicPath is required in prod mode."},v=g({},y,_,E);t.BUILD_001=f,t.BUILD_002=d,t.RUNTIME_001=r,t.RUNTIME_002=n,t.RUNTIME_003=o,t.RUNTIME_004=i,t.RUNTIME_005=a,t.RUNTIME_006=s,t.RUNTIME_007=l,t.RUNTIME_008=c,t.RUNTIME_009=u,t.TYPE_001=h,t.buildDescMap=E,t.errorDescMap=v,t.getShortErrorMsg=m,t.runtimeDescMap=y,t.typeDescMap=_},45628:function(e,t,r){var n=r(13364),o=r(75365),i=r(51623);let a="[ Federation Runtime ]",s=o.createLogger(a);function l(e,t){e||c(t)}function c(e){if(e instanceof Error)throw e.message.startsWith(a)||(e.message=`${a}: ${e.message}`),e;throw Error(`${a}: ${e}`)}function u(e){e instanceof Error&&(e.message.startsWith(a)||(e.message=`${a}: ${e.message}`)),s.warn(e)}function h(e,t){return -1===e.findIndex(e=>e===t)&&e.push(t),e}function f(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function d(e){return void 0!==e.entry}function p(e){return!e.entry.includes(".json")}async function m(e,t){try{return await e()}catch(e){t||u(e);return}}function g(e){return e&&"object"==typeof e}let y=Object.prototype.toString;function _(e){return"[object Object]"===y.call(e)}function E(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function v(e){return Array.isArray(e)?e:[e]}function b(e){let t={url:"",type:"global",globalName:""};return o.isBrowserEnv()||o.isReactNativeEnv()?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}let S=(e,t)=>{let r;return r=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),r+=t},R="object"==typeof globalThis?globalThis:window,N=(()=>{try{return document.defaultView}catch(e){return R}})(),I=N;function $(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function M(e,t){return Object.hasOwnProperty.call(e,t)}M(R,"__GLOBAL_LOADING_REMOTE_ENTRY__")||$(R,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});let O=R.__GLOBAL_LOADING_REMOTE_ENTRY__;function T(e){var t,r,n,o,i,a,s,l,c,u,h,f;M(e,"__VMOK__")&&!M(e,"__FEDERATION__")&&$(e,"__FEDERATION__",e.__VMOK__),M(e,"__FEDERATION__")||($(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),$(e,"__VMOK__",e.__FEDERATION__)),null!=(s=(t=e.__FEDERATION__).__GLOBAL_PLUGIN__)||(t.__GLOBAL_PLUGIN__=[]),null!=(l=(r=e.__FEDERATION__).__INSTANCES__)||(r.__INSTANCES__=[]),null!=(c=(n=e.__FEDERATION__).moduleInfo)||(n.moduleInfo={}),null!=(u=(o=e.__FEDERATION__).__SHARE__)||(o.__SHARE__={}),null!=(h=(i=e.__FEDERATION__).__MANIFEST_LOADING__)||(i.__MANIFEST_LOADING__={}),null!=(f=(a=e.__FEDERATION__).__PRELOADED_MAP__)||(a.__PRELOADED_MAP__=new Map)}function A(){R.__FEDERATION__.__GLOBAL_PLUGIN__=[],R.__FEDERATION__.__INSTANCES__=[],R.__FEDERATION__.moduleInfo={},R.__FEDERATION__.__SHARE__={},R.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(O).forEach(e=>{delete O[e]})}function w(e){R.__FEDERATION__.__INSTANCES__.push(e)}function k(){return R.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.isDebugMode();t&&(R.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,R.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.19.1")}function D(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};for(let r of Object.keys(e)){let[n,o]=r.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}throw Error("key must be string")}T(R),T(N);let x=()=>N.__FEDERATION__.moduleInfo,L=(e,t)=>{let r=D(t,f(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){let{version:t}=e,r=f(n._object_without_properties_loose(e,["version"])),o=D(N.__FEDERATION__.moduleInfo,r).value;if((null==o?void 0:o.version)===t)return o}},F=e=>L(e,N.__FEDERATION__.moduleInfo),j=(e,t)=>{let r=f(e);return N.__FEDERATION__.moduleInfo[r]=t,N.__FEDERATION__.moduleInfo},H=e=>(N.__FEDERATION__.moduleInfo=n._extends({},N.__FEDERATION__.moduleInfo,e),()=>{for(let t of Object.keys(e))delete N.__FEDERATION__.moduleInfo[t]}),C=(e,t)=>{let r=t||`__FEDERATION_${e}:custom__`,n=R[r];return{remoteEntryKey:r,entryExports:n}},U=e=>{let{__GLOBAL_PLUGIN__:t}=N.__FEDERATION__;e.forEach(e=>{-1===t.findIndex(t=>t.name===e.name)?t.push(e):u(`The plugin ${e.name} has been registered.`)})},V=()=>N.__FEDERATION__.__GLOBAL_PLUGIN__,G=e=>R.__FEDERATION__.__PRELOADED_MAP__.get(e),q=e=>R.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),B="default",W="global",K="[0-9A-Za-z-]+",z=`(?:\\+(${K}(?:\\.${K})*))`,Y="0|[1-9]\\d*",X="[0-9]+",J="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Z=`(?:${X}|${J})`,Q=`(?:-?(${Z}(?:\\.${Z})*))`,ee=`(?:${Y}|${J})`,et=`(?:-(${ee}(?:\\.${ee})*))`,er=`${Y}|x|X|\\*`,en=`[v=\\s]*(${er})(?:\\.(${er})(?:\\.(${er})(?:${et})?${z}?)?)?`,eo=`^\\s*(${en})\\s+-\\s+(${en})\\s*$`,ei=`(${X})\\.(${X})\\.(${X})`,ea=`[v=\\s]*${ei}${Q}?${z}?`,es="((?:<|>)?=?)",el=`(\\s*)${es}\\s*(${ea}|${en})`,ec="(?:~>?)",eu=`(\\s*)${ec}\\s+`,eh="(?:\\^)",ef=`(\\s*)${eh}\\s+`,ed="(<|>)?=?\\s*\\*",ep=`^${eh}${en}$`,em=`(${Y})\\.(${Y})\\.(${Y})`,eg=`v?${em}${et}?${z}?`,ey=`^${ec}${en}$`,e_=`^${es}\\s*${en}$`,eE=`^${es}\\s*(${eg})$|^$`,ev="^\\s*>=\\s*0.0.0\\s*$";function eb(e){return new RegExp(e)}function eS(e){return!e||"x"===e.toLowerCase()||"*"===e}function eR(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>t.reduce((e,t)=>t(e),e)}function eN(e){return e.match(eb(eE))}function eI(e,t,r,n){let o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function e$(e){return e.replace(eb(eo),(e,t,r,n,o,i,a,s,l,c,u,h)=>(t=eS(r)?"":eS(n)?`>=${r}.0.0`:eS(o)?`>=${r}.${n}.0`:`>=${t}`,s=eS(l)?"":eS(c)?`<${Number(l)+1}.0.0-0`:eS(u)?`<${l}.${Number(c)+1}.0-0`:h?`<=${l}.${c}.${u}-${h}`:`<=${s}`,`${t} ${s}`.trim()))}function eM(e){return e.replace(eb(el),"$1$2$3")}function eO(e){return e.replace(eb(eu),"$1~")}function eT(e){return e.replace(eb(ef),"$1^")}function eA(e){return e.trim().split(/\s+/).map(e=>e.replace(eb(ep),(e,t,r,n,o)=>{if(eS(t))return"";if(eS(r))return`>=${t}.0.0 <${Number(t)+1}.0.0-0`;if(eS(n))if("0"===t)return`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`;else return`>=${t}.${r}.0 <${Number(t)+1}.0.0-0`;if(o)if("0"!==t)return`>=${t}.${r}.${n}-${o} <${Number(t)+1}.0.0-0`;else if("0"===r)return`>=${t}.${r}.${n}-${o} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`;if("0"===t)if("0"===r)return`>=${t}.${r}.${n} <${t}.${r}.${Number(n)+1}-0`;else return`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`;return`>=${t}.${r}.${n} <${Number(t)+1}.0.0-0`})).join(" ")}function ew(e){return e.trim().split(/\s+/).map(e=>e.replace(eb(ey),(e,t,r,n,o)=>eS(t)?"":eS(r)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:eS(n)?`>=${t}.${r}.0 <${t}.${Number(r)+1}.0-0`:o?`>=${t}.${r}.${n}-${o} <${t}.${Number(r)+1}.0-0`:`>=${t}.${r}.${n} <${t}.${Number(r)+1}.0-0`)).join(" ")}function ek(e){return e.split(/\s+/).map(e=>e.trim().replace(eb(e_),(e,t,r,n,o,i)=>{let a=eS(r),s=a||eS(n),l=s||eS(o);if("="===t&&l&&(t=""),i="",a)if(">"===t||"<"===t)return"<0.0.0-0";else return"*";return t&&l?(s&&(n=0),o=0,">"===t?(t=">=",s?(r=Number(r)+1,n=0):n=Number(n)+1,o=0):"<="===t&&(t="<",s?r=Number(r)+1:n=Number(n)+1),"<"===t&&(i="-0"),`${t+r}.${n}.${o}${i}`):s?`>=${r}.0.0${i} <${Number(r)+1}.0.0-0`:l?`>=${r}.${n}.0${i} <${r}.${Number(n)+1}.0-0`:e})).join(" ")}function eP(e){return e.trim().replace(eb(ed),"")}function eD(e){return e.trim().replace(eb(ev),"")}function ex(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function eL(e,t){let{preRelease:r}=e,{preRelease:n}=t;if(void 0===r&&n)return 1;if(r&&void 0===n)return -1;if(void 0===r&&void 0===n)return 0;for(let e=0,t=r.length;e<=t;e++){let t=r[e],o=n[e];if(t!==o){if(void 0===t&&void 0===o)return 0;if(!t)return 1;if(!o)return -1;return ex(t,o)}}return 0}function eF(e,t){return ex(e.major,t.major)||ex(e.minor,t.minor)||ex(e.patch,t.patch)||eL(e,t)}function ej(e,t){return e.version===t.version}function eH(e,t){switch(e.operator){case"":case"=":return ej(e,t);case">":return 0>eF(e,t);case">=":return ej(e,t)||0>eF(e,t);case"<":return eF(e,t)>0;case"<=":return ej(e,t)||eF(e,t)>0;case void 0:return!0;default:return!1}}function eC(e){return eR(eA,ew,ek,eP)(e)}function eU(e){return eR(e$,eM,eO,eT)(e.trim()).split(/\s+/).join(" ")}function eV(e,t){if(!e)return!1;let r=eN(e);if(!r)return!1;let[,n,,o,i,a,s]=r,l={operator:n,version:eI(o,i,a,s),major:o,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};for(let e of t.split("||")){let t=e.trim();if(!t||"*"===t||"x"===t)return!0;try{let e=eU(t);if(!e.trim())return!0;let r=e.split(" ").map(e=>eC(e)).join(" ");if(!r.trim())return!0;let n=r.split(/\s+/).map(e=>eD(e)).filter(Boolean);if(0===n.length)continue;let o=!0;for(let e of n){let t=eN(e);if(!t){o=!1;break}let[,r,,n,i,a,s]=t,c={operator:r,version:eI(n,i,a,s),major:n,minor:i,patch:a,preRelease:null==s?void 0:s.split(".")};if(!eH(c,l)){o=!1;break}}if(o)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function eG(e,t,r,o){var i,a,s;let l;return l="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{throw Error(`Can not get shared '${r}'!`)}),n._extends({deps:[],useIn:[],from:t,loading:null},e,{shareConfig:n._extends({requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1},e.shareConfig),get:l,loaded:null!=e&&!!e.loaded||"lib"in e||void 0,version:null!=(i=e.version)?i:"0",scope:Array.isArray(e.scope)?e.scope:[null!=(a=e.scope)?a:"default"],strategy:(null!=(s=e.strategy)?s:o)||"version-first"})}function eq(e,t){let r=t.shared||{},o=t.name,i=Object.keys(r).reduce((e,n)=>{let i=v(r[n]);return e[n]=e[n]||[],i.forEach(r=>{e[n].push(eG(r,o,n,t.shareStrategy))}),e},{}),a=n._extends({},e.shared);return Object.keys(i).forEach(e=>{a[e]?i[e].forEach(t=>{a[e].find(e=>e.version===t.version)||a[e].push(t)}):a[e]=i[e]}),{shared:a,shareInfos:i}}function eB(e,t){let r=e=>{if(!Number.isNaN(Number(e))){let t=e.split("."),r=e;for(let e=0;e<3-t.length;e++)r+=".0";return r}return e};return!!eV(r(e),`<=${r(t)}`)}let eW=(e,t)=>{let r=t||function(e,t){return eB(e,t)};return Object.keys(e).reduce((e,t)=>!e||r(e,t)||"0"===e?t:e,0)},eK=e=>!!e.loaded||"function"==typeof e.lib,ez=e=>!!e.loading;function eY(e,t,r){let n=e[t][r],o=function(e,t){return!eK(n[e])&&eB(e,t)};return eW(e[t][r],o)}function eX(e,t,r){let n=e[t][r],o=function(e,t){let r=e=>eK(e)||ez(e);if(r(n[t]))if(r(n[e]))return!!eB(e,t);else return!0;return!r(n[e])&&eB(e,t)};return eW(e[t][r],o)}function eJ(e){return"loaded-first"===e?eX:eY}function eZ(e,t,r,n){if(!e)return;let{shareConfig:o,scope:i=B,strategy:a}=r;for(let s of Array.isArray(i)?i:[i])if(o&&e[s]&&e[s][t]){let{requiredVersion:i}=o,l=eJ(a)(e,s,t),h=()=>{if(o.singleton){if("string"==typeof i&&!eV(l,i)){let n=`Version ${l} from ${l&&e[s][t][l].from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${i})`;o.strictVersion?c(n):u(n)}return e[s][t][l]}if(!1===i||"*"===i||eV(l,i))return e[s][t][l];for(let[r,n]of Object.entries(e[s][t]))if(eV(r,i))return n},f={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:I.__FEDERATION__,resolver:h};return(n.emit(f)||f).resolver()}}function eQ(){return I.__FEDERATION__.__SHARE__}function e0(e){var t;let{pkgName:r,extraOptions:n,shareInfos:o}=e,i=e=>{if(!e)return;let t={};e.forEach(e=>{t[e.version]=e});let r=function(e,r){return!eK(t[e])&&eB(e,r)},n=eW(t,r);return t[n]};return Object.assign({},(null!=(t=null==n?void 0:n.resolver)?t:i)(o[r]),null==n?void 0:n.customShareInfo)}function e1(){return"ScatterChart:0.8.1"}function e2(e,t){for(let r of e){let e=t.startsWith(r.name),n=t.replace(r.name,"");if(e){if(n.startsWith("/"))return{pkgNameOrAlias:r.name,expose:n=`.${n}`,remote:r};else if(""===n)return{pkgNameOrAlias:r.name,expose:".",remote:r}}let o=r.alias&&t.startsWith(r.alias),i=r.alias&&t.replace(r.alias,"");if(r.alias&&o){if(i&&i.startsWith("/"))return{pkgNameOrAlias:r.alias,expose:i=`.${i}`,remote:r};else if(""===i)return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function e5(e,t){for(let r of e)if(t===r.name||r.alias&&t===r.alias)return r}function e7(e,t){let r=V(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(t=>{(null==e?void 0:e.find(e=>e.name!==t.name))&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{n.forEach(r=>{r.applyPlugin(e,t)})}),e}let e8=".then(callbacks[0]).catch(callbacks[1])";async function e9(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?Function("callbacks",`import("${t}")${e8}`)([e,n]):import(t).then(e).catch(n)}catch(e){n(e)}})}async function e4(e){let{entry:t,remoteEntryExports:r}=e;return new Promise((e,n)=>{try{r?e(r):Function("callbacks",`System.import("${t}")${e8}`)([e,n])}catch(e){n(e)}})}function e3(e,t,r){let{remoteEntryKey:n,entryExports:o}=C(e,t);return l(o,i.getShortErrorMsg(i.RUNTIME_001,i.runtimeDescMap,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n})),o}async function e6(e){let{name:t,globalName:r,entry:n,loaderHook:a,getEntryUrl:s}=e,{entryExports:c}=C(t,r);if(c)return c;let u=s?s(n):n;return o.loadScript(u,{attrs:{},createScriptHook:(e,t)=>{let r=a.lifecycle.createScript.emit({url:e,attrs:t});if(r&&(r instanceof HTMLScriptElement||"script"in r||"timeout"in r))return r}}).then(()=>e3(t,r,n)).catch(e=>{throw l(void 0,i.getShortErrorMsg(i.RUNTIME_008,i.runtimeDescMap,{remoteName:t,resourceUrl:n})),e})}async function te(e){let{remoteInfo:t,remoteEntryExports:r,loaderHook:n,getEntryUrl:o}=e,{entry:i,entryGlobalName:a,name:s,type:l}=t;switch(l){case"esm":case"module":return e9({entry:i,remoteEntryExports:r});case"system":return e4({entry:i,remoteEntryExports:r});default:return e6({entry:i,globalName:a,name:s,loaderHook:n,getEntryUrl:o})}}async function tt(e){let{remoteInfo:t,loaderHook:r}=e,{entry:n,entryGlobalName:i,name:a,type:s}=t,{entryExports:l}=C(a,i);return l||o.loadScriptNode(n,{attrs:{name:a,globalName:i,type:s},loaderHook:{createScriptHook:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.lifecycle.createScript.emit({url:e,attrs:t});if(n&&"url"in n)return n}}}).then(()=>e3(a,i,n)).catch(e=>{throw e})}function tr(e){let{entry:t,name:r}=e;return o.composeKeyWithSeparator(r,t)}async function tn(e){let{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:i}=e,a=tr(n);if(r)return r;if(!O[a]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,s=t.loaderHook;O[a]=e.emit({loaderHook:s,remoteInfo:n,remoteEntryExports:r}).then(e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:o.isBrowserEnv())?te({remoteInfo:n,remoteEntryExports:r,loaderHook:s,getEntryUrl:i}):tt({remoteInfo:n,loaderHook:s})))}return O[a]}function to(e){return n._extends({},e,{entry:"entry"in e?e.entry:"",type:e.type||W,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||B})}function ti(e){return n._extends({resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1},e)}function ta(e,t){return t.map(t=>{let r=e5(e,t.nameOrAlias);return l(r,`Unable to preload ${t.nameOrAlias} as it is not included in ${!r&&o.safeToString({remoteInfo:r,remotes:e})}`),{remote:r,preloadConfig:ti(t)}})}function ts(e){return e?e.map(e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e):[]}function tl(e,t,r){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:s}=r;if(t.options.inBrowser){if(s.forEach(r=>{let{moduleInfo:n}=r,o=t.moduleCache.get(e.name);o?tn({origin:t,remoteInfo:n,remoteEntryExports:o.remoteEntryExports}):tn({origin:t,remoteInfo:n,remoteEntryExports:void 0})}),n){let e={rel:"preload",as:"style"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let e={rel:"stylesheet",type:"text/css"};i.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n},needDeleteLink:!1});i&&document.head.appendChild(n)})}if(n){let e={rel:"preload",as:"script"};a.forEach(r=>{let{link:n,needAttach:i}=o.createLink({url:r,cb:()=>{},attrs:e,createLinkHook:(e,r)=>{let n=t.loaderHook.lifecycle.createLink.emit({url:e,attrs:r});if(n instanceof HTMLLinkElement)return n}});i&&document.head.appendChild(n)})}else{let r={fetchpriority:"high",type:(null==e?void 0:e.type)==="module"?"module":"text/javascript"};a.forEach(e=>{let{script:n,needAttach:i}=o.createScript({url:e,cb:()=>{},attrs:r,createScriptHook:(e,r)=>{let n=t.loaderHook.lifecycle.createScript.emit({url:e,attrs:r});if(n instanceof HTMLScriptElement)return n},needDeleteScript:!0});i&&document.head.appendChild(n)})}}}var tc={global:{Global:I,nativeGlobal:N,resetFederationGlobalInfo:A,setGlobalFederationInstance:w,getGlobalFederationConstructor:k,setGlobalFederationConstructor:P,getInfoWithoutType:D,getGlobalSnapshot:x,getTargetSnapshotInfoByModuleInfo:L,getGlobalSnapshotInfoByModuleInfo:F,setGlobalSnapshotInfoByModuleInfo:j,addGlobalSnapshot:H,getRemoteEntryExports:C,registerGlobalPlugins:U,getGlobalHostPlugins:V,getPreloaded:G,setPreloaded:q},share:{getRegisteredShare:eZ,getGlobalShareScope:eQ},utils:{matchRemoteWithNameAndExpose:e2,preloadAssets:tl,getRemoteInfo:to}};let tu=class{async getEntry(){let e;if(this.remoteEntryExports)return this.remoteEntryExports;try{e=await tn({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports})}catch(r){let t=tr(this.remoteInfo);r instanceof Error&&r.message.includes(i.RUNTIME_008)&&(e=await this.host.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:tn,origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,globalLoading:O,uniqueKey:t}))}return l(e,`remoteEntryExports is undefined
|
|
3
|
+
${o.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,t,r,o){let a,{loadFactory:s=!0}=r||{loadFactory:!0},u=await this.getEntry();if(!this.inited){let t=this.host.shareScopeMap,r=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];r.length||r.push("default"),r.forEach(e=>{t[e]||(t[e]={})});let a=t[r[0]],s=[],l={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?r:this.remoteInfo.shareScope||"default"};Object.defineProperty(l,"shareScopeMap",{value:t,enumerable:!1});let h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:l,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});void 0===(null==u?void 0:u.init)&&c(i.getShortErrorMsg(i.RUNTIME_002,i.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await u.init(h.shareScope,h.initScope,h.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(n._extends({},h,{id:e,remoteSnapshot:o,remoteEntryExports:u}))}this.lib=u,this.inited=!0,(a=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:u,expose:t,moduleInfo:this.remoteInfo}))||(a=await u.get(t)),l(a,`${f(this.remoteInfo)} remote don't export ${t}.`);let h=S(this.remoteInfo.name,t),d=this.wraperFactory(a,h);return s?await d():d}wraperFactory(e,t){function r(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return e instanceof Promise?async()=>{let n=await e();return r(n,t),n}:()=>{let n=e();return r(n,t),n}}constructor({remoteInfo:e,host:t}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}};class th{on(e){"function"==typeof e&&this.listeners.add(e)}once(e){let t=this;this.on(function r(){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.remove(r),e.apply(null,o)})}emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.listeners.size>0&&this.listeners.forEach(t=>{e=t(...r)}),e}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}}class tf extends th{emit(){let e;for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=Array.from(this.listeners);if(o.length>0){let t=0,n=e=>!1!==e&&(t<o.length?Promise.resolve(o[t++].apply(null,r)).then(n):e);e=n()}return Promise.resolve(e)}}function td(e,t){if(!g(t))return!1;if(e!==t){for(let r in e)if(!(r in t))return!1}return!0}class tp extends th{emit(e){for(let t of(g(e)||c(`The data for the "${this.type}" hook should be an object.`),this.listeners))try{let r=t(e);if(td(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){u(e),this.onerror(e)}return e}constructor(e){super(),this.onerror=c,this.type=e}}class tm extends th{emit(e){g(e)||c(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let r=0,n=t=>(u(t),this.onerror(t),e),o=i=>{if(td(e,i)){if(e=i,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(e){return n(e)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}constructor(e){super(),this.onerror=c,this.type=e}}class tg{applyPlugin(e,t){l(_(e),"Plugin configuration is invalid.");let r=e.name;l(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,null==e.apply||e.apply.call(e,t),Object.keys(this.lifecycle).forEach(t=>{let r=e[t];r&&this.lifecycle[t].on(r)}))}removePlugin(e){l(e,"A name is required.");let t=this.registerPlugins[e];l(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{"name"!==e&&this.lifecycle[e].remove(t[e])})}constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}}function ty(e,t){let r=b(t);r.url||c(`The attribute remoteEntry of ${e.name} must not be undefined.`);let n=o.getResourceUrl(t,r.url);o.isBrowserEnv()||n.startsWith("http")||(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function t_(){return{name:"snapshot-plugin",async afterResolve(e){let{remote:t,pkgNameOrAlias:r,expose:o,origin:i,remoteInfo:a,id:s}=e;if(!d(t)||!p(t)){let{remoteSnapshot:l,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:s});ty(a,l);let u={remote:t,preloadConfig:{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:u,remoteInfo:a,remote:t,remoteSnapshot:l,globalSnapshot:c});return h&&tl(a,i,h,!1),n._extends({},e,{remoteSnapshot:l})}return e}}}function tE(e){let t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function tv(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5?arguments[5]:void 0,{value:s}=D(e,f(t)),l=a||s;if(l&&!o.isManifestProvider(l)&&(r(l,t,n),l.remotesInfo))for(let t of Object.keys(l.remotesInfo)){if(i[t])continue;i[t]=!0;let n=tE(t),o=l.remotesInfo[t];tv(e,{name:n.name,version:o.matchedVersion},r,!1,i,void 0)}}let tb=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function tS(e,t,r,n,i){let a=[],s=[],l=[],c=new Set,u=new Set,{options:h}=e,{preloadConfig:f}=t,{depsRemote:d}=f;if(tv(n,r,(t,r,n)=>{let i;if(n)i=f;else if(Array.isArray(d)){let e=d.find(e=>e.nameOrAlias===r.name||e.nameOrAlias===r.alias);if(!e)return;i=ti(e)}else{if(!0!==d)return;i=f}let c=o.getResourceUrl(t,b(t).url);c&&l.push({name:r.name,moduleInfo:{name:r.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:r.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let u="modules"in t?t.modules:[],h=ts(i.exposes);if(h.length&&"modules"in t){var p;u=null==t||null==(p=t.modules)?void 0:p.reduce((e,t)=>((null==h?void 0:h.indexOf(t.moduleName))!==-1&&e.push(t),e),[])}function m(e){let r=e.map(e=>o.getResourceUrl(t,e));return i.filter?r.filter(i.filter):r}if(u){let n=u.length;for(let o=0;o<n;o++){let n=u[o],l=`${r.name}/${n.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===n.moduleName?r.name:l,name:r.name,remoteSnapshot:t,preloadConfig:i,remote:r,origin:e}),G(l)||("all"===i.resourceCategory?(a.push(...m(n.assets.css.async)),a.push(...m(n.assets.css.sync)),s.push(...m(n.assets.js.async))):(i.resourceCategory="sync",a.push(...m(n.assets.css.sync))),s.push(...m(n.assets.js.sync)),q(l))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,r)=>{let n=eZ(e.shareScopeMap,r.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare);n&&"function"==typeof n.lib&&(r.assets.js.sync.forEach(e=>{c.add(e)}),r.assets.css.sync.forEach(e=>{u.add(e)}))};i.shared.forEach(e=>{var r;let n=null==(r=h.shared)?void 0:r[e.sharedName];if(!n)return;let o=e.version?n.find(t=>t.version===e.version):n;o&&v(o).forEach(r=>{t(r,e)})})}let p=s.filter(e=>!c.has(e)&&!tb("script",e));return{cssAssets:a.filter(e=>!u.has(e)&&!tb("link",e)),jsAssetsWithoutEntry:p,entryAssets:l.filter(e=>!tb("script",e.url))}}let tR=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){let{origin:t,preloadOptions:r,remoteInfo:n,remote:i,globalSnapshot:a,remoteSnapshot:s}=e;return o.isBrowserEnv()?d(i)&&p(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:n.name,entry:i.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(ty(n,s),tS(t,r,n,a,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function tN(e,t){let r=F({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&D(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:x(),remoteSnapshot:F({name:e.name,version:"version"in e?e.version:void 0})}}class tI{async loadRemoteSnapshotInfo(e){let t,r,{moduleInfo:a,id:s,expose:l}=e,{options:u}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:u,moduleInfo:a});let h=F({name:this.HostInstance.options.name,version:this.HostInstance.options.version});h||(h={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},H({[this.HostInstance.options.name]:h})),h&&"remotesInfo"in h&&!D(h.remotesInfo,a.name).value&&("version"in a||"entry"in a)&&(h.remotesInfo=n._extends({},null==h?void 0:h.remotesInfo,{[a.name]:{matchedVersion:"version"in a?a.version:a.entry}}));let{hostGlobalSnapshot:f,remoteSnapshot:p,globalSnapshot:m}=this.getGlobalRemoteInfo(a),{remoteSnapshot:g,globalSnapshot:y}=await this.hooks.lifecycle.loadSnapshot.emit({options:u,moduleInfo:a,hostGlobalSnapshot:f,remoteSnapshot:p,globalSnapshot:m});if(g)if(o.isManifestProvider(g)){let e=o.isBrowserEnv()?g.remoteEntry:g.ssrRemoteEntry||g.remoteEntry||"",i=await this.getManifestJson(e,a,{}),s=j(n._extends({},a,{entry:e}),i);t=i,r=s}else{let{remoteSnapshot:e}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:g,from:"global"});t=e,r=y}else if(d(a)){let e=await this.getManifestJson(a.entry,a,{}),n=j(a,e),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:a,remoteSnapshot:e,from:"global"});t=o,r=n}else c(i.getShortErrorMsg(i.RUNTIME_007,i.runtimeDescMap,{hostName:a.name,hostVersion:a.version,globalSnapshot:JSON.stringify(y)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:s,host:this.HostInstance,options:u,moduleInfo:a,remoteSnapshot:t}),{remoteSnapshot:t,globalSnapshot:r}}getGlobalRemoteInfo(e){return tN(e,this.HostInstance)}async getManifestJson(e,t,r){let n=async()=>{let r=this.manifestCache.get(e);if(r)return r;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{});t&&t instanceof Response||(t=await fetch(e,{})),r=await t.json()}catch(n){(r=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}))||(delete this.manifestLoading[e],c(i.getShortErrorMsg(i.RUNTIME_003,i.runtimeDescMap,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${n}`)))}return l(r.metaData&&r.exposes&&r.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,r),r},a=async()=>{let r=await n(),i=o.generateSnapshotFromManifest(r,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:r,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new tg({beforeLoadRemoteSnapshot:new tf("beforeLoadRemoteSnapshot"),loadSnapshot:new tm("loadGlobalSnapshot"),loadRemoteSnapshot:new tm("loadRemoteSnapshot"),afterLoadSnapshot:new tm("afterLoadSnapshot")}),this.manifestLoading=I.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}}class t${registerShared(e,t){let{shareInfos:r,shared:n}=eq(e,t);return Object.keys(r).forEach(e=>{r[e].forEach(r=>{!eZ(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)&&r&&r.lib&&this.setShared({pkgName:e,lib:r.lib,get:r.get,loaded:!0,shared:r,from:t.name})})}),{shareInfos:r,shared:n}}async loadShare(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&await Promise.all(n.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:n.strategy}))}));let{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});l(o,`Cannot find ${e} Share in the ${r.options.name}. Please ensure that the ${e} Share parameters have been injected`);let i=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),h(e.useIn,r.options.name)};if(i&&i.lib)return a(i),i.lib;if(i&&i.loading&&!i.loaded){let e=await i.loading;return i.loaded=!0,i.lib||(i.lib=e),a(i),e}if(i){let t=(async()=>{let e=await i.get();return a(i),i.loaded=!0,i.lib=e,e})();return this.setShared({pkgName:e,loaded:!1,shared:i,from:r.options.name,lib:null,loading:t}),t}{if(null==t?void 0:t.customShareInfo)return!1;let n=(async()=>{let t=await o.get();o.lib=t,o.loaded=!0,a(o);let r=eZ(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare);return r&&(r.lib=t,r.loaded=!0,r.from=o.from),t})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:n}),n}}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0,{host:r}=this,n=null==t?void 0:t.from,o=null==t?void 0:t.strategy,i=null==t?void 0:t.initScope,a=[];if("build"!==n){let{initTokens:t}=this;i||(i=[]);let r=t[e];if(r||(r=t[e]={from:this.host.name}),i.indexOf(r)>=0)return a;i.push(r)}let s=this.shareScopeMap,l=r.options.name;s[e]||(s[e]={});let c=s[e],u=(e,t)=>{var r;let{version:n,eager:o}=t;c[e]=c[e]||{};let i=c[e],a=i[n],s=!!(a&&(a.eager||(null==(r=a.shareConfig)?void 0:r.eager)));(!a||"loaded-first"!==a.strategy&&!a.loaded&&(!o!=!s?o:l>a.from))&&(i[n]=t)},h=t=>t&&t.init&&t.init(s[e],i),f=async e=>{let{module:t}=await r.remoteHandler.getRemoteModuleAndOptions({id:e});if(t.getEntry){let n;try{n=await t.getEntry()}catch(t){n=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:t,from:"runtime",lifecycle:"beforeLoadShare",origin:r})}t.inited||(await h(n),t.inited=!0)}};return Object.keys(r.options.shared).forEach(t=>{r.options.shared[t].forEach(r=>{r.scope.includes(e)&&u(t,r)})}),("version-first"===r.options.shareStrategy||"version-first"===o)&&r.options.remotes.forEach(t=>{t.shareScope===e&&a.push(f(t.name))}),a}loadShareSync(e,t){let{host:r}=this,n=e0({pkgName:e,extraOptions:t,shareInfos:r.options.shared});(null==n?void 0:n.scope)&&n.scope.forEach(e=>{this.initializeSharing(e,{strategy:n.strategy})});let o=eZ(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare),a=e=>{e.useIn||(e.useIn=[]),h(e.useIn,r.options.name)};if(o){if("function"==typeof o.lib)return a(o),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if("function"==typeof o.get){let t=o.get();if(!(t instanceof Promise))return a(o),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:t,shared:o}),t}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){let o=n.get();if(o instanceof Promise){let n=(null==t?void 0:t.from)==="build"?i.RUNTIME_005:i.RUNTIME_006;throw Error(i.getShortErrorMsg(n,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}return n.lib=o,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}throw Error(i.getShortErrorMsg(i.RUNTIME_006,i.runtimeDescMap,{hostName:r.options.name,sharedPkgName:e}))}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared(e){let{pkgName:t,shared:r,from:o,lib:i,loading:a,loaded:s,get:l}=e,{version:c,scope:u="default"}=r,h=n._object_without_properties_loose(r,["version","scope"]);(Array.isArray(u)?u:[u]).forEach(e=>{if(this.shareScopeMap[e]||(this.shareScopeMap[e]={}),this.shareScopeMap[e][t]||(this.shareScopeMap[e][t]={}),!this.shareScopeMap[e][t][c]){this.shareScopeMap[e][t][c]=n._extends({version:c,scope:["default"]},h,{lib:i,loaded:s,loading:a}),l&&(this.shareScopeMap[e][t][c].get=l);return}let r=this.shareScopeMap[e][t][c];a&&!r.loading&&(r.loading=a),s&&!r.loaded&&(r.loaded=s),o&&r.from!==o&&(r.from=o)})}_setGlobalShareScopeMap(e){let t=eQ(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}constructor(e){this.hooks=new tg({afterResolve:new tm("afterResolve"),beforeLoadShare:new tm("beforeLoadShare"),loadShare:new tf,resolveShare:new tp("resolveShare"),initContainerShareScopeMap:new tp("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}}class tM{formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:r,expose:n}=t,{name:o,alias:i}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},i&&e.startsWith(o)){let t=e.replace(o,i);this.idToRemoteMap[t]={name:r.name,expose:n};return}if(i&&e.startsWith(i)){let t=e.replace(i,o);this.idToRemoteMap[t]={name:r.name,expose:n}}}async loadRemote(e,t){let{host:r}=this;try{let{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:i,remoteMatchInfo:a}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:s,remote:l,expose:c,id:u,remoteSnapshot:h}=a,f=await o.get(u,c,t,h),d=await this.hooks.lifecycle.onLoad.emit({id:u,pkgNameOrAlias:s,expose:c,exposeModule:n?f:void 0,exposeModuleFactory:n?void 0:f,remote:l,options:i,moduleInstance:o,origin:r});if(this.setIdToRemoteMap(e,a),"function"==typeof d)return d;return f}catch(i){let{from:n="runtime"}=t||{from:"runtime"},o=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:n,lifecycle:"onLoad",origin:r});if(!o)throw i;return o}}async preloadRemote(e){let{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=ta(t.options.remotes,e);await Promise.all(r.map(async e=>{let{remote:r}=e,n=to(r),{globalSnapshot:o,remoteSnapshot:i}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:r}),a=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:e,remote:r,remoteInfo:n,globalSnapshot:o,remoteSnapshot:i});a&&tl(n,t,a)}))}registerRemotes(e,t){let{host:r}=this;e.forEach(e=>{this.registerRemote(e,r.options.remotes,{force:null==t?void 0:t.force})})}async getRemoteModuleAndOptions(e){let t,{host:r}=this,{id:o}=e;try{t=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:r.options,origin:r})}catch(e){if(!(t=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:r.options,origin:r,from:"runtime",error:e,lifecycle:"beforeRequest"})))throw e}let{id:a}=t,s=e2(r.options.remotes,a);l(s,i.getShortErrorMsg(i.RUNTIME_004,i.runtimeDescMap,{hostName:r.options.name,requestId:a}));let{remote:c}=s,u=to(c),h=await r.sharedHandler.hooks.lifecycle.afterResolve.emit(n._extends({id:a},s,{options:r.options,origin:r,remoteInfo:u})),{remote:f,expose:d}=h;l(f&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let p=r.moduleCache.get(f.name),m={host:r,remoteInfo:u};return p||(p=new tu(m),r.moduleCache.set(f.name,p)),{module:p,moduleOptions:m,remoteMatchInfo:h}}registerRemote(e,t,r){let{host:n}=this,i=()=>{if(e.alias){let r=t.find(t=>{var r;return e.alias&&(t.name.startsWith(e.alias)||(null==(r=t.alias)?void 0:r.startsWith(e.alias)))});l(!r,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${r&&r.name} name or alias`)}"entry"in e&&o.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=B),e.type||(e.type=W)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});let a=t.find(t=>t.name===e.name);if(a){let s=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];(null==r?void 0:r.force)&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),o.warn(s.join(" ")))}else i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n})}removeRemote(e){try{let{host:r}=this,{name:n}=e,i=r.options.remotes.findIndex(e=>e.name===n);-1!==i&&r.options.remotes.splice(i,1);let a=r.moduleCache.get(e.name);if(a){let n=a.remoteInfo,i=n.entryGlobalName;if(R[i]){var t;(null==(t=Object.getOwnPropertyDescriptor(R,i))?void 0:t.configurable)?delete R[i]:R[i]=void 0}let s=tr(a.remoteInfo);O[s]&&delete O[s],r.snapshotHandler.manifestCache.delete(n.entry);let l=n.buildVersion?o.composeKeyWithSeparator(n.name,n.buildVersion):n.name,c=R.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===l:e.name===l);if(-1!==c){let e=R.__FEDERATION__.__INSTANCES__[c];l=e.options.id||l;let t=eQ(),r=!0,o=[];Object.keys(t).forEach(e=>{let i=t[e];i&&Object.keys(i).forEach(t=>{let a=i[t];a&&Object.keys(a).forEach(i=>{let s=a[i];s&&Object.keys(s).forEach(a=>{let l=s[a];l&&"object"==typeof l&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:o.push([e,t,i,a])):o.push([e,t,i,a]))})})})}),r&&(e.shareScopeMap={},delete t[l]),o.forEach(e=>{var r,n,o;let[i,a,s,l]=e;null==(o=t[i])||null==(n=o[a])||null==(r=n[s])||delete r[l]}),R.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:u}=tN(e,r);if(u){let t=u&&"remotesInfo"in u&&u.remotesInfo&&D(u.remotesInfo,e.name).key;t&&(delete u.remotesInfo[t],I.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete I.__FEDERATION__.__MANIFEST_LOADING__[t])}r.moduleCache.delete(e.name)}}catch(e){s.log("removeRemote fail: ",e)}}constructor(e){this.hooks=new tg({beforeRegisterRemote:new tp("beforeRegisterRemote"),registerRemote:new tp("registerRemote"),beforeRequest:new tm("beforeRequest"),onLoad:new tf("onLoad"),handlePreloadModule:new th("handlePreloadModule"),errorLoadRemote:new tf("errorLoadRemote"),beforePreloadRemote:new tf("beforePreloadRemote"),generatePreloadAssets:new tf("generatePreloadAssets"),afterPreloadRemote:new tf,loadEntry:new tf}),this.host=e,this.idToRemoteMap={}}}let tO=!0;class tT{initOptions(e){this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0;return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){let n=new tu({host:this,remoteInfo:to({name:e,entry:t})});return n.remoteEntryExports=r,this.moduleCache.set(e,n),n}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){let{shared:r}=eq(e,t),{userOptions:o,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),a=this.remoteHandler.formatAndRegisterRemote(i,o),{shared:s}=this.sharedHandler.registerShared(i,o),l=[...i.plugins];o.plugins&&o.plugins.forEach(e=>{l.includes(e)||l.push(e)});let c=n._extends({},e,t,{plugins:l,remotes:a,shared:s});return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){let t=e7(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,n._extends({},this.options,{shared:e}))}constructor(e){this.hooks=new tg({beforeInit:new tp("beforeInit"),init:new th,beforeInitContainer:new tm("beforeInitContainer"),initContainer:new tm("initContainer")}),this.version="0.19.1",this.moduleCache=new Map,this.loaderHook=new tg({getModuleInfo:new th,createScript:new th,createLink:new th,fetch:new tf,loadEntryError:new tf,getModuleFactory:new tf}),this.bridgeHook=new tg({beforeBridgeRender:new th,afterBridgeRender:new th,beforeBridgeDestroy:new th,afterBridgeDestroy:new th});let t=tO?[t_(),tR()]:[],r={id:e1(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:o.isBrowserEnv()};this.name=e.name,this.options=r,this.snapshotHandler=new tI(this),this.sharedHandler=new t$(this),this.remoteHandler=new tM(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}}var tA=Object.freeze({__proto__:null});t.loadScript=o.loadScript,t.loadScriptNode=o.loadScriptNode,t.CurrentGlobal=R,t.Global=I,t.Module=tu,t.ModuleFederation=tT,t.addGlobalSnapshot=H,t.assert=l,t.getGlobalFederationConstructor=k,t.getGlobalSnapshot=x,t.getInfoWithoutType=D,t.getRegisteredShare=eZ,t.getRemoteEntry=tn,t.getRemoteInfo=to,t.helpers=tc,t.isStaticResourcesEqual=E,t.matchRemoteWithNameAndExpose=e2,t.registerGlobalPlugins=U,t.resetFederationGlobalInfo=A,t.safeWrapper=m,t.satisfy=eV,t.setGlobalFederationConstructor=P,t.setGlobalFederationInstance=w,t.types=tA},13364:function(e,t){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function n(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}t._extends=r,t._object_without_properties_loose=n},10121:function(e,t,r){var n=r(45628),o=r(51623),i=r(11765);function a(e){let t=new(n.getGlobalFederationConstructor()||n.ModuleFederation)(e);return n.setGlobalFederationInstance(t),t}let s=null;function l(e){let t=i.getGlobalFederationInstance(e.name,e.version);return t?(t.initOptions(e),s||(s=t),t):s=a(e)}function c(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadRemote.apply(s,t)}function u(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShare.apply(s,t)}function h(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.loadShareSync.apply(s,t)}function f(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.preloadRemote.apply(s,t)}function d(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerRemotes.apply(s,t)}function p(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerPlugins.apply(s,t)}function m(){return s}function g(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.assert(s,o.getShortErrorMsg(o.RUNTIME_009,o.runtimeDescMap)),s.registerShared.apply(s,t)}n.setGlobalFederationConstructor(n.ModuleFederation),t.Module=n.Module,t.ModuleFederation=n.ModuleFederation,t.getRemoteEntry=n.getRemoteEntry,t.getRemoteInfo=n.getRemoteInfo,t.loadScript=n.loadScript,t.loadScriptNode=n.loadScriptNode,t.registerGlobalPlugins=n.registerGlobalPlugins,t.createInstance=a,t.getInstance=m,t.init=l,t.loadRemote=c,t.loadShare=u,t.loadShareSync=h,t.preloadRemote=f,t.registerPlugins=p,t.registerRemotes=d,t.registerShared=g},11765:function(e,t,r){var n=r(45628);function o(){return"ScatterChart:0.8.1"}t.getGlobalFederationInstance=function(e,t){let r=o();return n.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!r&&n.options.id===r||n.options.name===e&&!n.options.version&&!t||n.options.name===e&&!!t&&n.options.version===t)}},75365:function(__unused_webpack_module,exports,__webpack_require__){var polyfills=__webpack_require__(58867);let FederationModuleManifest="federation-manifest.json",MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},NameTransformMap={[NameTransformSymbol.AT]:"scope_",[NameTransformSymbol.HYPHEN]:"_",[NameTransformSymbol.SLASH]:"__"},EncodedNameTransformMap={[NameTransformMap[NameTransformSymbol.AT]]:NameTransformSymbol.AT,[NameTransformMap[NameTransformSymbol.HYPHEN]]:NameTransformSymbol.HYPHEN,[NameTransformMap[NameTransformSymbol.SLASH]]:NameTransformSymbol.SLASH},SEPARATOR=":",ManifestFileName="mf-manifest.json",StatsFileName="mf-stats.json",MFModuleType={NPM:"npm",APP:"app"},MODULE_DEVTOOL_IDENTIFIER="__MF_DEVTOOLS_MODULE_INFO__",ENCODE_NAME_PREFIX="ENCODE_NAME_PREFIX",TEMP_DIR=".federation",MFPrefetchCommon={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ContainerPlugin=Object.freeze({__proto__:null}),ContainerReferencePlugin=Object.freeze({__proto__:null}),ModuleFederationPlugin=Object.freeze({__proto__:null}),SharePlugin=Object.freeze({__proto__:null});function isBrowserEnv(){return"undefined"!=typeof window&&void 0!==window.document}function isReactNativeEnv(){var e;return"undefined"!=typeof navigator&&(null==(e=navigator)?void 0:e.product)==="ReactNative"}function isBrowserDebug(){try{if(isBrowserEnv()&&window.localStorage)return!!localStorage.getItem(BROWSER_LOG_KEY)}catch(e){}return!1}function isDebugMode(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:!!("undefined"!=typeof FEDERATION_DEBUG&&FEDERATION_DEBUG)||isBrowserDebug()}let getProcessEnv=function(){return"undefined"!=typeof process&&process.env?process.env:{}},LOG_CATEGORY="[ Federation Runtime ]",parseEntry=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SEPARATOR,n=e.split(r),o="development"===getProcessEnv().NODE_ENV&&t,i="*",a=e=>e.startsWith("http")||e.includes(MANIFEST_EXT);if(n.length>=2){let[t,...s]=n;e.startsWith(r)&&(t=n.slice(0,2).join(r),s=[o||n.slice(2).join(r)]);let l=o||s.join(r);return a(l)?{name:t,entry:l}:{name:t,version:l||i}}if(1===n.length){let[e]=n;return o&&a(o)?{name:e,entry:o}:{name:e,version:o||i}}throw`Invalid entry value: ${e}`},composeKeyWithSeparator=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length?t.reduce((e,t)=>t?e?`${e}${SEPARATOR}${t}`:t:e,""):""},encodeName=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=r?".js":"";return`${t}${e.replace(RegExp(`${NameTransformSymbol.AT}`,"g"),NameTransformMap[NameTransformSymbol.AT]).replace(RegExp(`${NameTransformSymbol.HYPHEN}`,"g"),NameTransformMap[NameTransformSymbol.HYPHEN]).replace(RegExp(`${NameTransformSymbol.SLASH}`,"g"),NameTransformMap[NameTransformSymbol.SLASH])}${n}`}catch(e){throw e}},decodeName=function(e,t,r){try{let n=e;if(t){if(!n.startsWith(t))return n;n=n.replace(RegExp(t,"g"),"")}return n=n.replace(RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`,"g"),EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(e){throw e}},generateExposeFilename=(e,t)=>{if(!e)return"";let r=e;return"."===r&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),encodeName(r,"__federation_expose_",t)},generateShareFilename=(e,t)=>e?encodeName(e,"__federation_shared_",t):"",getResourceUrl=(e,t)=>{if("getPublicPath"in e){let r;return r=e.getPublicPath.startsWith("function")?Function("return "+e.getPublicPath)()():Function(e.getPublicPath)(),`${r}${t}`}return"publicPath"in e?!isBrowserEnv()&&!isReactNativeEnv()&&"ssrPublicPath"in e?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},assert=(e,t)=>{e||error(t)},error=e=>{throw Error(`${LOG_CATEGORY}: ${e}`)},warn=e=>{console.warn(`${LOG_CATEGORY}: ${e}`)};function safeToString(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}let VERSION_PATTERN_REGEXP=/^([\d^=v<>~]|[*xX]$)/;function isRequiredVersion(e){return VERSION_PATTERN_REGEXP.test(e)}let simpleJoinRemoteEntry=(e,t)=>{if(!e)return t;let r=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){let t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return r?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:t};function inferAutoPublicPath(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function generateSnapshotFromManifest(e){var t,r,n;let o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{remotes:a={},overrides:s={},version:l}=i,c=()=>"publicPath"in e.metaData?"auto"===e.metaData.publicPath&&l?inferAutoPublicPath(l):e.metaData.publicPath:e.metaData.getPublicPath,u=Object.keys(s),h={};Object.keys(a).length||(h=(null==(n=e.remotes)?void 0:n.reduce((e,t)=>{let r,n=t.federationContainerName;return r=u.includes(n)?s[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:r},e},{}))||{}),Object.keys(a).forEach(e=>h[e]={matchedVersion:u.includes(e)?s[e]:a[e]});let{remoteEntry:{path:f,name:d,type:p},types:m,buildInfo:{buildVersion:g},globalName:y,ssrRemoteEntry:_}=e.metaData,{exposes:E}=e,v={version:l||"",buildVersion:g,globalName:y,remoteEntry:simpleJoinRemoteEntry(f,d),remoteEntryType:p,remoteTypes:simpleJoinRemoteEntry(m.path,m.name),remoteTypesZip:m.zip||"",remoteTypesAPI:m.api||"",remotesInfo:h,shared:null==e?void 0:e.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version})),modules:null==E?void 0:E.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(null==(t=e.metaData)?void 0:t.prefetchInterface){let t=e.metaData.prefetchInterface;v=polyfills._({},v,{prefetchInterface:t})}if(null==(r=e.metaData)?void 0:r.prefetchEntry){let{path:t,name:r,type:n}=e.metaData.prefetchEntry;v=polyfills._({},v,{prefetchEntry:simpleJoinRemoteEntry(t,r),prefetchEntryType:n})}return o="publicPath"in e.metaData?polyfills._({},v,{publicPath:c(),ssrPublicPath:e.metaData.ssrPublicPath}):polyfills._({},v,{getPublicPath:c()}),_&&(o.ssrRemoteEntry=simpleJoinRemoteEntry(_.path,_.name),o.ssrRemoteEntryType=_.type||"commonjs-module"),o}function isManifestProvider(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(MANIFEST_EXT))}let PREFIX="[ Module Federation ]",Logger=class{setPrefix(e){this.prefix=e}log(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}success(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}info(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}ready(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];console.log(this.prefix,...t)}debug(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];isDebugMode()&&console.log(this.prefix,...t)}constructor(e){this.prefix=e}};function createLogger(e){return new Logger(e)}let logger=createLogger(PREFIX);async function safeWrapper(e,t){try{return await e()}catch(e){t||warn(e);return}}function isStaticResourcesEqual(e,t){let r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function createScript(e){let t,r=null,n=!0,o=2e4,i=document.getElementsByTagName("script");for(let t=0;t<i.length;t++){let o=i[t],a=o.getAttribute("src");if(a&&isStaticResourcesEqual(a,e.url)){r=o,n=!1;break}}if(!r){let t,n=e.attrs;(r=document.createElement("script")).type=(null==n?void 0:n.type)==="module"?"module":"text/javascript",e.createScriptHook&&((t=e.createScriptHook(e.url,e.attrs))instanceof HTMLScriptElement?r=t:"object"==typeof t&&("script"in t&&t.script&&(r=t.script),"timeout"in t&&t.timeout&&(o=t.timeout))),r.src||(r.src=e.url),n&&!t&&Object.keys(n).forEach(e=>{r&&("async"===e||"defer"===e?r[e]=n[e]:r.getAttribute(e)||r.setAttribute(e,n[e]))})}let a=async(n,o)=>{clearTimeout(t);let i=()=>{(null==o?void 0:o.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(o)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(r&&(r.onerror=null,r.onload=null,safeWrapper(()=>{let{needDeleteScript:t=!0}=e;t&&(null==r?void 0:r.parentNode)&&r.parentNode.removeChild(r)}),n&&"function"==typeof n)){let e=n(o);if(e instanceof Promise){let t=await e;return i(),t}return i(),e}i()};return r.onerror=a.bind(null,r.onerror),r.onload=a.bind(null,r.onload),t=setTimeout(()=>{a(null,Error(`Remote script "${e.url}" time-outed.`))},o),{script:r,needAttach:n}}function createLink(e){let t=null,r=!0,n=document.getElementsByTagName("link");for(let o=0;o<n.length;o++){let i=n[o],a=i.getAttribute("href"),s=i.getAttribute("rel");if(a&&isStaticResourcesEqual(a,e.url)&&s===e.attrs.rel){t=i,r=!1;break}}if(!t){let r;(t=document.createElement("link")).setAttribute("href",e.url);let n=e.attrs;e.createLinkHook&&(r=e.createLinkHook(e.url,n))instanceof HTMLLinkElement&&(t=r),n&&!r&&Object.keys(n).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,n[e])})}let o=(r,n)=>{let o=()=>{(null==n?void 0:n.type)==="error"?(null==e?void 0:e.onErrorCallback)&&(null==e||e.onErrorCallback(n)):(null==e?void 0:e.cb)&&(null==e||e.cb())};if(t&&(t.onerror=null,t.onload=null,safeWrapper(()=>{let{needDeleteLink:r=!0}=e;r&&(null==t?void 0:t.parentNode)&&t.parentNode.removeChild(t)}),r)){let e=r(n);return o(),e}o()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function loadScript(e,t){let{attrs:r={},createScriptHook:n}=t;return new Promise((t,o)=>{let{script:i,needAttach:a}=createScript({url:e,cb:t,onErrorCallback:o,attrs:polyfills._({fetchpriority:"high"},r),createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}let sdkImportCache=new Map;function importNodeModule(e){if(!e)throw Error("import specifier is required");if(sdkImportCache.has(e))return sdkImportCache.get(e);let t=Function("name","return import(name)")(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),sdkImportCache.delete(e),t});return sdkImportCache.set(e,t),t}let loadNodeFetch=async()=>{let e=await importNodeModule("node-fetch");return e.default||e},lazyLoaderHookFetch=async(e,t,r)=>{let n=(e,t)=>r.lifecycle.fetch.emit(e,t),o=await n(e,t||{});return o&&o instanceof Response?o:("undefined"==typeof fetch?await loadNodeFetch():fetch)(e,t||{})},createScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(url,cb,attrs,loaderHook)=>{let urlObj;if(null==loaderHook?void 0:loaderHook.createScriptHook){let hookResult=loaderHook.createScriptHook(url);hookResult&&"object"==typeof hookResult&&"url"in hookResult&&(url=hookResult.url)}try{urlObj=new URL(url)}catch(e){console.error("Error constructing URL:",e),cb(Error(`Invalid URL: ${e}`));return}let getFetch=async()=>(null==loaderHook?void 0:loaderHook.fetch)?(e,t)=>lazyLoaderHookFetch(e,t,loaderHook):"undefined"==typeof fetch?loadNodeFetch():fetch,handleScriptFetch=async(f,urlObj)=>{try{var _vm_constants,_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;let res=await f(urlObj.href),data=await res.text(),[path,vm]=await Promise.all([importNodeModule("path"),importNodeModule("vm")]),scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname),script=new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
|
|
4
|
+
})`,{filename,importModuleDynamically:null!=(_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER=null==(_vm_constants=vm.constants)?void 0:_vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER)?_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER:importNodeModule});script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename);let exportedInterface=scriptContext.module.exports||scriptContext.exports;if(attrs&&exportedInterface&&attrs.globalName){let container=exportedInterface[attrs.globalName]||exportedInterface;cb(void 0,container);return}cb(void 0,exportedInterface)}catch(e){cb(e instanceof Error?e:Error(`Script execution error: ${e}`))}};getFetch().then(async e=>{if((null==attrs?void 0:attrs.type)==="esm"||(null==attrs?void 0:attrs.type)==="module")return loadModule(urlObj.href,{fetch:e,vm:await importNodeModule("vm")}).then(async e=>{await e.evaluate(),cb(void 0,e.namespace)}).catch(e=>{cb(e instanceof Error?e:Error(`Script execution error: ${e}`))});handleScriptFetch(e,urlObj)}).catch(e=>{cb(e)})}:(e,t,r,n)=>{t(Error("createScriptNode is disabled in non-Node.js environment"))},loadScriptNode="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise((r,n)=>{createScriptNode(e,(e,o)=>{if(e)n(e);else{var i,a;let e=(null==t||null==(i=t.attrs)?void 0:i.globalName)||`__FEDERATION_${null==t||null==(a=t.attrs)?void 0:a.name}:custom__`;r(globalThis[e]=o)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error("loadScriptNode is disabled in non-Node.js environment")},esmModuleCache=new Map;async function loadModule(e,t){if(esmModuleCache.has(e))return esmModuleCache.get(e);let{fetch:r,vm:n}=t,o=await r(e),i=await o.text(),a=new n.SourceTextModule(i,{importModuleDynamically:async(r,n)=>loadModule(new URL(r,e).href,t)});return esmModuleCache.set(e,a),await a.link(async r=>{let n=new URL(r,e).href;return await loadModule(n,t)}),a}function normalizeOptions(e,t,r){return function(n){if(!1===n)return!1;if(void 0===n)if(e)return t;else return!1;if(!0===n)return t;if(n&&"object"==typeof n)return polyfills._({},t,n);throw Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}let createModuleFederationConfig=e=>e;exports.BROWSER_LOG_KEY=BROWSER_LOG_KEY,exports.ENCODE_NAME_PREFIX=ENCODE_NAME_PREFIX,exports.EncodedNameTransformMap=EncodedNameTransformMap,exports.FederationModuleManifest=FederationModuleManifest,exports.MANIFEST_EXT=MANIFEST_EXT,exports.MFModuleType=MFModuleType,exports.MFPrefetchCommon=MFPrefetchCommon,exports.MODULE_DEVTOOL_IDENTIFIER=MODULE_DEVTOOL_IDENTIFIER,exports.ManifestFileName=ManifestFileName,exports.NameTransformMap=NameTransformMap,exports.NameTransformSymbol=NameTransformSymbol,exports.SEPARATOR=SEPARATOR,exports.StatsFileName=StatsFileName,exports.TEMP_DIR=TEMP_DIR,exports.assert=assert,exports.composeKeyWithSeparator=composeKeyWithSeparator,exports.containerPlugin=ContainerPlugin,exports.containerReferencePlugin=ContainerReferencePlugin,exports.createLink=createLink,exports.createLogger=createLogger,exports.createModuleFederationConfig=createModuleFederationConfig,exports.createScript=createScript,exports.createScriptNode=createScriptNode,exports.decodeName=decodeName,exports.encodeName=encodeName,exports.error=error,exports.generateExposeFilename=generateExposeFilename,exports.generateShareFilename=generateShareFilename,exports.generateSnapshotFromManifest=generateSnapshotFromManifest,exports.getProcessEnv=getProcessEnv,exports.getResourceUrl=getResourceUrl,exports.inferAutoPublicPath=inferAutoPublicPath,exports.isBrowserEnv=isBrowserEnv,exports.isDebugMode=isDebugMode,exports.isManifestProvider=isManifestProvider,exports.isReactNativeEnv=isReactNativeEnv,exports.isRequiredVersion=isRequiredVersion,exports.isStaticResourcesEqual=isStaticResourcesEqual,exports.loadScript=loadScript,exports.loadScriptNode=loadScriptNode,exports.logger=logger,exports.moduleFederationPlugin=ModuleFederationPlugin,exports.normalizeOptions=normalizeOptions,exports.parseEntry=parseEntry,exports.safeToString=safeToString,exports.safeWrapper=safeWrapper,exports.sharePlugin=SharePlugin,exports.simpleJoinRemoteEntry=simpleJoinRemoteEntry,exports.warn=warn},58867:function(e,t){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}t._=r},2721:function(e,t){t.FEDERATION_SUPPORTED_TYPES=["script"]},51490:function(e,t,r){var n=r(10121),o=r(2721),i=r(75365);function a(e){e.S&&!e.federation.hasAttachShareScopeMap&&e.federation.instance&&e.federation.instance.shareScopeMap&&(e.S=e.federation.instance.shareScopeMap,e.federation.hasAttachShareScopeMap=!0)}function s(e){let{chunkId:t,promises:r,chunkMapping:n,idToExternalAndNameMapping:s,webpackRequire:l,idToRemoteMap:c}=e;a(l),l.o(n,t)&&n[t].forEach(e=>{let t=l.R;t||(t=[]);let n=s[e],a=c[e];if(t.indexOf(n)>=0)return;if(t.push(n),n.p)return r.push(n.p);let u=t=>{t||(t=Error("Container missing")),"string"==typeof t.message&&(t.message+=`
|
|
5
|
+
while loading "${n[1]}" from ${n[2]}`),l.m[e]=()=>{throw t},n.p=0},h=(e,t,o,i,a,s)=>{try{let l=e(t,o);if(!l||!l.then)return a(l,i,s);{let e=l.then(e=>a(e,i),u);if(!s)return e;r.push(n.p=e)}}catch(e){u(e)}},f=(e,t,r)=>e?h(l.I,n[0],0,e,d,r):u();var d=(e,r,o)=>h(r.get,n[1],t,0,p,o),p=t=>{n.p=1,l.m[e]=e=>{e.exports=t()}};let m=()=>{try{let e=i.decodeName(a[0].name,i.ENCODE_NAME_PREFIX)+n[1].slice(1),t=l.federation.instance,r=()=>l.federation.instance.loadRemote(e,{loadFactory:!1,from:"build"});if("version-first"===t.options.shareStrategy)return Promise.all(t.sharedHandler.initializeSharing(n[0])).then(()=>r());return r()}catch(e){u(e)}};1===a.length&&o.FEDERATION_SUPPORTED_TYPES.includes(a[0].externalType)&&a[0].name?h(m,n[2],0,0,p,1):h(l,n[2],0,0,f,1)})}function l(e){let{chunkId:t,promises:r,chunkMapping:n,installedModules:o,moduleToHandlerMapping:i,webpackRequire:s}=e;a(s),s.o(n,t)&&n[t].forEach(e=>{if(s.o(o,e))return r.push(o[e]);let t=t=>{o[e]=0,s.m[e]=r=>{var n;delete s.c[e];let o=t(),{shareInfo:a}=i[e];if((null==a||null==(n=a.shareConfig)?void 0:n.layer)&&o&&"object"==typeof o)try{o.hasOwnProperty("layer")&&void 0!==o.layer||(o.layer=a.shareConfig.layer)}catch(e){}r.exports=o}},n=t=>{delete o[e],s.m[e]=r=>{throw delete s.c[e],t}};try{let a=s.federation.instance;if(!a)throw Error("Federation instance not found!");let{shareKey:l,getter:c,shareInfo:u}=i[e],h=a.loadShare(l,{customShareInfo:u}).then(e=>!1===e?c():e);h.then?r.push(o[e]=h.then(t).catch(n)):t(h)}catch(e){n(e)}})}function c(e){let{shareScopeName:t,webpackRequire:r,initPromises:n,initTokens:i,initScope:s}=e,l=Array.isArray(t)?t:[t];var c=[],u=function(e){s||(s=[]);let l=r.federation.instance;var c=i[e];if(c||(c=i[e]={from:l.name}),s.indexOf(c)>=0)return;s.push(c);let u=n[e];if(u)return u;var h=e=>"undefined"!=typeof console&&console.warn&&console.warn(e),f=n=>{var o=e=>h("Initialization of sharing external failed: "+e);try{var i=r(n);if(!i)return;var a=n=>n&&n.init&&n.init(r.S[e],s,{shareScopeMap:r.S||{},shareScopeKeys:t});if(i.then)return d.push(i.then(a,o));var l=a(i);if(l&&"boolean"!=typeof l&&l.then)return d.push(l.catch(o))}catch(e){o(e)}};let d=l.initializeSharing(e,{strategy:l.options.shareStrategy,initScope:s,from:"build"});a(r);let p=r.federation.bundlerRuntimeOptions.remotes;return(p&&Object.keys(p.idToRemoteMap).forEach(e=>{let t=p.idToRemoteMap[e],r=p.idToExternalAndNameMapping[e][2];if(t.length>1)f(r);else if(1===t.length){let e=t[0];o.FEDERATION_SUPPORTED_TYPES.includes(e.externalType)||f(r)}}),d.length)?n[e]=Promise.all(d).then(()=>n[e]=!0):n[e]=!0};return l.forEach(e=>{c.push(u(e))}),Promise.all(c).then(()=>!0)}function u(e){let{moduleId:t,moduleToHandlerMapping:r,webpackRequire:n}=e,o=n.federation.instance;if(!o)throw Error("Federation instance not found!");let{shareKey:i,shareInfo:a}=r[t];try{return o.loadShareSync(i,{customShareInfo:a})}catch(e){throw console.error('loadShareSync failed! The function should not be called unless you set "eager:true". If you do not set it, and encounter this issue, you can check whether an async boundary is implemented.'),console.error("The original error message is as follows: "),e}}function h(e){let{moduleToHandlerMapping:t,webpackRequire:r,installedModules:n,initialConsumes:o}=e;o.forEach(e=>{r.m[e]=o=>{var i;n[e]=0,delete r.c[e];let a=u({moduleId:e,moduleToHandlerMapping:t,webpackRequire:r});if("function"!=typeof a)throw Error(`Shared module is not available for eager consumption: ${e}`);let s=a(),{shareInfo:l}=t[e];if((null==l||null==(i=l.shareConfig)?void 0:i.layer)&&s&&"object"==typeof s)try{s.hasOwnProperty("layer")&&void 0!==s.layer||(s.layer=l.shareConfig.layer)}catch(e){}o.exports=s}})}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function d(e){let{webpackRequire:t,shareScope:r,initScope:n,shareScopeKey:o,remoteEntryInitOptions:i}=e;if(!t.S||!t.federation||!t.federation.instance||!t.federation.initOptions)return;let a=t.federation.instance;a.initOptions(f({name:t.federation.initOptions.name,remotes:[]},i));let s=null==i?void 0:i.shareScopeKeys,l=null==i?void 0:i.shareScopeMap;if(o&&"string"!=typeof o)o.forEach(e=>{if(!s||!l)return void a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}});l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})});else{let e=o||"default";Array.isArray(s)?s.forEach(e=>{l[e]||(l[e]={});let t=l[e];a.initShareScopeMap(e,t,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}):a.initShareScopeMap(e,r,{hostShareScopeMap:(null==i?void 0:i.shareScopeMap)||{}})}return(t.federation.attachShareScopeMap&&t.federation.attachShareScopeMap(t),"function"==typeof t.federation.prefetch&&t.federation.prefetch(),Array.isArray(o))?t.federation.initOptions.shared?t.I(o,n):Promise.all(o.map(e=>t.I(e,n))).then(()=>!0):t.I(o||"default",n)}e.exports={runtime:function(e){var t=Object.create(null);if(e)for(var r in e)t[r]=e[r];return t.default=e,Object.freeze(t)}(n),instance:void 0,initOptions:void 0,bundlerRuntime:{remotes:s,consumes:l,I:c,S:{},installInitialConsumes:h,initContainerEntry:d},attachShareScopeMap:a,bundlerRuntimeOptions:{}}},82594:function(e,t,r){r(24246),r(54538),r(64010);var n=r(36232),o=r(8890),i=r(99635),a=r(48906),s=r(27806),l=r(65201),c=r(23709),u=r(67745),h=r(50378);r(87570),(0,n.D)([i.N,a.N,s.N,o.N,l.N,c.N,u.N,h.N]),new Intl.DateTimeFormat(void 0,{dateStyle:"long",timeStyle:"medium"}).format},98798:function(e,t,r){var n,o,i,a,s,l,c,u,h,f,d,p,m=r(51490),g=r.n(m);let y=[],_={},E="ScatterChart",v="version-first";if((r.initializeSharingData||r.initializeExposesData)&&r.federation){let e=(e,t,r)=>{e&&e[t]&&(e[t]=r)},t=(e,t,r)=>{var n,o,i,a,s,l;let c=r();Array.isArray(c)?(null!=(i=(n=e)[o=t])||(n[o]=[]),e[t].push(...c)):"object"==typeof c&&null!==c&&(null!=(l=(a=e)[s=t])||(a[s]={}),Object.assign(e[t],c))},m=(e,t,r)=>{var n,o,i;null!=(i=(n=e)[o=t])||(n[o]=r())},b=null!=(u=null==(n=r.remotesLoadingData)?void 0:n.chunkMapping)?u:{},S=null!=(h=null==(o=r.remotesLoadingData)?void 0:o.moduleIdToRemoteDataMapping)?h:{},R=null!=(f=null==(i=r.initializeSharingData)?void 0:i.scopeToSharingDataMapping)?f:{},N=null!=(d=null==(a=r.consumesLoadingData)?void 0:a.chunkMapping)?d:{},I=null!=(p=null==(s=r.consumesLoadingData)?void 0:s.moduleIdToConsumeDataMapping)?p:{},$={},M=[],O={},T=null==(l=r.initializeExposesData)?void 0:l.shareScope;for(let e in g())r.federation[e]=g()[e];m(r.federation,"consumesLoadingModuleToHandlerMapping",()=>{let e={};for(let[t,r]of Object.entries(I))e[t]={getter:r.fallback,shareInfo:{shareConfig:{fixedDependencies:!1,requiredVersion:r.requiredVersion,strictVersion:r.strictVersion,singleton:r.singleton,eager:r.eager},scope:[r.shareScope]},shareKey:r.shareKey};return e}),m(r.federation,"initOptions",()=>({})),m(r.federation.initOptions,"name",()=>E),m(r.federation.initOptions,"shareStrategy",()=>v),m(r.federation.initOptions,"shared",()=>{let e={};for(let[t,r]of Object.entries(R))for(let n of r)if("object"==typeof n&&null!==n){let{name:r,version:o,factory:i,eager:a,singleton:s,requiredVersion:l,strictVersion:c}=n,u={},h=function(e){return void 0!==e};h(s)&&(u.singleton=s),h(l)&&(u.requiredVersion=l),h(a)&&(u.eager=a),h(c)&&(u.strictVersion=c);let f={version:o,scope:[t],shareConfig:u,get:i};e[r]?e[r].push(f):e[r]=[f]}return e}),t(r.federation.initOptions,"remotes",()=>Object.values(_).flat().filter(e=>"script"===e.externalType)),t(r.federation.initOptions,"plugins",()=>y),m(r.federation,"bundlerRuntimeOptions",()=>({})),m(r.federation.bundlerRuntimeOptions,"remotes",()=>({})),m(r.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>b),m(r.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{let e={};for(let[t,r]of Object.entries(S))e[t]=[r.shareScope,r.name,r.externalModuleId,r.remoteName];return e}),m(r.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>r),t(r.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{let e={};for(let[t,r]of Object.entries(S)){let n=_[r.remoteName];n&&(e[t]=n)}return e}),e(r,"S",r.federation.bundlerRuntime.S),r.federation.attachShareScopeMap&&r.federation.attachShareScopeMap(r),e(r.f,"remotes",(e,t)=>r.federation.bundlerRuntime.remotes({chunkId:e,promises:t,chunkMapping:b,idToExternalAndNameMapping:r.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:r.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:r})),e(r.f,"consumes",(e,t)=>r.federation.bundlerRuntime.consumes({chunkId:e,promises:t,chunkMapping:N,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping,installedModules:$,webpackRequire:r})),e(r,"I",(e,t)=>r.federation.bundlerRuntime.I({shareScopeName:e,initScope:t,initPromises:M,initTokens:O,webpackRequire:r})),e(r,"initContainer",(e,t,n)=>r.federation.bundlerRuntime.initContainerEntry({shareScope:e,initScope:t,remoteEntryInitOptions:n,shareScopeKey:T,webpackRequire:r})),e(r,"getContainer",(e,t)=>{var n=r.initializeExposesData.moduleMap;return r.R=t,t=Object.prototype.hasOwnProperty.call(n,e)?n[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,t}),r.federation.instance=r.federation.runtime.init(r.federation.initOptions),(null==(c=r.consumesLoadingData)?void 0:c.initialConsumes)&&r.federation.bundlerRuntime.installInitialConsumes({webpackRequire:r,installedModules:$,initialConsumes:r.consumesLoadingData.initialConsumes,moduleToHandlerMapping:r.federation.consumesLoadingModuleToHandlerMapping})}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.c=__webpack_module_cache__,__webpack_require__.x=()=>{var e=__webpack_require__.O(void 0,["101","333","677"],function(){return __webpack_require__(82594)});return __webpack_require__.O(e)},(()=>{__webpack_require__.federation||(__webpack_require__.federation={chunkMatcher:function(e){return!/^(157|250|312|341|494|677|759|910)$/.test(e)},rootOutputDir:"../../"})})(),(()=>{__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{var e=__webpack_require__.x,t=!1;__webpack_require__.x=function(){if(t||(t=!0,__webpack_require__(98798)),"function"==typeof e)return e();console.warn("[MF] Invalid prevStartup")}})(),(()=>{__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,r)=>(__webpack_require__.f[r](e,t),t),[]))})(),(()=>{__webpack_require__.u=e=>"__mf/js/async/"+("118"===e?"lib-router":e)+"."+({109:"f3e6d8b4",118:"c387b50a",173:"ab77c209",214:"7983e65f",224:"fc2a8424",238:"16ecfee4",269:"5bb64fce",288:"3bee5f6d",292:"0026ffe2",356:"7ea71e7e",409:"744b01b2",422:"e34eaeff",488:"064b892d",516:"d0e99b34",580:"d7eab327",651:"4f472055",694:"ea33534b",738:"580d645a",740:"7c6f3f45",75:"7a5ae496",770:"f8131ccc",960:"3781a1d1",964:"dc115a62",981:"6aa3d08a"})[e]+".js"})(),(()=>{__webpack_require__.miniCssF=e=>"__mf/css/async/"+e+"."+({341:"9c79ef64",580:"9c79ef64",759:"9c79ef64"})[e]+".css"})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="ScatterChart:";__webpack_require__.l=function(r,n,o,i){if(e[r])return void e[r].push(n);if(void 0!==o)for(var a,s,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==r||u.getAttribute("data-webpack")==t+o){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.setAttribute("data-webpack",t+o),a.src=r),e[r]=[n];var h=function(t,n){a.onerror=a.onload=null,clearTimeout(f);var o=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}})(),(()=>{__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{__webpack_require__.nc=void 0})(),(()=>{var e=[];__webpack_require__.O=(t,r,n,o)=>{if(r){o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,n,o];return}for(var a=1/0,i=0;i<e.length;i++){for(var[r,n,o]=e[i],s=!0,l=0;l<r.length;l++)(!1&o||a>=o)&&Object.keys(__webpack_require__.O).every(e=>__webpack_require__.O[e](r[l]))?r.splice(l--,1):(s=!1,o<a&&(a=o));if(s){e.splice(i--,1);var c=n();void 0!==c&&(t=c)}}return t}})(),(()=>{__webpack_require__.p="/plugins/ScatterChart/"})(),(()=>{__webpack_require__.S={},__webpack_require__.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("960"),__webpack_require__.e("677"),__webpack_require__.e("651")]).then(()=>()=>__webpack_require__(96434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([__webpack_require__.e("677"),__webpack_require__.e("157"),__webpack_require__.e("694")]).then(()=>()=>__webpack_require__(51958)),eager:0,singleton:1},{name:"@hookform/resolvers",version:"3.10.0",factory:()=>Promise.all([__webpack_require__.e("292"),__webpack_require__.e("677"),__webpack_require__.e("214")]).then(()=>()=>__webpack_require__(81228)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.52.0",factory:()=>Promise.all([__webpack_require__.e("101"),__webpack_require__.e("516"),__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("292"),__webpack_require__.e("356"),__webpack_require__.e("422"),__webpack_require__.e("288"),__webpack_require__.e("677"),__webpack_require__.e("910"),__webpack_require__.e("157"),__webpack_require__.e("312"),__webpack_require__.e("580")]).then(()=>()=>__webpack_require__(68003)),eager:0,singleton:1},{name:"@perses-dev/plugin-system",version:"0.52.0",factory:()=>Promise.all([__webpack_require__.e("118"),__webpack_require__.e("516"),__webpack_require__.e("292"),__webpack_require__.e("356"),__webpack_require__.e("109"),__webpack_require__.e("677"),__webpack_require__.e("910"),__webpack_require__.e("157"),__webpack_require__.e("312"),__webpack_require__.e("250"),__webpack_require__.e("269")]).then(()=>()=>__webpack_require__(82323)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657)),eager:0,singleton:1},{name:"echarts",version:"5.5.0",factory:()=>Promise.all([__webpack_require__.e("101"),__webpack_require__.e("422"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([__webpack_require__.e("173"),__webpack_require__.e("677")]).then(()=>()=>__webpack_require__(31542)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react",version:"18.3.1",factory:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"ScatterChart"},__webpack_require__.I=__webpack_require__.I||function(){throw Error("should have __webpack_require__.I")}})(),(()=>{__webpack_require__.consumesLoadingData={chunkMapping:{157:["72116"],677:["54538"],980:["64010","87570"],910:["93098"],312:["6085","45913","4665","20461"],494:["57871"],250:["57751","55922","30156","84275","74614","27901","59862"]},moduleIdToConsumeDataMapping:{87570:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"^0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("118"),__webpack_require__.e("516"),__webpack_require__.e("292"),__webpack_require__.e("356"),__webpack_require__.e("109"),__webpack_require__.e("910"),__webpack_require__.e("157"),__webpack_require__.e("312"),__webpack_require__.e("250"),__webpack_require__.e("488")]).then(()=>()=>__webpack_require__(82323))},20461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},74614:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},59862:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},54538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("964").then(()=>()=>__webpack_require__(27378))},93098:{shareScope:"default",shareKey:"lodash",import:"lodash",requiredVersion:"^4.17.21",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("981").then(()=>()=>__webpack_require__(98784))},64010:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"^0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("516"),__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("292"),__webpack_require__.e("356"),__webpack_require__.e("422"),__webpack_require__.e("288"),__webpack_require__.e("910"),__webpack_require__.e("157"),__webpack_require__.e("312"),__webpack_require__.e("341")]).then(()=>()=>__webpack_require__(68003))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("224"),__webpack_require__.e("740"),__webpack_require__.e("494")]).then(()=>()=>__webpack_require__(48872))},57871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("238"),__webpack_require__.e("75")]).then(()=>()=>__webpack_require__(99657))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("173").then(()=>()=>__webpack_require__(31542))},27901:{shareScope:"default",shareKey:"@perses-dev/components",import:"@perses-dev/components",requiredVersion:"0.52.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("101"),__webpack_require__.e("238"),__webpack_require__.e("224"),__webpack_require__.e("422"),__webpack_require__.e("288"),__webpack_require__.e("759")]).then(()=>()=>__webpack_require__(68003))},30156:{shareScope:"default",shareKey:"echarts",import:"echarts",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([__webpack_require__.e("101"),__webpack_require__.e("422"),__webpack_require__.e("409")]).then(()=>()=>__webpack_require__(71932))},55922:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("770").then(()=>()=>__webpack_require__(51958))},84275:{shareScope:"default",shareKey:"@hookform/resolvers",import:"@hookform/resolvers",requiredVersion:"^2.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("738").then(()=>()=>__webpack_require__(81228))},45913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("770").then(()=>()=>__webpack_require__(51958))},57751:{shareScope:"default",shareKey:"@perses-dev/plugin-system",import:"@perses-dev/plugin-system",requiredVersion:"*",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>()=>__webpack_require__(82323)},72116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>__webpack_require__.e("960").then(()=>()=>__webpack_require__(96434))}},initialConsumes:["54538","64010","87570"]},__webpack_require__.f.consumes=__webpack_require__.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")}})(),(()=>{if("undefined"!=typeof document){var e=function(e,t,r,n,o){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",__webpack_require__.nc&&(i.nonce=__webpack_require__.nc);var a=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}};return i.onerror=i.onload=a,i.href=t,r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},r=function(r){return new Promise(function(n,o){var i=__webpack_require__.miniCssF(r),a=__webpack_require__.p+i;if(t(i,a))return n();e(r,a,null,n,o)})},n={980:0};__webpack_require__.f.miniCss=function(e,t){var o={580:1,759:1,341:1};n[e]?t.push(n[e]):0!==n[e]&&o[e]&&t.push(n[e]=r(e).then(function(){n[e]=0},function(t){throw delete n[e],t}))}}})(),(()=>{var e={677:0,980:0};__webpack_require__.f.j=function(t,r){var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(/^(157|250|312|341|494|677|759|910)$/.test(t))e[t]=0;else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=__webpack_require__.p+__webpack_require__.u(t),a=Error(),s=function(r){if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,n[1](a)}};__webpack_require__.l(i,s,"chunk-"+t,t)}},__webpack_require__.O.j=t=>0===e[t];var t=(t,r)=>{var n,o,[i,a,s]=r,l=0;if(i.some(t=>0!==e[t])){for(n in a)__webpack_require__.o(a,n)&&(__webpack_require__.m[n]=a[n]);if(s)var c=s(__webpack_require__)}for(t&&t(r);l<i.length;l++)o=i[l],__webpack_require__.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return __webpack_require__.O(c)},r=self.chunk_ScatterChart=self.chunk_ScatterChart||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var __webpack_exports__=__webpack_require__.x()})();
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { PanelProps } from '@perses-dev/plugin-system';
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { TraceData, TraceSearchResult } from '@perses-dev/core';
|
|
4
4
|
import { ScatterChartOptions } from './scatter-chart-model';
|
|
5
5
|
export interface EChartTraceValue extends Omit<TraceSearchResult, 'startTimeUnixMs' | 'serviceStats'> {
|
|
6
6
|
name: string;
|
|
7
|
-
|
|
7
|
+
linkVariables: Record<string, string>;
|
|
8
8
|
startTime: Date;
|
|
9
9
|
spanCount: number;
|
|
10
10
|
errorCount: number;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
/**
|
|
14
|
-
* Custom onClick event handler.
|
|
15
|
-
* If this field is unset or undefined, a default handler which links to the Gantt chart on the explore page is configured.
|
|
16
|
-
* Set this field explicitly to null to disable handling the click event.
|
|
17
|
-
*/
|
|
18
|
-
onClick?: ((data: EChartTraceValue) => void) | null;
|
|
19
|
-
}
|
|
12
|
+
export type ScatterChartPanelProps = PanelProps<ScatterChartOptions, TraceData>;
|
|
20
13
|
/**
|
|
21
14
|
* ScatterChartPanel receives data from the DataQueriesProvider and transforms it
|
|
22
15
|
* into a `dataset` object that Apache ECharts can consume. Additionally,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterChartPanel.d.ts","sourceRoot":"","sources":["../../src/ScatterChartPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ScatterChartPanel.d.ts","sourceRoot":"","sources":["../../src/ScatterChartPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,cAAc,CAAC;IACnG,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAKhF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,GAAG,IAAI,CA+GpF;AAGD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1B,MAAM,CAYR"}
|
package/lib/ScatterChartPanel.js
CHANGED
|
@@ -18,22 +18,6 @@ import { Scatterplot } from './Scatterplot';
|
|
|
18
18
|
6,
|
|
19
19
|
20
|
|
20
20
|
];
|
|
21
|
-
// Navigate to the Gantt Chart on the explore page by default
|
|
22
|
-
function defaultClickHandler(data) {
|
|
23
|
-
// clone the original query spec (including the datasource) and replace the query value with the trace id
|
|
24
|
-
const query = JSON.parse(JSON.stringify(data.query));
|
|
25
|
-
query.spec.plugin.spec.query = data.traceId;
|
|
26
|
-
const exploreParams = new URLSearchParams({
|
|
27
|
-
explorer: 'traces',
|
|
28
|
-
data: JSON.stringify({
|
|
29
|
-
queries: [
|
|
30
|
-
query
|
|
31
|
-
]
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
// do not use react-router here, as downstream products, which embed this panel, may not have a compatible version of it
|
|
35
|
-
window.location.href = `/explore?${exploreParams}`;
|
|
36
|
-
}
|
|
37
21
|
/**
|
|
38
22
|
* ScatterChartPanel receives data from the DataQueriesProvider and transforms it
|
|
39
23
|
* into a `dataset` object that Apache ECharts can consume. Additionally,
|
|
@@ -49,7 +33,7 @@ function defaultClickHandler(data) {
|
|
|
49
33
|
* @returns a `ScatterPlot` component that contains an EChart which will handle
|
|
50
34
|
* visualization of the data.
|
|
51
35
|
*/ export function ScatterChartPanel(props) {
|
|
52
|
-
const { spec, contentDimensions, queryResults: traceResults
|
|
36
|
+
const { spec, contentDimensions, queryResults: traceResults } = props;
|
|
53
37
|
const chartsTheme = useChartsTheme();
|
|
54
38
|
const defaultColor = chartsTheme.thresholds.defaultColor || 'blue';
|
|
55
39
|
const sizeRange = spec.sizeRange || DEFAULT_SIZE_RANGE;
|
|
@@ -75,9 +59,13 @@ function defaultClickHandler(data) {
|
|
|
75
59
|
if (maxSpanCount === undefined || spanCount > maxSpanCount) {
|
|
76
60
|
maxSpanCount = spanCount;
|
|
77
61
|
}
|
|
62
|
+
const pluginSpec = result.definition.spec.plugin.spec;
|
|
78
63
|
const newTraceValue = {
|
|
79
64
|
...trace,
|
|
80
|
-
|
|
65
|
+
linkVariables: {
|
|
66
|
+
datasourceName: pluginSpec?.datasource?.name ?? '',
|
|
67
|
+
traceId: trace.traceId
|
|
68
|
+
},
|
|
81
69
|
name: `${trace.rootServiceName}: ${trace.rootTraceName}`,
|
|
82
70
|
startTime: new Date(trace.startTimeUnixMs),
|
|
83
71
|
spanCount,
|
|
@@ -162,7 +150,7 @@ function defaultClickHandler(data) {
|
|
|
162
150
|
width: contentDimensions.width,
|
|
163
151
|
height: contentDimensions.height,
|
|
164
152
|
options: options,
|
|
165
|
-
|
|
153
|
+
link: spec.link
|
|
166
154
|
})
|
|
167
155
|
});
|
|
168
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ScatterChartPanel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { ReactElement, useMemo } from 'react';\nimport { QueryDefinition, TraceData, TraceSearchResult } from '@perses-dev/core';\nimport { EChartsOption, SeriesOption } from 'echarts';\nimport { NoDataOverlay, useChartsTheme } from '@perses-dev/components';\nimport { Scatterplot } from './Scatterplot';\nimport { ScatterChartOptions } from './scatter-chart-model';\n\nexport interface EChartTraceValue extends Omit<TraceSearchResult, 'startTimeUnixMs' | 'serviceStats'> {\n name: string;\n query: QueryDefinition;\n startTime: Date;\n spanCount: number;\n errorCount: number;\n}\n\nexport interface ScatterChartPanelProps extends PanelProps<ScatterChartOptions, TraceData> {\n /**\n * Custom onClick event handler.\n * If this field is unset or undefined, a default handler which links to the Gantt chart on the explore page is configured.\n * Set this field explicitly to null to disable handling the click event.\n */\n onClick?: ((data: EChartTraceValue) => void) | null;\n}\n\n/** default size range of the circles diameter */\nconst DEFAULT_SIZE_RANGE: [number, number] = [6, 20];\n\n// Navigate to the Gantt Chart on the explore page by default\nfunction defaultClickHandler(data: EChartTraceValue): void {\n // clone the original query spec (including the datasource) and replace the query value with the trace id\n const query: QueryDefinition = JSON.parse(JSON.stringify(data.query));\n query.spec.plugin.spec.query = data.traceId;\n\n const exploreParams = new URLSearchParams({\n explorer: 'traces',\n data: JSON.stringify({ queries: [query] }),\n });\n\n // do not use react-router here, as downstream products, which embed this panel, may not have a compatible version of it\n window.location.href = `/explore?${exploreParams}`;\n}\n\n/**\n * ScatterChartPanel receives data from the DataQueriesProvider and transforms it\n * into a `dataset` object that Apache ECharts can consume. Additionally,\n * data formatting is also dictated in this component. Formatting includes\n * datapoint size and color.\n *\n * Documentation for data structures accepted by Apache ECharts:\n * https://echarts.apache.org/handbook/en/concepts/dataset\n *\n * Examples for scatter chart formatting in Apache ECharts:\n * https://echarts.apache.org/examples/en/index.html#chart-type-scatter\n *\n * @returns a `ScatterPlot` component that contains an EChart which will handle\n * visualization of the data.\n */\nexport function ScatterChartPanel(props: ScatterChartPanelProps): ReactElement | null {\n const { spec, contentDimensions, queryResults: traceResults, onClick } = props;\n const chartsTheme = useChartsTheme();\n const defaultColor = chartsTheme.thresholds.defaultColor || 'blue';\n const sizeRange = spec.sizeRange || DEFAULT_SIZE_RANGE;\n\n // Generate dataset\n // Transform Tempo API response to fit 'dataset' structure from Apache ECharts\n // https://echarts.apache.org/handbook/en/concepts/dataset\n const { dataset, minSpanCount, maxSpanCount } = useMemo(() => {\n const dataset = [];\n let minSpanCount: number | undefined;\n let maxSpanCount: number | undefined;\n for (const result of traceResults) {\n if (result.data.searchResult === undefined) continue;\n const dataSeries = result.data.searchResult.map((trace) => {\n let spanCount = 0;\n let errorCount = 0;\n for (const stats of Object.values(trace.serviceStats)) {\n spanCount += stats.spanCount;\n errorCount += stats.errorCount ?? 0;\n }\n\n if (minSpanCount === undefined || spanCount < minSpanCount) {\n minSpanCount = spanCount;\n }\n if (maxSpanCount === undefined || spanCount > maxSpanCount) {\n maxSpanCount = spanCount;\n }\n\n const newTraceValue: EChartTraceValue = {\n ...trace,\n query: result.definition,\n name: `${trace.rootServiceName}: ${trace.rootTraceName}`,\n startTime: new Date(trace.startTimeUnixMs), // convert unix epoch time to Date\n spanCount,\n errorCount,\n };\n return newTraceValue;\n });\n dataset.push({\n source: dataSeries,\n });\n }\n return { dataset, minSpanCount: minSpanCount ?? 0, maxSpanCount: maxSpanCount ?? 0 };\n }, [traceResults]);\n\n // Formatting for the dataset\n // 1. Map x,y coordinates\n // 2. Datapoint size corresponds to the number of spans in a trace\n // 3. Color datapoint red if the trace contains an error\n const series = useMemo(() => {\n const seriesTemplate2: SeriesOption = {\n type: 'scatter',\n encode: {\n // Map to x-axis.\n x: 'startTime',\n // Map to y-axis.\n y: 'durationMs',\n },\n symbolSize: function (data) {\n // returns the diameter of the circles\n return getSymbolSize(data.spanCount, [minSpanCount, maxSpanCount], sizeRange);\n },\n itemStyle: {\n color: function (params) {\n const traceData: EChartTraceValue = params.data as EChartTraceValue;\n // If the trace contains an error, color the datapoint in red\n if (traceData.errorCount > 0) {\n return 'red';\n }\n // Else return default color\n return defaultColor;\n },\n },\n };\n\n // Each data set needs to have a corresponding series formatting object\n const series = [];\n for (let i = 0; i < dataset.length; i++) {\n series.push({ ...seriesTemplate2, datasetIndex: i });\n }\n return series;\n }, [dataset, defaultColor, minSpanCount, maxSpanCount, sizeRange]);\n\n const tracesFound = traceResults.some((traceData) => (traceData.data?.searchResult ?? []).length > 0);\n if (!tracesFound) {\n return <NoDataOverlay resource=\"traces\" />;\n }\n\n const options: EChartsOption = {\n dataset: dataset,\n series: series,\n };\n\n if (contentDimensions === undefined) return null;\n\n return (\n <div data-testid=\"ScatterChartPanel_ScatterPlot\">\n <Scatterplot\n width={contentDimensions.width}\n height={contentDimensions.height}\n options={options}\n onClick={onClick === null ? undefined : (onClick ?? defaultClickHandler)}\n />\n </div>\n );\n}\n\n// exported for tests\nexport function getSymbolSize(\n spanCount: number,\n spanCountRange: [number, number],\n sizeRange: [number, number]\n): number {\n const [minSize, maxSize] = sizeRange;\n const [minSpanCount, maxSpanCount] = spanCountRange;\n\n // catch divison by zero\n if (maxSpanCount - minSpanCount === 0) {\n return maxSize;\n }\n\n // apply linear scale of spanCount from range [minSpanCount,maxSpanCount] to a value from range [minSize,maxSize]\n const rel = (spanCount - minSpanCount) / (maxSpanCount - minSpanCount);\n return minSize + (maxSize - minSize) * rel;\n}\n"],"names":["useMemo","NoDataOverlay","useChartsTheme","Scatterplot","DEFAULT_SIZE_RANGE","defaultClickHandler","data","query","JSON","parse","stringify","spec","plugin","traceId","exploreParams","URLSearchParams","explorer","queries","window","location","href","ScatterChartPanel","props","contentDimensions","queryResults","traceResults","onClick","chartsTheme","defaultColor","thresholds","sizeRange","dataset","minSpanCount","maxSpanCount","result","searchResult","undefined","dataSeries","map","trace","spanCount","errorCount","stats","Object","values","serviceStats","newTraceValue","definition","name","rootServiceName","rootTraceName","startTime","Date","startTimeUnixMs","push","source","series","seriesTemplate2","type","encode","x","y","symbolSize","getSymbolSize","itemStyle","color","params","traceData","i","length","datasetIndex","tracesFound","some","resource","options","div","data-testid","width","height","spanCountRange","minSize","maxSize","rel"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/ScatterChartPanel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelProps } from '@perses-dev/plugin-system';\nimport { ReactElement, useMemo } from 'react';\nimport { TraceData, TraceSearchResult } from '@perses-dev/core';\nimport { EChartsOption, SeriesOption } from 'echarts';\nimport { NoDataOverlay, useChartsTheme } from '@perses-dev/components';\nimport { Scatterplot } from './Scatterplot';\nimport { ScatterChartOptions } from './scatter-chart-model';\n\nexport interface EChartTraceValue extends Omit<TraceSearchResult, 'startTimeUnixMs' | 'serviceStats'> {\n name: string;\n linkVariables: Record<string, string>;\n startTime: Date;\n spanCount: number;\n errorCount: number;\n}\n\nexport type ScatterChartPanelProps = PanelProps<ScatterChartOptions, TraceData>;\n\n/** default size range of the circles diameter */\nconst DEFAULT_SIZE_RANGE: [number, number] = [6, 20];\n\n/**\n * ScatterChartPanel receives data from the DataQueriesProvider and transforms it\n * into a `dataset` object that Apache ECharts can consume. Additionally,\n * data formatting is also dictated in this component. Formatting includes\n * datapoint size and color.\n *\n * Documentation for data structures accepted by Apache ECharts:\n * https://echarts.apache.org/handbook/en/concepts/dataset\n *\n * Examples for scatter chart formatting in Apache ECharts:\n * https://echarts.apache.org/examples/en/index.html#chart-type-scatter\n *\n * @returns a `ScatterPlot` component that contains an EChart which will handle\n * visualization of the data.\n */\nexport function ScatterChartPanel(props: ScatterChartPanelProps): ReactElement | null {\n const { spec, contentDimensions, queryResults: traceResults } = props;\n const chartsTheme = useChartsTheme();\n const defaultColor = chartsTheme.thresholds.defaultColor || 'blue';\n const sizeRange = spec.sizeRange || DEFAULT_SIZE_RANGE;\n\n // Generate dataset\n // Transform Tempo API response to fit 'dataset' structure from Apache ECharts\n // https://echarts.apache.org/handbook/en/concepts/dataset\n const { dataset, minSpanCount, maxSpanCount } = useMemo(() => {\n const dataset = [];\n let minSpanCount: number | undefined;\n let maxSpanCount: number | undefined;\n for (const result of traceResults) {\n if (result.data.searchResult === undefined) continue;\n const dataSeries = result.data.searchResult.map((trace) => {\n let spanCount = 0;\n let errorCount = 0;\n for (const stats of Object.values(trace.serviceStats)) {\n spanCount += stats.spanCount;\n errorCount += stats.errorCount ?? 0;\n }\n\n if (minSpanCount === undefined || spanCount < minSpanCount) {\n minSpanCount = spanCount;\n }\n if (maxSpanCount === undefined || spanCount > maxSpanCount) {\n maxSpanCount = spanCount;\n }\n\n const pluginSpec = result.definition.spec.plugin.spec as { datasource?: { name?: string } } | undefined;\n const newTraceValue: EChartTraceValue = {\n ...trace,\n linkVariables: {\n datasourceName: pluginSpec?.datasource?.name ?? '',\n traceId: trace.traceId,\n },\n name: `${trace.rootServiceName}: ${trace.rootTraceName}`,\n startTime: new Date(trace.startTimeUnixMs), // convert unix epoch time to Date\n spanCount,\n errorCount,\n };\n return newTraceValue;\n });\n dataset.push({\n source: dataSeries,\n });\n }\n return { dataset, minSpanCount: minSpanCount ?? 0, maxSpanCount: maxSpanCount ?? 0 };\n }, [traceResults]);\n\n // Formatting for the dataset\n // 1. Map x,y coordinates\n // 2. Datapoint size corresponds to the number of spans in a trace\n // 3. Color datapoint red if the trace contains an error\n const series = useMemo(() => {\n const seriesTemplate2: SeriesOption = {\n type: 'scatter',\n encode: {\n // Map to x-axis.\n x: 'startTime',\n // Map to y-axis.\n y: 'durationMs',\n },\n symbolSize: function (data) {\n // returns the diameter of the circles\n return getSymbolSize(data.spanCount, [minSpanCount, maxSpanCount], sizeRange);\n },\n itemStyle: {\n color: function (params) {\n const traceData: EChartTraceValue = params.data as EChartTraceValue;\n // If the trace contains an error, color the datapoint in red\n if (traceData.errorCount > 0) {\n return 'red';\n }\n // Else return default color\n return defaultColor;\n },\n },\n };\n\n // Each data set needs to have a corresponding series formatting object\n const series = [];\n for (let i = 0; i < dataset.length; i++) {\n series.push({ ...seriesTemplate2, datasetIndex: i });\n }\n return series;\n }, [dataset, defaultColor, minSpanCount, maxSpanCount, sizeRange]);\n\n const tracesFound = traceResults.some((traceData) => (traceData.data?.searchResult ?? []).length > 0);\n if (!tracesFound) {\n return <NoDataOverlay resource=\"traces\" />;\n }\n\n const options: EChartsOption = {\n dataset: dataset,\n series: series,\n };\n\n if (contentDimensions === undefined) return null;\n\n return (\n <div data-testid=\"ScatterChartPanel_ScatterPlot\">\n <Scatterplot\n width={contentDimensions.width}\n height={contentDimensions.height}\n options={options}\n link={spec.link}\n />\n </div>\n );\n}\n\n// exported for tests\nexport function getSymbolSize(\n spanCount: number,\n spanCountRange: [number, number],\n sizeRange: [number, number]\n): number {\n const [minSize, maxSize] = sizeRange;\n const [minSpanCount, maxSpanCount] = spanCountRange;\n\n // catch divison by zero\n if (maxSpanCount - minSpanCount === 0) {\n return maxSize;\n }\n\n // apply linear scale of spanCount from range [minSpanCount,maxSpanCount] to a value from range [minSize,maxSize]\n const rel = (spanCount - minSpanCount) / (maxSpanCount - minSpanCount);\n return minSize + (maxSize - minSize) * rel;\n}\n"],"names":["useMemo","NoDataOverlay","useChartsTheme","Scatterplot","DEFAULT_SIZE_RANGE","ScatterChartPanel","props","spec","contentDimensions","queryResults","traceResults","chartsTheme","defaultColor","thresholds","sizeRange","dataset","minSpanCount","maxSpanCount","result","data","searchResult","undefined","dataSeries","map","trace","spanCount","errorCount","stats","Object","values","serviceStats","pluginSpec","definition","plugin","newTraceValue","linkVariables","datasourceName","datasource","name","traceId","rootServiceName","rootTraceName","startTime","Date","startTimeUnixMs","push","source","series","seriesTemplate2","type","encode","x","y","symbolSize","getSymbolSize","itemStyle","color","params","traceData","i","length","datasetIndex","tracesFound","some","resource","options","div","data-testid","width","height","link","spanCountRange","minSize","maxSize","rel"],"mappings":"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"}
|
package/lib/Scatterplot.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { EChartsOption } from 'echarts';
|
|
3
|
-
interface ScatterplotProps
|
|
3
|
+
export interface ScatterplotProps {
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
options: EChartsOption;
|
|
7
|
-
|
|
7
|
+
link?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function Scatterplot
|
|
10
|
-
export {};
|
|
9
|
+
export declare function Scatterplot(props: ScatterplotProps): ReactElement;
|
|
11
10
|
//# sourceMappingURL=Scatterplot.d.ts.map
|
package/lib/Scatterplot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scatterplot.d.ts","sourceRoot":"","sources":["../../src/Scatterplot.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAa9C,OAAO,EAAE,aAAa,EAAuB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Scatterplot.d.ts","sourceRoot":"","sources":["../../src/Scatterplot.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAa9C,OAAO,EAAE,aAAa,EAAuB,MAAM,SAAS,CAAC;AAgB7D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAiFjE"}
|
package/lib/Scatterplot.js
CHANGED
|
@@ -18,6 +18,7 @@ import { ScatterChart as EChartsScatterChart } from 'echarts/charts';
|
|
|
18
18
|
import { DatasetComponent, DataZoomComponent, LegendComponent, GridComponent, TitleComponent, TooltipComponent } from 'echarts/components';
|
|
19
19
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
20
20
|
import { formatValue } from '@perses-dev/core';
|
|
21
|
+
import { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';
|
|
21
22
|
use([
|
|
22
23
|
DatasetComponent,
|
|
23
24
|
DataZoomComponent,
|
|
@@ -33,8 +34,10 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {
|
|
|
33
34
|
timeStyle: 'medium'
|
|
34
35
|
}).format;
|
|
35
36
|
export function Scatterplot(props) {
|
|
36
|
-
const { width, height, options,
|
|
37
|
+
const { width, height, options, link: linkTemplate } = props;
|
|
37
38
|
const chartsTheme = useChartsTheme();
|
|
39
|
+
const variableValues = useAllVariableValues();
|
|
40
|
+
const { navigate } = useRouterContext();
|
|
38
41
|
// Apache EChart Options Docs: https://echarts.apache.org/en/option.html
|
|
39
42
|
const eChartOptions = {
|
|
40
43
|
dataset: options.dataset,
|
|
@@ -92,12 +95,18 @@ export function Scatterplot(props) {
|
|
|
92
95
|
};
|
|
93
96
|
const handleEvents = useMemo(()=>{
|
|
94
97
|
const handlers = {};
|
|
95
|
-
if (
|
|
96
|
-
handlers.click = (params)=>
|
|
98
|
+
if (navigate && linkTemplate) {
|
|
99
|
+
handlers.click = (params)=>{
|
|
100
|
+
const linkVariables = params.data.linkVariables;
|
|
101
|
+
const link = replaceVariablesInString(linkTemplate, variableValues, linkVariables);
|
|
102
|
+
navigate(link);
|
|
103
|
+
};
|
|
97
104
|
}
|
|
98
105
|
return handlers;
|
|
99
106
|
}, [
|
|
100
|
-
|
|
107
|
+
linkTemplate,
|
|
108
|
+
navigate,
|
|
109
|
+
variableValues
|
|
101
110
|
]);
|
|
102
111
|
return /*#__PURE__*/ _jsx(EChart, {
|
|
103
112
|
sx: {
|
package/lib/Scatterplot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Scatterplot.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { EChart, OnEventsType, useChartsTheme } from '@perses-dev/components';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { ScatterChart as EChartsScatterChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChartsOption, ScatterSeriesOption } from 'echarts';\nimport { formatValue } from '@perses-dev/core';\nimport { EChartTraceValue } from './ScatterChartPanel';\n\nuse([\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n EChartsScatterChart,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\
|
|
1
|
+
{"version":3,"sources":["../../src/Scatterplot.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { EChart, OnEventsType, useChartsTheme } from '@perses-dev/components';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { ScatterChart as EChartsScatterChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChartsOption, ScatterSeriesOption } from 'echarts';\nimport { formatValue } from '@perses-dev/core';\nimport { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport { EChartTraceValue } from './ScatterChartPanel';\n\nuse([\n DatasetComponent,\n DataZoomComponent,\n LegendComponent,\n EChartsScatterChart,\n GridComponent,\n TitleComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\nexport interface ScatterplotProps {\n width: number;\n height: number;\n options: EChartsOption;\n link?: string;\n}\n\nconst DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {\n dateStyle: 'long',\n timeStyle: 'medium',\n}).format;\n\nexport function Scatterplot(props: ScatterplotProps): ReactElement {\n const { width, height, options, link: linkTemplate } = props;\n const chartsTheme = useChartsTheme();\n const variableValues = useAllVariableValues();\n const { navigate } = useRouterContext();\n\n // Apache EChart Options Docs: https://echarts.apache.org/en/option.html\n const eChartOptions: EChartsCoreOption = {\n dataset: options.dataset,\n series: options.series,\n dataZoom: options.dataZoom,\n grid: {\n bottom: 40,\n top: 50,\n left: 50,\n right: 100,\n },\n xAxis: {\n type: 'time',\n name: 'Local Time',\n },\n yAxis: {\n scale: true,\n type: 'value',\n name: 'Duration',\n axisLabel: {\n formatter: (durationMs: number) => formatValue(durationMs, { unit: 'milliseconds' }),\n },\n },\n animation: false,\n tooltip: {\n padding: 5,\n borderWidth: 1,\n trigger: 'axis',\n axisPointer: {\n type: 'cross',\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formatter: function (params: any) {\n // TODO: import type from ECharts instead of using any\n const data = params[0].data as EChartTraceValue;\n return [\n `<b>Service name</b>: ${data.rootServiceName}<br/>`,\n `<b>Span name</b>: ${data.rootTraceName}<br/>`,\n `<b>Time</b>: ${DATE_FORMATTER(data.startTime)}<br/>`,\n `<b>Duration</b>: ${formatValue(data.durationMs, { unit: 'milliseconds' })}<br/>`,\n `<b>Span count</b>: ${data.spanCount} (${data.errorCount} errors)<br/>`,\n ].join('');\n },\n },\n legend: {\n show: true,\n type: 'scroll',\n orient: 'horizontal',\n bottom: 0,\n },\n };\n\n const handleEvents: OnEventsType<ScatterSeriesOption['data'] | unknown> = useMemo(() => {\n const handlers: OnEventsType<ScatterSeriesOption['data'] | unknown> = {};\n if (navigate && linkTemplate) {\n handlers.click = (params): void => {\n const linkVariables = params.data.linkVariables as Record<string, string> | undefined;\n const link = replaceVariablesInString(linkTemplate, variableValues, linkVariables);\n navigate(link);\n };\n }\n return handlers;\n }, [linkTemplate, navigate, variableValues]);\n\n return (\n <EChart\n sx={{\n width: width,\n height: height,\n }}\n option={eChartOptions}\n theme={chartsTheme.echartsTheme}\n onEvents={handleEvents}\n />\n );\n}\n"],"names":["useMemo","EChart","useChartsTheme","use","ScatterChart","EChartsScatterChart","DatasetComponent","DataZoomComponent","LegendComponent","GridComponent","TitleComponent","TooltipComponent","CanvasRenderer","formatValue","replaceVariablesInString","useAllVariableValues","useRouterContext","DATE_FORMATTER","Intl","DateTimeFormat","undefined","dateStyle","timeStyle","format","Scatterplot","props","width","height","options","link","linkTemplate","chartsTheme","variableValues","navigate","eChartOptions","dataset","series","dataZoom","grid","bottom","top","left","right","xAxis","type","name","yAxis","scale","axisLabel","formatter","durationMs","unit","animation","tooltip","padding","borderWidth","trigger","axisPointer","params","data","rootServiceName","rootTraceName","startTime","spanCount","errorCount","join","legend","show","orient","handleEvents","handlers","click","linkVariables","sx","option","theme","echartsTheme","onEvents"],"mappings":"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"}
|
|
@@ -36,24 +36,8 @@ const _Scatterplot = require("./Scatterplot");
|
|
|
36
36
|
6,
|
|
37
37
|
20
|
|
38
38
|
];
|
|
39
|
-
// Navigate to the Gantt Chart on the explore page by default
|
|
40
|
-
function defaultClickHandler(data) {
|
|
41
|
-
// clone the original query spec (including the datasource) and replace the query value with the trace id
|
|
42
|
-
const query = JSON.parse(JSON.stringify(data.query));
|
|
43
|
-
query.spec.plugin.spec.query = data.traceId;
|
|
44
|
-
const exploreParams = new URLSearchParams({
|
|
45
|
-
explorer: 'traces',
|
|
46
|
-
data: JSON.stringify({
|
|
47
|
-
queries: [
|
|
48
|
-
query
|
|
49
|
-
]
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
// do not use react-router here, as downstream products, which embed this panel, may not have a compatible version of it
|
|
53
|
-
window.location.href = `/explore?${exploreParams}`;
|
|
54
|
-
}
|
|
55
39
|
function ScatterChartPanel(props) {
|
|
56
|
-
const { spec, contentDimensions, queryResults: traceResults
|
|
40
|
+
const { spec, contentDimensions, queryResults: traceResults } = props;
|
|
57
41
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
58
42
|
const defaultColor = chartsTheme.thresholds.defaultColor || 'blue';
|
|
59
43
|
const sizeRange = spec.sizeRange || DEFAULT_SIZE_RANGE;
|
|
@@ -79,9 +63,13 @@ function ScatterChartPanel(props) {
|
|
|
79
63
|
if (maxSpanCount === undefined || spanCount > maxSpanCount) {
|
|
80
64
|
maxSpanCount = spanCount;
|
|
81
65
|
}
|
|
66
|
+
const pluginSpec = result.definition.spec.plugin.spec;
|
|
82
67
|
const newTraceValue = {
|
|
83
68
|
...trace,
|
|
84
|
-
|
|
69
|
+
linkVariables: {
|
|
70
|
+
datasourceName: pluginSpec?.datasource?.name ?? '',
|
|
71
|
+
traceId: trace.traceId
|
|
72
|
+
},
|
|
85
73
|
name: `${trace.rootServiceName}: ${trace.rootTraceName}`,
|
|
86
74
|
startTime: new Date(trace.startTimeUnixMs),
|
|
87
75
|
spanCount,
|
|
@@ -166,7 +154,7 @@ function ScatterChartPanel(props) {
|
|
|
166
154
|
width: contentDimensions.width,
|
|
167
155
|
height: contentDimensions.height,
|
|
168
156
|
options: options,
|
|
169
|
-
|
|
157
|
+
link: spec.link
|
|
170
158
|
})
|
|
171
159
|
});
|
|
172
160
|
}
|
package/lib/cjs/Scatterplot.js
CHANGED
|
@@ -28,6 +28,7 @@ const _charts = require("echarts/charts");
|
|
|
28
28
|
const _components1 = require("echarts/components");
|
|
29
29
|
const _renderers = require("echarts/renderers");
|
|
30
30
|
const _core1 = require("@perses-dev/core");
|
|
31
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
31
32
|
(0, _core.use)([
|
|
32
33
|
_components1.DatasetComponent,
|
|
33
34
|
_components1.DataZoomComponent,
|
|
@@ -43,8 +44,10 @@ const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {
|
|
|
43
44
|
timeStyle: 'medium'
|
|
44
45
|
}).format;
|
|
45
46
|
function Scatterplot(props) {
|
|
46
|
-
const { width, height, options,
|
|
47
|
+
const { width, height, options, link: linkTemplate } = props;
|
|
47
48
|
const chartsTheme = (0, _components.useChartsTheme)();
|
|
49
|
+
const variableValues = (0, _pluginsystem.useAllVariableValues)();
|
|
50
|
+
const { navigate } = (0, _pluginsystem.useRouterContext)();
|
|
48
51
|
// Apache EChart Options Docs: https://echarts.apache.org/en/option.html
|
|
49
52
|
const eChartOptions = {
|
|
50
53
|
dataset: options.dataset,
|
|
@@ -102,12 +105,18 @@ function Scatterplot(props) {
|
|
|
102
105
|
};
|
|
103
106
|
const handleEvents = (0, _react.useMemo)(()=>{
|
|
104
107
|
const handlers = {};
|
|
105
|
-
if (
|
|
106
|
-
handlers.click = (params)=>
|
|
108
|
+
if (navigate && linkTemplate) {
|
|
109
|
+
handlers.click = (params)=>{
|
|
110
|
+
const linkVariables = params.data.linkVariables;
|
|
111
|
+
const link = (0, _pluginsystem.replaceVariablesInString)(linkTemplate, variableValues, linkVariables);
|
|
112
|
+
navigate(link);
|
|
113
|
+
};
|
|
107
114
|
}
|
|
108
115
|
return handlers;
|
|
109
116
|
}, [
|
|
110
|
-
|
|
117
|
+
linkTemplate,
|
|
118
|
+
navigate,
|
|
119
|
+
variableValues
|
|
111
120
|
]);
|
|
112
121
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.EChart, {
|
|
113
122
|
sx: {
|
|
@@ -6,6 +6,11 @@ export type TraceQueryDefinition<PluginSpec = UnknownSpec> = QueryDefinition<'Tr
|
|
|
6
6
|
export interface ScatterChartOptions {
|
|
7
7
|
/** range of the circles diameter */
|
|
8
8
|
sizeRange?: [number, number];
|
|
9
|
+
/**
|
|
10
|
+
* Where to navigate after clicking on a bubble.
|
|
11
|
+
* Supported variables: datasourceName, traceId
|
|
12
|
+
*/
|
|
13
|
+
link?: string;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
16
|
* Creates the initial/empty options for a ScatterChart panel.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scatter-chart-model.d.ts","sourceRoot":"","sources":["../../src/scatter-chart-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,MAAM,oBAAoB,CAAC,UAAU,GAAG,WAAW,IAAI,eAAe,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAEvG;;GAEG;AAKH,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"scatter-chart-model.d.ts","sourceRoot":"","sources":["../../src/scatter-chart-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,MAAM,MAAM,oBAAoB,CAAC,UAAU,GAAG,WAAW,IAAI,eAAe,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAEvG;;GAEG;AAKH,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1E"}
|