@luzmo/analytics-components-kit 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +8 -2
  2. package/angular/components/interactive-viz-item.ts +40 -3
  3. package/angular/components/item-option-color-picker.ts +30 -3
  4. package/angular/components/item-option-color-range.ts +30 -3
  5. package/angular/components/item-option-guidelines.ts +31 -4
  6. package/angular/components/item-option-panel.ts +41 -4
  7. package/angular/components/item-option-slider.ts +41 -4
  8. package/angular/components/item-option.ts +41 -4
  9. package/angular/esm/components/interactive-viz-item.d.ts +13 -4
  10. package/angular/esm/components/interactive-viz-item.js +29 -3
  11. package/angular/esm/components/item-option-color-picker.d.ts +11 -4
  12. package/angular/esm/components/item-option-color-picker.js +23 -3
  13. package/angular/esm/components/item-option-color-range.d.ts +11 -4
  14. package/angular/esm/components/item-option-color-range.js +23 -3
  15. package/angular/esm/components/item-option-guidelines.d.ts +11 -4
  16. package/angular/esm/components/item-option-guidelines.js +24 -4
  17. package/angular/esm/components/item-option-panel.d.ts +13 -4
  18. package/angular/esm/components/item-option-panel.js +30 -4
  19. package/angular/esm/components/item-option-slider.d.ts +13 -4
  20. package/angular/esm/components/item-option-slider.js +30 -4
  21. package/angular/esm/components/item-option.d.ts +13 -4
  22. package/angular/esm/components/item-option.js +30 -4
  23. package/angular/package.json +2 -2
  24. package/angular/utils/option-interaction/index.d.ts +2 -0
  25. package/angular/utils/option-interaction/is-same-option-value.d.ts +10 -0
  26. package/angular/utils/option-interaction/option-interaction-controller.d.ts +54 -0
  27. package/angular/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
  28. package/angular/utils/store/base-store.d.ts +9 -0
  29. package/angular/utils/store/tests/store-base-history.test.d.ts +1 -0
  30. package/components/{base-store-SgJsjLap.cjs → base-store-D3whjduR.cjs} +1 -1
  31. package/components/{base-store-g0dt7ru7.js → base-store-DQYj8A1W.js} +3 -0
  32. package/components/{choropleth-map-options.config-D9-u-NwX.js → choropleth-map-options.config-Blu0Z2tR.js} +1 -1
  33. package/components/{choropleth-map-options.config-CXDGMiSJ.cjs → choropleth-map-options.config-DwFJ00CS.cjs} +1 -1
  34. package/components/{color-range-utils-CUCTsRXM.js → color-range-utils-CgwRGUkg.js} +18 -18
  35. package/components/{color-range-utils-BCFQAeY1.cjs → color-range-utils-D8uygiMe.cjs} +1 -1
  36. package/components/{heat-map-options.config-ChZeslEy.js → heat-map-options.config-BQkhkLPb.js} +16 -16
  37. package/components/{heat-map-options.config-DiNa8NnG.cjs → heat-map-options.config-DjQkB039.cjs} +1 -1
  38. package/components/{heat-table-options.config-BPCszrFn.js → heat-table-options.config-CMWWTeyo.js} +1 -1
  39. package/components/{heat-table-options.config-BvE6coaV.cjs → heat-table-options.config-D21xtaIk.cjs} +1 -1
  40. package/components/index.cjs +1 -1
  41. package/components/index.js +7 -7
  42. package/components/interactive-viz-item/index.cjs +1 -1
  43. package/components/interactive-viz-item/index.d.ts +2 -1
  44. package/components/interactive-viz-item/index.js +1 -1
  45. package/components/interactive-viz-item/interactive-viz-item.d.ts +31 -1
  46. package/components/interactive-viz-item/types.d.ts +13 -0
  47. package/components/{interactive-viz-item-CofUkpP6.js → interactive-viz-item-CwRRaCZB.js} +144 -84
  48. package/components/interactive-viz-item-CxdrGRKc.cjs +265 -0
  49. package/components/is-same-option-value-B2oyvEqT.js +42 -0
  50. package/components/is-same-option-value-Cf6BQcs7.cjs +20 -0
  51. package/components/item-option/helpers/control-markup.d.ts +7 -0
  52. package/components/item-option/index.cjs +1 -1
  53. package/components/item-option/index.d.ts +1 -1
  54. package/components/item-option/index.js +1 -1
  55. package/components/item-option/item-option.d.ts +23 -2
  56. package/components/item-option/types.d.ts +19 -0
  57. package/components/{item-option-Cgx3c08E.js → item-option-DKLRnicU.js} +182 -136
  58. package/components/item-option-DpLdospV.cjs +285 -0
  59. package/components/item-option-color-picker/index.cjs +1 -1
  60. package/components/item-option-color-picker/index.d.ts +1 -1
  61. package/components/item-option-color-picker/index.js +1 -1
  62. package/components/item-option-color-picker/item-option-color-picker.d.ts +17 -1
  63. package/components/item-option-color-picker-CNW7GsCO.cjs +37 -0
  64. package/components/item-option-color-picker-DDvsY7hV.js +129 -0
  65. package/components/item-option-color-range/index.cjs +1 -1
  66. package/components/item-option-color-range/index.d.ts +1 -1
  67. package/components/item-option-color-range/index.js +1 -1
  68. package/components/item-option-color-range/item-option-color-range.d.ts +20 -1
  69. package/components/item-option-color-range-BqSbuSZh.cjs +101 -0
  70. package/components/item-option-color-range-FQduqtz3.js +265 -0
  71. package/components/item-option-guidelines/index.cjs +1 -1
  72. package/components/item-option-guidelines/index.d.ts +1 -1
  73. package/components/item-option-guidelines/index.js +1 -1
  74. package/components/item-option-guidelines/item-option-guidelines.d.ts +16 -1
  75. package/components/{item-option-guidelines-DNJevmVD.js → item-option-guidelines-k5DwMONo.js} +132 -104
  76. package/components/item-option-guidelines-z9BsGR-l.cjs +138 -0
  77. package/components/item-option-panel/index.cjs +1 -1
  78. package/components/item-option-panel/index.d.ts +1 -1
  79. package/components/item-option-panel/index.js +1 -1
  80. package/components/item-option-panel/item-option-panel.d.ts +12 -1
  81. package/components/{item-option-panel-DHdnisRb.js → item-option-panel-BLXWIbjX.js} +18 -6
  82. package/components/{item-option-panel-Dl3aYBNe.cjs → item-option-panel-CU51qvgV.cjs} +6 -4
  83. package/components/item-option-slider/index.cjs +1 -1
  84. package/components/item-option-slider/index.d.ts +1 -1
  85. package/components/item-option-slider/index.js +1 -1
  86. package/components/item-option-slider/item-option-slider.d.ts +15 -2
  87. package/components/item-option-slider-BKtJfL3D.js +119 -0
  88. package/components/item-option-slider-Kz2eFBql.cjs +36 -0
  89. package/components/item-options-configs.cjs +1 -1
  90. package/components/item-options-configs.js +5 -5
  91. package/components/option-interaction-controller-B8S1N_Oo.js +90 -0
  92. package/components/option-interaction-controller-D0U-CTpZ.cjs +20 -0
  93. package/components/{route-map-options.config-DdCaVtIF.cjs → route-map-options.config-DER6ENky.cjs} +1 -1
  94. package/components/{route-map-options.config-B7vT6KG_.js → route-map-options.config-DTcS47fW.js} +1 -1
  95. package/components/{spike-map-options.config-DkmRZ1JZ.js → spike-map-options.config-CPYfKWoF.js} +1 -1
  96. package/components/{spike-map-options.config-B3hDh2qU.cjs → spike-map-options.config-DeF1Whq5.cjs} +1 -1
  97. package/components/utils/store.cjs +1 -1
  98. package/components/utils/store.js +1 -1
  99. package/custom-elements.json +409 -103
  100. package/package.json +1 -1
  101. package/react/components/interactive-viz-item.component.ts +11 -2
  102. package/react/components/item-option-color-picker.component.ts +9 -3
  103. package/react/components/item-option-color-range.component.ts +9 -3
  104. package/react/components/item-option-guidelines.component.ts +9 -3
  105. package/react/components/item-option-panel.component.ts +12 -3
  106. package/react/components/item-option-slider.component.ts +12 -3
  107. package/react/components/item-option.component.ts +12 -3
  108. package/react/esm/components/interactive-viz-item.component.d.ts +8 -2
  109. package/react/esm/components/interactive-viz-item.component.js +7 -1
  110. package/react/esm/components/item-option-color-picker.component.d.ts +6 -2
  111. package/react/esm/components/item-option-color-picker.component.js +6 -2
  112. package/react/esm/components/item-option-color-range.component.d.ts +6 -2
  113. package/react/esm/components/item-option-color-range.component.js +6 -2
  114. package/react/esm/components/item-option-guidelines.component.d.ts +6 -2
  115. package/react/esm/components/item-option-guidelines.component.js +6 -2
  116. package/react/esm/components/item-option-panel.component.d.ts +8 -2
  117. package/react/esm/components/item-option-panel.component.js +8 -2
  118. package/react/esm/components/item-option-slider.component.d.ts +8 -2
  119. package/react/esm/components/item-option-slider.component.js +8 -2
  120. package/react/esm/components/item-option.component.d.ts +8 -2
  121. package/react/esm/components/item-option.component.js +8 -2
  122. package/react/luzmo-stub.d.ts +7 -0
  123. package/react/package.json +2 -2
  124. package/standalone/chunks/{choropleth-map-options.config-Cs4Kvr9h.js → choropleth-map-options.config-rUJsEJcm.js} +1 -1
  125. package/standalone/chunks/{color-range-utils-CKDpd3gZ.js → color-range-utils-DxOtqAKB.js} +1 -1
  126. package/standalone/chunks/embed-CBu7iQRx.js +231 -0
  127. package/standalone/chunks/{heat-map-options.config-DF5kjOOe.js → heat-map-options.config-D93AeYFi.js} +1 -1
  128. package/standalone/chunks/{heat-table-options.config-DaePzfHG.js → heat-table-options.config-ZVML76FK.js} +1 -1
  129. package/standalone/chunks/is-same-option-value-Di-A7Wmg.js +2 -0
  130. package/standalone/chunks/item-option-color-picker-lLvBPnKA.js +19 -0
  131. package/standalone/chunks/{item-option-color-range-CyJd1LZ_.js → item-option-color-range-BqeatOei.js} +18 -15
  132. package/standalone/chunks/item-option-guidelines-Cop8rM8y.js +120 -0
  133. package/standalone/chunks/item-option-panel-CzSKFCVl.js +316 -0
  134. package/standalone/chunks/item-option-slider-K_bsNci8.js +18 -0
  135. package/standalone/chunks/option-interaction-controller-BslAXAHF.js +2 -0
  136. package/standalone/chunks/{route-map-options.config-D7FfzIiU.js → route-map-options.config-Dwy0JSVq.js} +1 -1
  137. package/standalone/chunks/{spike-map-options.config-CZiFzDm9.js → spike-map-options.config-DFmuNxym.js} +1 -1
  138. package/standalone/interactive-viz-item.js +24 -20
  139. package/standalone/item-grid.js +1 -1
  140. package/standalone/manifest.json +14 -13
  141. package/utils/option-interaction/index.d.ts +2 -0
  142. package/utils/option-interaction/is-same-option-value.d.ts +10 -0
  143. package/utils/option-interaction/option-interaction-controller.d.ts +54 -0
  144. package/utils/option-interaction/tests/option-interaction-controller.test.d.ts +1 -0
  145. package/utils/store/base-store.d.ts +9 -0
  146. package/utils/store/tests/store-base-history.test.d.ts +1 -0
  147. package/components/interactive-viz-item-D537mo3l.cjs +0 -261
  148. package/components/item-option-CqGDFdPj.cjs +0 -269
  149. package/components/item-option-color-picker-BpPoOO2b.cjs +0 -34
  150. package/components/item-option-color-picker-cojuCvu5.js +0 -84
  151. package/components/item-option-color-range-CMBEx1fi.cjs +0 -98
  152. package/components/item-option-color-range-Dt7Bv06p.js +0 -217
  153. package/components/item-option-guidelines-Beh0DlG0.cjs +0 -135
  154. package/components/item-option-slider-Bo5vs6nr.js +0 -89
  155. package/components/item-option-slider-CyWKWr5D.cjs +0 -33
  156. package/standalone/chunks/color-7IgCGZKz.js +0 -2
  157. package/standalone/chunks/embed-BfHBKhIe.js +0 -231
  158. package/standalone/chunks/item-option-color-picker-Cr7ujQNO.js +0 -16
  159. package/standalone/chunks/item-option-guidelines-6NjpzS6b.js +0 -117
  160. package/standalone/chunks/item-option-panel-VxvWU56c.js +0 -298
  161. package/standalone/chunks/item-option-slider-l9wt7_0c.js +0 -15
@@ -0,0 +1,231 @@
1
+
2
+ import{t as e}from"./version-BW4Ixl63.js";import{LitElement as t,css as n,html as r,property as i,query as a,state as o,styleMap as s}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.6.1/standalone/lit.js";function c(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;r<e.length;r++)n+=e[r]*(t[r]||0);return n}));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}function l(e){return u(e)===`string`}function u(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function d(e,{precision:t,unit:n}){return f(e)?`none`:m(e,t)+(n??``)}function f(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function p(e){return f(e)?0:e}function m(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}var h={deg:1,grad:.9,rad:180/Math.PI,turn:360};function g(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,n=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let e=[];return a[2].replace(i,(t,i)=>{let a=i.match(r),o=i;if(a){let e=a[0],t=o.slice(0,-e.length);e===`%`?(o=/* @__PURE__ */ new Number(t/100),o.type=`<percentage>`):(o=new Number(t*h[e]),o.type=`<angle>`,o.unit=e)}else n.test(o)?(o=new Number(o),o.type=`<number>`):o===`none`&&(o=/* @__PURE__ */ new Number(NaN),o.none=!0);t.startsWith(`/`)&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),typeof o==`object`&&o instanceof Number&&(o.raw=i),e.push(o)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:e}}}function _(e){return e[e.length-1]}function v(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function y(e,t,n){return(n-e)/(t-e)}function b(e,t,n){return v(t[0],t[1],y(e[0],e[1],n))}function ee(e){return e.map(e=>e.split(`|`).map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let e=new String(t[1]);return e.range=[+t[2],+t[3]],e}return e}))}function te(e,t,n){return Math.max(Math.min(n,t),e)}function x(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function S(e,t){return x(Math.abs(e)**t,e)}function ne(e,t){return t===0?0:e/t}function re(e,t,n=0,r=e.length){for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n}var ie=/*#__PURE__*/ Object.freeze({__proto__:null,bisectLeft:re,clamp:te,copySign:x,interpolate:v,interpolateInv:y,isNone:f,isString:l,last:_,mapRange:b,multiplyMatrices:c,parseCoordGrammar:ee,parseFunction:g,serializeNumber:d,skipNone:p,spow:S,toPrecision:m,type:u,zdiv:ne}),ae=new class{add(e,t,n){if(typeof arguments[0]!=`string`)for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},C={gamut_mapping:`css`,precision:5,deltaE:`76`,verbose:globalThis?.process?.env?.NODE_ENV?.toLowerCase()!==`test`,warn:function(e){this.verbose&&globalThis?.console?.warn?.(e)}},w={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function oe(e){return Array.isArray(e)?e:w[e]}function T(e,t,n,r={}){if(e=oe(e),t=oe(t),!e||!t)throw TypeError(`Missing white point to convert ${e?``:`from`}${!e&&!t?`/`:``}${t?``:`to`}`);if(e===t)return n;let i={W1:e,W2:t,XYZ:n,options:r};if(ae.run(`chromatic-adaptation-start`,i),i.M||(i.W1===w.D65&&i.W2===w.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===w.D50&&i.W2===w.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ae.run(`chromatic-adaptation-end`,i),i.M)return c(i.M,i.XYZ);throw TypeError(`Only Bradford CAT with white points D50 and D65 supported for now.`)}var se=/* @__PURE__ */ new Set([`<number>`,`<percentage>`,`<angle>`]);function ce(e,t,n,r){return Object.entries(e.coords).map(([e,i],a)=>{let o=t.coordGrammar[a],s=r[a],c=s?.type,l;if(l=s.none?o.find(e=>se.has(e)):o.find(e=>e==c),!l){let t=i.name||e;throw TypeError(`${c??s.raw} not allowed for ${t} in ${n}()`)}let u=l.range;c===`<percentage>`&&(u||=[0,1]);let d=i.range||i.refRange;return u&&d&&(r[a]=b(u,d,r[a])),l})}function le(e,{meta:t}={}){let n={str:String(e)?.trim()};if(ae.run(`parse-start`,n),n.color)return n.color;if(n.parsed=g(n.str),n.parsed){let e=n.parsed.name;if(e===`color`){let e=n.parsed.args.shift(),r=e.startsWith(`--`)?e.substring(2):`--${e}`,i=[e,r],a=n.parsed.rawArgs.indexOf(`/`)>0?n.parsed.args.pop():1;for(let r of D.all){let o=r.getFormat(`color`);if(o&&(i.includes(o.id)||o.ids?.filter(e=>i.includes(e)).length)){let i=Object.keys(r.coords).map((e,t)=>n.parsed.args[t]||0),s;return o.coordGrammar&&(s=ce(r,o,`color`,i)),t&&Object.assign(t,{formatId:`color`,types:s}),o.id.startsWith(`--`)&&!e.startsWith(`--`)&&C.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${o.id}) instead of color(${e}).`),e.startsWith(`--`)&&!o.id.startsWith(`--`)&&C.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${o.id}) instead of prefixed color(${e}).`),{spaceId:r.id,coords:i,alpha:a}}}let o=``,s=e in D.registry?e:r;if(s in D.registry){let e=D.registry[s].formats?.color?.id;e&&(o=`Did you mean color(${e})?`)}throw TypeError(`Cannot parse color(${e}). `+(o||`Missing a plugin?`))}for(let r of D.all){let i=r.getFormat(e);if(i&&i.type===`function`){let a=1;(i.lastAlpha||_(n.parsed.args).alpha)&&(a=n.parsed.args.pop());let o=n.parsed.args,s;return i.coordGrammar&&(s=ce(r,i,e,o)),t&&Object.assign(t,{formatId:i.name,types:s}),{spaceId:r.id,coords:o,alpha:a}}}}else for(let e of D.all)for(let r in e.formats){let i=e.formats[r];if(i.type!==`custom`||i.test&&!i.test(n.str))continue;let a=i.parse(n.str);if(a)return a.alpha??=1,t&&(t.formatId=r),a}throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function E(e){if(Array.isArray(e))return e.map(E);if(!e)throw TypeError(`Empty color reference`);l(e)&&(e=le(e));let t=e.space||e.spaceId;return t instanceof D||(e.space=D.get(t)),e.alpha===void 0&&(e.alpha=1),e}var ue=75e-6,D=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;this.white=oe(r),this.formats=t.formats??{};for(let e in this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),this.gamutSpace=t.gamutSpace?t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.base:this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:de(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ae.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=ue}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Number.isNaN(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(typeof e==`object`)return e=fe(e,this),e;let t;return t=e==="default"?Object.values(this.formats)[0]:this.formats[e],t?(t=fe(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=E(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Number.isNaN(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;e<r.length&&r[e].equals(i[e]);e++)a=r[e],o=e;if(!a)throw Error(`Cannot convert between color spaces ${this} and ${t}: no connection space was found`);for(let e=r.length-1;e>o;e--)n=r[e].toBase(n);for(let e=o+1;e<i.length;e++)n=i[e].fromBase(n);return n}from(t,n){if(arguments.length===1){let e=E(t);[t,n]=[e.space,e.coords]}return t=e.get(t),t.to(this,n)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let n=this.coords[t],r=n.range||n.refRange;e.push(r?.min??0)}return e}static registry={};static get all(){return[...new Set(Object.values(e.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let e of t.aliases)this.register(e,t);return t}static get(t,...n){if(!t||t instanceof e)return t;if(u(t)===`string`){let n=e.registry[t.toLowerCase()];if(!n)throw TypeError(`No color space found with id = "${t}"`);return n}if(n.length)return e.get(...n);throw TypeError(`${t} is not a valid color space`)}static resolveCoord(t,n){let r=u(t),i,a;if(r===`string`?t.includes(`.`)?[i,a]=t.split(`.`):[i,a]=[,t]:Array.isArray(t)?[i,a]=t:(i=t.space,a=t.coordId),i=e.get(i),i||=n,!i)throw TypeError(`Cannot resolve coordinate reference ${t}: No color space specified and relative references are not allowed here`);if(r=u(a),r===`number`||r===`string`&&a>=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function de(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}function fe(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||=`function`,e.name||=`color`,e.coordGrammar=ee(e.coords);let n=Object.entries(t).map(([t,n],r)=>{let i=e.coordGrammar[r][0],a=n.range||n.refRange,o=i.range,s=``;return i==`<percentage>`?(o=[0,100],s=`%`):i==`<angle>`&&(s=`deg`),{fromRange:a,toRange:o,suffix:s}});e.serializeCoords=(e,t)=>e.map((e,r)=>{let{fromRange:i,toRange:a,suffix:o}=n[r];return i&&a&&(e=b(i,a,e)),e=d(e,{precision:t,unit:o}),e})}return e}var O=new D({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{name:`X`},y:{name:`Y`},z:{name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),k=class extends D{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=O,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=c(e.toXYZ_M,t);return this.white!==this.base.white&&(n=T(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=T(this.base.white,this.white,t),c(e.fromXYZ_M,t))),e.referred??=`display`,super(e)}};function pe(e,t){return e=E(e),!t||e.space.equals(t)?e.coords.slice():(t=D.get(t),t.from(e))}function A(e,t){e=E(e);let{space:n,index:r}=D.resolveCoord(t,e.space);return pe(e,n)[r]}function me(e,t,n){return e=E(e),t=D.get(t),e.coords=t.to(e.space,n),e}me.returns=`color`;function j(e,t,n){if(e=E(e),arguments.length===2&&u(arguments[1])===`object`){let t=arguments[1];for(let n in t)j(e,n,t[n])}else{typeof n==`function`&&(n=n(A(e,t)));let{space:r,index:i}=D.resolveCoord(t,e.space),a=pe(e,r);a[i]=n,me(e,r,a)}return e}j.returns=`color`;var he=new D({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:O,fromBase:e=>T(O.white,`D50`,e),toBase:e=>T(`D50`,O.white,e)}),ge=216/24389,_e=24/116,ve=24389/27,ye=w.D50,M=new D({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ye,base:he,fromBase(e){let t=e.map((e,t)=>e/ye[t]).map(e=>e>ge?Math.cbrt(e):(ve*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>_e?t[0]**3:(116*t[0]-16)/ve,e[0]>8?((e[0]+16)/116)**3:e[0]/ve,t[2]>_e?t[2]**3:(116*t[2]-16)/ve].map((e,t)=>e*ye[t])},formats:{lab:{coords:[`<number> | <percentage>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}});function N(e){return(e%360+360)%360}function be(e,t){if(e===`raw`)return t;let[n,r]=t.map(N),i=r-n;return e===`increasing`?i<0&&(r+=360):e===`decreasing`?i>0&&(n+=360):e===`longer`?-180<i&&i<180&&(i>0?n+=360:r+=360):e===`shorter`&&(i>180?n+=360:i<-180&&(r+=360)),[n,r]}var xe=new D({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:M,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n)<a&&Math.abs(r)<a?NaN:Math.atan2(r,n)*180/Math.PI,[t,Math.sqrt(n**2+r**2),N(i)]},toBase(e){let[t,n,r]=e;return n<0&&(n=0),isNaN(r)&&(r=0),[t,n*Math.cos(r*Math.PI/180),n*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),Se=25**7,Ce=Math.PI,we=180/Ce,Te=Ce/180;function Ee(e){let t=e*e;return t*t*t*e}function De(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=E([e,t]);let[a,o,s]=M.from(e),c=xe.from(M,[a,o,s])[1],[l,u,d]=M.from(t),f=xe.from(M,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=Ee((c+f)/2),m=.5*(1-Math.sqrt(p/(p+Se))),h=(1+m)*o,g=(1+m)*u,_=Math.sqrt(h**2+s**2),v=Math.sqrt(g**2+d**2),y=h===0&&s===0?0:Math.atan2(s,h),b=g===0&&d===0?0:Math.atan2(d,g);y<0&&(y+=2*Ce),b<0&&(b+=2*Ce),y*=we,b*=we;let ee=l-a,te=v-_,x=b-y,S=y+b,ne=Math.abs(x),re;_*v===0?re=0:ne<=180?re=x:x>180?re=x-360:x<-180?re=x+360:C.warn(`the unthinkable has happened`);let ie=2*Math.sqrt(v*_)*Math.sin(re*Te/2),ae=(a+l)/2,w=(_+v)/2,oe=Ee(w),T;T=_*v===0?S:ne<=180?S/2:S<360?(S+360)/2:(S-360)/2;let se=(ae-50)**2,ce=1+.015*se/Math.sqrt(20+se),le=1+.045*w,ue=1;ue-=.17*Math.cos((T-30)*Te),ue+=.24*Math.cos(2*T*Te),ue+=.32*Math.cos((3*T+6)*Te),ue-=.2*Math.cos((4*T-63)*Te);let D=1+.015*w*ue,de=30*Math.exp(-1*((T-275)/25)**2),fe=2*Math.sqrt(oe/(oe+Se)),O=-1*Math.sin(2*de*Te)*fe,k=(ee/(n*ce))**2;return k+=(te/(r*le))**2,k+=(ie/(i*D))**2,k+=O*(te/(r*le))*(ie/(i*D)),Math.sqrt(k)}var Oe=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],ke=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Ae=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],je=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Me=new D({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:O,fromBase(e){return c(Ae,c(Oe,e).map(e=>Math.cbrt(e)))},toBase(e){return c(ke,c(je,e).map(e=>e**3))},formats:{oklab:{coords:[`<percentage> | <number>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}});function Ne(e,t){[e,t]=E([e,t]);let[n,r,i]=Me.from(e),[a,o,s]=Me.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}var Pe=75e-6;function Fe(e,t,{epsilon:n=Pe}={}){e=E(e),t||=e.space,t=D.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function Ie(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Le(e,t,n=`lab`){n=D.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return isNaN(t)||isNaN(r)?e:e+(r-t)**2},0))}function Re(e,t){return Le(e,t,`lab`)}var ze=Math.PI/180;function Be(e,t,{l:n=2,c:r=1}={}){[e,t]=E([e,t]);let[i,a,o]=M.from(e),[,s,c]=xe.from(M,[i,a,o]),[l,u,d]=M.from(t),f=xe.from(M,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Number.isNaN(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*ze)):.36+Math.abs(.4*Math.cos((c+35)*ze));let ee=s**4,te=Math.sqrt(ee/(ee+1900)),x=y*(te*b+1-te),S=(p/(n*v))**2;return S+=(m/(r*y))**2,S+=_/x**2,Math.sqrt(S)}var Ve=203,He=new D({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:O,fromBase(e){return e.map(e=>Math.max(e*Ve,0))},toBase(e){return e.map(e=>Math.max(e/Ve,0))}}),Ue=1.15,We=.66,Ge=2610/2**14,Ke=2**14/2610,qe=3424/4096,Je=2413/128,Ye=2392/128,Xe=1.7*2523/32,Ze=32/(1.7*2523),Qe=-.56,$e=16295499532821565e-27,et=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],tt=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],nt=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],rt=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],it=new D({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:He,fromBase(e){let[t,n,r]=e,[i,a,o]=c(nt,c(et,[Ue*t-.1499999999999999*r,We*n- -.33999999999999997*t,r]).map(function(e){return((qe+Je*(e/1e4)**Ge)/(1+Ye*(e/1e4)**Ge))**Xe}));return[.43999999999999995*i/(1+Qe*i)-$e,a,o]},toBase(e){let[t,n,r]=e,[i,a,o]=c(tt,c(rt,[(t+$e)/(.43999999999999995-Qe*(t+$e)),n,r]).map(function(e){return 1e4*((qe-e**Ze)/(Ye*e**Ze-Je))**Ke})),s=(i+.1499999999999999*o)/Ue;return[s,(a+-.33999999999999997*s)/We,o]},formats:{color:{coords:[`<number> | <percentage>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),at=new D({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,1],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:it,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n)<a&&Math.abs(r)<a?NaN:Math.atan2(r,n)*180/Math.PI,[t,Math.sqrt(n**2+r**2),N(i)]},toBase(e){return[e[0],e[1]*Math.cos(e[2]*Math.PI/180),e[1]*Math.sin(e[2]*Math.PI/180)]}});function ot(e,t){[e,t]=E([e,t]);let[n,r,i]=at.from(e),[a,o,s]=at.from(t),c=n-a,l=r-o;Number.isNaN(i)&&Number.isNaN(s)?(i=0,s=0):Number.isNaN(i)?i=s:Number.isNaN(s)&&(s=i);let u=i-s,d=2*Math.sqrt(r*o)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(c**2+l**2+d**2)}var st=3424/4096,ct=2413/128,lt=2392/128,ut=2610/16384,dt=2523/32,ft=16384/2610,pt=32/2523,mt=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],ht=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],gt=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],_t=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],vt=new D({id:`ictcp`,name:`ICTCP`,coords:{i:{refRange:[0,1],name:`I`},ct:{refRange:[-.5,.5],name:`CT`},cp:{refRange:[-.5,.5],name:`CP`}},base:He,fromBase(e){return yt(c(mt,e))},toBase(e){return c(_t,bt(e))}});function yt(e){return c(ht,e.map(function(e){return((st+ct*(e/1e4)**ut)/(1+lt*(e/1e4)**ut))**dt}))}function bt(e){return c(gt,e).map(function(e){return 1e4*(Math.max(e**pt-st,0)/(ct-lt*e**pt))**ft})}function xt(e,t){[e,t]=E([e,t]);let[n,r,i]=vt.from(e),[a,o,s]=vt.from(t);return 720*Math.sqrt((n-a)**2+.25*(r-o)**2+(i-s)**2)}var St=w.D65,Ct=.42,wt=1/Ct,Tt=2*Math.PI,Et=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],Dt=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],Ot=[[460,451,288],[460,-891,-261],[460,-220,-6300]],kt={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},At={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},jt=180/Math.PI,Mt=Math.PI/180;function Nt(e,t){return e.map(e=>{let n=S(t*Math.abs(e)*.01,Ct);return 400*x(n,e)/(n+27.13)})}function Pt(e,t){let n=100/t*27.13**wt;return e.map(e=>{let t=Math.abs(e);return x(n*S(t/(400-t),wt),e)})}function Ft(e){let t=N(e);t<=At.h[0]&&(t+=360);let n=re(At.h,t)-1,[r,i]=At.h.slice(n,n+2),[a,o]=At.e.slice(n,n+2),s=At.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function It(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=At.h.slice(n,n+2),[a,o]=At.e.slice(n,n+2);return N((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Lt(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let o=e.map(e=>e*100);a.la=t,a.yb=n;let s=o[1],l=c(Et,o);r=kt[a.surround];let u=r[0];a.c=r[1],a.nc=r[2];let d=(1/(5*a.la+1))**4;a.fl=d*a.la+.1*(1-d)*(1-d)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let f=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(e=>v(1,s/e,f)),a.dRgbInv=a.dRgb.map(e=>1/e);let p=Nt(l.map((e,t)=>e*a.dRgb[t]),a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var Rt=Lt(St,64/Math.PI*.2,20,`average`,!1);function zt(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?It(e.H)*Mt:N(e.h)*Mt;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=S(e.J,1/2)*.1;let o=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(o=4e-4*e.s**2*(t.aW+4)/t.c):o=e.M/t.flRoot/a:o=e.C/a;let s=S(o*(1.64-.29**t.n)**-.73,10/9),l=.25*(Math.cos(n+2)+3.8),u=t.aW*S(a,2/t.c/t.z),d=5e4/13*t.nc*t.ncb*l,f=u/t.nbb,p=23*(f+.305)*ne(s,23*d+s*(11*r+108*i));return c(Dt,Pt(c(Ot,[f,p*r,p*i]).map(e=>e*1/1403),t.fl).map((e,n)=>e*t.dRgbInv[n])).map(e=>e/100)}function Bt(e,t){let n=Nt(c(Et,e.map(e=>e*100)).map((e,n)=>e*t.dRgb[n]),t.fl),r=n[0]+(-12*n[1]+n[2])/11,i=(n[0]+n[1]-2*n[2])/9,a=(Math.atan2(i,r)%Tt+Tt)%Tt,o=.25*(Math.cos(a+2)+3.8),s=S(5e4/13*t.nc*t.ncb*ne(o*Math.sqrt(r**2+i**2),n[0]+n[1]+1.05*n[2]+.305),.9)*(1.64-.29**t.n)**.73,l=S(t.nbb*(2*n[0]+n[1]+.05*n[2])/t.aW,.5*t.c*t.z),u=100*S(l,2),d=4/t.c*l*(t.aW+4)*t.flRoot,f=s*l,p=f*t.flRoot,m=N(a*jt),h=Ft(m);return{J:u,C:f,h:m,s:50*S(t.c*s/(t.aW+4),1/2),Q:d,M:p,H:h}}var Vt=new D({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:O,fromBase(e){let t=Bt(e,Rt);return[t.J,t.M,t.h]},toBase(e){return zt({J:e[0],M:e[1],h:e[2]},Rt)}}),Ht=w.D65,Ut=216/24389,Wt=24389/27;function Gt(e){return 116*(e>Ut?Math.cbrt(e):(Wt*e+16)/116)-16}function Kt(e){return e>8?((e+16)/116)**3:e/Wt}function qt(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Kt(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=0,l=1/0;for(;c<=15;){a=zt({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e<l){if(e<=2e-12)return a;l=e}o-=(a[1]-s)*o/(2*a[1]),c+=1}return zt({J:o,C:r,h:n},t)}function Jt(e,t){let n=Gt(e[1]);if(n===0)return[0,0,0];let r=Bt(e,Yt);return[N(r.h),r.C,n]}var Yt=Lt(Ht,200/Math.PI*Kt(50),Kt(50)*100,`average`,!1),Xt=new D({id:`hct`,name:`HCT`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},c:{refRange:[0,145],name:`Colorfulness`},t:{refRange:[0,100],name:`Tone`}},base:O,fromBase(e){return Jt(e)},toBase(e){return qt(e,Yt)},formats:{color:{id:`--hct`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Zt=Math.PI/180,Qt=[1,.007,.0228];function $t(e){e[1]<0&&(e=Xt.fromBase(Xt.toBase(e)));let t=Math.log(Math.max(1+Qt[2]*e[1]*Yt.flRoot,1))/Qt[2],n=e[0]*Zt,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function en(e,t){[e,t]=E([e,t]);let[n,r,i]=$t(Xt.from(e)),[a,o,s]=$t(Xt.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var tn={deltaE76:Re,deltaECMC:Be,deltaE2000:De,deltaEJz:ot,deltaEITP:xt,deltaEOK:Ne,deltaEHCT:en};function nn(e){return Math.max(parseFloat(`1e${(e?Math.floor(Math.log10(Math.abs(e))):0)-2}`),1e-6)}var rn={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function an(e,{method:t=C.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a={}}={}){if(e=E(e),l(arguments[1])?n=arguments[1]:n||=e.space,n=D.get(n),Fe(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=sn(e,{space:n});else{if(t!==`clip`&&!Fe(e,n)){Object.prototype.hasOwnProperty.call(rn,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=rn[t]);let s=De;if(r!==``){for(let e in tn)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=tn[e];break}}let c=an(P(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(Object.keys(a).length===3){let t=D.resolveCoord(a.channel),n=A(P(e,t.space),t.id);if(f(n)&&(n=0),n>=a.max)return P({space:`xyz-d65`,coords:w.D65},e.space);if(n<=a.min)return P({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=D.resolveCoord(t),c=r.space,l=r.id,u=P(e,c);u.coords.forEach((e,t)=>{f(e)&&(u.coords[t]=0)});let d=(r.range||r.refRange)[0],p=nn(i),m=d,h=A(u,l);for(;h-m>p;){let e=Ie(u);e=an(e,{space:n,method:`clip`}),s(u,e)-i<p?m=A(u,l):h=A(u,l),j(u,l,(m+h)/2)}o=P(u,n)}else o=c}else o=P(e,n);if(t===`clip`||!Fe(o,n,{epsilon:0})){let e=Object.values(n.coords).map(e=>e.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=P(o,e.space)),e.coords=o.coords,e}an.returns=`color`;var on={WHITE:{space:Me,coords:[1,0,0]},BLACK:{space:Me,coords:[0,0,0]}};function sn(e,{space:t}={}){let n=.02,r=1e-4;e=E(e),t||=e.space,t=D.get(t);let i=D.get(`oklch`);if(t.isUnbounded)return P(e,t);let a=P(e,i),o=a.coords[0];if(o>=1){let n=P(on.WHITE,t);return n.alpha=e.alpha,P(n,t)}if(o<=0){let n=P(on.BLACK,t);return n.alpha=e.alpha,P(n,t)}if(Fe(a,t,{epsilon:0}))return P(a,t);function s(e){let n=P(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return te(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=Ie(a),f=s(d),p=Ne(f,d);if(p<n)return f;for(;l-c>r;){let e=(c+l)/2;if(d.coords[1]=e,u&&Fe(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Ne(f,d),p<n){if(n-p<r)break;u=!1,c=e}else l=e}return f}function P(e,t,{inGamut:n}={}){e=E(e),t=D.get(t);let r=t.from(e),i={space:t,coords:r,alpha:e.alpha};return n&&(i=an(i,n===!0?void 0:n)),i}P.returns=`color`;function cn(e,{precision:t=C.precision,format:n=`default`,inGamut:r=!0,...i}={}){let a;e=E(e);let o=n;n=e.space.getFormat(n)??e.space.getFormat(`default`)??D.DEFAULT_FORMAT;let s=e.coords.slice();if(r||=n.toGamut,r&&!Fe(e)&&(s=an(Ie(e),r===!0?void 0:r).coords),n.type===`custom`){if(i.precision=t,n.serialize)a=n.serialize(s,e.alpha,i);else throw TypeError(`format ${o} can only be used to parse colors, not for serialization`)}else{let r=n.name||`color`;n.serializeCoords?s=n.serializeCoords(s,t):t!==null&&(s=s.map(e=>d(e,{precision:t})));let i=[...s];if(r===`color`){let t=n.id||n.ids?.[0]||e.space.id;i.unshift(t)}let o=e.alpha;t!==null&&(o=d(o,{precision:t}));let c=e.alpha>=1||n.noAlpha?``:`${n.commas?`,`:` /`} ${o}`;a=`${r}(${i.join(n.commas?`, `:` `)}${c})`}return a}var ln=new k({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),un=1.09929682680944,dn=.018053968510807,fn=new k({id:`rec2020`,name:`REC.2020`,base:ln,toBase(e){return e.map(function(e){return e<dn*4.5?e/4.5:((e+un-1)/un)**(1/.45)})},fromBase(e){return e.map(function(e){return e>=dn?un*e**.45-.09929682680944008:4.5*e})}}),pn=new k({id:`p3-linear`,cssId:`--display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),mn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],F=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],hn=new k({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:mn,fromXYZ_M:F}),gn={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},_n=[,,,].fill(`<percentage> | <number>[0, 255]`),vn=[,,,].fill(`<number>[0, 255]`),yn=new k({id:`srgb`,name:`sRGB`,base:hn,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:_n},rgb_number:{name:`rgb`,commas:!0,coords:vn,noAlpha:!0},color:{},rgba:{coords:_n,commas:!0,lastAlpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:vn},hex:{type:`custom`,toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0}={})=>{t<1&&e.push(t),e=e.map(e=>Math.round(e*255));let r=n&&e.every(e=>e%17==0);return`#`+e.map(e=>r?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``)}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=gn.black,t.alpha=0):t.coords=gn[e],t.coords)return t}}}}),bn=new k({id:`p3`,cssId:`display-p3`,name:`P3`,base:pn,fromBase:yn.fromBase,toBase:yn.toBase});C.display_space=yn;var xn;if(typeof CSS<`u`&&CSS.supports)for(let e of[M,fn,bn]){let t=cn({space:e,coords:e.getMinCoords(),alpha:1});if(CSS.supports(`color`,t)){C.display_space=e;break}}function Sn(e,{space:t=C.display_space,...n}={}){let r=cn(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!C.display_space)r=new String(r),r.color=e;else{let i=e;if((e.coords.some(f)||f(e.alpha))&&!(xn??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=Ie(e),i.coords=i.coords.map(p),i.alpha=p(i.alpha),r=cn(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=P(i,t),r=new String(cn(i,n)),r.color=i}return r}function Cn(e,t){return e=E(e),t=E(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function wn(e){return A(e,[O,`y`])}function Tn(e,t){j(e,[O,`y`],t)}function En(e){Object.defineProperty(e.prototype,"luminance",{get(){return wn(this)},set(e){Tn(this,e)}})}var Dn=/*#__PURE__*/ Object.freeze({__proto__:null,getLuminance:wn,register:En,setLuminance:Tn});function On(e,t){e=E(e),t=E(t);let n=Math.max(wn(e),0),r=Math.max(wn(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}var kn=.56,An=.57,jn=.62,Mn=.65,Nn=.022,Pn=1.414,Fn=.1,In=5e-4,Ln=1.14,Rn=.027,zn=1.14;function Bn(e){return e>=Nn?e:e+(Nn-e)**Pn}function Vn(e){return(e<0?-1:1)*Math.abs(e)**2.4}function Hn(e,t){t=E(t),e=E(e);let n,r,i,a,o,s;t=P(t,`srgb`),[a,o,s]=t.coords;let c=Vn(a)*.2126729+Vn(o)*.7151522+Vn(s)*.072175;e=P(e,`srgb`),[a,o,s]=e.coords;let l=Vn(a)*.2126729+Vn(o)*.7151522+Vn(s)*.072175,u=Bn(c),d=Bn(l),f=d>u;return Math.abs(d-u)<In?r=0:f?(n=d**kn-u**An,r=n*Ln):(n=d**Mn-u**jn,r=n*zn),i=Math.abs(r)<Fn?0:r>0?r-Rn:r+Rn,i*100}function Un(e,t){e=E(e),t=E(t);let n=Math.max(wn(e),0),r=Math.max(wn(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}var Wn=5e4;function Gn(e,t){e=E(e),t=E(t);let n=Math.max(wn(e),0),r=Math.max(wn(t),0);return r>n&&([n,r]=[r,n]),r===0?Wn:(n-r)/r}function Kn(e,t){e=E(e),t=E(t);let n=A(e,[M,`l`]),r=A(t,[M,`l`]);return Math.abs(n-r)}var qn=216/24389,Jn=24/116,Yn=24389/27,Xn=w.D65,Zn=new D({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Xn,base:O,fromBase(e){let t=e.map((e,t)=>e/Xn[t]).map(e=>e>qn?Math.cbrt(e):(Yn*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>Jn?t[0]**3:(116*t[0]-16)/Yn,e[0]>8?((e[0]+16)/116)**3:e[0]/Yn,t[2]>Jn?t[2]**3:(116*t[2]-16)/Yn].map((e,t)=>e*Xn[t])},formats:{"lab-d65":{coords:[`<number> | <percentage>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),Qn=5**.5*.5+.5;function $n(e,t){e=E(e),t=E(t);let n=A(e,[Zn,`l`]),r=A(t,[Zn,`l`]),i=Math.abs(n**+Qn-r**+Qn)**(1/Qn)*Math.SQRT2-40;return i<7.5?0:i}var er=/*#__PURE__*/ Object.freeze({__proto__:null,contrastAPCA:Hn,contrastDeltaPhi:$n,contrastLstar:Kn,contrastMichelson:Un,contrastWCAG21:On,contrastWeber:Gn});function tr(e,t,n={}){l(n)&&(n={algorithm:n});let{algorithm:r,...i}=n;if(!r){let e=Object.keys(er).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}e=E(e),t=E(t);for(let n in er)if(`contrast`+r.toLowerCase()===n.toLowerCase())return er[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function nr(e){let[t,n,r]=pe(e,O),i=t+15*n+3*r;return[4*t/i,9*n/i]}function rr(e){let[t,n,r]=pe(e,O),i=t+n+r;return[t/i,n/i]}function ir(e){Object.defineProperty(e.prototype,"uv",{get(){return nr(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return rr(this)}})}var ar=/*#__PURE__*/ Object.freeze({__proto__:null,register:ir,uv:nr,xy:rr});function or(e,t,n={}){l(n)&&(n={method:n});let{method:r=C.deltaE,...i}=n;for(let n in tn)if(`deltae`+r.toLowerCase()===n.toLowerCase())return tn[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function sr(e,t=.25){return j(e,[D.get(`oklch`,`lch`),`l`],e=>e*(1+t))}function cr(e,t=.25){return j(e,[D.get(`oklch`,`lch`),`l`],e=>e*(1-t))}var lr=/*#__PURE__*/ Object.freeze({__proto__:null,darken:cr,lighten:sr});function ur(e,t,n=.5,r={}){return[e,t]=[E(e),E(t)],u(n)===`object`&&([n,r]=[.5,n]),fr(e,t,r)(n)}function dr(e,t,n={}){let r;pr(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||=([e,t]=[E(e),E(t)],fr(e,t,c));let l=or(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=or(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;t<d.length&&d.length<s;t++){let n=d[t-1],i=d[t],a=(i.p+n.p)/2,o=r(a);e=Math.max(e,or(o,n.color),or(o,i.color)),d.splice(t,0,{p:a,color:r(a)}),t++}}}return d=d.map(e=>e.color),d}function fr(e,t,n={}){if(pr(e)){let[n,r]=[e,t];return fr(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=E(e),t=E(t),e=Ie(e),t=Ie(t);let s={colors:[e,t],options:n};if(r=r?D.get(r):D.registry[C.interpolationSpace]||e.space,i=i?D.get(i):r,e=P(e,r),t=P(t,r),e=an(e),t=an(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[A(e,a),A(t,a)];isNaN(o)&&!isNaN(s)?o=s:isNaN(s)&&!isNaN(o)&&(s=o),[o,s]=be(i,[o,s]),j(e,a,o),j(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return v(e,i,n)}),c=v(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=P(l,i)),l},{rangeArgs:s})}function pr(e){return u(e)===`function`&&!!e.rangeArgs}C.interpolationSpace=`lab`;function mr(e){e.defineFunction(`mix`,ur,{returns:`color`}),e.defineFunction(`range`,fr,{returns:`function<color>`}),e.defineFunction(`steps`,dr,{returns:`array<color>`})}var hr=/*#__PURE__*/ Object.freeze({__proto__:null,isRange:pr,mix:ur,range:fr,register:mr,steps:dr}),gr=new D({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:yn,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[NaN,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return s<0&&(o+=180,s=Math.abs(s)),o>=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[`<number> | <angle>`,`<percentage>`,`<percentage>`]},hsla:{coords:[`<number> | <angle>`,`<percentage>`,`<percentage>`],commas:!0,lastAlpha:!0}}}),_r=new D({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:gr,fromBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r+n*Math.min(r,1-r);return[t,i===0?0:200*(1-r/i),100*i]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r*(1-n/2);return[t,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:`--hsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),vr=new D({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:_r,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1)return[t,0,n/i*100];let a=1-r;return[t,(a===0?0:1-n/a)*100,a*100]},formats:{hwb:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),yr=new k({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),br=new k({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:yr,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))}),xr=new k({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:he,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),Sr=1/512,Cr=16/512,wr=new k({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:xr,toBase(e){return e.map(e=>e<Cr?e/16:e**1.8)},fromBase(e){return e.map(e=>e>=Sr?e**(1/1.8):16*e)}}),Tr=new D({id:`oklch`,name:`Oklch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:Me,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n)<a&&Math.abs(r)<a?NaN:Math.atan2(r,n)*180/Math.PI,[t,Math.sqrt(n**2+r**2),N(i)]},toBase(e){let[t,n,r]=e,i,a;return isNaN(r)?(i=0,a=0):(i=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180)),[t,i,a]},formats:{oklch:{coords:[`<percentage> | <number>`,`<number> | <percentage>[0,1]`,`<number> | <angle>`]}}}),Er=w.D65,Dr=216/24389,Or=24389/27,[kr,Ar]=nr({space:O,coords:Er}),jr=new D({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Er,base:O,fromBase(e){let t=[p(e[0]),p(e[1]),p(e[2])],n=t[1],[r,i]=nr({space:O,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=Dr?Or*n:116*Math.cbrt(n)-16;return[a,13*a*(r-kr),13*a*(i-Ar)]},toBase(e){let[t,n,r]=e;if(t===0||f(t))return[0,0,0];n=p(n),r=p(r);let i=n/(13*t)+kr,a=r/(13*t)+Ar,o=t<=8?t/Or:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[`<number> | <percentage>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),Mr=new D({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:jr,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n)<a&&Math.abs(r)<a?NaN:Math.atan2(r,n)*180/Math.PI,[t,Math.sqrt(n**2+r**2),N(i)]},toBase(e){let[t,n,r]=e;return n<0&&(n=0),isNaN(r)&&(r=0),[t,n*Math.cos(r*Math.PI/180),n*Math.sin(r*Math.PI/180)]},formats:{color:{id:`--lchuv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),Nr=216/24389,Pr=24389/27,Fr=F[0][0],Ir=F[0][1],Lr=F[0][2],Rr=F[1][0],zr=F[1][1],Br=F[1][2],Vr=F[2][0],Hr=F[2][1],Ur=F[2][2];function Wr(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function Gr(e){let t=(e+16)**3/1560896,n=t>Nr?t:e/Pr,r=n*(284517*Fr-94839*Lr),i=n*(838422*Lr+769860*Ir+731718*Fr),a=n*(632260*Lr-126452*Ir),o=n*(284517*Rr-94839*Br),s=n*(838422*Br+769860*zr+731718*Rr),c=n*(632260*Br-126452*zr),l=n*(284517*Vr-94839*Ur),u=n*(838422*Ur+769860*Hr+731718*Vr),d=n*(632260*Ur-126452*Hr);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function Kr(e,t){let n=t/360*Math.PI*2,r=Wr(e.r0s,e.r0i,n),i=Wr(e.r1s,e.r1i,n),a=Wr(e.g0s,e.g0i,n),o=Wr(e.g1s,e.g1i,n),s=Wr(e.b0s,e.b0i,n),c=Wr(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var qr=new D({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Mr,gamutSpace:yn,fromBase(e){let[t,n,r]=[p(e[0]),p(e[1]),p(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/Kr(Gr(t),r)*100,[r,i,t]},toBase(e){let[t,n,r]=[p(e[0]),p(e[1]),p(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=Kr(Gr(r),t)/100*n,[r,i,t]},formats:{color:{id:`--hsluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});F[0][0],F[0][1],F[0][2],F[1][0],F[1][1],F[1][2],F[2][0],F[2][1],F[2][2];function Jr(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function Yr(e){let t=Jr(e.r0s,e.r0i),n=Jr(e.r1s,e.r1i),r=Jr(e.g0s,e.g0i),i=Jr(e.g1s,e.g1i),a=Jr(e.b0s,e.b0i),o=Jr(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var Xr=new D({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Mr,gamutSpace:`self`,fromBase(e){let[t,n,r]=[p(e[0]),p(e[1]),p(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/Yr(Gr(t))*100,[r,i,t]},toBase(e){let[t,n,r]=[p(e[0]),p(e[1]),p(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=Yr(Gr(r))/100*n,[r,i,t]},formats:{color:{id:`--hpluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),Zr=203,Qr=2610/2**14,$r=2**14/2610,ei=2523/32,ti=32/2523,ni=3424/4096,ri=2413/128,ii=2392/128,ai=new k({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:ln,toBase(e){return e.map(function(e){return(Math.max(e**ti-ni,0)/(ri-ii*e**ti))**$r*1e4/Zr})},fromBase(e){return e.map(function(e){let t=Math.max(e*Zr/1e4,0);return((ni+ri*t**Qr)/(1+ii*t**Qr))**ei})}}),oi=.17883277,si=.28466892,ci=.55991073,li=3.7743,ui=new k({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:ln,toBase(e){return e.map(function(e){return e<=.5?e**2/3*li:(Math.exp((e-ci)/oi)+si)/12*li})},fromBase(e){return e.map(function(e){return e/=li,e<=1/12?Math.sqrt(3*e):oi*Math.log(12*e-si)+ci})}}),di={};ae.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=pi(e.W1,e.W2,e.options.method))}),ae.add(`chromatic-adaptation-end`,e=>{e.M||=pi(e.W1,e.W2,e.options.method)});function fi({id:e,toCone_M:t,fromCone_M:n}){di[e]=arguments[0]}function pi(e,t,n=`Bradford`){let r=di[n],[i,a,o]=c(r.toCone_M,e),[s,l,u]=c(r.toCone_M,t),d=c([[s/i,0,0],[0,l/a,0],[0,0,u/o]],r.toCone_M);return c(r.fromCone_M,d)}fi({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),fi({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),fi({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),fi({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(w,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),w.ACES=[.32168/.33767,1,.34065/.33767];var mi=new k({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:w.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),hi=2**-16,gi=-.35828683,_i=(Math.log2(65504)+9.72)/17.52,vi=new k({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[gi,_i],name:`Red`},g:{range:[gi,_i],name:`Green`},b:{range:[gi,_i],name:`Blue`}},referred:`scene`,base:mi,toBase(e){return e.map(function(e){return e<=-.3013698630136986?(2**(e*17.52-9.72)-hi)*2:e<_i?2**(e*17.52-9.72):65504})},fromBase(e){return e.map(function(e){return e<=0?(Math.log2(hi)+9.72)/17.52:e<hi?(Math.log2(hi+e*.5)+9.72)/17.52:(Math.log2(e)+9.72)/17.52})}}),yi=/*#__PURE__*/ Object.freeze({__proto__:null,A98RGB:br,A98RGB_Linear:yr,ACEScc:vi,ACEScg:mi,CAM16_JMh:Vt,HCT:Xt,HPLuv:Xr,HSL:gr,HSLuv:qr,HSV:_r,HWB:vr,ICTCP:vt,JzCzHz:at,Jzazbz:it,LCH:xe,LCHuv:Mr,Lab:M,Lab_D65:Zn,Luv:jr,OKLCH:Tr,OKLab:Me,P3:bn,P3_Linear:pn,ProPhoto:wr,ProPhoto_Linear:xr,REC_2020:fn,REC_2020_Linear:ln,REC_2100_HLG:ui,REC_2100_PQ:ai,XYZ_ABS_D65:He,XYZ_D50:he,XYZ_D65:O,sRGB:yn,sRGB_Linear:hn}),I=class e{constructor(...e){let t;e.length===1&&(t=E(e[0]));let n,r,i;t?(n=t.space||t.spaceId,r=t.coords,i=t.alpha):[n,r,i]=e,Object.defineProperty(this,"space",{value:D.get(n),writable:!1,enumerable:!0,configurable:!0}),this.coords=r?r.slice():[0,0,0],this.alpha=i>1||i===void 0?1:i<0?0:i;for(let e=0;e<this.coords.length;e++)this.coords[e]===`NaN`&&(this.coords[e]=NaN);for(let e in this.space.coords)Object.defineProperty(this,e,{get:()=>this.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=Sn(this,...t);return n.color=new e(n.color),n}static get(t,...n){return t instanceof e?t:new e(t,...n)}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function<color>`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array<color>`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(t){if(t.register)t.register(e);else for(let n in t)e.defineFunction(n,t[n])}};I.defineFunctions({get:A,getAll:pe,set:j,setAll:me,to:P,equals:Cn,inGamut:Fe,toGamut:an,distance:Le,toString:cn}),Object.assign(I,{util:ie,hooks:ae,WHITES:w,Space:D,spaces:D.registry,parse:le,defaults:C});for(let e of Object.keys(yi))D.register(yi[e]);for(let e in D.registry)bi(e,D.registry[e]);ae.add(`colorspace-init-end`,e=>{bi(e.id,e),e.aliases?.forEach(t=>{bi(t,e)})});function bi(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty(I.prototype,n,{get(){let n=this.getAll(e);return typeof Proxy>`u`?n:new Proxy(n,{has:(e,n)=>{try{return D.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,r)=>{if(n&&typeof n!=`symbol`&&!(n in e)){let{index:r}=D.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,r)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||r>=0){let{index:a}=D.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}})},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}I.extend(tn),I.extend({deltaE:or}),Object.assign(I,{deltaEMethods:tn}),I.extend(lr),I.extend({contrast:tr}),I.extend(ar),I.extend(Dn),I.extend(hr),I.extend(er);var xi=(e,t)=>{let n=`The dashboard component encountered an error`;typeof t?.dashboardId==`string`&&(n+=` for dashboard with id ${t.dashboardId}`),typeof t?.dashboardSlug==`string`&&(n+=` for dashboard with slug ${t.dashboardSlug}`),typeof t?.container==`string`&&(n+=` in container ${t.container}`),e&&(n+=`:
3
+ ${e}`,console.warn(n))},Si=e=>{let t=!1,n=``,r=(document.body||document.documentElement).style,i={svg:!!(`createElementNS`in document&&document.createElementNS(`http://www.w3.org/2000/svg`,`svg`).createSVGRect),flexbox:r.webkitFlexWrap===``||r.flexWrap===``,postMessage:!!window.postMessage};for(let r of[`svg`,`flexbox`,`postMessage`])i[r]||(t=!0,e.browserNotSupported=e.browserNotSupported||[],e.browserNotSupported.push(r),n+=`Your browser does not support: ${r}
4
+ `);let a=window.navigator.userAgent,o=a.includes(`MSIE`),s=a.includes(`Trident/`);(o||s)&&(t=!0,n=`IE is not supported.`),t&&xi(n)},L={appServer:`https://app.luzmo.com/`,apiHost:`https://api.luzmo.com/`,dashboardId:null,dashboardSlug:null,container:null,key:null,token:null,language:`auto`,editorLanguage:`auto`,editMode:null,screenMode:null,switchScreenModeOnResize:!0,itemId:null,theme:``,mainColor:``,itemDimensions:{width:`auto`,height:`auto`},loaderBackground:`#f9f9f9`,loaderFontColor:`#5a5a5a`,loaderSpinnerColor:`rgb(68, 52, 255)`,loaderSpinnerBackground:`rgba(169, 169, 169, 0.14)`,timezoneId:null,contextId:null},Ci=[{mode:`mobile`,width:[150,767]},{mode:`tablet`,width:[768,1199]},{mode:`desktop`,width:[1200,1599]},{mode:`largeScreen`,width:[1600,9999]},{mode:`fixed`,width:[]}],wi={initializing:{en:`Initializing...`,nl:`Laden...`,fr:`Chargement...`,de:`Initialisiere...`,es:`Inicializando...`},errorDashboard:{en:`Oops, we could not load this dashboard!`,nl:`Oeps, we konden het dashboard niet laden.`,fr:`Le chargement a echoué.`,de:`Hoppla, wir konnten dieses Dashboard nicht laden!`,es:`¡Ups! No pudimos cargar este tablero.`},errorItem:{en:`Oops, we could not load this item!`,nl:`Oeps, we konden de grafiek niet laden.`,fr:`Le chargement a echoué.`,de:`Hoppla, wir konnten dieses Diagramm nicht laden!`,es:`¡Ups! No pudimos cargar este elemento.`}},Ti=e=>e?e.endsWith(`/`)?e:`${e}/`:``,Ei=e=>e?e.endsWith(`/`)?e.slice(0,-1):e:``,Di=(e,t,n,r)=>{let i=(e,t)=>{let n=e.users.find(e=>e.id===t.id),r=n&&n.userAccessRight?{flagRead:n.userAccessRight.flagRead,flagUse:n.userAccessRight.flagUse,flagModify:n.userAccessRight.flagModify,flagOwn:n.userAccessRight.flagOwn}:{flagRead:!1,flagUse:!1,flagModify:!1,flagOwn:!1},i=e.groups.filter(e=>t.userGroups.includes(e.id)||e.public===!0).map(e=>{if(e.groupAccessRight)return e.groupAccessRight});for(let e of i)!r.flagRead&&e.flagRead&&(r.flagRead=e.flagRead),!r.flagUse&&e.flagUse&&(r.flagUse=e.flagUse),!r.flagModify&&e.flagModify&&(r.flagModify=e.flagModify),!r.flagOwn&&e.flagOwn&&(r.flagOwn=e.flagOwn);let a=e.integrations?.length>0?e.integrations.map(e=>{if(e.integrationAccessRight)return e.integrationAccessRight}):[];for(let e of a)!r.flagRead&&e.flagRead&&(r.flagRead=e.flagRead),!r.flagUse&&e.flagUse&&(r.flagUse=e.flagUse),!r.flagModify&&e.flagModify&&(r.flagModify=e.flagModify);return r},a=(e,t)=>{if(e==null)return``;if(typeof e!=`object`||Object.keys(e).length===0)return typeof e==`object`&&Object.keys(e).length===0?``:e;let n;return n=t&&e[t]?e[t]:e[Object.keys(e)[0]],n??=``,n},o=[];for(let s of e){let e={accessibleBy:[],accessRights:i(s,n),id:s.id,modifiedAt:s.modified_at,name:a(s.name,r.language),slug:null,tags:s.tags.map(e=>e.tag).sort((e,t)=>e.localeCompare(t))},c=s.integrations.find(e=>e.id===t);c?.integrationAccessRight?.slug&&(e.slug=c.integrationAccessRight.slug);let l=s.users.map(e=>({model:`User`,id:e.id,name:a(e.name,n.locale_id)})),u=s.groups.map(e=>({model:`Group`,id:e.id,name:a(e.name,n.locale_id)||{}})),d=s.integrations.map(e=>({model:`Integration`,id:e.id,name:a(e.name,n.locale_id)||{}}));e.accessibleBy=[...l,...u,...d],o.push(e)}return o},Oi=e=>{let t=/^(%20|\s)*(javascript|data)/im,n=/[^\u0020-\u007E]/gim,r=/^([^:]+):/gm,i=/* @__PURE__ */ new Set([`.`,`/`]),a=e=>i.has(e[0]);if(!e)return`about:blank`;let o=e.replaceAll(n,``).trim();if(a(o))return o;let s=o.match(r);if(!s)return o;let c=s[0];return t.test(c)?`about:blank`:o},ki=e=>JSON.parse(JSON.stringify(e)),Ai=e=>e&&typeof e==`object`,ji=(e,t)=>(Object.entries(t).forEach(([t,n])=>{e[t]=t in e?e[t]===void 0?n:Ai(n)?ji(e[t],n):e[t]:n}),e),R=()=>`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replaceAll(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)}),Mi=e=>{let t=[],{appServer:n,language:r,editorLanguage:i,loaderBackground:a,loaderSpinnerColor:o,loaderSpinnerBackground:s,loaderFontColor:c,screenMode:l,key:u,token:d,timezoneId:f,itemEmbedding:p,itemDimensions:m,dashboardId:h,dashboardSlug:g,itemId:_,theme:v,mainColor:y,editMode:b}=e.params;r&&r!==`auto`&&t.push(`language=${r}`),i&&i!==`auto`&&t.push(`editorLanguage=${i}`),a&&t.push(`ldrbg=${a}`),c&&t.push(`ldrftclr=${c}`),o&&t.push(`ldrspclr=${o}`),s&&t.push(`ldrspbg=${s}`),v&&t.push(`theme=${v}`),y&&t.push(`mainColor=${y}`),l&&l!==`auto`&&t.push(`screenMode=${l}`),f&&t.push(`timezoneId=`+f),p&&m&&m.width&&t.push(`width=`+m.width),p&&m&&m.height&&t.push(`height=`+m.height),b&&t.push(`editMode=`+b);let ee=u&&d?`#`+u+`:`+d:``;t.push(`version=`+(e.libVersion||`0.0.0-unknown-luzmo`));let te=Ti(n);return Oi(p?`${te}i/${h||g}/${_}?${encodeURIComponent(t.join(`&`))}${ee}`:`${te}i/${h||g}?${encodeURIComponent(t.join(`&`))}${ee}`)},Ni=e=>{let t;(e.params.error||e.browserNotSupported.length>0)&&(e.params.error=!0,e.browserNotSupported&&(t=`Browser is not supported.`));let n=wi.initializing[e.params.language]||wi.initializing.en;return e.browserNotSupported||e.params.error?{loadingMsg:n,errorMsg:t}:{loadingMsg:n,errorMsg:``}};function Pi(e,t,n){e.promises[t]&&(e.promises[t].resolve(n),delete e.promises[t])}function Fi(e,t,n){e.promises[t]&&(e.promises[t].reject(n),delete e.promises[t])}function Ii(e){let t={};return e.params.loaderBackground&&!e.iframeLoaded&&(t.background=e.params.loaderBackground),t}function Li(e){let t=e.params.itemDimensions?.height||L.itemDimensions.height,n=e.params.itemEmbedding&&t!==`auto`;return{display:e.iframeLoaded?`none`:``,height:`${n?t:e.minHeight}px`}}function Ri(e){let t=e.params.loaderBackground||L.loaderBackground;if(e.params.itemEmbedding){e.loaderSize=24,e.borderWidth=4,e.minHeight=200;let n=e.params.itemDimensions?.width||L.itemDimensions.width,r=e.params.itemDimensions?.height||L.itemDimensions.height,i=n!==`auto`,a=r!==`auto`;return{background:t,width:i?`${n}px`:`100%`,height:`${a?r:`200`}px`,"min-height":a?``:`200px`}}return{background:t}}function zi(e){let{loaderSpinnerColor:t,loaderSpinnerBackground:n}=L,r=Hi(e.borderWidth,e.params.loaderSpinnerColor||t),i=Hi(e.borderWidth,e.params.loaderSpinnerBackground||n),a=`${e.loaderSize}px`;return{"border-top":r,"border-right":r,"border-bottom":i,"border-left":i,width:a,height:a}}function Bi(e){let t=e.params.itemDimensions?.height||L.itemDimensions.height,n=e.params.itemEmbedding&&t!==`auto`;return{padding:`${e.params.itemId?(t=>`${(t-e.loaderSize-32)/2}px`)(n?Number.parseInt(`${t}`,10):e.minHeight):`128px`} 16px`}}function Vi(e){let t=e.params.itemDimensions?.height||L.itemDimensions.height,n=e.params.itemDimensions?.width||L.itemDimensions.width;e.iframeHeight=e.params.itemEmbedding&&t!==`auto`?`${t}px`:e.params.itemEmbedding?`200px`:[`editFull`,`editLimited`].includes(e.params.editMode)?`100%`:`400px`,e.iframeWidth=e.params.itemEmbedding&&n!==`auto`?`${n}px`:`100%`;let r={height:e.iframeHeight,width:e.iframeWidth};return e.iframeLoaded?r.opacity=1:e.error?(r.opacity=1,r.width=`100%`,r.height=`400px`):r.opacity=0,r}function Hi(e,t){return`${e}px solid ${t}`}var Ui=(e,t)=>{e?.contentWindow&&e.contentWindow.location.replace(t)},Wi=(e,t,n)=>{let r=R();return t?.contentWindow?(t.contentWindow.postMessage({action:`exportDashboard`,format:n||`png`,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(/* @__PURE__ */ Error(`exportDashboard request timed out.`)),delete e.promises[r])},12e5)})):Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},Gi=async e=>{if(await e.updateComplete,(e.currentAuthKey??e.authKey)&&(e.currentAuthToken??e.authToken)){let t=new Promise((t,n)=>{(()=>{try{window.fetch(`${Ti(e.params.apiHost)}0.1.0/authorization`,{method:`POST`,mode:`cors`,cache:`no-cache`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify({action:`get`,version:`0.1.0`,key:e.currentAuthKey??e.authKey,token:e.currentAuthToken??e.authToken,find:{where:{id:e.authKey},attributes:[`id`,`integration_id`],include:[{model:`User`,attributes:[`id`,`name`,`locale_id`],include:[{model:`Group`}]}]}})}).then(e=>e.json()).then(e=>{!e||!e.rows||e.rows.length===0||!e.rows[0].user?n(`Authorization failed, please check authKey and authToken. If the problem persists, please contact support@luzmo.com.`):(e.rows[0].user.userGroups=e.rows[0].user.groups.map(e=>e.id),delete e.rows[0].user.groups,t({integrationId:e.rows[0].integration_id,user:e.rows[0].user}))})}catch(e){n(e)}})()});return new Promise((n,r)=>void(()=>{try{t.then(t=>{window.fetch(`${Ti(e.params.apiHost)}0.1.0/securable`,{method:`POST`,mode:`cors`,cache:`no-cache`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify({action:`get`,version:`0.1.0`,key:e.currentAuthKey??e.authKey,token:e.currentAuthToken??e.authToken,find:{where:{type:`dashboard`,is_variant:!1},attributes:[`id`,`name`,`modified_at`],order:[[`modified_at`,`desc`]],include:[{model:`Tag`,attributes:[`tag`]},{model:`User`,attributes:[`id`,`name`]},{model:`Group`,attributes:[`id`,`name`,`public`]},{model:`Integration`,attributes:[`id`,`name`]}]}})}).then(e=>e.json()).then(r=>{n(r.rows.length>0?Di(r.rows,t.integrationId,t.user,e):[])})}).catch(e=>{r(e)})}catch(e){r(e)}})())}throw Error(`No authKey or authToken found in the luzmo-dashboard component.`)},Ki=(e,t)=>{if(t?.contentWindow){let n=R();return t.contentWindow.postMessage({action:`getDashboardContext`,_version:e.libVersion,requestId:n},`*`),new Promise((t,r)=>{e.promises[n]={resolve:t,reject:r},setTimeout(()=>{e.promises[n]&&(e.promises[n].reject(/* @__PURE__ */ Error(`getDashboardContext request timed out.`)),delete e.promises[n])},2e3)})}return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},qi=(e,t,n)=>{if(t?.contentWindow){let r=R();return t.contentWindow.postMessage({action:`getData`,id:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(/* @__PURE__ */ Error(`getData request timed out.`)),delete e.promises[r])},2e3)})}return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},Ji=(e,t)=>{if(t?.contentWindow){let n=R();return t.contentWindow.postMessage({action:`getFilters`,_version:e.libVersion,requestId:n},`*`),new Promise((t,r)=>{e.promises[n]={resolve:t,reject:r},setTimeout(()=>{e.promises[n]&&(e.promises[n].reject(/* @__PURE__ */ Error(`getFilters request timed out.`)),delete e.promises[n])},2e3)})}return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},Yi=(e,t,n={})=>{if(!t?.contentWindow)return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`));let r=R();return t.contentWindow.postMessage({action:`getInsights`,options:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(/* @__PURE__ */ Error(`getInsights request timed out.`)),delete e.promises[r])},6e4)})},Xi=(e,t,n)=>t?(t.contentWindow.postMessage({action:`refreshData`,id:n??null,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`)),Zi=(e,t)=>t?(t.contentWindow.postMessage({action:`reloadDashboard`,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`)),Qi=(e,t,n,r,i)=>t?(t.contentWindow.postMessage({action:`sendExportEmail`,type:n||`once`,subject:r,message:i,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`)),$i=(e,t,n,r)=>t?(t.contentWindow.postMessage({action:`setAuthorization`,key:n,token:r,_version:e.libVersion},`*`),Promise.resolve()):Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`)),ea=(e,t,n)=>{if(t&&t.contentWindow){let r=R();return e.params.editMode===n?Promise.reject(/* @__PURE__ */ Error(`editMode parameter is currently already set to `+n)):n!==`editFull`&&n!==`editLimited`&&n!==`view`?Promise.reject(/* @__PURE__ */ Error(`The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'.`)):(t.contentWindow.postMessage({action:`setEditMode`,editMode:n,_version:e.libVersion,requestId:r},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n}}))}return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},ta=(e,t,n)=>{if(t){let r=R();return t.contentWindow.postMessage({action:`setPreview`,preview:n,requestId:r,_version:e.libVersion},`*`),new Promise((t,n)=>{e.promises[r]={resolve:t,reject:n},setTimeout(()=>{e.promises[r]&&(e.promises[r].reject(/* @__PURE__ */ Error(`setPreview request timed out.`)),delete e.promises[r])},2e3)})}return Promise.reject(/* @__PURE__ */ Error(`Cannot retrieve contentWindow.`))},na=(e,t,n,r)=>{if(t){let i=R();return t.contentWindow.postMessage({action:`setSelectedData`,itemId:n,filters:r,_version:e.libVersion,requestId:i},`*`),new Promise((t,n)=>{e.promises[i]={resolve:t,reject:n},setTimeout(()=>{e.promises[i]&&(e.promises[i].reject(/* @__PURE__ */ Error(`setSelectedData request timed out.`)),delete e.promises[i])},2e3)})}return Promise.reject()},ra=e=>{if(!e.dimensions){e.params.error=!0,xi(`Got no valid dimensions.`,e.params);return}let t=Object.keys(e.dimensions),n=[],r,i=0,a=0;if(!e.params.switchScreenModeOnResize&&e.currentScreenMode&&(e.params.screenMode=e.currentScreenMode),e.dimensions&&t?.[0]===`fixed`)r=`fixed`,i=e.dimensions.fixed[0],a=e.dimensions.fixed[1];else{let o=[`mobile`,`tablet`,`desktop`,`largeScreen`];if(e.params.itemEmbedding){let[n]=t,r=ki(n);for(let n of o){let i=t.find(e=>e===n);i?r=ki(i):e.dimensions[n]=e.dimensions[r]}}for(let r of t)if(o.includes(r)){let t=Ci.find(e=>e.mode===r);n.push({...t,height:e.dimensions[r][1]||50})}if(n.map(e=>e.mode).includes(e.params.screenMode)||(e.params.screenMode=`auto`),e.params.screenMode===`auto`){n.sort((e,t)=>o.indexOf(e.mode)-o.indexOf(t.mode));for(let t of n){let[n,o]=t.width;e.params.itemEmbedding&&e.params.itemDimensions&&e.params.itemDimensions.width!==`auto`&&e.params.itemDimensions.height===`auto`?n<e.params.itemDimensions.width&&(r=t.mode,i=Number.parseInt(e.params.itemDimensions.width,10),a=e.dimensions[r][1]):n<e.containerWidth&&(r=t.mode,e.params.itemEmbedding?(i=e.params.itemDimensions?.width&&e.params.itemDimensions?.width!==`auto`?Number.parseInt(e.params.itemDimensions.width,10):Math.min(e.containerWidth,o),a=e.params.itemDimensions?.height&&e.params.itemDimensions?.height!==`auto`?Number.parseInt(e.params.itemDimensions.height,10):e.dimensions[r][1],e.params.itemDimensions&&e.params.itemDimensions.width!==`auto`&&e.params.itemDimensions.height===`auto`&&(i=Number.parseInt(e.params.itemDimensions.width,10),a=e.dimensions[r][1])):(i=Math.max(Math.min(o,e.containerWidth),n),a=t.height))}}else{let{height:t,width:[o,s]}=n.find(t=>t.mode===e.params.screenMode);r=e.params.screenMode,i=Math.max(Math.min(s,e.containerWidth),o),a=t,e.params.itemEmbedding&&(e.params.itemDimensions?.width&&e.params.itemDimensions?.width!==`auto`&&(i=Number.parseInt(e.params.itemDimensions.width,10)),e.params.itemDimensions?.height&&e.params.itemDimensions?.height!==`auto`&&(a=Number.parseInt(e.params.itemDimensions.height,10)))}if(!r&&n.length>0){let[e]=n;r=e.mode,i=e.width[0],a=e.height}}e.currentScreenMode=r;let o={height:a===0?`100%`:`${String(a)}px`,width:i===0?`100%`:`${String(i)}px`,opacity:1};[`editFull`,`editLimited`].includes(e.params.editMode)?(o.height=`100%`,o.width=`100%`):e.params.itemEmbedding&&e.params.itemDimensions?(o.height=e.params.itemDimensions.height===`auto`?o.height:`${String(e.params.itemDimensions.height).replace(`px`,``)}px`,o.width=e.params.itemDimensions.width===`auto`?o.width:`${String(e.params.itemDimensions.width).replace(`px`,``)}px`):(o.height=a===0?`100%`:`${String(a)}px`,o.width=i===0?`100%`:`${String(i)}px`),e.currentScreenMode=r,e.iframeStyle=o},ia=e=>{let t=Object.keys(L),n=[],r=[`appServer`,`language`,`apiHost`],i=[`key`,`token`,`screenMode`,`timezoneId`,`itemId`,`container`,`loaderBackground`,`loaderFontColor`,`loaderSpinnerColor`,`loaderSpinnerBackground`],a=[`itemDimensions`],o=[`mobile`,`tablet`,`desktop`,`largeScreen`,`fixed`,`auto`];for(let n of t)e.params[n]===null&&delete e.params[n];e.params=ji(e.params,L),e.params.dashboardId&&typeof e.params.dashboardId==`string`||e.params.dashboardSlug&&typeof e.params.dashboardSlug==`string`||(delete e.params.dashboardId,delete e.params.dashboardSlug);for(let t of r)typeof e.params[t]!=`string`&&(delete e.params[t],n.push(`${t} needs to be of type string.`));for(let t of i)typeof e.params[t]!=`string`&&e.params[t]!==null&&e.params[t]!==void 0&&(delete e.params[t],n.push(`${t} needs to be of type string or empty.`));if(e.params.screenMode&&!o.includes(e.params.screenMode)){let t=o.map(e=>`"${e}"`).join(`, `);n.push(`"screenMode" needs should be one of these types: ${t}`),e.params.screenMode=`auto`}e.params.itemId&&(e.params.itemEmbedding=!0);for(let t of a)typeof e.params[t]!=`object`&&e.params[t]!==null&&(delete e.params[t],n.push(`${t} needs to be of type object or empty.`));if(typeof e.params.switchScreenModeOnResize!=`boolean`&&(n.push(`switchScreenModeOnResize needs to be of type boolean.`),e.params.switchScreenModeOnResize=!0),e.params.itemDimensions)for(let t of[`width`,`height`])![`string`,`number`].includes(typeof e.params.itemDimensions[t])&&e.params.itemDimensions[t]!==null&&n.push(`itemDimensions ${t} needs to be of type string, number or empty.`);e.params=ji(e.params,L),e.params.screenMode&&e.params.screenMode!==`auto`&&(e.params.switchScreenModeOnResize=!1),e.params.itemDimensions.width!==`auto`&&(e.params.itemDimensions.width=Number.parseInt(`${e.params.itemDimensions.width}`.replace(`px`,``),10)||`auto`),e.params.itemDimensions.height!==`auto`&&(e.params.itemDimensions.height=Number.parseInt(`${e.params.itemDimensions.height}`.replace(`px`,``),10)||`auto`),e.params.itemEmbedding=!!e.params.itemId,(e.params.error||n.length>0)&&xi(n.join(`
5
+ `),e.params)},aa={type:`type`,slots:`slots`,options:`options`,appServer:`app-server`,apiHost:`api-host`,authKey:`auth-key`,authToken:`auth-token`,contextId:`context-id`,canFilter:`can-filter`,filters:`filters`,dashboardId:`dashboard-id`,itemId:`item-id`,aiMessageAssetId:`ai-message-asset-id`,dashboardContentsVersion:`dashboard-contents-version`,libVersion:`lib-version`},oa=`luzmo-embed-container`,sa=`FEDERATION_DEBUG`,ca={AT:`@`,HYPHEN:`-`,SLASH:`/`},la={[ca.AT]:`scope_`,[ca.HYPHEN]:`_`,[ca.SLASH]:`__`};la[ca.AT],ca.AT,la[ca.HYPHEN],ca.HYPHEN,la[ca.SLASH],ca.SLASH;var ua=/* @__PURE__ */ function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),da=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function fa(){return da}function pa(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function ma(){try{if(fa()&&window.localStorage)return!!localStorage.getItem(sa)}catch{return!1}return!1}function ha(){return typeof process<`u`&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:ma()}var ga=`[ Federation Runtime ]`,_a=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``};function va(e,t){if(`getPublicPath`in e){let n;return n=e.getPublicPath.startsWith(`function`)?Function(`return `+e.getPublicPath)()():Function(e.getPublicPath)(),`${n}${t}`}return`publicPath`in e?!fa()&&!pa()&&`ssrPublicPath`in e&&typeof e.ssrPublicPath==`string`?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn(`Cannot get resource URL. If in debug mode, please ignore.`,e,t),``)}var ya=e=>{console.warn(`${ga}: ${e}`)};function ba(e){try{return JSON.stringify(e,null,2)}catch{return``}}var xa=(e,t)=>{if(!e)return t;let n=(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 n?n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`:t};function Sa(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function Ca(e,t={}){let{remotes:n={},overrides:r={},version:i}=t,a,o=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&i?Sa(i):e.metaData.publicPath:e.metaData.getPublicPath,s=Object.keys(r),c={};Object.keys(n).length||(c=e.remotes?.reduce((e,t)=>{let n,i=t.federationContainerName;return n=s.includes(i)?r[i]:`version`in t?t.version:t.entry,e[i]={matchedVersion:n},e},{})||{}),Object.keys(n).forEach(e=>c[e]={matchedVersion:s.includes(e)?r[e]:n[e]});let{remoteEntry:{path:l,name:u,type:d},types:f={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:p},globalName:m,ssrRemoteEntry:h}=e.metaData,{exposes:g}=e,_={version:i||``,buildVersion:p,globalName:m,remoteEntry:xa(l,u),remoteEntryType:d,remoteTypes:xa(f.path,f.name),remoteTypesZip:f.zip||``,remoteTypesAPI:f.api||``,remotesInfo:c,shared:e?.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]})),modules:g?.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(a={..._,publicPath:o()},typeof e.metaData.ssrPublicPath==`string`&&(a.ssrPublicPath=e.metaData.ssrPublicPath)):a={..._,getPublicPath:o()},h){let e=xa(h.path,h.name);a.ssrRemoteEntry=e,a.ssrRemoteEntryType=h.type||`commonjs-module`}return a}function wa(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var Ta=`[ Module Federation ]`,Ea=console,Da=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function Oa(){try{let e=(/* @__PURE__ */ Error()).stack;if(!e)return;let[,...t]=e.split(`
6
+ `),n=t.filter(e=>!Da.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
7
+ `)}`:void 0}catch{return}}var ka=class{constructor(e,t=Ea){this.prefix=e,this.delegate=t??Ea}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Ea}emit(e,t){let n=this.delegate,r=ha()?Oa():void 0,i=r?[...t,r]:t,a=(()=>{switch(e){case`log`:return[`log`,`info`];case`info`:return[`info`,`log`];case`warn`:return[`warn`,`info`,`log`];case`error`:return[`error`,`warn`,`log`];default:return[`debug`,`log`]}})();for(let e of a){let t=n[e];if(typeof t==`function`){t.call(n,this.prefix,...i);return}}for(let e of a){let t=Ea[e];if(typeof t==`function`){t.call(Ea,this.prefix,...i);return}}}log(...e){this.emit(`log`,e)}warn(...e){this.emit(`warn`,e)}error(...e){this.emit(`error`,e)}success(...e){this.emit(`info`,e)}info(...e){this.emit(`info`,e)}ready(...e){this.emit(`info`,e)}debug(...e){ha()&&this.emit(`debug`,e)}};function Aa(e){return new ka(e)}function ja(e){let t=new ka(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Aa(Ta),ja(Ta);async function Ma(e,t){try{return await e()}catch(e){!t&&ya(e);return}}function Na(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function Pa(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`script`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`src`);if(o&&Na(o,e.url)){t=i,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=n?.type===`module`?`module`:`text/javascript`;let i;e.createScriptHook&&(i=e.createScriptHook(e.url,e.attrs),i instanceof HTMLScriptElement?t=i:typeof i==`object`&&(`script`in i&&i.script&&(t=i.script),`timeout`in i&&i.timeout&&(r=i.timeout))),t.src||(t.src=e.url),n&&!i&&Object.keys(n).forEach(e=>{t&&(e===`async`||e===`defer`?t[e]=n[e]:t.getAttribute(e)||t.setAttribute(e,n[e]))})}let o=null,s=typeof window<`u`?t=>{if(t.filename&&Na(t.filename,e.url)){let n=/* @__PURE__ */ Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);n.name=`ScriptExecutionError`,o=n}}:null;s&&window.addEventListener(`error`,s);let c=async(n,r)=>{clearTimeout(i),s&&window.removeEventListener(`error`,s);let a=()=>{if(r?.type===`error`){let t=/* @__PURE__ */ Error(r?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name=`ScriptNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else o?e?.onErrorCallback&&e?.onErrorCallback(o):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,Ma(()=>{let{needDeleteScript:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n&&typeof n==`function`)){let e=n(r);if(e instanceof Promise){let t=await e;return a(),t}return a(),e}a()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),i=setTimeout(()=>{c(null,{type:`error`,isTimeout:!0})},r),{script:t,needAttach:n}}function Fa(e){let t=null,n=!0,r=2e4,i,a=document.getElementsByTagName(`link`);for(let r=0;r<a.length;r++){let i=a[r],o=i.getAttribute(`href`),s=i.getAttribute(`rel`);if(o&&Na(o,e.url)&&s===e.attrs.rel){t=i,n=!1;break}}if(!t){t=document.createElement(`link`),t.setAttribute(`href`,e.url);let n,i=!0,a=e.attrs;e.createLinkHook&&(n=e.createLinkHook(e.url,a),n instanceof HTMLLinkElement?(t=n,i=!1):typeof n==`object`&&(`link`in n&&n.link&&(t=n.link,i=!1),`timeout`in n&&n.timeout&&(r=n.timeout))),a&&i&&Object.keys(a).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,a[e])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};let o=(n,r)=>{i&&clearTimeout(i);let a=()=>{if(r?.type===`error`){let t=/* @__PURE__ */ Error(r?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name=`LinkNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,Ma(()=>{let{needDeleteLink:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n)){let e=n(r);return a(),e}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),i=setTimeout(()=>{o(null,{type:`error`,isTimeout:!0})},r),{link:t,needAttach:n}}function Ia(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,i)=>{let{script:a,needAttach:o}=Pa({url:e,cb:t,onErrorCallback:i,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});o&&document.head.appendChild(a)})}var La=/* @__PURE__ */ new Map;function Ra(e){if(!e)throw Error(`import specifier is required`);if(La.has(e))return La.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),La.delete(e),t});return La.set(e,t),t}var za=async(e,t,n)=>{let r=await((e,t)=>n.lifecycle.fetch.emit(e,t))(e,t||{});return!r||!(r instanceof Response)?fetch(e,t||{}):r},Ba=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t,n,r)=>{if(r?.createScriptHook){let t=r.createScriptHook(e);t&&typeof t==`object`&&`url`in t&&(e=t.url)}let i;try{i=new URL(e)}catch(e){console.error(`Error constructing URL:`,e),t(/* @__PURE__ */ Error(`Invalid URL: ${e}`));return}let a=async()=>r?.fetch?(e,t)=>za(e,t,r):fetch,o=async(e,r)=>{try{let i=await(await e(r.href)).text(),[a,o]=await Promise.all([Ra(`path`),Ra(`vm`)]),s={exports:{},module:{exports:{}}},c=r.pathname.split(`/`).slice(0,-1).join(`/`),l=a.basename(r.pathname),u=new o.Script(`(function(exports, module, require, __dirname, __filename) {${i}\n})`,{filename:l,importModuleDynamically:o.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??Ra}),d;d=(await Ra(`node:module`)).createRequire(r.protocol===`file:`||r.protocol===`node:`?r.href:a.join(process.cwd(),`__mf_require_base__.js`)),u.runInThisContext()(s.exports,s.module,d,c,l);let f=s.module.exports||s.exports;if(n&&f&&n.globalName){t(void 0,f[n.globalName]||f);return}t(void 0,f)}catch(e){t(e instanceof Error?e:/* @__PURE__ */ Error(`Script execution error: ${e}`))}};a().then(async e=>{if(n?.type===`esm`||n?.type===`module`)return $a(i.href,{fetch:e,vm:await Ra(`vm`)}).then(async e=>{await e.evaluate(),t(void 0,e.namespace)}).catch(e=>{t(e instanceof Error?e:/* @__PURE__ */ Error(`Script execution error: ${e}`))});o(e,i)}).catch(e=>{t(e)})}:(e,t,n,r)=>{t(/* @__PURE__ */ Error(`createScriptNode is disabled in non-Node.js environment`))},Va=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{Ba(e,(e,i)=>{if(e)r(e);else{let e=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[e]=i)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error(`loadScriptNode is disabled in non-Node.js environment`)},Ha=/* @__PURE__ */ new Map,Ua=e=>e.startsWith(`http:`)||e.startsWith(`https:`),Wa=e=>!e.startsWith(`./`)&&!e.startsWith(`../`)&&!e.startsWith(`/`)&&!e.includes(`:`);function Ga(e){let t=new URL(e),n=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),i=t.pathname.split(`/`).map(e=>encodeURIComponent(e)).join(`/`),a=encodeURIComponent(`${t.search}${t.hash}`);return`/${n}/${r}${i}${a?`/${a}`:``}`}function Ka(e,t){let n=t.endsWith(`/`)?t:`${t}/`;return new URL(`__module_federation_remote__${Ga(e)}`,n).href}async function qa(e){return e.startsWith(`node:`)?!0:Wa(e)?(await Ra(`node:module`)).builtinModules.includes(e):!1}function Ja(e){let t=e&&(typeof e==`object`||typeof e==`function`)?e:{default:e},n={...t};return Object.prototype.hasOwnProperty.call(n,`default`)||(n.default=t),n}async function Ya(e,t,n){if(typeof n.SyntheticModule!=`function`)throw Error(`vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.`);let r=Ja(t),i=Object.keys(r),a=new n.SyntheticModule(i,function(){for(let e of i)this.setExport(e,r[e])},{identifier:e});return Ha.set(e,a),await a.link(async()=>{throw Error(`Node.js built-in module "${e}" should not request child modules.`)}),await a.evaluate(),a}async function Xa(e,t){let n=`node-builtin:${e}`;return Ha.has(n)?Ha.get(n):Ya(n,await Ra(e),t)}async function Za(e,t,n){if(await qa(e))return Xa(e,n.vm);if(Wa(e))throw Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);let r=new URL(e,t).href;if(!Ua(r))throw Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return $a(r,n)}async function Qa(e){if(e.status===`linked`&&await e.evaluate(),e.status===`errored`)throw e.error;return e}async function $a(e,t){if(Ha.has(e))return Ha.get(e);let{fetch:n,vm:r}=t;if(!Ua(e))throw Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);let i=await(await n(e)).text(),a=(await Ra(`node:url`)).pathToFileURL(process.cwd()).href,o=new r.SourceTextModule(i,{identifier:e,initializeImportMeta:t=>{t.url=Ka(e,a)},importModuleDynamically:async n=>Qa(await Za(n,e,t))});return Ha.set(e,o),await o.link(async n=>Za(n,e,t)),o}var eo=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,to=(e,t,n,r)=>{let i=[`${[t[e]]} #${e}`];return n&&i.push(`args: ${JSON.stringify(n)}`),i.push(eo(e)),r&&i.push(`Original Error Message:\n ${r}`),i.join(`
8
+ `)};function no(e,t,n,r,i,a){return r(to(e,t,n,i))}var ro=`[ Federation Runtime ]`,io=Aa(ro);function z(e,t,n,r,i){e||(n===void 0?B(t):B(t,n,r,void 0,i))}function B(e,t,n,r,i){if(t!==void 0)return no(e,t,n??{},e=>{throw Error(`${ro}: ${e}`)},r,i);let a=e;throw a instanceof Error?(a.message.startsWith(ro)||(a.message=`${ro}: ${a.message}`),a):Error(`${ro}: ${a}`)}function ao(e){e instanceof Error&&(e.message.startsWith(ro)||(e.message=`${ro}: ${e.message}`)),io.warn(e)}function oo(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function so(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function co(e){return e.entry!==void 0}function lo(e){return!e.entry.includes(`.json`)}function uo(e){return e&&typeof e==`object`}var fo=Object.prototype.toString;function po(e){return fo.call(e)===`[object Object]`}function mo(e){return Array.isArray(e)?e:[e]}function ho(e){let t={url:``,type:`global`,globalName:``};return da||pa()||!(`ssrRemoteEntry`in e)?`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}var go=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},_o=2e3,V=typeof globalThis==`object`?globalThis:window,H=(()=>{try{return document.defaultView}catch{return V}})(),vo=H;function yo(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function bo(e,t){return Object.hasOwnProperty.call(e,t)}bo(V,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||yo(V,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var xo=V.__GLOBAL_LOADING_REMOTE_ENTRY__;function So(e){bo(e,`__VMOK__`)&&!bo(e,`__FEDERATION__`)&&yo(e,`__FEDERATION__`,e.__VMOK__),bo(e,`__FEDERATION__`)||(yo(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:/* @__PURE__ */ new Map,__PRELOADED_ASSETS__:/* @__PURE__ */ new Set}),yo(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=/* @__PURE__ */ new Map,e.__FEDERATION__.__PRELOADED_ASSETS__??=/* @__PURE__ */ new Set}So(V),So(H);function Co(e){V.__FEDERATION__.__INSTANCES__.push(e)}function wo(){return V.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function To(e,t=ha()){t&&(V.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,V.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.9.0`)}function Eo(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,i]=r.split(`:`),a=`${n}:${t}`,o=e[a];if(o)return{value:o,key:a}}return{value:void 0,key:t}}}B(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Do=()=>H.__FEDERATION__.moduleInfo,Oo=(e,t)=>{let n=Eo(t,so(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=so(n),i=Eo(H.__FEDERATION__.moduleInfo,r).value;if(i?.version===t)return i}},ko=e=>Oo(e,H.__FEDERATION__.moduleInfo),Ao=(e,t)=>{let n=so(e);return H.__FEDERATION__.moduleInfo[n]=t,H.__FEDERATION__.moduleInfo},jo=e=>(H.__FEDERATION__.moduleInfo={...H.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete H.__FEDERATION__.moduleInfo[e]}),Mo=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:V[n]}},No=()=>H.__FEDERATION__.__GLOBAL_PLUGIN__,Po=e=>V.__FEDERATION__.__PRELOADED_MAP__.get(e),Fo=e=>V.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Io=e=>V.__FEDERATION__.__PRELOADED_ASSETS__.has(e),Lo=e=>{let t=V.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>_o){let e=t.values().next().value;e!==void 0&&t.delete(e)}},Ro=`[0-9A-Za-z-]+`,zo=`(?:\\+(${Ro}(?:\\.${Ro})*))`,Bo=`0|[1-9]\\d*`,Vo=`[0-9]+`,Ho=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,Uo=`(?:${Vo}|${Ho})`,Wo=`(?:-?(${Uo}(?:\\.${Uo})*))`,Go=`(?:${Bo}|${Ho})`,Ko=`(?:-(${Go}(?:\\.${Go})*))`,qo=`${Bo}|x|X|\\*`,Jo=`[v=\\s]*(${qo})(?:\\.(${qo})(?:\\.(${qo})(?:${Ko})?${zo}?)?)?`,Yo=`^\\s*(${Jo})\\s+-\\s+(${Jo})\\s*$`,Xo=`[v=\\s]*${`(${Vo})\\.(${Vo})\\.(${Vo})`}${Wo}?${zo}?`,Zo=`((?:<|>)?=?)`,Qo=`(\\s*)${Zo}\\s*(${Xo}|${Jo})`,$o=`(?:~>?)`,es=`(\\s*)${$o}\\s+`,ts=`(?:\\^)`,ns=`(\\s*)${ts}\\s+`,rs=`(<|>)?=?\\s*\\*`,is=`^${ts}${Jo}$`,as=`v?${`(${Bo})\\.(${Bo})\\.(${Bo})`}${Ko}?${zo}?`,os=`^${$o}${Jo}$`,ss=`^${Zo}\\s*${Jo}$`,cs=`^${Zo}\\s*(${as})$|^$`,ls=`^\\s*>=\\s*0.0.0\\s*$`;function U(e){return new RegExp(e)}function W(e){return!e||e.toLowerCase()===`x`||e===`*`}function us(...e){return t=>e.reduce((e,t)=>t(e),t)}function ds(e){return e.match(U(cs))}function fs(e,t,n,r){let i=`${e}.${t}.${n}`;return r?`${i}-${r}`:i}function ps(e){return e.replace(U(Yo),(e,t,n,r,i,a,o,s,c,l,u,d)=>(t=W(n)?``:W(r)?`>=${n}.0.0`:W(i)?`>=${n}.${r}.0`:`>=${t}`,s=W(c)?``:W(l)?`<${Number(c)+1}.0.0-0`:W(u)?`<${c}.${Number(l)+1}.0-0`:d?`<=${c}.${l}.${u}-${d}`:`<=${s}`,`${t} ${s}`.trim()))}function ms(e){return e.replace(U(Qo),`$1$2$3`)}function hs(e){return e.replace(U(es),`$1~`)}function gs(e){return e.replace(U(ns),`$1^`)}function _s(e){return e.trim().split(/\s+/).map(e=>e.replace(U(is),(e,t,n,r,i)=>W(t)?``:W(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:W(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:i?t===`0`?n===`0`?`>=${t}.${n}.${r}-${i} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${i} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function vs(e){return e.trim().split(/\s+/).map(e=>e.replace(U(os),(e,t,n,r,i)=>W(t)?``:W(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:W(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function ys(e){return e.split(/\s+/).map(e=>e.trim().replace(U(ss),(e,t,n,r,i,a)=>{let o=W(n),s=o||W(r),c=s||W(i);return t===`=`&&c&&(t=``),a=``,o?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&c?(s&&(r=0),i=0,t===`>`?(t=`>=`,s?(n=Number(n)+1,r=0,i=0):(r=Number(r)+1,i=0)):t===`<=`&&(t=`<`,s?n=Number(n)+1:r=Number(r)+1),t===`<`&&(a=`-0`),`${t+n}.${r}.${i}${a}`):s?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:c?`>=${n}.${r}.0${a} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function bs(e){return e.trim().replace(U(rs),``)}function xs(e){return e.trim().replace(U(ls),``)}function Ss(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Cs(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],i=r[e];if(t!==i)return t===void 0&&i===void 0?0:t?i?Ss(t,i):-1:1}return 0}function ws(e,t){return Ss(e.major,t.major)||Ss(e.minor,t.minor)||Ss(e.patch,t.patch)||Cs(e,t)}function Ts(e,t){return e.version===t.version}function Es(e,t){switch(e.operator){case``:case`=`:return Ts(e,t);case`>`:return ws(e,t)<0;case`>=`:return Ts(e,t)||ws(e,t)<0;case`<`:return ws(e,t)>0;case`<=`:return Ts(e,t)||ws(e,t)>0;case void 0:return!0;default:return!1}}function Ds(e){return us(_s,vs,ys,bs)(e)}function Os(e){return us(ps,ms,hs,gs)(e.trim()).split(/\s+/).join(` `)}function ks(e,t){if(!e)return!1;let n=ds(e);if(!n)return!1;let[,r,,i,a,o,s]=n,c={operator:r,version:fs(i,a,o,s),major:i,minor:a,patch:o,preRelease:s?.split(`.`)},l=t.split(`||`);for(let e of l){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=Os(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>Ds(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>xs(e)).filter(Boolean);if(r.length===0)continue;let i=!0;for(let e of r){let t=ds(e);if(!t){i=!1;break}let[,n,,r,a,o,s]=t;if(!Es({operator:n,version:fs(r,a,o,s),major:r,minor:a,patch:o,preRelease:s?.split(`.`)},c)){i=!1;break}}if(i)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var As=`default`,js=`global`;function Ms(e,t,n,r){let i;return i=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{B(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&B(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:i,loaded:e?.loaded||`lib`in e?!0:void 0,version:e.version??`0`,scope:Array.isArray(e.scope)?e.scope:[e.scope??`default`],strategy:(e.strategy??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??ua.UNKNOWN,useIn:[]}:void 0}}function Ns(e,t){let n=t.shared||{},r=t.name,i=Object.keys(n).reduce((e,i)=>{let a=mo(n[i]);return e[i]=e[i]||[],a.forEach(n=>{e[i].push(Ms(n,r,i,t.shareStrategy))}),e},{}),a={...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]}),{allShareInfos:a,newShareInfos:i}}function Ps(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===ua.NO_USE?!1:n===ua.CALCULATED?!0:r===`runtime-infer`?!t||zs(e,t):!1}function Fs(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!ks(n(e),`<=${n(t)}`)}var Is=(e,t)=>{let n=t||function(e,t){return Fs(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},Ls=e=>!!e.loaded||typeof e.lib==`function`,Rs=e=>!!e.loading,zs=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function Bs(e,t,n,r){let i=e[t][n],a=``,o=Ps(r),s=function(e,t){return o?i[e].treeShaking?i[t].treeShaking?!Ls(i[e].treeShaking)&&Fs(e,t):!1:!0:!Ls(i[e])&&Fs(e,t)};if(o){if(a=Is(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:Is(e[t][n],s),useTreesShaking:o}}var Vs=e=>Ls(e)||Rs(e);function Hs(e,t,n,r){let i=e[t][n],a=``,o=Ps(r),s=function(e,t){if(o){if(!i[e].treeShaking)return!0;if(!i[t].treeShaking)return!1;if(Vs(i[t].treeShaking))return!Vs(i[e].treeShaking)||!!Fs(e,t);if(Vs(i[e].treeShaking))return!1}return Vs(i[t])?!Vs(i[e])||!!Fs(e,t):!Vs(i[e])&&Fs(e,t)};if(o){if(a=Is(e[t][n],s),a)return{version:a,useTreesShaking:o};o=!1}return{version:Is(e[t][n],s),useTreesShaking:o}}function Us(e){return e===`loaded-first`?Hs:Bs}function Ws(e,t,n,r,i){if(!e)return;let{shareConfig:a,scope:o=As,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=Us(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:vo.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!ks(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?B(e):ao(e)}return{shared:r,useTreesShaking:d}}{if(l===!1||l===`*`||ks(u,l))return{shared:r,useTreesShaking:d};let n=Ps(c);if(n){for(let[r,i]of Object.entries(e[o][t]))if(Ps(i.treeShaking,c?.usedExports)&&ks(r,l))return{shared:i,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(ks(n,l))return{shared:r,useTreesShaking:!1}}},loadContext:i};return(r.emit(f)||f).resolver()}}function Gs(){return vo.__FEDERATION__.__SHARE__}function Ks(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,i=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[Is(t,function(e,n){return!Ls(t[e])&&Fs(e,n)})]}),a=e=>typeof e==`object`&&!!e&&!Array.isArray(e),o=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];a(n)&&a(r)?t[e]=o(n,r):r!==void 0&&(t[e]=r)}return t};return o(i(r[t]),n?.customShareInfo)}var qs=(e,t)=>{e.useIn||=[],oo(e.useIn,t)};function Js(e,t){return t&&e.treeShaking?e.treeShaking:e}function Ys(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function Xs(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let i=n.alias&&t.startsWith(n.alias),a=n.alias&&t.replace(n.alias,``);if(n.alias&&i){if(a&&a.startsWith(`/`)){let e=n.alias;return a=`.${a}`,{pkgNameOrAlias:e,expose:a,remote:n}}if(a===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function Zs(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var Qs=`RUNTIME-001`,$s=`RUNTIME-002`,ec=`RUNTIME-003`,tc=`RUNTIME-004`,nc=`RUNTIME-005`,rc=`RUNTIME-006`,ic=`RUNTIME-007`,ac=`RUNTIME-008`,oc=`RUNTIME-009`,sc=`RUNTIME-010`,cc=`RUNTIME-011`,lc=`RUNTIME-012`,uc=`RUNTIME-013`,dc=`RUNTIME-014`,fc=`RUNTIME-015`,pc=`TYPE-001`,mc=`BUILD-001`,hc=`BUILD-002`,G={[Qs]:`Failed to get remoteEntry exports.`,[$s]:`The remote entry interface does not contain "init"`,[ec]:`Failed to get manifest.`,[tc]:`Failed to locate remote.`,[nc]:`Invalid loadShareSync function call from bundler runtime`,[rc]:`Invalid loadShareSync function call from runtime`,[ic]:`Failed to get remote snapshot.`,[ac]:`Failed to load script resources.`,[oc]:`Please call createInstance first.`,[sc]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[cc]:`The remoteEntry URL is missing from the remote snapshot.`,[lc]:`The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.`,[uc]:`The manifest is not a valid Module Federation manifest.`,[dc]:`The remote does not expose the requested module.`,[fc]:`Remote container initialization failed.`},gc={[pc]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},_c={[mc]:`Failed to find expose module.`,[hc]:`PublicPath is required in prod mode.`};({...G,...gc,..._c});var vc=`.then(callbacks[0]).catch(callbacks[1])`,yc=/* @__PURE__ */ new WeakMap,bc=[`Failed to fetch dynamically imported module`,`Importing a module script failed`,`error loading dynamically imported module`];function xc(e){return e instanceof TypeError&&bc.some(t=>e.message.includes(t))}function Sc(e){return e===`esm`||e===`module`}async function Cc({entry:e,remoteEntryExports:t,name:n,getEntryUrl:r}){return new Promise((i,a)=>{let o=e=>{if(xc(e)){let t=e instanceof Error?e.message:String(e);try{B(ac,G,{remoteName:n,resourceUrl:s},t)}catch(e){a(e);return}}a(e)},s=r?r(e):e;try{t?i(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${s}")${vc}`)([i,o]):import(
9
+ /* webpackIgnore: true */
10
+ /* @vite-ignore */
11
+ s).then(i).catch(o)}catch(e){B(`Failed to load ESM entry from "${s}". ${e instanceof Error?e.message:String(e)}`)}})}async function wc({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${vc}`)([n,r])}catch(t){B(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Tc(e,t,n){let{remoteEntryKey:r,entryExports:i}=Mo(e,t);return i||B(Qs,G,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),i}async function Ec({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:i,getEntryUrl:a,resourceContext:o}){let{entryExports:s}=Mo(e,t);if(s)return s;let c=a?a(n):n;return Ia(c,{attrs:{},createScriptHook:(e,t)=>{let n=i.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:o?{...o,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>Tc(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);B(ac,G,{remoteName:e,resourceUrl:c},n)})}async function Dc({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:i}){let{entry:a,entryGlobalName:o,name:s,type:c}=e;return Sc(c)?Cc({entry:a,remoteEntryExports:t,name:s,getEntryUrl:r}):c===`system`?wc({entry:a,remoteEntryExports:t}):Ec({entry:a,globalName:o,name:s,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:i})}async function Oc({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:i,name:a,type:o}=e,{entryExports:s}=Mo(a,i);return s||Va(r,{attrs:{name:a,globalName:i,type:o},loaderHook:{createScriptHook:(r,i={})=>{let a=t.lifecycle.createScript.emit({url:r,attrs:i,remoteInfo:e,resourceContext:n?{...n,url:r}:void 0});if(a&&`url`in a)return a}}}).then(()=>Tc(a,i,r)).catch(e=>{B(`Failed to load Node.js entry for remote "${a}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function kc(e){let{entry:t,name:n}=e;return _a(n,t)}async function Ac(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:i,resourceContext:a,_inErrorHandling:o=!1}=e,s=kc(r);if(n)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:n,resourceContext:a,cached:!0}),n;if(!xo[s]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;xo[s]=e.emit({origin:t,loaderHook:c,remoteInfo:r,remoteEntryExports:n,resourceContext:a}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:da)?Dc({remoteInfo:r,remoteEntryExports:n,loaderHook:c,getEntryUrl:i,resourceContext:a}):Oc({remoteInfo:r,loaderHook:c,resourceContext:a}))).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,resourceContext:a}),e)).catch(async e=>{let i=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!i&&!o){let i=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>Ac({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:xo,uniqueKey:s});if(i)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:i,resourceContext:a,error:e,recovered:!0}),i}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e}),yc.set(xo[s],t)}let c=xo[s];if(yc.get(c)!==t)try{let e=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,resourceContext:a}),e}catch(e){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,resourceContext:a,error:e}),e}return c}function jc(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Mc(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Nc(e){let t=/* @__PURE__ */ new Map;return[...e||[],...No()].forEach(e=>{e&&(z(po(e),`Plugin configuration is invalid.`),z(e.name,`A name must be provided by the plugin.`),t.has(e.name)||t.set(e.name,e))}),Array.from(t.values())}function Pc(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Fc(e,t){let n=/* @__PURE__ */ new Map;t.options.plugins.forEach(e=>{e&&n.set(e.name,e)});let r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Nc(e).forEach(e=>{if(n.set(e.name,e),t.hooks.registerPlugins[e.name])return;let i=Pc(e,e.apply?.(t));r.forEach(e=>{e.applyPlugin(i)})}),Array.from(n.values())}function Ic(e){return{name:e.name,alias:e.alias,entry:`entry`in e?e.entry:void 0,version:`version`in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function K(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion!==!1&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(Ic)??[],shared:t}}}function Lc(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function Rc(e,t){return t.map(t=>{let n=Zs(e,t.nameOrAlias);return z(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&ba({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Lc(t)}})}function zc(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function Bc(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function Vc(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Hc(e,t,n,r){return n?Io(t)?Promise.resolve(Vc(e,t,`cached`)):(Lo(t),r()):r()}async function Uc(e,t,n,r){let i=e.moduleCache.get(n.name),a=n.entry;if(i?.remoteEntryExports)return Vc(r,a,`cached`);try{if(!await Ac({origin:e,remoteInfo:n,remoteEntryExports:i?.remoteEntryExports,resourceContext:{...r,url:a}}))throw Error(`Failed to load remoteEntry "${a}".`);return Vc(r,a,`success`)}catch(e){return Vc(r,a,Bc(e)?`timeout`:`error`,e)}}function Wc({host:e,remoteInfo:t,url:n,attrs:r,context:i,needDeleteLink:a}){return new Promise(o=>{let{link:s,needAttach:c}=Fa({url:n,cb:()=>{o(Vc(i,n,c?`success`:`cached`))},onErrorCallback:e=>{o(Vc(i,n,Bc(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let a=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLLinkElement,a},needDeleteLink:a});c&&document.head.appendChild(s)})}function Gc({host:e,remoteInfo:t,url:n,attrs:r,context:i}){return new Promise(a=>{let{script:o,needAttach:s}=Pa({url:n,cb:()=>{a(Vc(i,n,s?`success`:`cached`))},onErrorCallback:e=>{a(Vc(i,n,Bc(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let a=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...i,url:n}});return a instanceof HTMLScriptElement,a},needDeleteScript:!0});s&&document.head.appendChild(o)})}function Kc(e,t){return{...e,resourceType:t}}function qc(e,t,n,r=!0,i={initiator:`preloadRemote`,id:e.name},a=!0){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(Uc(t,e,r,Kc(i,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{let o=Kc(i,`css`);l.push(Hc(o,r,a,()=>Wc({host:t,remoteInfo:e,url:r,attrs:n,context:o})))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{let o=Kc(i,`css`);l.push(Hc(o,r,a,()=>Wc({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:o})))})}let n=Gc,u={fetchpriority:`high`,type:`text/javascript`};r?(n=Wc,u={rel:`preload`,as:`script`}):Sc(e.type)&&(n=Wc,u={rel:`modulepreload`,fetchpriority:`high`}),s.forEach(r=>{let o=Kc(i,`js`);l.push(Hc(o,r,a,()=>n({host:t,remoteInfo:e,url:r,attrs:u,context:o})))})}return Promise.all(l)}function Jc(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function Yc(e,t,n){let r=t,i=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];i.length||i.push(`default`),i.forEach(e=>{r[e]||(r[e]={})});let a={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?i:e.shareScope||`default`};return Object.defineProperty(a,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:a,shareScope:r[i[0]],initScope:n??[]}}var Xc=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e,t){let n=t||{initiator:`loadRemote`,id:Ys(this.remoteInfo.name,e),resourceType:`remoteEntry`,url:this.remoteInfo.entry,expose:e},r=await Ac({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:n});return z(r,`remoteEntryExports is undefined \n ${ba(this.remoteInfo)}`),this.remoteEntryExports=r,this.remoteEntryExports}async init(e,t,n,r,i){let a=await this.getEntry(r,i);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:i,initScope:o}=Yc(this.remoteInfo,this.host.shareScopeMap,n),s=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:i,remoteEntryInitOptions:r,initScope:o,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&B($s,G,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,K(this.host.options));try{await a.init(s.shareScope,s.initScope,s.remoteEntryInitOptions)}catch(e){B(fc,G,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,K(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...s,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}async get(e,t,n,r){let{loadFactory:i=!0}=n||{loadFactory:!0},a=await this.init(e,r,void 0,t);this.lib=a,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,origin:this.host});let o;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:a,expose:t,moduleInfo:this.remoteInfo});o=typeof n==`function`?n:void 0,o||=await a.get(t),o||B(dc,G,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Jc(r)},void 0,K(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,moduleFactory:o,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:a,error:n,origin:this.host}),n}let s=go(this.remoteInfo.name,t),c=this.wraperFactory(o,s);if(!i)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,origin:this.host});try{let n=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:i,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},Zc=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){z(po(e),`Plugin configuration is invalid.`);let t=e.name;z(t,`A name must be provided by the plugin.`),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){z(e,`A name is required.`);let t=this.registerPlugins[e];z(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(e=>{let n=t[e];n&&this.lifecycle[e].remove(n)}),delete this.registerPlugins[e]}},q=class{constructor(e){this.type=``,this.listeners=/* @__PURE__ */ new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},J=class extends q{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,i=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?i(t):i(n)):t;t=i()}return Promise.resolve(t)}};function Qc(e,t){if(!uo(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var $c=class extends q{constructor(e){super(),this.onerror=B,this.type=e}emit(e){uo(e)||B(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(Qc(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){ao(e),this.onerror(e)}return e}},el=class extends q{constructor(e){super(),this.onerror=B,this.type=e}emit(e){uo(e)||B(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(ao(t),this.onerror(t),e),i=a=>{if(a!==void 0&&Qc(e,a))e=a;else if(a!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(i,r)}catch(e){return r(e)}return e};return Promise.resolve(i(e))}return Promise.resolve(e)}},tl=`Remote loading is disabled by experiments.optimization.disableRemote.`,nl=class{constructor(){this.hooks=new Zc({})}formatAndRegisterRemote(){return[]}loadRemote(){throw Error(tl)}preloadRemote(){throw Error(tl)}registerRemotes(){throw Error(tl)}getRemoteModuleAndOptions(){throw Error(tl)}initRawContainer(){throw Error(tl)}};function rl(e,t){let n=ho(t);n.url||B(cc,G,{remoteName:e.name});let r=va(t,n.url);!da&&!r.startsWith(`http`)&&(r=`https:${r}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function il(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:i,remoteInfo:a,id:o}=e;if(!co(t)||!lo(t)){let{remoteSnapshot:s,globalSnapshot:c}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Ys(t.name,r)});rl(a,s);let l=[{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await i.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:i.options,origin:i});let[u]=l;if(u){let e={remote:t,preloadConfig:u},n=await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:e,remoteInfo:a,remote:t,remoteSnapshot:s,globalSnapshot:c});n&&qc(a,i,n,!1,{initiator:`loadRemote`,id:o},u.recordPreloadedAssets).catch(()=>void 0)}return{...e,remoteSnapshot:s}}return e}}}function al(e){let t=e.split(`:`);return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function ol(e,t,n,r,i={},a){let{value:o}=Eo(e,so(t)),s=a||o;if(s&&!wa(s)&&(n(s,t,r),s.remotesInfo)){let t=Object.keys(s.remotesInfo);for(let r of t){if(i[r])continue;i[r]=!0;let t=al(r),a=s.remotesInfo[r];ol(e,{name:t.name,version:a.matchedVersion},n,!1,i,void 0)}}}var sl=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function cl(e,t,n,r,i){let a=[],o=[],s=[],c=/* @__PURE__ */ new Set,l=/* @__PURE__ */ new Set,{options:u}=e,{preloadConfig:d}=t,{depsRemote:f}=d;if(ol(r,n,(t,n,r)=>{let i;if(r)i=d;else if(Array.isArray(f)){let e=f.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;i=Lc(e)}else if(f===!0)i=d;else return;let c=va(t,ho(t).url);c&&s.push({name:n.name,moduleInfo:{name:n.name,entry:c,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:c});let l=`modules`in t?t.modules:[],u=zc(i.exposes);u.length&&`modules`in t&&(l=t?.modules?.reduce((e,t)=>(u?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function p(e){let n=e.map(e=>va(t,e));return i.filter?n.filter(i.filter):n}if(l){let r=l.length;for(let s=0;s<r;s++){let r=l[s],c=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:c,name:n.name,remoteSnapshot:t,preloadConfig:i,remote:n,origin:e}),!Po(c)&&(i.resourceCategory===`all`?(a.push(...p(r.assets.css.async)),a.push(...p(r.assets.css.sync)),o.push(...p(r.assets.js.async)),o.push(...p(r.assets.js.sync))):i.resourceCategory===`sync`&&(a.push(...p(r.assets.css.sync)),o.push(...p(r.assets.js.sync))),Fo(c))}}},!0,{},i),i.shared&&i.shared.length>0){let t=(t,n)=>{let{shared:r}=Ws(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{c.add(e)}),n.assets.css.sync.forEach(e=>{l.add(e)}))};i.shared.forEach(e=>{let n=u.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&mo(r).forEach(n=>{t(n,e)})})}let p=o.filter(e=>!c.has(e)&&!sl(`script`,e));return{cssAssets:a.filter(e=>!l.has(e)&&!sl(`link`,e)),jsAssetsWithoutEntry:p,entryAssets:s.filter(e=>!sl(`script`,e.url))}}var ll=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:i,globalSnapshot:a,remoteSnapshot:o}=e;return da?co(i)&&lo(i)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:i.name,url:i.entry,moduleInfo:{name:r.name,entry:i.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(rl(r,o),cl(t,n,r,a,o)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function ul(e,t){let n=ko({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&Eo(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Do(),remoteSnapshot:ko({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Do(),remoteSnapshot:ko({name:e.name,version:`version`in e?e.version:void 0})}}var dl=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=/* @__PURE__ */ new Map,this.hooks=new Zc({beforeLoadRemoteSnapshot:new J(`beforeLoadRemoteSnapshot`),loadSnapshot:new el(`loadGlobalSnapshot`),loadRemoteSnapshot:new el(`loadRemoteSnapshot`),afterLoadSnapshot:new el(`afterLoadSnapshot`),beforeLoadManifest:new J(`beforeLoadManifest`),afterLoadManifest:new J(`afterLoadManifest`)}),this.manifestLoading=vo.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let i=ko({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},jo({[this.HostInstance.options.name]:i})),i&&`remotesInfo`in i&&!Eo(i.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(i.remotesInfo={...i?.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:a,remoteSnapshot:o,globalSnapshot:s}),u,d;if(c){if(wa(c)){let r=da?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||``,i=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),a=Ao({...e,entry:r},i);u=i,d=a}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:`global`});u=t,d=l}}else if(co(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),i=Ao(e,r);u=r,d=i}else B(ic,G,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,K(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return ul(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=jc(t),i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,origin:this.HostInstance});let a,o,s=!1;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);t&&t instanceof Response||(t=await fetch(e,{})),a=t,i=await t.json()}catch(c){o=c,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,response:a,error:c,origin:this.HostInstance}),B(ec,G,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${c}`,K(this.HostInstance.options))),s=!0}let c=[!i.metaData&&`metaData`,!i.exposes&&`exposes`,!i.shared&&`shared`].filter(Boolean),l=c.length>0?/* @__PURE__ */ Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(`, `)}.`):void 0;return l&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:l,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:r,manifestJson:i,response:a,error:l||o,recovered:l?void 0:s||void 0,origin:this.HostInstance}),l&&B(uc,G,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:c.join(`,`)},void 0,K(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,n,r){let i=async()=>{let i=await this.getManifestJson(e,t,n,r),a=Ca(i,{version:e}),{remoteSnapshot:o}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:i,remoteSnapshot:a,manifestUrl:e,from:`manifest`});return o};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(e=>e)),this.manifestLoading[e]}},fl=class{constructor(){this.hooks=new Zc({})}},pl=class{constructor(e){this.hooks=new Zc({beforeRegisterShare:new $c(`beforeRegisterShare`),afterRegisterShare:new q(`afterRegisterShare`),afterResolve:new el(`afterResolve`),beforeLoadShare:new el(`beforeLoadShare`),loadShare:new J,afterLoadShare:new q(`afterLoadShare`),errorLoadShare:new q(`errorLoadShare`),resolveShare:new $c(`resolveShare`),initContainerShareScopeMap:new $c(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r,loadContext:i}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:i,origin:this.host})}catch(e){ao(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:i,loadContext:a}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:i,loadContext:a})}catch(e){ao(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=Ns(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n});let i=this.shareScopeMap[r]?.[e],a=i?.[n.version];i||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name}),this.emitAfterRegisterShare(e,{scope:r,shared:n,previousShared:a,registeredShared:this.shareScopeMap[r]?.[e]?.[n.version],trigger:`runtime`})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=t?.context,i=Ks({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=i;try{i?.scope&&await Promise.all(i.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:i.strategy,context:r}))}));let o=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:i,shared:n.options.shared,origin:n,loadContext:r});a=o.shareInfo,r=o.loadContext||r,z(a,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let s=a,{shared:c,useTreesShaking:l}=Ws(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,r)||{};if(c){let t=Js(c,l);if(t.lib)return qs(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),t.lib;if(t.loading&&!t.loaded){let i=await t.loading;return t.loaded=!0,t.lib||=i,qs(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),i}{let i=(async()=>{let e=await t.get();return qs(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:c,from:n.options.name,lib:null,loading:i,treeShaking:l?t:void 0});let a=await i;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:c,loadContext:r}),a}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,recovered:!0,loadContext:r}),!1;let i=Ps(s.treeShaking),a=Js(s,i),o=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,qs(a,n.options.name);let{shared:i,useTreesShaking:o}=Ws(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,r)||{};if(i){let e=Js(i,o);e.lib=t,e.loaded=!0,i.from=s.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:o,treeShaking:i?a:void 0});let c=await o;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:s,selectedShared:s,loadContext:r}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t,loadContext:r}),t}}initializeSharing(e=As,t){let{host:n}=this,r=t?.from,i=t?.strategy,a=t?.context?.trigger||r||`runtime`,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(t,n)=>{let{version:r,eager:i}=n;u[t]=u[t]||{};let o=u[t],s=o[r],c=s&&Js(s),d=!!(c&&(`eager`in c&&c.eager||`shareConfig`in c&&c.shareConfig?.eager));(!c||c.strategy!==`loaded-first`&&!c.loaded&&(!i==!d?l>o[r].from:i))&&(o[r]=n),this.emitAfterRegisterShare(t,{scope:e,shared:n,previousShared:s,registeredShared:o[r],trigger:a})},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r,i={initiator:`loadShare`,id:e,resourceType:`remoteEntry`,url:t.remoteInfo.entry};try{r=await t.getEntry(void 0,i)}catch(i){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o,void 0,i))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||i===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=t?.context,i=Ks({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{i?.scope&&i.scope.forEach(e=>{this.initializeSharing(e,{strategy:i.strategy,from:t?.from,context:r})});let{shared:a}=Ws(this.shareScopeMap,e,i,this.hooks.lifecycle.resolveShare,r)||{};if(a){if(typeof a.lib==`function`)return qs(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(i.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return qs(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:a,loadContext:r}),t}}if(i.lib)return i.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib;if(i.get){let a=i.get();return a instanceof Promise&&B(t?.from===`build`?nc:rc,G,{hostName:n.options.name,sharedPkgName:e},void 0,K(n.options)),i.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:i.lib,shared:i}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,selectedShared:i,loadContext:r}),i.lib}B(rc,G,{hostName:n.options.name,sharedPkgName:e},void 0,K(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:i,error:t,loadContext:r}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:i,loaded:a,get:o,treeShaking:s}){let{version:c,scope:l=`default`,...u}=t,d=Array.isArray(l)?l:[l],f=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=s?e.treeShaking:e;t(n,`loaded`,a),t(n,`loading`,i),t(n,`get`,o),t(n,`lib`,r)};d.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...u,lib:r});let i=this.shareScopeMap[t][e][c];f(i),n&&i.from!==n&&(i.from=n)})}_setGlobalShareScopeMap(e){let t=Gs(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},ml=class{constructor(){this.shareScopeMap={},this.hooks=new Zc({afterResolve:new el(`afterResolve`)})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}loadShareSync(){throw Error(`Shared dependency loading is disabled by experiments.optimization.disableShared.`)}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},hl=class{constructor(e){this.hooks=new Zc({beforeRegisterRemote:new $c(`beforeRegisterRemote`),registerRemote:new $c(`registerRemote`),beforeRequest:new el(`beforeRequest`),afterMatchRemote:new J(`afterMatchRemote`),onLoad:new J(`onLoad`),afterLoadRemote:new J(`afterLoadRemote`),handlePreloadModule:new q(`handlePreloadModule`),errorLoadRemote:new J(`errorLoadRemote`),beforePreloadRemote:new J(`beforePreloadRemote`),generatePreloadAssets:new J(`generatePreloadAssets`),afterPreloadRemote:new J(`afterPreloadRemote`),loadEntry:new J}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:i,alias:a}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},a&&e.startsWith(i)){let t=e.replace(i,a);this.idToRemoteMap[t]={name:n.name,expose:r}}else if(a&&e.startsWith(a)){let t=e.replace(a,i);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=Xs(n.options.remotes,e),i=e,a=r?.expose,o=r?jc(r.remote):void 0,s;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:u}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:f,expose:p,id:m,remoteSnapshot:h}=u;i=m,a=p,o=jc(f);let g=await c.get(m,p,t,h),_=await this.hooks.lifecycle.onLoad.emit({id:m,pkgNameOrAlias:d,expose:p,exposeModule:r?g:void 0,exposeModuleFactory:r?void 0:g,remote:f,options:l,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,u),s={id:i,expose:a,remote:o,options:t,origin:n},typeof _==`function`?_:g}catch(r){let{from:c=`runtime`}=t||{from:`runtime`},l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:`onLoad`,expose:a,remote:o,origin:n})}catch(e){throw s={id:i,expose:a,remote:o,options:t,error:e,origin:n},e}if(!l)throw s={id:i,expose:a,remote:o,options:t,error:r,origin:n},r;return s={id:i,expose:a,remote:o,options:t,error:r,origin:n,recovered:!0},l}finally{s&&await this.hooks.lifecycle.afterLoadRemote.emit(s)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=Rc(t.options.remotes,e),i=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:Ys(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},a;await Promise.all(r.flatMap(i).map(async e=>{let{ops:r,id:i}=e,{remote:a,preloadConfig:o}=r,s=jc(a);try{let{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:a,id:i,initiator:`preloadRemote`}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:a,remoteInfo:s,globalSnapshot:e,remoteSnapshot:c});if(!l)return;let u=await qc(s,t,l,!0,{initiator:`preloadRemote`,id:i},o.recordPreloadedAssets);n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:u})}catch(e){n.push({remote:a,remoteInfo:s,preloadConfig:o,id:i,results:[{url:s.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(s.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:i,error:e}]})}}));let o=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(o.length>0&&(a=/* @__PURE__ */ Error(`preloadRemote failed to load ${o.length} resource(s).`),Object.assign(a,{results:n,failedResults:o})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:a}),a)throw a}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}initRawContainer(e,t,n){let{host:r}=this,i=new Xc({host:r,remoteInfo:jc({name:e,entry:t})});return i.remoteEntryExports=n,r.moduleCache.set(e,i),i}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:i}=r,a=Xs(t.options.remotes,i);if(!a)try{B(tc,G,{hostName:t.options.name,requestId:i},void 0,K(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:i,options:t.options,error:e,origin:t}),e}let{remote:o}=a,s=jc(o);await this.hooks.lifecycle.afterMatchRemote.emit({id:i,...a,options:t.options,remoteInfo:s,origin:t});let c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:i,...a,options:t.options,origin:t,remoteInfo:s}),{remote:l,expose:u}=c;z(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let d=t.moduleCache.get(l.name),f={host:t,remoteInfo:s};return d||(d=new Xc(f),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:f,remoteMatchInfo:c}}registerRemote(e,t,n){let{host:r}=this,i=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));z(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&da&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=As,e.type||=js};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let a=t.find(t=>t.name===e.name);if(!a)i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let o=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(a),i(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),ya(o.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let i=Eo(V.__FEDERATION__.moduleInfo,so(e)).key;delete V.__FEDERATION__.moduleInfo[i],`entry`in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete vo.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);let{hostGlobalSnapshot:a}=ul(e,t);if(a){let t=a&&`remotesInfo`in a&&a.remotesInfo&&Eo(a.remotesInfo,e.name).key;t&&delete a.remotesInfo[t]}let o=t.moduleCache.get(e.name);if(o){let n=o.remoteInfo,r=n.entryGlobalName;V[r]&&(Object.getOwnPropertyDescriptor(V,r)?.configurable?delete V[r]:V[r]=void 0);let i=kc(o.remoteInfo);xo[i]&&delete xo[i];let a=n.buildVersion?_a(n.name,n.buildVersion):n.name,s=V.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===a:e.name===a);if(s!==-1){let e=V.__FEDERATION__.__INSTANCES__[s];a=e.options.id||a;let t=Gs(),r=!0,i=[];Object.keys(t).forEach(e=>{let a=t[e];a&&Object.keys(a).forEach(t=>{let o=a[t];o&&Object.keys(o).forEach(a=>{let s=o[a];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&typeof c==`object`&&c.from===n.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter(e=>e!==n.name),c.useIn.length?r=!1:i.push([e,t,a,o])):i.push([e,t,a,o]))})})})}),r&&(e.shareScopeMap={},delete t[a]),i.forEach(([e,n,r,i])=>{delete t[e]?.[n]?.[r]?.[i]}),V.__FEDERATION__.__INSTANCES__.splice(s,1)}t.moduleCache.delete(e.name)}}catch(e){io.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},gl=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN!=`boolean`||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,_l=typeof FEDERATION_OPTIMIZE_NO_REMOTE!=`boolean`||!FEDERATION_OPTIMIZE_NO_REMOTE,vl=typeof FEDERATION_OPTIMIZE_NO_SHARED!=`boolean`||!FEDERATION_OPTIMIZE_NO_SHARED,yl=class{constructor(e){this.hooks=new Zc({beforeInit:new $c(`beforeInit`),init:new q,beforeInitContainer:new el(`beforeInitContainer`),initContainer:new el(`initContainer`)}),this.version=`2.9.0`,this.moduleCache=/* @__PURE__ */ new Map,this.loaderHook=new Zc({getModuleInfo:new q,createScript:new q,createLink:new q,fetch:new J,loadEntryError:new J,afterLoadEntry:new J(`afterLoadEntry`),beforeInitRemote:new J(`beforeInitRemote`),afterInitRemote:new J(`afterInitRemote`),beforeGetExpose:new J(`beforeGetExpose`),afterGetExpose:new J(`afterGetExpose`),beforeExecuteFactory:new J(`beforeExecuteFactory`),afterExecuteFactory:new J(`afterExecuteFactory`),getModuleFactory:new J}),this.bridgeHook=new Zc({beforeBridgeRender:new q,afterBridgeRender:new q,beforeBridgeDestroy:new q,afterBridgeDestroy:new q,afterBridgeRouteSync:new q});let t=_l&&gl?[il(),ll()]:[],n={id:Mc(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:da};this.name=e.name,this.options=n,this.snapshotHandler=_l?new dl(this):new fl,this.sharedHandler=vl?new pl(this):new ml,this.remoteHandler=_l?new hl(this):new nl,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&B(to(sc,G)),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(e=As,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){return this.remoteHandler.initRawContainer(e,t,n)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let n=vl?Ns(e,t).allShareInfos:{},{userOptions:r,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),a=this.remoteHandler.formatAndRegisterRemote(i,r),{allShareInfos:o}=this.sharedHandler.registerShared(i,r),s=[...i.plugins];r.plugins&&r.plugins.forEach(e=>{s.includes(e)||s.push(e)});let c={...e,...t,plugins:s,remotes:a,shared:o,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Fc(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};function bl(e){let t=new((wo())||yl)({id:`${e.name}@${e.version||Date.now()}`,...e});return Co(t),t}To(yl);var xl=bl({name:`luzmo-embed-runtime`,remotes:[]}),Sl=/* @__PURE__ */ new Map,Cl=0,wl=/* @__PURE__ */ new Set;function Tl(e){if(typeof document>`u`)return;let t;try{t=new URL(Ei(e)).origin}catch{return}if(wl.has(t))return;wl.add(t);let n=document.createElement(`link`);n.rel=`preconnect`,n.href=t,n.crossOrigin=`anonymous`,(document.head??document.documentElement).append(n)}function El(e,t){let n=Ei(e);if(e.startsWith(`http://localhost`))return`${n}/mf-manifest.json`;switch(t){case`DashboardApp`:case`VizItemApp`:return`${n}/dashboard-app/mf-manifest.json`;case`IQApp`:return`${n}/iq-app/mf-manifest.json`}}function Dl(e,t){return`${e}|${t}`}function Ol(e,t){let n=Dl(e,t),r=Sl.get(n);if(r)return r;let i={entry:El(e,t),registered:!1,remoteName:`luzmo_embed_${Cl++}`};return Sl.set(n,i),i}function kl(e,t=`DashboardApp`){Tl(e);let n=Ol(e,t);return n.module?Promise.resolve(n.module):(n.loadPromise||=(n.registered||=(xl.registerRemotes([{name:n.remoteName,entry:n.entry}]),!0),xl.loadRemote(`${n.remoteName}/${t}`).then(e=>{if(!e)throw Error(`Failed to load "${t}" from "${n.entry}".`);return n.module=e,e}).finally(()=>{n.loadPromise=void 0})),n.loadPromise)}var Al=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Y=(e,t,n,r)=>{for(var i=r>1?void 0:r?jl(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Al(t,n,i),i},Ml=`7.5.0`;function Nl(e){let t={type:`error`,errorMsg:e,error:{msg:e}};return{...t,data:t}}function Pl(...e){return e.find(e=>typeof e==`string`&&e.length>0)}function Fl(e){let t=e?.data??e??{};return Nl(Pl(t.errorMsg,t.error?.msg)??`Unknown error`)}var Il=new class{constructor(){this._dashboardComponents=[]}},Ll=()=>{typeof window.__luzmoMessageHandler!=`function`&&(window.__luzmoMessageHandler=e=>{let t=Il._dashboardComponents.find(t=>e.data.name===t._iframeId);if(t)switch(e.data?.type){case`load`:t.dispatchEvent(new CustomEvent(`load`,{detail:{data:e.data}})),t._loadTimeoutHandle&&=(clearTimeout(t._loadTimeoutHandle),void 0),t.iframeLoaded=!0,t.dimensions=e.data.dimensions,t._calculateDimAfterDashboardLoaded();break;case`error`:t._handleEmbedError(e.data);break;case`data`:Pi(t,e.data.requestId,e.data.data);break;case`filters`:Pi(t,e.data.requestId,e.data.filters);break;case`insights`:e.data.error?Fi(t,e.data.requestId,Error(e.data.error.message)):Pi(t,e.data.requestId,e.data.summary);break;case`dashboardContext`:Pi(t,e.data.requestId,e.data.context);break;case`getAccessibleDashboards`:Pi(t,e.data.requestId,e.data.accessibleDashboards);break;case`dashboardAction`:t.dispatchEvent(new CustomEvent(`dashboardAction`,{detail:{data:e.data}}));break;case`export`:e.data.error?Fi(t,e.data.requestId,e.data):(t.dispatchEvent(new CustomEvent(`exported`,{detail:{data:e.data}})),Pi(t,e.data.requestId,e.data));break;case`changedFilters`:t.dispatchEvent(new CustomEvent(`changedFilters`,{detail:{data:e.data}}));break;case`contextChanged`:t.dispatchEvent(new CustomEvent(`contextChanged`,{detail:{data:e.data}}));break;case`customEvent`:t.dispatchEvent(new CustomEvent(`customEvent`,{detail:{data:e.data}}));break;case`chartsRendered`:case`itemsRendered`:e.data.type=`itemsRendered`,t.dispatchEvent(new CustomEvent(`itemsRendered`,{detail:{data:e.data}}));break;case`setEditMode`:e.data.error?Fi(t,e.data.requestId,e.data):(Pi(t,e.data.requestId,e.data),t.params.editMode=e.data.editMode,t._containerStyle=Ii(t),t.dimensions&&ra(t));break;case`calculatedDimensions`:t.dimensions=e.data.dimensions,ra(t);break;case`trackViewport`:e.data.enabled?t._startViewportTracking():t._stopViewportTracking();break;case`setSelectedData`:case`setFilters`:e.data.error?Fi(t,e.data.requestId,e.data):Pi(t,e.data.requestId,e.data);break;case`setPreview`:e.data.error?Fi(t,e.data.requestId,e.data):Pi(t,e.data.requestId,e.data)}},window.addEventListener(`message`,window.__luzmoMessageHandler,!1))},Rl=n`
12
+ :host {
13
+ display: block;
14
+ height: 100%;
15
+ }
16
+
17
+ @-webkit-keyframes spin {
18
+ 0% {
19
+ -webkit-transform: rotate(0deg);
20
+ transform: rotate(0deg);
21
+ }
22
+ 100% {
23
+ -webkit-transform: rotate(360deg);
24
+ transform: rotate(360deg);
25
+ }
26
+ }
27
+
28
+ @keyframes spin {
29
+ 0% {
30
+ -webkit-transform: rotate(0deg);
31
+ transform: rotate(0deg);
32
+ }
33
+ 100% {
34
+ -webkit-transform: rotate(360deg);
35
+ transform: rotate(360deg);
36
+ }
37
+ }
38
+ :host {
39
+ position: relative;
40
+ width: 100%;
41
+ }
42
+
43
+ .luzmo-embed-dashboard {
44
+ background: transparent;
45
+ padding: 0;
46
+ border: 0;
47
+ }
48
+
49
+ .luzmo-embed-dashboard-ede {
50
+ }
51
+
52
+ .luzmo-embed-container-ede {
53
+ width: 100%;
54
+ height: 100%;
55
+ }
56
+
57
+ /*
58
+ * Web component mode: the dashboard app renders directly (no iframe). Make its host fill the
59
+ * sized .dashboard-container so the app's internal height:100% chain resolves to the calculated
60
+ * dashboard height - exactly like the iframe gets its height. Without this the app collapses to
61
+ * its intrinsic size and its inner scroll container produces a second scrollbar, and content can
62
+ * spill outside the container.
63
+ */
64
+ #dashboard-wc-container {
65
+ width: 100%;
66
+ height: 100%;
67
+ }
68
+
69
+ #dashboard-wc-container dashboard-component {
70
+ display: block;
71
+ width: 100%;
72
+ height: 100%;
73
+ }
74
+
75
+ .luzmo-container-loader {
76
+ width: 100%;
77
+ position: relative;
78
+ }
79
+
80
+ .luzmo-lc {
81
+ margin: 0 auto;
82
+ }
83
+
84
+ .luzmo-loading-message {
85
+ width: 100%;
86
+ height: 20px;
87
+ text-align: center;
88
+ margin-bottom: 16px;
89
+ font-family: Helvetica, Arial, sans-serif;
90
+ font-size: 14px;
91
+ }
92
+
93
+ .luzmo-loading-circle {
94
+ box-sizing: border-box;
95
+ margin: 16px auto;
96
+ position: relative;
97
+ text-indent: -9999em;
98
+ animation: spin 0.6s infinite linear;
99
+ }
100
+
101
+ .luzmo-loading-circle,
102
+ .luzmo-loading-circle:after {
103
+ border-radius: 50%;
104
+ width: 32px;
105
+ height: 32px;
106
+ }
107
+
108
+ .itemEmbedding:after {
109
+ width: 24px;
110
+ height: 24px;
111
+ }
112
+
113
+ .luzmo-error {
114
+ background: transparent;
115
+ padding: 48px 0;
116
+ margin: 0 auto;
117
+ width: 80%;
118
+ border: 0;
119
+ text-align: center;
120
+ min-height: 192px;
121
+ }
122
+
123
+ .dashboard-error {
124
+ font-size: 30px;
125
+ background: transparent;
126
+ padding: 48px 0;
127
+ margin: 0 auto;
128
+ width: 80%;
129
+ border: 0;
130
+ text-align: center;
131
+ min-height: 192px;
132
+ }
133
+
134
+ .luzmo-loader {
135
+ top: 0;
136
+ left: 0;
137
+ width: 100%;
138
+ min-height: 400px;
139
+ position: absolute;
140
+ transition-duration: 0.3s;
141
+ }
142
+ `,zl=`DashboardApp`,X=class extends t{constructor(){super(),this.language=`auto`,this.editorLanguage=`auto`,this.screenMode=`auto`,this.switchScreenModeOnResize=!0,this.editMode=`view`,this.embedMode=`iframe`,this.iframeStyle={},this._containerStyle={},this._loaderStyle={},this._lcStyle={},this._loadingCircleStyle={},this._containerLoaderStyle={},this._loaderMsg=``,this._itemEmbedding=!1,this.browserError=!1,this.browserErrorMsg=``,this.dashboardError=!1,this.browserNotSupported=[],this.libVersion=Ml+`-wc-luzmo`,this.isLibraryLoaded=!1,this.currentAuthKey=null,this.currentAuthToken=null,this.isInitCalled=!1,this.attributesMap={dashboardId:`dashboard-id`,dashboardSlug:`dashboard-slug`,itemId:`item-id`,language:`language`,editorLanguage:`editorLanguage`,screenMode:`screen-mode`,switchScreenModeOnResize:`switch-screen-mode-on-resize`,authKey:`auth-key`,authToken:`auth-token`,editMode:`edit-mode`,theme:`theme`,mainColor:`main-color`,loaderBackground:`loader-background`,loaderFontColor:`loader-font-color`,loaderSpinnerColor:`loader-spinner-color`,loaderSpinnerBackground:`loader-spinner-background`,appServer:`app-server`,apiHost:`api-host`,itemDimensions:`item-dimensions`,timezoneId:`timezone-id`},this.loaderSize=32,this.borderWidth=3,this.minHeight=400,this._viewportTrackingActive=!1,this._onViewportChange=()=>{this._postViewport()},this._containerId=R(),this._iframeId=`luzmo-dashboard-${this._containerId}`,this.iframeLoaded=!1,this.promises={},this.params=this._setOptions(),this._onResize=()=>{if(this.shadowRoot?.querySelector(`.dashboard-container`)){if(this.containerWidth=this.luzmoEmbedContainer.offsetWidth,this.params.switchScreenModeOnResize&&this.params.screenMode===`auto`)for(let e of Ci)e.width[0]<=window.innerWidth&&window.innerWidth<=e.width[1]&&(this.currentScreenMode=e.mode);this.iframeLoaded?this._calculateDimAfterDashboardLoaded():this.dimensions&&(this.containerWidth=this.luzmoEmbedContainer.offsetWidth,ra(this))}},this._resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{Array.isArray(e)&&e.length!==0&&this._onResize()})})}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect(),this._stopViewportTracking();for(let e of Object.keys(this.promises))this.promises[e].reject(/* @__PURE__ */ Error(`Dashboard component was removed`))}_startViewportTracking(){this.embedMode===`iframe`&&(this._viewportTrackingActive||(this._viewportTrackingActive=!0,window.addEventListener(`scroll`,this._onViewportChange,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onViewportChange,{passive:!0})),this._postViewport())}_stopViewportTracking(){this._viewportTrackingActive&&(this._viewportTrackingActive=!1,window.removeEventListener(`scroll`,this._onViewportChange,{capture:!0}),window.removeEventListener(`resize`,this._onViewportChange))}_postViewport(){let e=this.iframe?.contentWindow;if(!e)return;let t=this.iframe.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=Math.max(t.top,0),i=Math.min(t.bottom,n),a=Math.max(i-r,0),o=Math.min(Math.max(-t.top,0),t.height);e.postMessage({action:`setViewport`,offsetTop:o,visibleHeight:a},`*`)}firstUpdated(){this._loaderMsg=Ni(this)?.loadingMsg,this._loaderStyles(),Il._dashboardComponents.push(this),this.luzmoEmbedContainer&&this._resizeObserver.observe(this.luzmoEmbedContainer)}initComponent(){this.params=this._setOptions(),this.isWebComponentViewMode()?kl(this.params.appServer,zl).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete;let e=document.createElement(`dashboard-component`);this.setAllAttributesOnElement(e),e.addEventListener(`load`,t=>{this.containerWidth=e.offsetWidth,this.dimensions=t.detail.dimensions,ra(this),window.dispatchEvent(new Event(`resize`)),this.dispatchEvent(new CustomEvent(`load`,t))}),e.addEventListener(`itemsRendered`,e=>this.dispatchEvent(new CustomEvent(`itemsRendered`,e))),e.addEventListener(`error`,e=>{this._handleEmbedError(e.detail)}),e.addEventListener(`customEvent`,e=>this.dispatchEvent(new CustomEvent(`customEvent`,e))),e.addEventListener(`changedFilters`,e=>this.dispatchEvent(new CustomEvent(`changedFilters`,e))),e.addEventListener(`dashboardAction`,e=>this.dispatchEvent(new CustomEvent(`dashboardAction`,e))),e.addEventListener(`export`,e=>this.dispatchEvent(new CustomEvent(`exported`,e))),e.addEventListener(`contextChanged`,e=>this.dispatchEvent(new CustomEvent(`contextChanged`,e)));let t=this.renderRoot.querySelector(`#dashboard-wc-container`);t&&(t.append(e),this.dashboardReference=e)}):(this.containerWidth=this.container?.clientWidth,ia(this),Si(this),this._setupLoader(),this.params.error||(this._loaderStyles(),Ll(),this._iframeUrl=Mi(this),this.iframe?.setAttribute(`src`,this._iframeUrl),this.iframeStyle=Vi(this)))}setAllAttributes(){this.dashboardReference&&this.setAllAttributesOnElement(this.dashboardReference)}setAllAttributesOnElement(e){if(e){this.params.dashboardId&&e.setAttribute(`dashboard-id`,this.params.dashboardId),this.params.appServer&&e.setAttribute(`app-server`,this.params.appServer),this.params.apiHost&&e.setAttribute(`api-host`,Ei(this.params.apiHost));for(let t in this.attributesMap)![`authKey`,`authToken`,`apiHost`,`itemDimensions`,`dashboardId`,`appServer`].includes(t)&&this.params[t]&&e.setAttribute(this.attributesMap[t],this.params[t]);this.params.itemDimensions&&e.setAttribute(`item-dimensions`,JSON.stringify(this.params.itemDimensions)),this.params.key&&e.setAttribute(`auth-key`,this.params.key),this.params.token&&e.setAttribute(`auth-token`,this.params.token)}}updated(e){let t=/* @__PURE__ */ new Set([`dashboardId`,`dashboardSlug`,`itemId`,`language`,`editorLanguage`,`theme`,`editMode`,`screenMode`,`switchScreenModeOnResize`,`authToken`,`authKey`,`appServer`,`apiHost`,`timezoneId`,`itemDimensions`]),n=[`dashboardId`,`dashboardSlug`,`itemId`],r=!1;for(let t of n)r||=e.get(t)===void 0&&this[t]!==void 0;if(r&&!this.isInitCalled)this.initComponent(),this.isInitCalled=!0;else if(this.isWebComponentViewMode()){if(e.has(`editMode`)&&!this.dashboardReference){this.iframeLoaded=!1,this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this.params=this._setOptions(),this.initComponent();return}if(this.dashboardReference){for(let[t]of e.entries())if(t===`appSever`)kl(e[t],zl).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete,this.dashboardReference=this.renderRoot.querySelector(`dashboard-component`),this.setAllAttributes()});else if(this.attributesMap[t]){let e=this.attributesMap[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()||this[t];this.dashboardReference.setAttribute(e,n)}}}else for(let[n]of e.entries())t.has(n)&&n!==`editMode`?this._reloadIframeContent():t.has(n)&&n===`editMode`&&(this.iframeLoaded?(this.setEditMode(this.editMode),this.params=this._setOptions()):this._reloadIframeContent())}_reloadIframeContent(){this.params=this._setOptions(),ia(this),this._setupLoader(),this.params.error?(this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this._loaderStyles()):(this.iframeLoaded=!1,this._loadTimeoutHandle&&clearTimeout(this._loadTimeoutHandle),this._loadTimeoutHandle=setTimeout(()=>{console.warn(`Failed to load dashboard, appServer is likely down or unreachable.`)},15e3),this._loaderStyles(),this._iframeUrl=Mi(this),this.iframe&&this._updateIframeUrl(),this.iframeStyle=Vi(this))}_setOptions(){let e={dashboardId:this.dashboardId,dashboardSlug:this.dashboardSlug};return this.itemId?(e.itemId=this.itemId,this._itemEmbedding=!0):this._itemEmbedding=!1,this.language&&(e.language=this.language),this.editorLanguage&&(e.editorLanguage=this.editorLanguage),this.screenMode&&(e.screenMode=this.screenMode),e.switchScreenModeOnResize=this.switchScreenModeOnResize,this.authToken&&(e.token=this.authToken),this.authKey&&(e.key=this.authKey),this.editMode&&(e.editMode=this.editMode),this.theme&&(e.theme=this.theme),this.mainColor&&(e.mainColor=this.mainColor),this.loaderBackground&&(e.loaderBackground=this.loaderBackground),this.loaderFontColor&&(e.loaderFontColor=this.loaderFontColor),this.loaderSpinnerColor&&(e.loaderSpinnerColor=this.loaderSpinnerColor),this.loaderSpinnerBackground&&(e.loaderSpinnerBackground=this.loaderSpinnerBackground),this.timezoneId&&(e.timezoneId=this.timezoneId),this.itemDimensions&&(e.itemDimensions=this.itemDimensions),this.appServer?(this.appServer=this.isWebComponentViewMode()?Ei(this.appServer):Ti(this.appServer),e.appServer=this.appServer):(this.appServer=Ti(L.appServer),e.appServer=this.appServer),this.apiHost?(this.apiHost=this.isWebComponentViewMode()?Ei(this.apiHost):Ti(this.apiHost),e.apiHost=this.apiHost):(this.apiHost=this.appServer.includes(`luzmo.com`)?this.appServer.replace(`app`,`api`):this.appServer,e.apiHost=this.apiHost),this.currentAuthKey=this.authKey,this.currentAuthToken=this.authToken,e}_updateIframeUrl(){Ui(this.iframe,this._iframeUrl)}_setupLoader(){let e=Ni(this);this._loaderMsg=e.loadingMsg,e.errorMsg&&this._handleEmbedError({errorMsg:e.errorMsg},`browser`)}_handleEmbedError(e,t=`dashboard`){let n=Fl(e),r=n.errorMsg;t===`browser`?(this.browserError=!0,this.browserErrorMsg=r):(this.dashboardError=!0,this.iframeLoaded=!0),this._loadTimeoutHandle&&=(clearTimeout(this._loadTimeoutHandle),void 0),this._displayError(),console.error(`Dashboard error:`,r),this.dispatchEvent(new CustomEvent(`error`,{detail:n}))}_displayError(){this.dashboardError&&(this._loaderStyles(),this.iframeStyle.opacity=1),this.browserError&&(this._containerStyle.display=`none`)}_calculateDimAfterDashboardLoaded(){this.dashboardError=!1,this._loaderStyles(),ra(this)}_loaderStyles(){this._containerStyle=Ii(this),this._loaderStyle=Ri(this),this._loadingCircleStyle=zi(this),this._containerLoaderStyle=Li(this),this._lcStyle=Bi(this)}static get styles(){return[Rl]}render(){let e,t=r`
143
+ <div
144
+ class="luzmo-container-loader"
145
+ id="luzmo-container-loader-${this._containerId}"
146
+ style=${s(this._containerLoaderStyle)}
147
+ >
148
+ <div
149
+ class="luzmo-loader"
150
+ id="luzmo-loader-${this._containerId}"
151
+ style=${s(this._loaderStyle)}
152
+ >
153
+ <div
154
+ class="luzmo-lc"
155
+ style=${s(this._lcStyle)}
156
+ >
157
+ <div
158
+ class="luzmo-loading-circle"
159
+ style=${s(this._loadingCircleStyle)}
160
+ ></div>
161
+ ${this._itemEmbedding?``:r`
162
+ <div
163
+ class="luzmo-loading-message"
164
+ style=${s({color:this.loaderFontColor})}
165
+ >
166
+ ${this._loaderMsg}
167
+ </div>
168
+ `}
169
+ </div>
170
+ </div>
171
+ </div>
172
+ `;return e=this.isWebComponentViewMode()?this.isLibraryLoaded?r`
173
+ ${this.dashboardId||this.dashboardSlug?r`
174
+ <div id="dashboard-wc-container"></div>
175
+ `:r`
176
+ <div id="luzmo-error-${this._containerId}">
177
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
178
+ </div>
179
+ `}
180
+ `:r`${t}`:r`
181
+ ${this.dashboardId||this.dashboardSlug?r`
182
+ ${t}
183
+ <iframe
184
+ class="luzmo-embed-dashboard ${this.isWebComponentViewMode()?``:`luzmo-embed-dashboard-ede`}"
185
+ id="${this._iframeId}"
186
+ name="${this._iframeId}"
187
+ style=${s(this.iframeStyle)}
188
+ src="${this._iframeUrl}"
189
+ frameborder="0"
190
+ ></iframe>
191
+ `:r`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
192
+ ${this.browserError?r`
193
+ <div id="luzmo-error-${this._containerId}">
194
+ <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
195
+ </div>
196
+ `:``}
197
+ `,r`
198
+ <div class="${oa} ${this.isWebComponentViewMode()?``:`${oa}-ede`}">
199
+ <div
200
+ class="dashboard-container"
201
+ style=${s(Object.assign({},this._containerStyle,{width:this.iframeStyle.width??`100%`,height:this.iframeStyle.height??`100%`}))}
202
+ >
203
+ ${e}
204
+ </div>
205
+ </div>
206
+
207
+ `}getDashboards(){return new Promise(e=>e(Il._dashboardComponents))}getData(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getData(e):this.isWebComponentViewMode()?Promise.reject():qi(this,this.iframe,e)}getFilters(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getFilters():this.isWebComponentViewMode()?Promise.reject():Ji(this,this.iframe)}getInsights(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getInsights(e):this.isWebComponentViewMode()?Promise.reject(/* @__PURE__ */ Error(`getInsights is not available: dashboard reference is not ready.`)):Yi(this,this.iframe,e)}getDashboardContext(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.getDashboardContext():this.isWebComponentViewMode()?Promise.reject(/* @__PURE__ */ Error(`getDashboardContext is not available: dashboard reference is not ready.`)):Ki(this,this.iframe)}setSelectedData(e,t){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setSelectedData(e,t):this.isWebComponentViewMode()?Promise.reject():na(this,this.iframe,e,t)}setAuthorization(e,t){return this.currentAuthKey=e,this.currentAuthToken=t,this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setAuthorization(e,t):this.isWebComponentViewMode()?Promise.reject():$i(this,this.iframe,e,t)}refreshData(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.refreshData(e):this.isWebComponentViewMode()?Promise.reject():e?Xi(this,this.iframe,e):Xi(this,this.iframe)}reloadDashboard(){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.reloadDashboard():this.isWebComponentViewMode()?Promise.reject():Zi(this,this.iframe)}exportDashboard(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.exportDashboard(e):this.isWebComponentViewMode()?Promise.reject():e?Wi(this,this.iframe,e):Wi(this,this.iframe)}getAccessibleDashboards(){return Gi(this)}addFilters(e,t){return this.dashboardReference.addFilters(e,t)}setEditMode(e){return this.dashboardReference&&e===`view`?(this.editMode=`view`,this.params.editMode=`view`,this.initComponent(),Promise.resolve({type:`setEditMode`,editMode:e})):this.dashboardReference&&[`editFull`,`editLimited`].includes(e)?(this.editMode=e,this.params.editMode=e,this.initComponent(),Promise.resolve({type:`setEditMode`,editMode:e})):this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setEditMode(e):this.isWebComponentViewMode()?Promise.reject():ea(this,this.iframe,e)}setPreview(e){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.setPreview(e):ta(this,this.iframe,e)}sendExportEmail(e,t,n){return this.isWebComponentViewMode()&&this.dashboardReference?this.dashboardReference.sendExportEmail(e,t,n):this.isWebComponentViewMode()?Promise.reject():Qi(this,this.iframe,e,t,n)}isWebComponentViewMode(){return this.embedMode===`webComponent`&&(this.editMode===`view`||this.editMode===void 0)}};Y([a(`.dashboard-container`)],X.prototype,`container`,2),Y([a(`.${oa}`)],X.prototype,`luzmoEmbedContainer`,2),Y([a(`iframe`)],X.prototype,`iframe`,2),Y([i()],X.prototype,`dashboardId`,2),Y([i()],X.prototype,`dashboardSlug`,2),Y([i()],X.prototype,`itemId`,2),Y([i()],X.prototype,`language`,2),Y([i()],X.prototype,`editorLanguage`,2),Y([i()],X.prototype,`screenMode`,2),Y([i({converter:{fromAttribute:e=>e===`true`,toAttribute:String}})],X.prototype,`switchScreenModeOnResize`,2),Y([i()],X.prototype,`editMode`,2),Y([i()],X.prototype,`theme`,2),Y([i()],X.prototype,`mainColor`,2),Y([i()],X.prototype,`authToken`,2),Y([i()],X.prototype,`authKey`,2),Y([i()],X.prototype,`loaderBackground`,2),Y([i()],X.prototype,`loaderFontColor`,2),Y([i()],X.prototype,`loaderSpinnerColor`,2),Y([i()],X.prototype,`loaderSpinnerBackground`,2),Y([i()],X.prototype,`appServer`,2),Y([i()],X.prototype,`timezoneId`,2),Y([i()],X.prototype,`apiHost`,2),Y([i({type:Object})],X.prototype,`itemDimensions`,2),Y([i()],X.prototype,`embedMode`,2),Y([i({attribute:!1})],X.prototype,`_containerId`,2),Y([i({attribute:!1})],X.prototype,`_iframeId`,2),Y([i({attribute:!1})],X.prototype,`params`,2),Y([i({attribute:!1})],X.prototype,`_iframeUrl`,2),Y([i({attribute:!1})],X.prototype,`iframeLoaded`,2),Y([i({attribute:!1})],X.prototype,`promises`,2),Y([i({attribute:!1})],X.prototype,`iframeStyle`,2),Y([i({attribute:!1})],X.prototype,`_containerStyle`,2),Y([i({attribute:!1})],X.prototype,`_loaderStyle`,2),Y([i({attribute:!1})],X.prototype,`_lcStyle`,2),Y([i({attribute:!1})],X.prototype,`_loadingCircleStyle`,2),Y([i({attribute:!1})],X.prototype,`_containerLoaderStyle`,2),Y([i({attribute:!1})],X.prototype,`_loaderMsg`,2),Y([i({attribute:!1})],X.prototype,`containerWidth`,2),Y([i({attribute:!1})],X.prototype,`dimensions`,2),Y([i({attribute:!1})],X.prototype,`currentScreenMode`,2),Y([i({attribute:!1})],X.prototype,`_itemEmbedding`,2),Y([i({attribute:!1})],X.prototype,`browserError`,2),Y([i({attribute:!1})],X.prototype,`browserErrorMsg`,2),Y([i({attribute:!1})],X.prototype,`dashboardError`,2),Y([i({attribute:!1})],X.prototype,`browserNotSupported`,2),Y([i()],X.prototype,`libVersion`,2),Y([o()],X.prototype,`isLibraryLoaded`,2),Y([o()],X.prototype,`dashboardReference`,2),Y([o()],X.prototype,`currentAuthKey`,2),Y([o()],X.prototype,`currentAuthToken`,2),Y([o()],X.prototype,`isInitCalled`,2);var Bl=class extends X{};customElements.get(`luzmo-embed-dashboard`)||customElements.define(`luzmo-embed-dashboard`,Bl);var Vl=e,Hl=`VizItemApp`;function Ul(e){let t=/* @__PURE__ */ new Set;for(let n of e??[])for(let e of n?.content??[]){let n=e,r=n.datasetId??n.set;r&&t.add(r)}return[...t]}var Z=class extends t{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.slots=[],this.version=Ml+`-wc-luzmo`,this.dashboardContentsVersion=Vl,this.libVersion=Ml+`-wc-luzmo`,this.postInitCallQueue=[]}static{this.styles=n`
208
+ :host {
209
+ display: block;
210
+ width: 100%;
211
+ height: 100%;
212
+ }
213
+
214
+ luzmo-embed-viz-item {
215
+ width: 100%;
216
+ height: 1000%;
217
+ display: block;
218
+ }
219
+ `}createRenderRoot(){return this.style.display||(this.style.display=`block`),this.style.height||(this.style.height=`100%`),this.style.width||(this.style.width=`100%`),this}canInitializeVizItem(){return!!(this.type||this.dashboardId&&this.itemId)}getFilters(){return this.chartElement.getFilters()}getVizItemContext(){let e=this.slots??[];return{id:this.contextId??this.getAttribute(`context-id`)??this.id??this.itemId??``,type:this.type,slots:e,options:this.options,filters:typeof this.chartElement?.getContextFilters==`function`?this.chartElement.getContextFilters():typeof this.chartElement?.getFilters==`function`?this.getFilters():[],datasetIds:Ul(e)}}export(e=`png`){return this.chartElement.export(e)}getData(){return this.chartElement.getData()}getInsights(e){return this.chartElement.getInsights(e)}refreshData(){return this.chartElement.refreshData()}setSelectedData(e){return this.chartElement.setSelectedData(void 0,e)}setAuthorization(e,t){return this.chartElement.setAuthorization(e,t)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`selecteddata`&&(this.chartElement?this.setSelectedData(JSON.parse(n??`{}`)):this.postInitCallQueue.push([this.setSelectedData,[JSON.parse(n??`{}`)]]))}async firstUpdated(e){super.firstUpdated(e),this.canInitializeVizItem()&&(await kl(this.appServer,Hl),this.createAndAppendElement())}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(`chart-component`),this.chartElement.setAttribute(`embedding-mode`,`chart`),this.chartElement.style.height=`100%`,this.chartElement.style.width=`100%`,this.chartElement.style.display=`block`,this.chartElement.addEventListener(`load`,e=>this.dispatchEvent(new CustomEvent(`load`,e))),this.chartElement.addEventListener(`rendered`,e=>{if(this.postInitCallQueue?.length>0)for(let e of this.postInitCallQueue)e[0].bind(this)(...e[1]);else this.selectedData&&this.setSelectedData(this.selectedData);this.dispatchEvent(new CustomEvent(`rendered`,e))}),this.chartElement.addEventListener(`changedFilters`,e=>{this.dispatchEvent(new CustomEvent(`changedFilters`,e)),this.dispatchEvent(new CustomEvent(`contextChanged`,{detail:{data:{type:`contextChanged`,context:this.getVizItemContext()}}}))}),this.chartElement.addEventListener(`exported`,e=>this.dispatchEvent(new CustomEvent(`exported`,e))),this.chartElement.addEventListener(`customEvent`,e=>this.dispatchEvent(new CustomEvent(`customEvent`,e))),this.chartElement.addEventListener(`error`,e=>{this.dispatchEvent(new CustomEvent(`error`,{detail:Fl(e.detail)}))}),this.chartElement.addEventListener(`authorizationExpired`,e=>this.dispatchEvent(new CustomEvent(`authorizationExpired`,e))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in aa){let t=this[e];if(t){let n=[`appServer`,`apiHost`].includes(e)?Ei(t):t;this.chartElement.setAttribute(aa[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=aa[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()??this[t];this.chartElement.setAttribute(e,n)}else this.canInitializeVizItem()&&(await kl(this.appServer,Hl),this.createAndAppendElement())}render(){return r` `}};Y([i()],Z.prototype,`appServer`,2),Y([i()],Z.prototype,`apiHost`,2),Y([i({type:Array})],Z.prototype,`slots`,2),Y([i({type:Object})],Z.prototype,`options`,2),Y([i()],Z.prototype,`type`,2),Y([i()],Z.prototype,`authKey`,2),Y([i()],Z.prototype,`authToken`,2),Y([i()],Z.prototype,`version`,2),Y([i()],Z.prototype,`contextId`,2),Y([i({converter:e=>{try{return JSON.parse(e)}catch{return e}}})],Z.prototype,`canFilter`,2),Y([i({type:Array})],Z.prototype,`filters`,2),Y([i()],Z.prototype,`dashboardId`,2),Y([i()],Z.prototype,`itemId`,2),Y([i({attribute:`ai-message-asset-id`})],Z.prototype,`aiMessageAssetId`,2),Y([i({type:Object})],Z.prototype,`selectedData`,2),Y([i()],Z.prototype,`dashboardContentsVersion`,2),Y([i()],Z.prototype,`libVersion`,2);var Wl=class extends Z{};customElements.get(`luzmo-embed-viz-item`)||customElements.define(`luzmo-embed-viz-item`,Wl);var Gl={aiEndpoint:`ai-endpoint`,appServer:`app-server`,apiHost:`api-host`,options:`options`,initialSuggestionsDatasetId:`initialSuggestionsDatasetId`,authKey:`auth-key`,authToken:`auth-token`,version:`version`,libVersion:`lib-version`,aydHost:`ayd-host`,availableDatasets:`available-datasets`,dashboardContext:`dashboard-context`,dashboardId:`dashboard-id`,contextIds:`context-ids`,agentId:`agent-id`},Kl=`luzmo-iq-embed-chat`,ql=`luzmo-iq-chat-component`,Q=class extends t{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.version=Ml+`-wc-luzmo`,this.libVersion=Ml+`-wc-luzmo`,this.remoteEntryServer=`http://localhost:4202/`,this.aydHost=`https://ayd.luzmo.com/`}static{this.styles=n`
220
+ :host {
221
+ display: block;
222
+ width: 100%;
223
+ height: 100%;
224
+ }
225
+ `}createRenderRoot(){return this}async firstUpdated(e){super.firstUpdated(e),await kl(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}get calculatedAppServer(){return this.appServer.startsWith(`http://localhost`)?this.remoteEntryServer:this.appServer}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(ql),this.chartElement.addEventListener(`load`,e=>this.dispatchEvent(new CustomEvent(`load`,e))),this.chartElement.addEventListener(`connectionStatusChanged`,e=>this.dispatchEvent(new CustomEvent(`connectionStatusChanged`,{detail:e.detail}))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in Gl){let t=this[e];if(t){let n=[`appServer`,`apiHost`,`aydHost`].includes(e)?Ei(t):t;this.chartElement.setAttribute(Gl[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=Gl[t]??t,n=this[t];if(n==null){this.chartElement.removeAttribute(e);continue}let r=typeof n==`object`?JSON.stringify(n):n.toString();this.chartElement.setAttribute(e,r)}else await kl(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}render(){return r``}connectedCallback(){super.connectedCallback();let e=document.querySelector(Kl);if(!e)return;let t=new MutationObserver(()=>{let n=e.querySelector(`*[slot="custom-chat-widget-content"]`);if(!n)return;let r=e.querySelector(ql);r&&(r.append(n),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}};Y([i()],Q.prototype,`appServer`,2),Y([i()],Q.prototype,`apiHost`,2),Y([i({type:Object})],Q.prototype,`options`,2),Y([i({type:String})],Q.prototype,`initialSuggestionsDatasetId`,2),Y([i()],Q.prototype,`aiEndpoint`,2),Y([i()],Q.prototype,`authKey`,2),Y([i()],Q.prototype,`authToken`,2),Y([i()],Q.prototype,`version`,2),Y([i()],Q.prototype,`libVersion`,2),Y([i()],Q.prototype,`remoteEntryServer`,2),Y([i()],Q.prototype,`aydHost`,2),Y([i({type:Array})],Q.prototype,`availableDatasets`,2),Y([i({type:Object})],Q.prototype,`dashboardContext`,2),Y([i()],Q.prototype,`dashboardId`,2),Y([i({type:Array})],Q.prototype,`contextIds`,2),Y([i()],Q.prototype,`agentId`,2),customElements.get(Kl)||customElements.define(Kl,Q);var Jl={aiEndPoint:`ai-end-point`,appServer:`app-server`,apiHost:`api-host`,options:`options`,authKey:`auth-key`,authToken:`auth-token`,version:`version`,libVersion:`lib-version`,messages:`messages`},Yl=`luzmo-iq-embed-answer`,$=class extends t{constructor(){super(...arguments),this.appServer=`https://app.luzmo.com`,this.apiHost=`https://api.luzmo.com`,this.version=Ml+`-wc-luzmo`,this.libVersion=Ml+`-wc-luzmo`,this.remoteEntryServer=`http://localhost:4202`}static{this.styles=n`
226
+ :host {
227
+ display: block;
228
+ width: 100%;
229
+ height: 100%;
230
+ }
231
+ `}createRenderRoot(){return this}async firstUpdated(e){super.firstUpdated(e),await kl(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}get calculatedAppServer(){return this.appServer.startsWith(`http://localhost`)?this.remoteEntryServer:this.appServer}createAndAppendElement(){this.chartElement||(this.chartElement=document.createElement(`luzmo-iq-answer-component`),this.chartElement.addEventListener(`addQuestion`,e=>this.dispatchEvent(new CustomEvent(`addQuestion`,e))),this.chartElement.addEventListener(`addAnswer`,e=>this.dispatchEvent(new CustomEvent(`addAnswer`,e))),this.updateVizItemProperties(),this.renderRoot.append(this.chartElement))}updateVizItemProperties(){if(this.chartElement)for(let e in Jl){let t=this[e];if(t){let n=[`appServer`,`apiHost`].includes(e)?Ei(t):t;this.chartElement.setAttribute(Jl[e],typeof n==`object`?JSON.stringify(n):n)}}}async updated(e){if(this.chartElement)for(let[t]of e.entries()){let e=Jl[t]??t,n=typeof this[t]==`object`?JSON.stringify(this[t]):this[t]?.toString()??this[t];this.chartElement.setAttribute(e,n)}else await kl(this.calculatedAppServer,`IQApp`),this.createAndAppendElement()}render(){return r` `}};Y([i()],$.prototype,`appServer`,2),Y([i()],$.prototype,`apiHost`,2),Y([i({type:Object})],$.prototype,`options`,2),Y([i()],$.prototype,`aiEndPoint`,2),Y([i()],$.prototype,`authKey`,2),Y([i()],$.prototype,`authToken`,2),Y([i()],$.prototype,`messages`,2),Y([i()],$.prototype,`version`,2),Y([i()],$.prototype,`libVersion`,2),Y([i()],$.prototype,`remoteEntryServer`,2),customElements.get(Yl)||customElements.define(Yl,$),t.disableWarning?.(`change-in-update`);export{I as t};