codecharta-visualization 2.6.0 → 2.7.0

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.
@@ -0,0 +1 @@
1
+ import{$ as ESe,$n as oi,$t as XCe,A as tn$2,An as iCe,Ar as y2,At as On$1,Bn as kl,C as en$1,Cn as er,Cr as vi,Ct as Nd,D as ne$1,Dr as wt,Dt as O$,E as it$1,En as h0,Et as O,F as yo,Fn as jbt,Fr as ze,Ft as Qt$1,H as $s,Hn as kv,Ht as T,I as z,In as jv,It as Qv,Jn as nSe,Kn as m2,Kt as Ule,L as ze$1,Ln as jz,Lt as Rd,M as ve,Mn as it,Mr as yi,Mt as Ps,N as wn$1,Nr as za$1,Nt as Qbt,O as nn$2,Ot as OBe,P as yn,Pr as zbt,Pt as Qs,Q as EOe,Qn as oN,Qt as Wv,R as $J,Rt as Ri,S as ar$1,St as N,T as fe$1,Tn as g2,Tt as Nn$1,U as $v,Un as l3,Ut as Tt,V as $bt,Vn as kt,W as Ai,Wn as lt,X as Ct,Xn as nn$1,Xt as Vr,Y as Ca$1,Yn as ne,Yt as Vn,Zt as Wn$1,_ as U,_n as bue,_r as tet,_t as Kr$1,a as Ge,ar as pt$1,at as G,b as Zn$1,br as ue,bt as Me,c as Ie,cn as Zv,d as Ke,dn as _Se,dr as rt,dt as IOe,en as Xv,er as ot,f as Me$1,fn as _i,ft as In$1,g as Sn$1,gr as tSe,gt as Kg,h as Qn$1,hn as ar,hr as st,i as En$1,in as ZCe,ir as pSe,it as Fd,j as tt,jn as ii,k as oe,l as J,lr as qce,lt as Hn,m as Qe,mn as aX,mr as sn$1,n as Bo$1,nr as p3,nt as FBe,o as Gn,on as Ze,or as qCe,p as Mn$1,pr as si,pt as Ir,qt as Uv,r as Bp,rn as Yv,s as H,st as Gv,t as Be,tn as YCe,tr as p2,tt as Et,u as Je$1,un as _N,ur as qv,ut as Hr,v as Ue,vn as cet,vr as tn$1,vt as Kv,w as et$1,wn as fSe,wr as wi,wt as Ne,x as an$1,xn as cx,xr as v2,xt as My,y as Ye,yn as ci,yr as uSe,zt as Rn$1}from"./main-W663WA53.js";import{$ as X,A as RT,At as lt$1,Ct as ie,D as QV,E as Pn$1,Ft as pd,G as V,Gt as wT,It as px,J as WG,Jt as wo,L as T1,Mt as no,N as ST,P as SY,Q as Wz,R as TO,Rt as re$1,S as OA,W as Uv$1,Wt as w,Xt as xT,_ as LA,_t as ge$1,a as Gr$1,at as Z,b as Lu,bt as hS,d as Jh,et as XG,ft as bT,h as Kn,j as Rh,jt as mv,k as RO,kt as lo,l as Ir$1,m as Ki,mt as de$1,n as CC,o as H$1,p as K,pt as dd,qt as wY,r as Ce$1,st as Zt$1,u as J$1,w as PN,wt as jV,z as TT,zt as sG}from"./chunk-oHIaR8OO.js";var re=(()=>{class t{constructor(){this.domainStateReadWindow=N(p2),this.store=N(wt),this.settings=Ri(this.domainStateReadWindow.wordCloudSettings$,{initialValue:ci}),this.hasTfidfData=Ri(this.store.select(Sn$1),{initialValue:!1})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Qn=[[[``,`body`,``]],`*`];var Zn=[`[body]`,`*`];var Jn=[`ngProjectAs`,`[body]`,5,[``,`body`,``]];var Gr=(()=>{class t{constructor(){this.label=Me.required(),this.value=Me.required(),this.idPrefix=Me.required(),this.minWidthClass=Me(`min-w-[120px]`),this.popoverId=sn$1(()=>`${this.idPrefix()}-popover`),this.anchorName=sn$1(()=>`${this.idPrefix()}-cog`),this.segmentTestId=sn$1(()=>`${this.idPrefix()}-segment`),this.cogTestId=sn$1(()=>`${this.idPrefix()}-cog`)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-segment`]],hostAttrs:[1,`contents`],inputs:{label:[1,`label`],value:[1,`value`],idPrefix:[1,`idPrefix`],minWidthClass:[1,`minWidthClass`]},ngContentSelectors:Zn,decls:3,vars:8,consts:[[3,`label`,`metricName`,`hasCog`,`cogPopoverId`,`cogAnchorName`,`testId`,`cogTestId`,`minWidthClass`]],template:function(o,i){o&1&&(Ca$1(Qn),Ne(0,`cc-axis-card`,0),Qs(1,0,Jn),ze(),Qs(2,1)),o&2&&Ct(`label`,i.label())(`metricName`,i.value())(`hasCog`,!0)(`cogPopoverId`,i.popoverId())(`cogAnchorName`,i.anchorName())(`testId`,i.segmentTestId())(`cogTestId`,i.cogTestId())(`minWidthClass`,i.minWidthClass())},dependencies:[uSe],encapsulation:2})}}return t})();var xe=(()=>{class t{constructor(){this.store=N(wt)}setShape(e){this.store.dispatch(Gv({value:e}))}setSizeRange(e){this.store.dispatch(Kv({value:e}))}setRotationRange(e){this.store.dispatch(Qv({value:e}))}setRotationStep(e){this.store.dispatch(jv({value:e}))}setGridSize(e){this.store.dispatch(kv({value:e}))}setSizingMode(e){this.store.dispatch(qv({value:e}))}setTopN(e){this.store.dispatch(Zv({value:e}))}setShrinkToFit(e){this.store.dispatch(Wv({value:e}))}setDrawOutOfBound(e){this.store.dispatch(Uv({value:e}))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Xr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.popoverId=Me.required(),this.anchorName=Me.required(),this.settings=this.readStore.settings,this.minRotationBounds={min:-90,max:0},this.maxRotationBounds={min:0,max:90},this.rotationStepBounds={min:15,max:90,step:15},this.resetKeys=[`domainState.rotationRange`,`domainState.rotationStep`]}onRotationStepChange(e){this.writeStore.setRotationStep(e)}onRotationRangeMinChange(e){this.writeStore.setRotationRange($bt(this.settings().rotationRange,e))}onRotationRangeMaxChange(e){this.writeStore.setRotationRange(zbt(this.settings().rotationRange,e))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-rotation-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:15,vars:14,consts:[[`ariaLabel`,`Rotation Settings`,`widthClass`,`w-80`,`contentClass`,`gap-3 py-3 px-4`,3,`popoverId`,`anchorName`],[1,`flex`,`flex-col`,`gap-2`,`rounded-lg`,`bg-base-200`,`p-3`],[`data-testid`,`domain-bar-rotation-min`],[1,`text-sm`],[`ariaLabel`,`Min Rotation in degrees`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-rotation-max`],[`ariaLabel`,`Max Rotation in degrees`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-rotation-step`,`title`,`Words are rotated in multiples of this angle`],[`ariaLabel`,`Rotation Step in degrees`,3,`valueChange`,`min`,`max`,`step`,`value`],[`tooltip`,`Reset the rotation settings to their defaults`,`label`,`Reset rotation`,3,`settingsKeys`,`small`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0)(1,`div`,1)(2,`div`,2)(3,`span`,3),Et(4,`Min Rotation`),ze(),Ne(5,`cc-slider-number-input`,4),lt(`valueChange`,function(n){return i.onRotationRangeMinChange(n)}),ze()(),Ne(6,`div`,5)(7,`span`,3),Et(8,`Max Rotation`),ze(),Ne(9,`cc-slider-number-input`,6),lt(`valueChange`,function(n){return i.onRotationRangeMaxChange(n)}),ze()(),Ne(10,`div`,7)(11,`span`,3),Et(12,`Rotation Step`),ze(),Ne(13,`cc-slider-number-input`,8),lt(`valueChange`,function(n){return i.onRotationStepChange(n)}),ze()()(),In$1(14,`cc-reset-settings-button`,9),ze()),o&2&&(Ct(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),Ct(`min`,i.minRotationBounds.min)(`max`,i.minRotationBounds.max)(`value`,i.settings().rotationRange[0]),ue(4),Ct(`min`,i.maxRotationBounds.min)(`max`,i.maxRotationBounds.max)(`value`,i.settings().rotationRange[1]),ue(4),Ct(`min`,i.rotationStepBounds.min)(`max`,i.rotationStepBounds.max)(`step`,i.rotationStepBounds.step)(`value`,i.settings().rotationStep),ue(),Ct(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[FBe,My,OBe],encapsulation:2})}}return t})();var mt=(()=>{class t{constructor(){this.uploaded=Tt(null),this.mask=this.uploaded.asReadonly(),this.dataUri=sn$1(()=>this.uploaded()?.dataUri??null)}accept(e){this.uploaded.set(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Yr=`image/svg+xml`;var ea=[`script`,`foreignObject`];var ta=[`href`,`xlink:href`];function Kr(t){let r=new DOMParser().parseFromString(t,Yr),e=r.documentElement;if(r.querySelector(`parsererror`)||e.localName!==`svg`)return{rejection:`That file is not an SVG.`};let o=ea.find(a=>e.getElementsByTagName(a).length>0);if(o)return{rejection:`An SVG carrying a <${o}> cannot be used as a shape.`};if(oa(e))return{rejection:`An SVG that references another file cannot be used as a shape.`};let i=ia(e);return i?{dataUri:`data:${Yr},${encodeURIComponent(new XMLSerializer().serializeToString(i))}`}:{rejection:`That SVG states neither a size nor a viewBox, so it has no shape to fill.`}}function oa(t){return[t,...t.querySelectorAll(`*`)].some(r=>ta.some(e=>{let o=r.getAttribute(e);return o!==null&&!o.startsWith(`#`)}))}function ia(t){if(t.getAttribute(`width`)&&t.getAttribute(`height`))return t;let r=t.getAttribute(`viewBox`)?.split(/[\s,]+/).filter(Boolean);if(r?.length!==4)return null;let[,,e,o]=r;return t.setAttribute(`width`,e),t.setAttribute(`height`,o),t}function ra(t,r){if(t&1&&(Ne(0,`option`,4),Et(1),ze()),t&2){let e=r.$implicit,o=st();Ct(`value`,e)(`selected`,e===o.settings().shape),ue(),Vr(o.shapeLabels[e])}}function na(t,r){t&1&&(Ne(0,`p`,8),Et(1),ze()),t&2&&(ue(),Vr(r))}function aa(t,r){t&1&&(Ne(0,`p`,9),Et(1),ze()),t&2&&(ue(),si(` `,r.fileName,` — words fill the opaque areas of the shape. `))}function sa(t,r){t&1&&(Ne(0,`p`,10),Et(1,` The cloud stays round until you upload a shape, and an uploaded one is forgotten on reload. `),ze())}function da(t,r){if(t&1){let e=Ir();Ne(0,`label`,6)(1,`span`,2),Et(2,`SVG file`),ze(),Ne(3,`input`,7),lt(`change`,function(i){Rn$1(e);return Nn$1(st().onShapeFileChosen(i))}),ze()(),tn$1(4,na,2,1,`p`,8)(5,aa,2,1,`p`,9)(6,sa,2,0,`p`,10)}if(t&2){let e,o=st();ue(4),nn$1((e=o.rejection())?4:(e=o.uploadedMask())?5:6,e)}}var Qr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.customShapeMaskStore=N(mt),this.popoverId=Me.required(),this.anchorName=Me.required(),this.settings=this.readStore.settings,this.shapes=Object.values(za$1),this.shapeLabels=jbt,this.resetKeys=[`domainState.shape`],this.isCustomShape=sn$1(()=>this.settings().shape===za$1.custom),this.uploadedMask=this.customShapeMaskStore.mask,this.rejection=Tt(null)}onShapeChange(e){this.writeStore.setShape(e)}async onShapeFileChosen(e){let o=e.target.files?.[0];if(!o)return;let i=Kr(await o.text());if(`rejection`in i){this.rejection.set(i.rejection);return}this.rejection.set(null),this.customShapeMaskStore.accept({fileName:o.name,dataUri:i.dataUri})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-shape-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:9,vars:5,consts:[[`ariaLabel`,`Shape Settings`,3,`popoverId`,`anchorName`],[`title`,`The outline the words are laid out in`,1,`form-control`,`w-full`,`gap-1`],[1,`text-sm`],[`data-testid`,`domain-bar-shape`,1,`select`,`select-bordered`,`select-sm`,`w-full`,3,`change`],[3,`value`,`selected`],[`tooltip`,`Reset the shape to its default`,`label`,`Reset shape`,3,`settingsKeys`,`small`],[1,`form-control`,`w-full`,`gap-1`],[`type`,`file`,`accept`,`image/svg+xml,.svg`,`data-testid`,`domain-bar-shape-upload`,1,`file-input`,`file-input-bordered`,`file-input-sm`,`w-full`,3,`change`],[`data-testid`,`domain-bar-shape-rejection`,1,`text-xs`,`text-error`],[`data-testid`,`domain-bar-shape-file`,1,`text-xs`,`opacity-60`],[`data-testid`,`domain-bar-shape-hint`,1,`text-xs`,`opacity-60`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0)(1,`label`,1)(2,`span`,2),Et(3,`Shape`),ze(),Ne(4,`select`,3),lt(`change`,function(n){return i.onShapeChange(n.target.value)}),Fd(5,ra,2,3,`option`,4,Ule),ze()(),tn$1(7,da,7,1),In$1(8,`cc-reset-settings-button`,5),ze()),o&2&&(Ct(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),Rd(i.shapes),ue(2),nn$1(i.isCustomShape()?7:-1),ue(),Ct(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[FBe,My],encapsulation:2})}}return t})();var Zr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.wordCountBounds={min:10,max:1e3,step:10}}onTopNChange(e){this.writeStore.setTopN(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-count-control`]],hostAttrs:[1,`contents`],decls:4,vars:4,consts:[[`data-testid`,`domain-bar-top-n`,`title`,`How many of the most important words are drawn`,1,`rounded-lg`,`bg-base-200`,`p-3`],[1,`text-sm`],[`ariaLabel`,`Words`,3,`valueChange`,`min`,`max`,`step`,`value`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`span`,1),Et(2,`Words`),ze(),Ne(3,`cc-slider-number-input`,2),lt(`valueChange`,function(n){return i.onTopNChange(n)}),ze()()),o&2&&(ue(3),Ct(`min`,i.wordCountBounds.min)(`max`,i.wordCountBounds.max)(`step`,i.wordCountBounds.step)(`value`,i.settings().topN))},dependencies:[OBe],encapsulation:2})}}return t})();var Jr=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.smallestWordBounds={min:10,max:40},this.largestWordBounds={min:40,max:120},this.shrinkToFitTitle=sn$1(()=>this.settings().shrinkToFit?`On — words that do not fit are shrunk until they do, so the full word count is drawn. Tail words can render below Smallest Word.`:`Off — words that do not fit are left out, so Smallest Word is exact but fewer words than requested appear.`),this.drawOutOfBoundTitle=sn$1(()=>this.settings().drawOutOfBound?`On — words may render partially outside the layout area instead of being dropped or shrunk, so more words fit at their true size.`:`Off — every word is kept fully inside the layout area; words that only fit overlapping the edge are shrunk or left out.`)}onSizeRangeMinChange(e){this.writeStore.setSizeRange($bt(this.settings().sizeRange,e))}onSizeRangeMaxChange(e){this.writeStore.setSizeRange(zbt(this.settings().sizeRange,e))}onShrinkToFitChange(e){this.writeStore.setShrinkToFit(e)}onDrawOutOfBoundChange(e){this.writeStore.setDrawOutOfBound(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-size-range-control`]],hostAttrs:[1,`contents`],decls:17,vars:10,consts:[[1,`flex`,`flex-col`,`gap-2`,`rounded-lg`,`bg-base-200`,`p-3`],[`data-testid`,`domain-bar-size-min`,`title`,`The least important word in the cloud renders at this size`],[1,`text-sm`],[`ariaLabel`,`Smallest Word in pixels`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-size-max`,`title`,`The most important word in the cloud renders at this size`],[`ariaLabel`,`Largest Word in pixels`,3,`valueChange`,`min`,`max`,`value`],[`data-testid`,`domain-bar-shrink-to-fit`,1,`flex`,`cursor-pointer`,`items-center`,`gap-2`,3,`title`],[`type`,`checkbox`,1,`checkbox`,`checkbox-sm`,3,`change`,`checked`],[`data-testid`,`domain-bar-draw-out-of-bound`,1,`flex`,`cursor-pointer`,`items-center`,`gap-2`,3,`title`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`div`,1)(2,`span`,2),Et(3,`Smallest Word`),ze(),Ne(4,`cc-slider-number-input`,3),lt(`valueChange`,function(n){return i.onSizeRangeMinChange(n)}),ze()(),Ne(5,`div`,4)(6,`span`,2),Et(7,`Largest Word`),ze(),Ne(8,`cc-slider-number-input`,5),lt(`valueChange`,function(n){return i.onSizeRangeMaxChange(n)}),ze()(),Ne(9,`label`,6)(10,`input`,7),lt(`change`,function(n){return i.onShrinkToFitChange(n.target.checked)}),ze(),Ne(11,`span`,2),Et(12,`Fit All Words`),ze()(),Ne(13,`label`,8)(14,`input`,7),lt(`change`,function(n){return i.onDrawOutOfBoundChange(n.target.checked)}),ze(),Ne(15,`span`,2),Et(16,`Draw Outside Bounds`),ze()()()),o&2&&(ue(4),Ct(`min`,i.smallestWordBounds.min)(`max`,i.smallestWordBounds.max)(`value`,i.settings().sizeRange[0]),ue(4),Ct(`min`,i.largestWordBounds.min)(`max`,i.largestWordBounds.max)(`value`,i.settings().sizeRange[1]),ue(),Ct(`title`,i.shrinkToFitTitle()),ue(),Ct(`checked`,i.settings().shrinkToFit),ue(3),Ct(`title`,i.drawOutOfBoundTitle()),ue(),Ct(`checked`,i.settings().drawOutOfBound))},dependencies:[OBe],encapsulation:2})}}return t})();function ca(t,r){t&1&&(rt(0,`span`,5),Et(1,`TF-IDF is unavailable: the loaded file has no TF-IDF scores.`),ot())}var en=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.hasTfidfData=this.readStore.hasTfidfData,this.WordCloudSizingMode=m2,this.tfidfOptionTitle=sn$1(()=>this.hasTfidfData()?`TF-IDF (relative importance) — sizes words by how distinctive they are, not by raw count`:`TF-IDF (relative importance) — not available: the loaded file has no TF-IDF scores`)}onSizingModeChange(e){this.writeStore.setSizingMode(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-sizing-mode-control`]],hostAttrs:[1,`contents`],decls:9,vars:7,consts:[[`title`,`Which word metric drives a word's rendered size`,1,`form-control`,`w-full`,`gap-1`],[1,`text-sm`],[`data-testid`,`domain-bar-sizing-mode`,1,`select`,`select-bordered`,`select-sm`,`w-full`,3,`change`],[`title`,`Frequency — sizes words by how often they occur`,3,`value`,`selected`],[3,`value`,`selected`,`disabled`,`title`],[1,`text-xs`,`opacity-70`]],template:function(o,i){o&1&&(rt(0,`label`,0)(1,`span`,1),Et(2,`Word Sizing`),ot(),rt(3,`select`,2),Wn$1(`change`,function(n){return i.onSizingModeChange(n.target.value)}),rt(4,`option`,3),Et(5,` Frequency `),ot(),rt(6,`option`,4),Et(7,` TF-IDF `),ot()(),tn$1(8,ca,2,0,`span`,5),ot()),o&2&&(ue(4),ar(`value`,i.WordCloudSizingMode.frequency)(`selected`,i.settings().sizingMode===i.WordCloudSizingMode.frequency),ue(2),ar(`value`,i.WordCloudSizingMode.tfidf)(`selected`,i.settings().sizingMode===i.WordCloudSizingMode.tfidf)(`disabled`,!i.hasTfidfData())(`title`,i.tfidfOptionTitle()),ue(2),nn$1(i.hasTfidfData()?-1:8))},encapsulation:2})}}return t})();var tn=(()=>{class t{constructor(){this.readStore=N(re),this.writeStore=N(xe),this.settings=this.readStore.settings,this.wordSpacingBounds={min:4,max:16,step:4}}onGridSizeChange(e){this.writeStore.setGridSize(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-spacing-control`]],hostAttrs:[1,`contents`],decls:4,vars:4,consts:[[`data-testid`,`domain-bar-grid-size`,`title`,`Spacing between words in pixels — larger means fewer, more spread-out words`,1,`rounded-lg`,`bg-base-200`,`p-3`],[1,`text-sm`],[`ariaLabel`,`Word Spacing in pixels`,3,`valueChange`,`min`,`max`,`step`,`value`]],template:function(o,i){o&1&&(Ne(0,`div`,0)(1,`span`,1),Et(2,`Word Spacing`),ze(),Ne(3,`cc-slider-number-input`,2),lt(`valueChange`,function(n){return i.onGridSizeChange(n)}),ze()()),o&2&&(ue(3),Ct(`min`,i.wordSpacingBounds.min)(`max`,i.wordSpacingBounds.max)(`step`,i.wordSpacingBounds.step)(`value`,i.settings().gridSize))},dependencies:[OBe],encapsulation:2})}}return t})();var on=(()=>{class t{constructor(){this.popoverId=Me.required(),this.anchorName=Me.required(),this.resetKeys=[`domainState.sizingMode`,`domainState.topN`,`domainState.sizeRange`,`domainState.gridSize`,`domainState.shrinkToFit`,`domainState.drawOutOfBound`]}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-sizing-settings-popover`]],hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:6,vars:4,consts:[[`ariaLabel`,`Word Sizing Settings`,`widthClass`,`w-80`,`contentClass`,`gap-3 py-3 px-4`,3,`popoverId`,`anchorName`],[`tooltip`,`Reset the word sizing settings to their defaults`,`label`,`Reset word sizing`,3,`settingsKeys`,`small`]],template:function(o,i){o&1&&(Ne(0,`cc-settings-popover-shell`,0),In$1(1,`cc-word-sizing-mode-control`)(2,`cc-word-count-control`)(3,`cc-word-size-range-control`)(4,`cc-word-spacing-control`)(5,`cc-reset-settings-button`,1),ze()),o&2&&(Ct(`popoverId`,i.popoverId())(`anchorName`,i.anchorName()),ue(5),Ct(`settingsKeys`,i.resetKeys)(`small`,!0))},dependencies:[FBe,My,en,Zr,Jr,tn],encapsulation:2})}}return t})();var Ro=(()=>{class t{constructor(){this.barBottom=fSe,this.readStore=N(re),this.settings=this.readStore.settings,this.shapeLabel=sn$1(()=>jbt[this.settings().shape]),this.sizingModeLabel=sn$1(()=>this.settings().sizingMode===m2.tfidf?`TF-IDF`:`Frequency`),this.rotationRangeLabel=sn$1(()=>{let[e,o]=this.settings().rotationRange;return`${e}\xB0 \u2013 ${o}\xB0`})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-bar`]],hostVars:2,hostBindings:function(o,i){o&2&&Vn(`bottom`,i.barBottom)},features:[qce([pSe])],decls:11,vars:10,consts:[[`shape`,``],[`wordSizing`,``],[`rotation`,``],[`label`,`Shape`,`idPrefix`,`domain-bar-shape`,`minWidthClass`,`min-w-[100px]`,3,`value`],[3,`popoverId`,`anchorName`],[`label`,`Word Sizing`,`idPrefix`,`domain-bar-word-sizing`,3,`value`],[`body`,``,`data-testid`,`domain-bar-top-n-value`,1,`text-xs`,`opacity-70`,`text-center`],[`label`,`Rotation`,`idPrefix`,`domain-bar-rotation`,`minWidthClass`,`min-w-[110px]`,3,`value`]],template:function(o,i){if(o&1&&(Ne(0,`cc-domain-segment`,3,0),In$1(2,`cc-shape-settings-popover`,4),ze(),Ne(3,`cc-domain-segment`,5,1)(5,`div`,6),Et(6),ze(),In$1(7,`cc-word-sizing-settings-popover`,4),ze(),Ne(8,`cc-domain-segment`,7,2),In$1(10,`cc-rotation-settings-popover`,4),ze()),o&2){let a=Nd(1),n=Nd(4),s=Nd(9);Ct(`value`,i.shapeLabel()),ue(2),Ct(`popoverId`,a.popoverId())(`anchorName`,a.anchorName()),ue(),Ct(`value`,i.sizingModeLabel()),ue(3),si(``,i.settings().topN,` words`),ue(),Ct(`popoverId`,n.popoverId())(`anchorName`,n.anchorName()),ue(),Ct(`value`,i.rotationRangeLabel()),ue(2),Ct(`popoverId`,s.popoverId())(`anchorName`,s.anchorName())}},dependencies:[Gr,Qr,on,Xr],encapsulation:2})}}return t})();var Do=(()=>{class t{static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-toolbox`]],features:[$s([{provide:l3,useExisting:IOe}])],decls:2,vars:0,consts:[[1,`join`,`shadow-md`,`bg-base-100`,`rounded`],[`view`,`domain`]],template:function(o,i){o&1&&(Ne(0,`div`,0),In$1(1,`cc-toolbox-screenshot-button`,1),ze())},dependencies:[EOe],encapsulation:2})}}return t})();function la(t,r){if(t&1){let e=Ir();Ne(0,`cc-floating-menu`,1),lt(`dismissed`,function(){Rn$1(e);return Nn$1(st().close())}),Ne(1,`button`,2),lt(`click`,function(){Rn$1(e);return Nn$1(st().copyWord())}),In$1(2,`i`),Ne(3,`span`,3),Et(4),ze()(),In$1(5,`div`,4),Ne(6,`cc-context-menu-item`,5),lt(`itemClick`,function(){Rn$1(e);return Nn$1(st().searchForThisWord())}),Et(7,` Search word `),ze(),Ne(8,`cc-context-menu-item`,6),lt(`itemClick`,function(){Rn$1(e);return Nn$1(st().hideThisWord())}),Et(9,` Hide word `),ze()()}if(t&2){let e=st();Ct(`anchor`,r),ue(2),vi(kl(`w-4 text-center `,e.wasWordCopied()?`fa-solid fa-check text-success`:`fa-regular fa-copy`)),ue(2),Vr(e.rightClickedWord()?.word)}}var ko=(()=>{class t{constructor(){this.clipboard=N(Be),this.rightClickedWord=Me(null),this.searchWord=Kr$1(),this.hideWord=Kr$1(),this.closed=Kr$1(),this.anchor=sn$1(()=>{let e=this.rightClickedWord();return e?{x:e.clientX,y:e.clientY}:null}),this.wasWordCopied=this.clipboard.copied}searchForThisWord(){let e=this.rightClickedWord();e&&this.searchWord.emit(e.word),this.close()}hideThisWord(){let e=this.rightClickedWord();e&&this.hideWord.emit(e.word),this.close()}async copyWord(){let e=this.rightClickedWord();e&&await this.clipboard.copy(e.word)}close(){this.closed.emit()}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-menu`]],inputs:{rightClickedWord:[1,`rightClickedWord`]},outputs:{searchWord:`searchWord`,hideWord:`hideWord`,closed:`closed`},decls:1,vars:1,consts:[[`data-testid`,`domain-word-menu`,1,`w-56`,3,`anchor`],[`data-testid`,`domain-word-menu`,1,`w-56`,3,`dismissed`,`anchor`],[`type`,`button`,`title`,`Copy word to clipboard`,`data-testid`,`domain-word-menu-copy`,1,`flex`,`w-full`,`items-center`,`gap-3`,`px-4`,`py-2.5`,`text-left`,`hover:bg-base-200`,3,`click`],[1,`truncate`,`text-sm`,`font-semibold`,`tracking-wide`],[1,`my-1`,`border-t`,`border-base-300`],[`icon`,`fa-solid fa-magnifying-glass`,`hoverHint`,`Put this word into the explorer's word search`,3,`itemClick`],[`icon`,`fa-solid fa-eye-slash`,`hoverHint`,`Drop this word from the cloud and the word list`,3,`itemClick`]],template:function(o,i){if(o&1&&tn$1(0,la,10,5,`cc-floating-menu`,0),o&2){let a;nn$1((a=i.anchor())?0:-1,a)}},dependencies:[_Se,ESe],encapsulation:2})}}return t})();function Yt(t,r){if(r.length===0)return t;let e=new Set(r);return t.filter(o=>!e.has(o.text))}var ma=O(wn$1,qCe,Yt);var He=(()=>{class t{constructor(){this.store=N(wt),this.projectWords$=this.store.select(ma)}occurrencesOf(e,o){return this.store.select(yn(o,e))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();function pt(t,r){let e=r.trim().toLowerCase();return t.filter(({text:o})=>o.toLowerCase().includes(e))}var ge=(function(t){return t.OCCURRENCES=`Occurrences`,t.NAME=`Name`,t.RELEVANCE=`Relevance`,t})(ge||{});var pa={[ge.OCCURRENCES]:(t,r)=>t.frequency-r.frequency,[ge.NAME]:(t,r)=>t.text.localeCompare(r.text),[ge.RELEVANCE]:(t,r)=>Qbt(t,m2.tfidf)-Qbt(r,m2.tfidf)};function rn(t,{option:r,ascending:e}){let o=pa[r],i=e?1:-1;return[...t].sort((a,n)=>i*o(a,n)||a.text.localeCompare(n.text))}function an(t){let{rowCount:r,rowHeight:e,scrolledPast:o,viewportHeight:i}=t;if(r===0)return ha(t);if(e<=0||i<=0)return ua(t);let a=nn(Math.floor(o/e)-6,0,r-1),n=nn(Math.floor((o+i)/e)+6,a,r-1);return{firstIndex:a,lastIndex:n,topSpacerHeight:a*e,bottomSpacerHeight:(r-n-1)*e}}function ha({rowCount:t}){return{firstIndex:0,lastIndex:t-1,topSpacerHeight:0,bottomSpacerHeight:0}}function ua({rowCount:t,rowHeight:r}){let e=Math.min(50,t)-1;return{firstIndex:0,lastIndex:e,topSpacerHeight:0,bottomSpacerHeight:(t-e-1)*Math.max(r,0)}}function nn(t,r,e){return Math.min(Math.max(t,r),e)}function Kt(t){let r=t*100;return r>0&&r<1?`<1%`:`${Math.round(r)}%`}var sn=(()=>{class t{constructor(){this.contextMenu=N(ve),this.node=Me.required(),this.word=Me.required(),this.isExpanded=Me(!1),this.isSelected=Me(!1),this.clicked=Kr$1(),this.isExpandable=sn$1(()=>this.node().children.length>0),this.isMarked=sn$1(()=>this.contextMenu.isMarked(this.node().path)),this.decoration=sn$1(()=>`${Kt(this.node().share)} of "${this.word()}" \xB7 ${Me$1(this.node().count)}`)}openContextMenu(e){this.contextMenu.openFor(this.node().path,e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-occurrence-row`]],hostAttrs:[1,`block`],hostVars:1,hostBindings:function(o,i){o&1&&lt(`click`,function(){return i.clicked.emit()})(`contextmenu`,function(n){return i.openContextMenu(n)}),o&2&&Hn(`aria-expanded`,i.isExpandable()?i.isExpanded():null)},inputs:{node:[1,`node`],word:[1,`word`],isExpanded:[1,`isExpanded`],isSelected:[1,`isSelected`]},outputs:{clicked:`clicked`},decls:4,vars:7,consts:[[`barTone`,`neutral`,3,`isSelected`,`isMarked`,`barShare`,`decoration`],[3,`isFolder`,`isOpen`],[1,`node-name`,`ml-1`,`flex-1`,`truncate`]],template:function(o,i){o&1&&(Ne(0,`cc-explorer-row`,0),In$1(1,`cc-explorer-tree-item-icon`,1),Ne(2,`span`,2),Et(3),ze()()),o&2&&(Ct(`isSelected`,i.isSelected())(`isMarked`,i.isMarked())(`barShare`,i.node().share)(`decoration`,i.decoration()),ue(),Ct(`isFolder`,i.node().isFolder)(`isOpen`,i.isExpanded()),ue(2),Vr(i.node().name))},dependencies:[et$1,tt],encapsulation:2})}}return t})();var dn=t=>({$implicit:t});var fa=(t,r)=>r.path;function ga(t,r){if(t&1&&(Ne(0,`p`,1),Et(1),ze()),t&2){let e=st();ue(),si(``,e.word(),` does not occur in any file.`)}}function va(t,r){t&1&&Kg(0)}function Sa(t,r){if(t&1&&(Ne(0,`div`,2),cx(1,va,1,0,`ng-container`,3),ze()),t&2){let e=st(),o=Nd(3);ue(),Ct(`ngTemplateOutlet`,o)(`ngTemplateOutletContext`,bue(2,dn,e.topLevelOccurrences()))}}function Ca(t,r){t&1&&Kg(0)}function wa(t,r){if(t&1&&cx(0,Ca,1,0,`ng-container`,3),t&2){let e=st().$implicit;st(2);Ct(`ngTemplateOutlet`,Nd(3))(`ngTemplateOutletContext`,bue(2,dn,e.children))}}function xa(t,r){if(t&1){let e=Ir();Ne(0,`cc-domain-word-occurrence-row`,4),lt(`clicked`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).clickRow(i))}),ze(),Ne(1,`div`,5),tn$1(2,wa,1,4,`ng-container`),ze()}if(t&2){let e=r.$implicit,o=st(2);Ct(`node`,e)(`word`,o.word())(`isExpanded`,o.isExpanded(e.path))(`isSelected`,e.path===o.selectedNodePath()),ue(2),nn$1(o.isExpanded(e.path)?2:-1)}}function _a(t,r){if(t&1&&Fd(0,xa,3,5,null,null,fa),t&2){let e=r.$implicit;Rd(e)}}var ya=null;var cn=(()=>{class t{constructor(){this.readStore=N(He),this.word=Me.required(),this.selectedNodePath=Me(null),this.nodeClicked=Kr$1(),this.occurrences=Ri(tet(this.word).pipe(Ai(e=>this.readStore.occurrencesOf(e,ya))),{initialValue:null}),this.topLevelOccurrences=sn$1(()=>this.occurrences()?.children??[]),this.expandedPaths=Tt(new Set)}isExpanded(e){return this.expandedPaths().has(e)}clickRow(e){e.children.length>0&&this.toggle(e.path),this.nodeClicked.emit(e.path)}toggle(e){let o=new Set(this.expandedPaths());o.delete(e)||o.add(e),this.expandedPaths.set(o)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-occurrence-tree`]],hostAttrs:[1,`block`],inputs:{word:[1,`word`],selectedNodePath:[1,`selectedNodePath`]},outputs:{nodeClicked:`nodeClicked`},decls:4,vars:1,consts:[[`subtree`,``],[`data-testid`,`domain-word-occurrences-empty`,1,`px-3`,`py-2`,`text-sm`,`opacity-60`],[`data-testid`,`domain-word-occurrences-tree`],[4,`ngTemplateOutlet`,`ngTemplateOutletContext`],[3,`clicked`,`node`,`word`,`isExpanded`,`isSelected`],[1,`pl-3`]],template:function(o,i){o&1&&(tn$1(0,ga,2,1,`p`,1)(1,Sa,2,4,`div`,2),cx(2,_a,2,0,`ng-template`,null,0,oN)),o&2&&nn$1(i.topLevelOccurrences().length===0?0:1)},dependencies:[_N,sn],encapsulation:2})}}return t})();var ba=t=>`domain-word-row-${t}`;var ln=(()=>{class t{constructor(){this.word=Me.required(),this.share=Me(0),this.isExpanded=Me(!1),this.toggled=Kr$1(),this.rowId=sn$1(()=>ba(this.word().text)),this.decoration=sn$1(()=>`${Kt(this.share())} of all words \xB7 ${Me$1(this.word().frequency)}`)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-row`]],hostAttrs:[1,`block`],hostVars:3,hostBindings:function(o,i){o&1&&lt(`click`,function(){return i.toggled.emit()}),o&2&&(ar(`id`,i.rowId()),Hn(`data-testid`,i.rowId())(`aria-expanded`,i.isExpanded()))},inputs:{word:[1,`word`],share:[1,`share`],isExpanded:[1,`isExpanded`]},outputs:{toggled:`toggled`},decls:4,vars:5,consts:[[1,`hover:bg-base-200`,3,`barShare`,`decoration`],[`aria-hidden`,`true`,1,`fa`,`fa-font`,`text-xs`,`opacity-70`],[1,`node-name`,`ml-1`,`flex-1`,`truncate`]],template:function(o,i){o&1&&(Ne(0,`cc-explorer-row`,0),In$1(1,`span`,1),Ne(2,`span`,2),Et(3),ze()()),o&2&&(Ct(`barShare`,i.share())(`decoration`,i.decoration()),ue(2),oi(`font-semibold`,i.isExpanded()),ue(),Vr(i.word().text))},dependencies:[et$1],encapsulation:2})}}return t})();var mn=28;var Wa=`cc-domain-word-row`;var Io={scrolledPast:0,viewportHeight:0,rowHeight:mn};var Qt=class{constructor(){this.scrollHost=null,this.measured=Tt(Io,{equal:(r,e)=>r.scrolledPast===e.scrolledPast&&r.viewportHeight===e.viewportHeight&&r.rowHeight===e.rowHeight}),this.geometry=this.measured.asReadonly(),this.remeasure=()=>this.measure()}attachTo(r,e){if(!(this.host===r&&this.scrollHost===e)){if(this.stopObserving(),this.host=r,this.scrollHost=e,!e){this.measured.set(Io);return}e.addEventListener(`scroll`,this.remeasure,{passive:!0}),typeof ResizeObserver<`u`&&(this.resizeObserver=new ResizeObserver(this.remeasure),this.resizeObserver.observe(r),this.resizeObserver.observe(e)),this.measure()}}measure(){let{host:r,scrollHost:e}=this;if(!(!r||!e)){if(!e.contains(r)){this.measured.set(Io);return}this.measured.set({scrolledPast:Math.max(0,e.getBoundingClientRect().top-r.getBoundingClientRect().top),viewportHeight:e.clientHeight,rowHeight:r.querySelector(Wa)?.offsetHeight||mn})}}dispose(){this.stopObserving(),this.host=void 0,this.scrollHost=null}stopObserving(){this.scrollHost?.removeEventListener(`scroll`,this.remeasure),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}};var Ta=(t,r)=>r.text;function Ma(t,r){if(t&1){let e=Ir();Ne(0,`div`,0)(1,`div`,1)(2,`span`,2),Et(3,`Pinned`),ze(),Ne(4,`button`,3),lt(`click`,function(){let i=Rn$1(e);return Nn$1(st().wordToggled.emit(i.text))}),In$1(5,`i`,4),ze()(),Ne(6,`cc-domain-word-row`,5),lt(`toggled`,function(){let i=Rn$1(e);return Nn$1(st().wordToggled.emit(i.text))}),ze(),Ne(7,`div`,6)(8,`cc-domain-word-occurrence-tree`,7),lt(`nodeClicked`,function(i){Rn$1(e);return Nn$1(st().nodeClicked.emit(i))}),ze()()()}if(t&2){let e=r,o=st();ue(6),Ct(`word`,e)(`share`,o.shareOf(e))(`isExpanded`,!0),ue(2),Ct(`word`,e.text)(`selectedNodePath`,o.selectedNodePath())}}function Ea(t,r){t&1&&(Ne(0,`p`,8),Et(1),ze()),t&2&&(ue(),Vr(r))}function Ra(t,r){if(t&1&&tn$1(0,Ea,2,1,`p`,8),t&2){let e;nn$1((e=st().emptyHint())?0:-1,e)}}function Da(t,r){if(t&1){let e=Ir();Ne(0,`cc-domain-word-row`,10),lt(`toggled`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).wordToggled.emit(i.text))}),ze()}if(t&2){let e=r.$implicit,o=st(2);Ct(`word`,e)(`share`,o.shareOf(e))}}function ka(t,r){if(t&1&&(In$1(0,`div`),Fd(1,Da,1,2,`cc-domain-word-row`,9,Ta),In$1(3,`div`)),t&2){let e=st();Vn(`height`,e.window().topSpacerHeight,`px`),ue(),Rd(e.renderedWords()),ue(2),Vn(`height`,e.window().bottomSpacerHeight,`px`)}}var Oo=(()=>{class t{constructor(){this.readStore=N(He),this.hostElement=N(er),this.scrollHostService=N(oe),this.viewport=new Qt,this.query=Me(``),this.sorting=Me({option:ge.OCCURRENCES,ascending:!1}),this.expandedWord=Me(null),this.selectedNodePath=Me(null),this.wordToggled=Kr$1(),this.nodeClicked=Kr$1(),this.projectWords=Ri(this.readStore.projectWords$,{requireSync:!0}),this.pinnedWord=sn$1(()=>this.projectWords().find(e=>e.text===this.expandedWord())??null),this.matchedWords=sn$1(()=>pt(this.projectWords(),this.query())),this.visibleWords=sn$1(()=>rn(this.matchedWords().filter(e=>e.text!==this.expandedWord()),this.sorting())),this.emptyHint=sn$1(()=>this.projectWords().length===0?`This project carries no words.`:this.matchedWords().length===0?`No word contains "${this.query().trim()}".`:null),this.geometry=sn$1(()=>ne(T({},this.viewport.geometry()),{rowCount:this.visibleWords().length})),this.window=sn$1(()=>an(this.geometry())),this.renderedWords=sn$1(()=>{let{firstIndex:e,lastIndex:o}=this.window();return this.visibleWords().slice(e,o+1)}),this.totalOccurrences=sn$1(()=>this.projectWords().reduce((e,o)=>e+o.frequency,0)),Ps(()=>this.viewport.attachTo(this.hostElement.nativeElement,this.scrollHostService.element()))}ngOnDestroy(){this.viewport.dispose()}shareOf(e){let o=this.totalOccurrences();return o>0?e.frequency/o:0}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-word-list`]],hostAttrs:[1,`block`],inputs:{query:[1,`query`],sorting:[1,`sorting`],expandedWord:[1,`expandedWord`],selectedNodePath:[1,`selectedNodePath`]},outputs:{wordToggled:`wordToggled`,nodeClicked:`nodeClicked`},decls:3,vars:2,consts:[[`data-testid`,`domain-word-pin`,1,`sticky`,`top-0`,`z-10`,`mb-1`,`rounded-md`,`border`,`border-base-300`,`bg-base-100`,`shadow-sm`],[1,`flex`,`items-center`,`gap-1`,`px-2`,`pt-1`],[1,`flex-1`,`text-[10px]`,`uppercase`,`tracking-wide`,`opacity-60`],[`type`,`button`,`title`,`Unpin this word`,`data-testid`,`domain-word-unpin`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,`shrink-0`,3,`click`],[1,`fa`,`fa-times`],[3,`toggled`,`word`,`share`,`isExpanded`],[1,`max-h-64`,`overflow-y-auto`,`pl-3`],[3,`nodeClicked`,`word`,`selectedNodePath`],[`data-testid`,`domain-word-list-empty`,1,`px-3`,`py-4`,`text-sm`,`opacity-60`],[3,`word`,`share`],[3,`toggled`,`word`,`share`]],template:function(o,i){if(o&1&&(tn$1(0,Ma,9,5,`div`,0),tn$1(1,Ra,1,1)(2,ka,4,4)),o&2){let a;nn$1((a=i.pinnedWord())?0:-1,a),ue(),nn$1(i.visibleWords().length===0?1:2)}},dependencies:[ln,cn],encapsulation:2})}}return t})();var ht=(()=>{class t{constructor(){this.store=N(wt),this.hiddenWords=Ri(this.store.select(qCe),{initialValue:[]})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var ut=(()=>{class t{constructor(){this.store=N(wt)}hide(e){this.store.dispatch(g2({word:e}))}restore(e){this.store.dispatch(y2({word:e}))}restoreAll(){this.store.dispatch(v2())}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var Ia=[`popover`];function Oa(t,r){t&1&&(rt(0,`div`,6),Et(1,` Right-click a word in the cloud to drop it from the cloud and the word list. `),ot())}function Na(t,r){if(t&1){let e=Ir();rt(0,`li`,8)(1,`span`,10),Et(2),ot(),rt(3,`button`,11),Wn$1(`click`,function(){let i=Rn$1(e).$implicit;return Nn$1(st(2).restore(i))}),Hr(4,`i`,12),ot()()}if(t&2){let e=r.$implicit;ue(2),Vr(e),ue(),ar(`title`,`Show `+e+` again`),Hn(`aria-label`,`Show `+e+` again`)(`data-testid`,`domain-restore-`+e)}}function La(t,r){if(t&1){let e=Ir();rt(0,`ul`,7),Fd(1,Na,5,4,`li`,8,Ule),ot(),rt(3,`button`,9),Wn$1(`click`,function(){Rn$1(e);return Nn$1(st().restoreAll())}),Et(4,` Show all words again `),ot()}if(t&2){let e=st();ue(),Rd(e.hiddenWords())}}var No=(()=>{class t{constructor(){this.readStore=N(ht),this.writeStore=N(ut),this.popoverId=Me.required(),this.anchorName=Me.required(),this.hiddenWords=sn$1(()=>[...this.readStore.hiddenWords()].sort((e,o)=>e.localeCompare(o))),this.popover=_i.required(`popover`)}closePopover(){this.popover().nativeElement.hidePopover()}restore(e){this.writeStore.restore(e)}restoreAll(){this.writeStore.restoreAll()}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-hidden-words-popover`]],viewQuery:function(o,i){o&1&&ii(i.popover,Ia,5),o&2&&yi()},hostAttrs:[1,`contents`],inputs:{popoverId:[1,`popoverId`],anchorName:[1,`anchorName`]},decls:9,vars:4,consts:[[`popover`,``],[`popover`,``,1,`dropdown`,`p-2`,`rounded-box`,`bg-base-100`,`shadow-lg`,`w-72`,3,`id`],[1,`flex`,`items-center`,`justify-between`,`border-b`,`border-base-300`,`pb-1`,`mb-1`],[1,`text-sm`,`font-semibold`,`uppercase`,`tracking-wide`],[`type`,`button`,`title`,`Close`,`data-testid`,`domain-hidden-words-close-button`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,3,`click`],[1,`fa`,`fa-times`],[`data-testid`,`domain-hidden-words-empty`,1,`px-2`,`py-3`,`text-xs`,`opacity-60`],[`data-testid`,`domain-hidden-words-list`,1,`m-0`,`flex`,`max-h-[60vh]`,`list-none`,`flex-col`,`overflow-y-auto`,`p-0`],[1,`flex`,`items-center`,`gap-2`,`rounded`,`py-1`,`pl-2`,`pr-1`,`hover:bg-base-200`],[`type`,`button`,`data-testid`,`domain-restore-all-words`,1,`btn`,`btn-sm`,`btn-block`,`mt-1`,3,`click`],[1,`min-w-0`,`flex-1`,`truncate`,`text-sm`],[`type`,`button`,1,`btn`,`btn-ghost`,`btn-xs`,`btn-square`,3,`click`,`title`],[1,`fa`,`fa-eye`]],template:function(o,i){o&1&&(rt(0,`div`,1,0)(2,`div`,2)(3,`span`,3),Et(4,`Hidden Words`),ot(),rt(5,`button`,4),Wn$1(`click`,function(){return i.closePopover()}),Hr(6,`i`,5),ot()(),tn$1(7,Oa,2,0,`div`,6)(8,La,5,0),ot()),o&2&&(Vn(`position-anchor`,`--`+i.anchorName()),ar(`id`,i.popoverId()),ue(7),nn$1(i.hiddenWords().length===0?7:8))},encapsulation:2})}}return t})();var pn=(()=>{class t{constructor(){this.store=N(wt)}wordsForSelectedNode(e){return this.store.select(O(Mn$1(e),qCe,Yt))}selectedNodeName(e){return cet(e,wi.rootName)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();function gt(t,r,e){if(e<=0)return[];let o=[];for(let i=0;i<t.length;i++){let a={word:t[i],value:Qbt(t[i],r),index:i};if(o.length<e){Pa(o,o.push(a)-1);continue}ft(a,o[0])&&(o[0]=a,Aa(o,0))}return o.sort((i,a)=>ft(i,a)?-1:1),o.map(({word:i})=>i)}function ft(t,r){return t.value>r.value||t.value===r.value&&t.index<r.index}function Pa(t,r){let e=r;for(;e>0;){let o=e-1>>1;if(!ft(t[o],t[e]))return;un(t,e,o),e=o}}function Aa(t,r){let e=r;for(;Fa(t,e);){let o=za(t,e);if(o===e)return;un(t,e,o),e=o}}var Fa=(t,r)=>hn(r)<t.length;function za(t,r){let e=hn(r),o=e+1,i=r;return ft(t[i],t[e])&&(i=e),o<t.length&&ft(t[i],t[o])&&(i=o),i}var hn=t=>2*t+1;function un(t,r,e){let o=t[r];t[r]=t[e],t[e]=o}var fn=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="640" height="563" viewBox="58.7 0 64 56.3"><path fill="#000" d="M81.9,20.3h0c0-6.9,3.5-13,8.8-16.7C87.4,1.3,83.4,0,79.1,0,67.9,0,58.8,9.1,58.7,20.3h0v36h17.6V20.4h0c0-1.5,1.2-2.8,2.8-2.8s2.8,1.2,2.8,2.8h0Z"/><path fill="#000" d="M122.7,20.3c0-11.2-9.2-20.3-20.4-20.3s-20.3,9.1-20.4,20.3h0v36h17.6V20.4h0c0-1.1.6-2.1,1.6-2.5,2-.9,4,.6,4,2.5h0v35.9h17.6V20.3h0Z"/></svg>`)}`;function Lo(t){return new Promise((r,e)=>{if(typeof Image>`u`){e(new Error(`Image is not available in this environment`));return}let o=new Image;o.onload=()=>r(o),o.onerror=()=>e(new Error(`Failed to load the word-cloud mask image`)),o.src=t})}var Po=`#e6007e`;var Ao=`#0030ff`;var Ha=`--wordCloudColorStart`;var ja=`--wordCloudColorEnd`;var Va=/^#[0-9A-Fa-f]{6}$/;function vn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return[Po,Ao];let t=getComputedStyle(document.documentElement);return[gn(t,Ha,Po),gn(t,ja,Ao)]}function gn(t,r,e){return Fo(t.getPropertyValue(r).trim(),e)}function Fo(t,r){return Va.test(t)?t:r}function Sn(t,r,e){let o=Math.min(1,Math.max(0,e)),i=Qt$1.convertHexToColorObject(Fo(t,Po)),a=Qt$1.convertHexToColorObject(Fo(r,Ao));return Qt$1.convertColorToHex(new pt$1().lerpColors(i,a,o))}function Cn(t,r,e,o){let[i,a]=t;if(e||!o||r.length===0)return t;let n=Math.max(...r.map(u=>u.text.length)),s=o*.9/(n*.62),l=Math.max(Math.min(a,Math.floor(s)),1);return[Math.min(i,l),l]}var qa=3;function wn(){return({name:t,data:r})=>{let e=[`<b>${wY(t)}</b>`,`Frequency: ${r.frequency}`];return r.tfidf!==void 0&&e.push(`TF-IDF: ${r.tfidf.toFixed(qa)}`),e.join(`<br/>`)}}var Ua=31;var xn=1e3;function _n(t,r,e){return Sn(r,e,$a(t))}function $a(t){let r=0;for(let e of t)r=(r*Ua+(e.codePointAt(0)??0))%xn;return r/xn}var Ga=10;var Xa=`#333`;var Ya=`Roboto, "Helvetica Neue", sans-serif`;var Ka=.55;function bn(t,r,e={}){let o=Cn(r.sizeRange,t,r.drawOutOfBound,e.containerWidth),{shape:i,maskImage:a,keepAspect:n}=Za(r.shape,e.maskImage);return{aria:{enabled:!0},tooltip:{show:!0,formatter:wn()},series:[{type:`wordCloud`,shape:i,maskImage:a,keepAspect:n,left:`center`,top:`center`,width:`${.9*100}%`,height:`${.9*100}%`,sizeRange:o,rotationRange:r.rotationRange,rotationStep:r.rotationStep,gridSize:r.gridSize,drawOutOfBound:r.drawOutOfBound,shrinkToFit:r.shrinkToFit,layoutAnimation:e.layoutAnimation??!0,textStyle:{fontFamily:Ya,fontWeight:`bold`},emphasis:{textStyle:{textShadowBlur:Ga,textShadowColor:Xa}},blur:{textStyle:{opacity:Ka}},data:Qa(t,r)}]}}function Qa(t,r){let[e,o]=vn();return t.map(i=>({name:i.text,value:Qbt(i,r.sizingMode),frequency:i.frequency,tfidf:i.tfidf,textStyle:{color:_n(i.text,e,o)}}))}function Za(t,r){return t===za$1.logoM||t===za$1.custom?{shape:za$1.circle,maskImage:r,keepAspect:!0}:{shape:t,maskImage:void 0,keepAspect:!1}}var vt=Math.PI*2;var je=Zt$1.CMD;var Ja=[`top`,`right`,`bottom`,`left`];function es(t,r,e,o,i){var a=e.width,n=e.height;switch(t){case`top`:o.set(e.x+a/2,e.y-r),i.set(0,-1);break;case`bottom`:o.set(e.x+a/2,e.y+n+r),i.set(0,1);break;case`left`:o.set(e.x-r,e.y+n/2),i.set(-1,0);break;case`right`:o.set(e.x+a+r,e.y+n/2),i.set(1,0);break}}function ts(t,r,e,o,i,a,n,s,l){n-=t,s-=r;var u=Math.sqrt(n*n+s*s);n/=u,s/=u;var d=n*e+t,W=s*e+r;if(Math.abs(o-i)%vt<1e-4)return l[0]=d,l[1]=W,u-e;if(a){var C=o;o=no(i),i=no(C)}else o=no(o),i=no(i);o>i&&(i+=vt);var m=Math.atan2(s,n);if(m<0&&(m+=vt),m>=o&&m<=i||m+vt>=o&&m+vt<=i)return l[0]=d,l[1]=W,u-e;var y=e*Math.cos(o)+t,D=e*Math.sin(o)+r,A=e*Math.cos(i)+t,ce=e*Math.sin(i)+r,H=(y-n)*(y-n)+(D-s)*(D-s),G=(A-n)*(A-n)+(ce-s)*(ce-s);return H<G?(l[0]=y,l[1]=D,Math.sqrt(H)):(l[0]=A,l[1]=ce,Math.sqrt(G))}function Bo(t,r,e,o,i,a,n,s){var l=i-t,u=a-r,d=e-t,W=o-r,C=Math.sqrt(d*d+W*W);d/=C,W/=C;var y=(l*d+u*W)/C;s&&(y=Math.min(Math.max(y,0),1)),y*=C;var D=n[0]=t+y*d,A=n[1]=r+y*W;return Math.sqrt((D-i)*(D-i)+(A-a)*(A-a))}function Tn(t,r,e,o,i,a,n){e<0&&(t=t+e,e=-e),o<0&&(r=r+o,o=-o);var s=t+e,l=r+o,u=n[0]=Math.min(Math.max(i,t),s),d=n[1]=Math.min(Math.max(a,r),l);return Math.sqrt((u-i)*(u-i)+(d-a)*(d-a))}var ye=[];function os(t,r,e){var o=Tn(r.x,r.y,r.width,r.height,t.x,t.y,ye);return e.set(ye[0],ye[1]),o}function is(t,r,e){for(var o=0,i=0,a=0,n=0,s,l,u=Infinity,d=r.data,W=t.x,C=t.y,m=0;m<d.length;){var y=d[m++];m===1&&(o=d[m],i=d[m+1],a=o,n=i);var D=u;switch(y){case je.M:a=d[m++],n=d[m++],o=a,i=n;break;case je.L:D=Bo(o,i,d[m],d[m+1],W,C,ye,!0),o=d[m++],i=d[m++];break;case je.C:D=pd(o,i,d[m++],d[m++],d[m++],d[m++],d[m],d[m+1],W,C,ye),o=d[m++],i=d[m++];break;case je.Q:D=dd(o,i,d[m++],d[m++],d[m],d[m+1],W,C,ye),o=d[m++],i=d[m++];break;case je.A:var A=d[m++],ce=d[m++],H=d[m++],G=d[m++],pe=d[m++],Le=d[m++];m+=1;var tt=!!(1-d[m++]);s=Math.cos(pe)*H+A,l=Math.sin(pe)*G+ce,m<=1&&(a=s,n=l);var Ue=(W-A)*G/H+A;D=ts(A,ce,G,pe,pe+Le,tt,Ue,C,ye),o=Math.cos(pe+Le)*H+A,i=Math.sin(pe+Le)*G+ce;break;case je.R:a=o=d[m++],n=i=d[m++];var ot=d[m++],Ct=d[m++];D=Tn(a,n,ot,Ct,W,C,ye);break;case je.Z:D=Bo(o,i,a,n,W,C,ye,!0),o=a,i=n;break}D<u&&(u=D,e.set(ye[0],ye[1]))}return u}var qe=new de$1;var de=new de$1;var Ce=new de$1;var Je=new de$1;var St=new de$1;function Ho(t,r){if(t){var e=t.getTextGuideLine(),o=t.getTextContent();if(o&&e){var i=t.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],n=i.candidates||Ja,s=o.getBoundingRect().clone();s.applyTransform(o.getComputedTransform());var l=Infinity,u=i.anchor,d=t.getComputedTransform(),W=d&&Gr$1([],d),C=r.get(`length2`)||0;u&&Ce.copy(u);for(var m=0;m<n.length;m++){var y=n[m];es(y,0,s,qe,Je),de$1.scaleAndAdd(de,qe,Je,C),de.transform(W);var D=t.getBoundingRect(),A=u?u.distance(de):t instanceof J$1?is(de,t.path,Ce):os(de,D,Ce);A<l&&(l=A,de.transform(d),Ce.transform(d),Ce.toArray(a[0]),de.toArray(a[1]),qe.toArray(a[2]))}rs(a,r.get(`minTurnAngle`)),e.setShape({points:a})}}}var Wn=[];var Ve=new de$1;function rs(t,r){if(r<=180&&r>0){r=r/180*Math.PI,qe.fromArray(t[0]),de.fromArray(t[1]),Ce.fromArray(t[2]),de$1.sub(Je,qe,de),de$1.sub(St,Ce,de);var e=Je.len(),o=St.len();if(!(e<.001||o<.001)){Je.scale(1/e),St.scale(1/o);var i=Je.dot(St);if(Math.cos(r)<i){var n=Bo(de.x,de.y,Ce.x,Ce.y,qe.x,qe.y,Wn,!1);Ve.fromArray(Wn),Ve.scaleAndAdd(St,n/Math.tan(Math.PI-r));var s=Ce.x!==de.x?(Ve.x-de.x)/(Ce.x-de.x):(Ve.y-de.y)/(Ce.y-de.y);if(isNaN(s))return;s<0?de$1.copy(Ve,de):s>1&&de$1.copy(Ve,Ce),Ve.toArray(t[1])}}}}function zo(t,r,e,o){var i=e===`normal`,a=i?t:t.ensureState(e);a.ignore=r;var n=o.get(`smooth`);n=n===!0?.3:Math.max(+n,0)||0,a.shape=a.shape||{},a.shape.smooth=n;var s=o.getModel(`lineStyle`).getLineStyle();i?t.useStyle(s):a.style=s}function ns(t,r){var e=r.smooth,o=r.points;if(o)if(t.moveTo(o[0][0],o[0][1]),e>0&&o.length>=3){var i=Uv$1(o[0],o[1]),a=Uv$1(o[1],o[2]);if(!i||!a){t.lineTo(o[1][0],o[1][1]),t.lineTo(o[2][0],o[2][1]);return}var n=Math.min(i,a)*e,s=RO([],o[1],o[0],n/i),l=RO([],o[1],o[2],n/a),u=RO([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],o[2][0],o[2][1])}else for(var d=1;d<o.length;d++)t.lineTo(o[d][0],o[d][1])}function Mn(t,r,e){var o=t.getTextGuideLine(),i=t.getTextContent();if(!i){o&&t.removeTextGuideLine();return}for(var a=r.normal,n=a.get(`show`),s=i.ignore,l=0;l<T1.length;l++){var u=T1[l],d=r[u],W=u===`normal`;if(d){var C=d.get(`show`);if((W?s:H$1(i.states[u]&&i.states[u].ignore,s))||!H$1(C,n)){var y=W?o:o&&o.states[u];y&&(y.ignore=!0),o&&zo(o,!0,u,d);continue}o||(o=new wo,t.setTextGuideLine(o),!W&&(s||!n)&&zo(o,!0,`normal`,r.normal),t.stateProxy&&(o.stateProxy=t.stateProxy)),zo(o,!1,u,d)}}if(o){re$1(o.style,e),o.style.fill=null;var D=a.get(`showAbove`),A=t.textGuideLineConfig=t.textGuideLineConfig||{};A.showAbove=D||!1,o.buildPath=ns}}function En(t,r){r=r||`labelLine`;for(var e={normal:t.getModel(r)},o=0;o<lo.length;o++){var i=lo[o];e[i]=t.getModel([i,r])}return e}function as(t){if(t){for(var r=[],e=0;e<t.length;e++)r.push(t[e].slice());return r}}function ss(t,r){var e=t.label,o=r&&r.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:e.style.align,verticalAlign:e.style.verticalAlign,labelLinePoints:as(o&&o.shape.points)}}var Rn=[`align`,`verticalAlign`,`width`,`height`,`fontSize`];var fe=new Pn$1;var jo=K();var ds=K();function Zt(t,r,e){for(var o=0;o<e.length;o++){var i=e[o];r[i]!=null&&(t[i]=r[i])}}var Jt=[`x`,`y`,`rotation`];var Dn=(function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(r,e,o,i,a){var n=i.style,l=i.__hostTarget.textConfig||{},u=i.getComputedTransform(),d=i.getBoundingRect().plain();X.applyTransform(d,d,u),u?fe.setLocalTransform(u):(fe.x=fe.y=fe.rotation=fe.originX=fe.originY=0,fe.scaleX=fe.scaleY=1),fe.rotation=no(fe.rotation);var W=i.__hostTarget,C;if(W){C=W.getBoundingRect().plain();var m=W.getComputedTransform();X.applyTransform(C,C,m)}var y=C&&W.getTextGuideLine();this._labelList.push({label:i,labelLine:y,seriesModel:o,dataIndex:r,dataType:e,layoutOptionOrCb:a,layoutOption:null,rect:d,hostRect:C,priority:C?C.width*C.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:y&&y.ignore,x:fe.x,y:fe.y,scaleX:fe.scaleX,scaleY:fe.scaleY,rotation:fe.rotation,style:{x:n.x,y:n.y,align:n.align,verticalAlign:n.verticalAlign,width:n.width,height:n.height,fontSize:n.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(r){var e=this;this._chartViewList.push(r);var o=r.__model,i=o.get(`labelLayout`);(V(i)||ie(i).length)&&r.group.traverse(function(a){if(a.ignore)return!0;var n=a.getTextContent(),s=ge$1(a);n&&!n.disableLabelLayout&&e._addLabel(s.dataIndex,s.dataType,o,n,i)})},t.prototype.updateLayoutConfig=function(r){var e=r.getWidth(),o=r.getHeight();function i(G,pe){return function(){Ho(G,pe)}}for(var a=0;a<this._labelList.length;a++){var n=this._labelList[a],s=n.label,l=s.__hostTarget,u=n.defaultAttr,d=void 0;V(n.layoutOptionOrCb)?d=n.layoutOptionOrCb(ss(n,l)):d=n.layoutOptionOrCb,d=d||{},n.layoutOption=d;var W=Math.PI/180;l&&l.setTextConfig({local:!1,position:d.x!=null||d.y!=null?null:u.attachedPos,rotation:d.rotate!=null?d.rotate*W:u.attachedRot,offset:[d.dx||0,d.dy||0]});var C=!1;if(d.x!=null?(s.x=lt$1(d.x,e),s.setStyle(`x`,0),C=!0):(s.x=u.x,s.setStyle(`x`,u.style.x)),d.y!=null?(s.y=lt$1(d.y,o),s.setStyle(`y`,0),C=!0):(s.y=u.y,s.setStyle(`y`,u.style.y)),d.labelLinePoints){var m=l.getTextGuideLine();m&&(m.setShape({points:d.labelLinePoints}),C=!1)}var y=jo(s);y.needsUpdateLabelLine=C,s.rotation=d.rotate!=null?d.rotate*W:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var D=0;D<Rn.length;D++){var A=Rn[D];s.setStyle(A,d[A]!=null?d[A]:u.style[A])}if(d.draggable){if(s.draggable=!0,s.cursor=`move`,l){var ce=n.seriesModel;if(n.dataIndex!=null)ce=n.seriesModel.getData(n.dataType).getItemModel(n.dataIndex);s.on(`drag`,i(l,ce.getModel(`labelLine`)))}}else s.off(`drag`),s.cursor=u.cursor}},t.prototype.layout=function(r){var e=r.getWidth(),o=r.getHeight(),i=[];w(this._labelList,function(l){l.defaultAttr.ignore||i.push(Jh({},l))});var a=Ce$1(i,function(l){return l.layoutOption.moveOverlap===`shiftX`}),n=Ce$1(i,function(l){return l.layoutOption.moveOverlap===`shiftY`});jV(a,0,0,e),jV(n,1,0,o);var s=Ce$1(i,function(l){return l.layoutOption.hideOverlap});QV(s),hS(s)},t.prototype.processLabelsOverall=function(){var r=this;w(this._chartViewList,function(e){var o=e.__model,i=e.ignoreLabelLineUpdate,a=o.isAnimationEnabled();e.group.traverse(function(n){if(n.ignore&&!n.forceLabelAnimation)return!0;var s=!i,l=n.getTextContent();!s&&l&&(s=jo(l).needsUpdateLabelLine),s&&r._updateLabelLine(n,o),a&&r._animateLabels(n,o)})})},t.prototype._updateLabelLine=function(r,e){var o=r.getTextContent(),i=ge$1(r),a=i.dataIndex;if(o&&a!=null){var n=e.getData(i.dataType),s=n.getItemModel(a),l={},u=n.getItemVisual(a,`style`);if(u)l.stroke=u[n.getVisual(`drawType`)];var W=s.getModel(`labelLine`);Mn(r,En(s),l),Ho(r,W)}},t.prototype._animateLabels=function(r,e){var o=r.getTextContent(),i=r.getTextGuideLine();if(o&&(r.forceLabelAnimation||!o.ignore&&!o.invisible&&!r.disableLabelAnimation&&!Ki(r))){var a=jo(o),n=a.oldLayout,s=ge$1(r),l=s.dataIndex,u={x:o.x,y:o.y,rotation:o.rotation},d=e.getData(s.dataType);if(n){o.attr(n);var C=r.prevStates;C&&(Z(C,`select`)>=0&&o.attr(a.oldLayoutSelect),Z(C,`emphasis`)>=0&&o.attr(a.oldLayoutEmphasis)),Ir$1(o,u,e,l)}else if(o.attr(u),!CC(o).valueAnimation){var W=H$1(o.style.opacity,1);o.style.opacity=0,Kn(o,{style:{opacity:W}},e,l)}if(a.oldLayout=u,o.states.select){var m=a.oldLayoutSelect={};Zt(m,u,Jt),Zt(m,o.states.select,Jt)}if(o.states.emphasis){var y=a.oldLayoutEmphasis={};Zt(y,u,Jt),Zt(y,o.states.emphasis,Jt)}PN(o,l,d,e,e)}if(i&&!i.ignore&&!i.invisible){var a=ds(i),n=a.oldLayout,D={points:i.shape.points};n?(i.attr({shape:n}),Ir$1(i,{shape:D},e)):(i.setShape(D),i.style.strokePercent=0,Kn(i,{style:{strokePercent:1}},e)),a.oldLayout=D}},t})();var Vo=K();function kn(t){t.registerUpdateLifecycle(`series:beforeupdate`,function(r,e,o){var i=Vo(e).labelManager;i||(i=Vo(e).labelManager=new Dn),i.clearLabels()}),t.registerUpdateLifecycle(`series:layoutlabels`,function(r,e,o){var i=Vo(e).labelManager;w(o.updatedSeries,function(a){i.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()})}Lu([TO,sG]);Lu(kn);WG({type:`series.wordCloud`,visualStyleAccessPath:`textStyle`,visualStyleMapper:function(t){return{fill:t.get(`color`)}},visualDrawType:`fill`,optionUpdated:function(){var t=this.option;t.gridSize=Math.max(Math.floor(t.gridSize),4)},getInitialData:function(t,r){var o=new mv(xT.createDimensions(t.data,{coordDimensions:[`value`]}),this);return o.initData(t.data),o},defaultOption:{maskImage:null,shape:`circle`,keepAspect:!1,left:`center`,top:`center`,width:`70%`,height:`80%`,sizeRange:[12,60],rotationRange:[-90,90],rotationStep:45,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,textStyle:{fontWeight:`normal`}}});XG({type:`wordCloud`,render:function(t,r,e){var o=this.group;o.removeAll();var i=t.getData(),a=t.get(`gridSize`);t.layoutInstance.ondraw=function(n,s,l,u){var d=i.getItemModel(l),W=d.getModel(`textStyle`),C=new TT.Text({style:xT.createTextStyle(W),scaleX:1/u.info.mu,scaleY:1/u.info.mu,x:(u.gx+u.info.gw/2)*a,y:(u.gy+u.info.gh/2)*a,rotation:u.rot});C.setStyle({x:u.info.fillTextOffsetX,y:u.info.fillTextOffsetY+s*.5,text:n,verticalAlign:`middle`,fill:i.getItemVisual(l,`style`).fill,fontSize:s}),o.add(C),i.setItemGraphicEl(l,C),C.ensureState(`emphasis`).style=xT.createTextStyle(d.getModel([`emphasis`,`textStyle`]),{state:`emphasis`}),C.ensureState(`blur`).style=xT.createTextStyle(d.getModel([`blur`,`textStyle`]),{state:`blur`}),xT.enableHoverEmphasis(C,d.get([`emphasis`,`focus`]),d.get([`emphasis`,`blurScope`])),C.stateTransition={duration:t.get(`animation`)?t.get([`stateAnimation`,`duration`]):0,easing:t.get([`stateAnimation`,`easing`])},C.__highDownDispatcher=!0},this._model=t},remove:function(){this.group.removeAll(),this._model.layoutInstance.dispose()},dispose:function(){this._model.layoutInstance.dispose()}});window.setImmediate||(window.setImmediate=(function(){return window.msSetImmediate||window.webkitSetImmediate||window.mozSetImmediate||window.oSetImmediate||(function(){if(!window.postMessage||!window.addEventListener)return null;var e=[void 0],o=`zero-timeout-message`,i=function(n){var s=e.length;return e.push(n),window.postMessage(o+s.toString(36),`*`),s};return window.addEventListener(`message`,function(n){if(!(typeof n.data!=`string`||n.data.substr(0,o.length)!==o)){n.stopImmediatePropagation();var s=parseInt(n.data.substr(o.length),36);e[s]&&(e[s](),e[s]=void 0)}},!0),window.clearImmediate=function(n){e[n]&&(e[n]=void 0)},i})()||function(e){window.setTimeout(e,0)}})());window.clearImmediate||(window.clearImmediate=(function(){return window.msClearImmediate||window.webkitClearImmediate||window.mozClearImmediate||window.oClearImmediate||function(e){window.clearTimeout(e)}})());var $o=(function(){var r=document.createElement(`canvas`);if(!r||!r.getContext)return!1;var e=r.getContext(`2d`);return!(!e||!e.getImageData||!e.fillText||!Array.prototype.some||!Array.prototype.push)})();var Uo=(function(){if($o){for(var r=document.createElement(`canvas`).getContext(`2d`),e=20,o,i;e;){if(r.font=e.toString(10)+`px sans-serif`,r.measureText(`W`).width===o&&r.measureText(`m`).width===i)return e+1;o=r.measureText(`W`).width,i=r.measureText(`m`).width,e--}return 0}})();var ls=function(t){if(Array.isArray(t)){var r=t.slice();return r.splice(0,2),r}else return[]};var ms=function(r){for(var e,o,i=r.length;i;)e=Math.floor(Math.random()*i),o=r[--i],r[i]=r[e],r[e]=o;return r};var et={};var Go=function(r,e){if(!$o)return;var o=Math.floor(Math.random()*Date.now());Array.isArray(r)||(r=[r]),r.forEach(function(L,c){if(typeof L==`string`){if(r[c]=document.getElementById(L),!r[c])throw new Error(`The element id specified is not found.`)}else if(!L.tagName&&!L.appendChild)throw new Error(`You must pass valid HTML elements, or ID of the element.`)});var i={list:[],fontFamily:`"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif`,fontWeight:`normal`,color:`random-dark`,minSize:0,weightFactor:1,clearCanvas:!0,backgroundColor:`#fff`,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,origin:null,drawMask:!1,maskColor:`rgba(255,0,0,0.3)`,maskGapWidth:.3,layoutAnimation:!0,wait:0,abortThreshold:0,abort:function(){},minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationStep:.1,shuffle:!0,rotateRatio:.1,shape:`circle`,ellipticity:.65,classes:null,hover:null,click:null};if(e)for(var a in e)a in i&&(i[a]=e[a]);if(typeof i.weightFactor!=`function`){var n=i.weightFactor;i.weightFactor=function(c){return c*n}}if(typeof i.shape!=`function`)switch(i.shape){case`circle`:default:i.shape=`circle`;break;case`cardioid`:i.shape=function(c){return 1-Math.sin(c)};break;case`diamond`:i.shape=function(c){var v=c%(2*Math.PI/4);return 1/(Math.cos(v)+Math.sin(v))};break;case`square`:i.shape=function(c){return Math.min(1/Math.abs(Math.cos(c)),1/Math.abs(Math.sin(c)))};break;case`triangle-forward`:i.shape=function(c){var v=c%(2*Math.PI/3);return 1/(Math.cos(v)+Math.sqrt(3)*Math.sin(v))};break;case`triangle`:case`triangle-upright`:i.shape=function(c){var v=(c+Math.PI*3/2)%(2*Math.PI/3);return 1/(Math.cos(v)+Math.sqrt(3)*Math.sin(v))};break;case`pentagon`:i.shape=function(c){var v=(c+.955)%(2*Math.PI/5);return 1/(Math.cos(v)+.726543*Math.sin(v))};break;case`star`:i.shape=function(c){var v=(c+.955)%(2*Math.PI/10);return(c+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-v)+3.07768*Math.sin(2*Math.PI/10-v)):1/(Math.cos(v)+3.07768*Math.sin(v))};break}i.gridSize=Math.max(Math.floor(i.gridSize),4);var s=i.gridSize,l=s-i.maskGapWidth,u=Math.abs(i.maxRotation-i.minRotation),d=Math.min(i.maxRotation,i.minRotation),W=i.rotationStep,C,m,y,D,A,ce,H;function G(L,c){return`hsl(`+(Math.random()*360).toFixed()+`,`+(Math.random()*30+70).toFixed()+`%,`+(Math.random()*(c-L)+L).toFixed()+`%)`}switch(i.color){case`random-dark`:H=function(){return G(10,50)};break;case`random-light`:H=function(){return G(50,90)};break;default:typeof i.color==`function`&&(H=i.color);break}var pe;typeof i.fontWeight==`function`&&(pe=i.fontWeight);var Le=null;typeof i.classes==`function`&&(Le=i.classes);var tt=!1,Ue=[],ot,Ct=function(c){var v=c.currentTarget,S=v.getBoundingClientRect(),E,b;c.touches?(E=c.touches[0].clientX,b=c.touches[0].clientY):(E=c.clientX,b=c.clientY);var B=E-S.left,O=b-S.top,P=Math.floor(B*(v.width/S.width||1)/s),U=Math.floor(O*(v.height/S.height||1)/s);return Ue[P]?Ue[P][U]:null},Jo=function(c){var v=Ct(c);if(ot!==v){if(ot=v,!v){i.hover(void 0,void 0,c);return}i.hover(v.item,v.dimension,c)}},ro=function(c){var v=Ct(c);v&&(i.click(v.item,v.dimension,c),c.preventDefault())},no=[],Hn=function(c){if(no[c])return no[c];var v=c*8,S=v,E=[];for(c===0&&E.push([D[0],D[1],0]);S--;){var b=1;i.shape!==`circle`&&(b=i.shape(S/v*2*Math.PI)),E.push([D[0]+c*b*Math.cos(-S/v*2*Math.PI),D[1]+c*b*Math.sin(-S/v*2*Math.PI)*i.ellipticity,S/v*2*Math.PI])}return no[c]=E,E},ao=function(){return i.abortThreshold>0&&new Date().getTime()-ce>i.abortThreshold},jn=function(){return i.rotateRatio===0||Math.random()>i.rotateRatio?0:u===0?d:d+Math.round(Math.random()*u/W)*W},Vn=function(c,v,S,E){var B=i.weightFactor(v);if(B<=i.minSize)return!1;var O=1;B<Uo&&(O=(function(){for(var lo=2;lo*B<Uo;)lo+=2;return lo})());var P;pe?P=pe(c,v,B,E):P=i.fontWeight;var U=document.createElement(`canvas`),k=U.getContext(`2d`,{willReadFrequently:!0});k.font=P+` `+(B*O).toString(10)+`px `+i.fontFamily;var V=k.measureText(c).width/O,j=Math.max(B*O,k.measureText(`m`).width,k.measureText(`W`).width)/O,ee=V+j*2,ne=j*3,ve=Math.ceil(ee/s),te=Math.ceil(ne/s);ee=ve*s,ne=te*s;var N=-V/2,X=-j*.4,oe=Math.ceil((ee*Math.abs(Math.sin(S))+ne*Math.abs(Math.cos(S)))/s),Se=Math.ceil((ee*Math.abs(Math.cos(S))+ne*Math.abs(Math.sin(S)))/s),Pe=Se*s,$e=oe*s;U.setAttribute(`width`,Pe),U.setAttribute(`height`,$e),k.scale(1/O,1/O),k.translate(Pe*O/2,$e*O/2),k.rotate(-S),k.font=P+` `+(B*O).toString(10)+`px `+i.fontFamily,k.fillStyle=`#000`,k.textBaseline=`middle`,k.fillText(c,N*O,(X+B*.5)*O);var Kn=k.getImageData(0,0,Pe,$e).data;if(ao())return!1;for(var ei=[],Ee=Se,be,so,co,ue=[oe/2,Se/2,oe/2,Se/2];Ee--;)for(be=oe;be--;){co=s;e:for(;co--;)for(so=s;so--;)if(Kn[((be*s+co)*Pe+(Ee*s+so))*4+3]){ei.push([Ee,be]),Ee<ue[3]&&(ue[3]=Ee),Ee>ue[1]&&(ue[1]=Ee),be<ue[0]&&(ue[0]=be),be>ue[2]&&(ue[2]=be);break e}}return{mu:O,occupied:ei,bounds:ue,gw:Se,gh:oe,fillTextOffsetX:N,fillTextOffsetY:X,fillTextWidth:V,fillTextHeight:j,fontSize:B}},qn=function(c,v,S,E,b){for(var B=b.length;B--;){var O=c+b[B][0],P=v+b[B][1];if(O>=m||P>=y||O<0||P<0){if(!i.drawOutOfBound)return!1;continue}if(!C[O][P])return!1}return!0},Un=function(c,v,S,E,b,B,O,P,U,k){var V=S.fontSize,j;H?j=H(E,b,V,B,O,k):j=i.color;var ee;pe?ee=pe(E,b,V,k):ee=i.fontWeight;var ne;Le?ne=Le(E,b,V,k):ne=i.classes,r.forEach(function(ve){if(ve.getContext){var te=ve.getContext(`2d`),N=S.mu;te.save(),te.scale(1/N,1/N),te.font=ee+` `+(V*N).toString(10)+`px `+i.fontFamily,te.fillStyle=j,te.translate((c+S.gw/2)*s*N,(v+S.gh/2)*s*N),P!==0&&te.rotate(-P),te.textBaseline=`middle`,te.fillText(E,S.fillTextOffsetX*N,(S.fillTextOffsetY+V*.5)*N),te.restore()}else{var X=document.createElement(`span`),oe=``;oe=`rotate(`+-P/Math.PI*180+`deg) `,S.mu!==1&&(oe+=`translateX(-`+S.fillTextWidth/4+`px) scale(`+1/S.mu+`)`);var Se={position:`absolute`,display:`block`,font:ee+` `+V*S.mu+`px `+i.fontFamily,left:(c+S.gw/2)*s+S.fillTextOffsetX+`px`,top:(v+S.gh/2)*s+S.fillTextOffsetY+`px`,width:S.fillTextWidth+`px`,height:S.fillTextHeight+`px`,lineHeight:V+`px`,whiteSpace:`nowrap`,transform:oe,webkitTransform:oe,msTransform:oe,transformOrigin:`50% 40%`,webkitTransformOrigin:`50% 40%`,msTransformOrigin:`50% 40%`};j&&(Se.color=j),X.textContent=E;for(var Pe in Se)X.style[Pe]=Se[Pe];if(U)for(var $e in U)X.setAttribute($e,U[$e]);ne&&(X.className+=ne),ve.appendChild(X)}})},$n=function(c,v,S,E,b){if(!(c>=m||v>=y||c<0||v<0)){if(C[c][v]=!1,S)r[0].getContext(`2d`).fillRect(c*s,v*s,l,l);tt&&(Ue[c][v]={item:b,dimension:E})}},Gn=function(c,v,S,E,b,B){var O=b.occupied,P=i.drawMask,U;P&&(U=r[0].getContext(`2d`),U.save(),U.fillStyle=i.maskColor);var k;if(tt){var V=b.bounds;k={x:(c+V[3])*s,y:(v+V[0])*s,w:(V[1]-V[3]+1)*s,h:(V[2]-V[0]+1)*s}}for(var j=O.length;j--;){var ee=c+O[j][0],ne=v+O[j][1];ee>=m||ne>=y||ee<0||ne<0||$n(ee,ne,P,k,B)}P&&U.restore()},Xn=function L(c,v){if(v>20)return null;var S,E,b;Array.isArray(c)?(S=c[0],E=c[1]):(S=c.word,E=c.weight,b=c.attributes);var B=jn(),O=ls(c),P=Vn(S,E,B,O);if(!P||ao())return!1;if(!i.drawOutOfBound&&!i.shrinkToFit){var U=P.bounds;if(U[1]-U[3]+1>m||U[2]-U[0]+1>y)return!1}for(var k=A+1,V=function(ve){var te=Math.floor(ve[0]-P.gw/2),N=Math.floor(ve[1]-P.gh/2),X=P.gw,oe=P.gh;return qn(te,N,X,oe,P.occupied)?(Un(te,N,P,S,E,A-k,ve[2],B,b,O),Gn(te,N,X,oe,P,c),{gx:te,gy:N,rot:B,info:P}):!1};k--;){var j=Hn(A-k);i.shuffle&&(j=[].concat(j),ms(j));for(var ee=0;ee<j.length;ee++){var ne=V(j[ee]);if(ne)return ne}}return i.shrinkToFit?(Array.isArray(c)?c[1]=c[1]*3/4:c.weight=c.weight*3/4,L(c,v+1)):null},it=function(c,v,S){if(v)return!r.some(function(E){var b=new CustomEvent(c,{cancelable:!0,detail:S||{}});return!E.dispatchEvent(b)},this);r.forEach(function(E){var b=new CustomEvent(c,{detail:S||{}});E.dispatchEvent(b)},this)},Yn=function(){var c=r[0];if(c.getContext)m=Math.ceil(c.width/s),y=Math.ceil(c.height/s);else{var v=c.getBoundingClientRect();m=Math.ceil(v.width/s),y=Math.ceil(v.height/s)}if(it(`wordcloudstart`,!0)){D=i.origin?[i.origin[0]/s,i.origin[1]/s]:[m/2,y/2],A=Math.floor(Math.sqrt(m*m+y*y)),C=[];var S,E,b;if(!c.getContext||i.clearCanvas)for(r.forEach(function(N){if(N.getContext){var X=N.getContext(`2d`);X.fillStyle=i.backgroundColor,X.clearRect(0,0,m*(s+1),y*(s+1)),X.fillRect(0,0,m*(s+1),y*(s+1))}else N.textContent=``,N.style.backgroundColor=i.backgroundColor,N.style.position=`relative`}),S=m;S--;)for(C[S]=[],E=y;E--;)C[S][E]=!0;else{var B=document.createElement(`canvas`).getContext(`2d`);B.fillStyle=i.backgroundColor,B.fillRect(0,0,1,1);var O=B.getImageData(0,0,1,1).data,P=c.getContext(`2d`).getImageData(0,0,m*s,y*s).data;S=m;for(var U,k;S--;)for(C[S]=[],E=y;E--;){k=s;e:for(;k--;)for(U=s;U--;)for(b=4;b--;)if(P[((E*s+k)*m*s+(S*s+U))*4+b]!==O[b]){C[S][E]=!1;break e}C[S][E]!==!1&&(C[S][E]=!0)}P=B=O=void 0}if(i.hover||i.click){for(tt=!0,S=m+1;S--;)Ue[S]=[];i.hover&&c.addEventListener(`mousemove`,Jo),i.click&&(c.addEventListener(`click`,ro),c.addEventListener(`touchstart`,ro),c.addEventListener(`touchend`,function(N){N.preventDefault()}),c.style.webkitTapHighlightColor=`rgba(0, 0, 0, 0)`),c.addEventListener(`wordcloudstart`,function N(){c.removeEventListener(`wordcloudstart`,N),c.removeEventListener(`mousemove`,Jo),c.removeEventListener(`click`,ro),ot=void 0})}b=0;var V,j,ee=!0;i.layoutAnimation?i.wait!==0?(V=window.setTimeout,j=window.clearTimeout):(V=window.setImmediate,j=window.clearImmediate):(V=function(N){N()},j=function(){ee=!1});var ne=function(X,oe){r.forEach(function(Se){Se.addEventListener(X,oe)},this)},ve=function(X,oe){r.forEach(function(Se){Se.removeEventListener(X,oe)},this)},te=function N(){ve(`wordcloudstart`,N),j(et[o])};ne(`wordcloudstart`,te),et[o]=(i.layoutAnimation?V:setTimeout)(function N(){if(ee){if(b>=i.list.length){j(et[o]),it(`wordcloudstop`,!1),ve(`wordcloudstart`,te),delete et[o];return}ce=new Date().getTime();var X=Xn(i.list[b],0),oe=!it(`wordclouddrawn`,!0,{item:i.list[b],drawn:X});if(ao()||oe){j(et[o]),i.abort(),it(`wordcloudabort`,!1),it(`wordcloudstop`,!1),ve(`wordcloudstart`,te);return}b++,et[o]=V(N,i.wait)}},i.wait)}};Yn()};Go.isSupported=$o;Go.minFontSize=Uo;var Xo=Go;if(!Xo.isSupported)throw new Error(`Sorry your browser not support wordCloud`);function ps(t){for(var r=t.getContext(`2d`),e=r.getImageData(0,0,t.width,t.height),o=r.createImageData(e),i=0,a=0,n=0;n<e.data.length;n+=4){var s=e.data[n+3];if(s>128){var l=e.data[n]+e.data[n+1]+e.data[n+2];i+=l,++a}}for(var u=i/a,n=0;n<e.data.length;n+=4){var l=e.data[n]+e.data[n+1]+e.data[n+2],s=e.data[n+3];s<128||l>u?(o.data[n]=0,o.data[n+1]=0,o.data[n+2]=0,o.data[n+3]=0):(o.data[n]=255,o.data[n+1]=255,o.data[n+2]=255,o.data[n+3]=255)}r.putImageData(o,0,0)}px(function(t,r){t.eachSeriesByType(`wordCloud`,function(e){var o=xT.getLayoutRect(e.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()}),i=e.get(`keepAspect`),a=e.get(`maskImage`),n=a?a.width/a.height:1;i&&hs(o,n);var s=e.getData(),l=document.createElement(`canvas`);l.width=o.width,l.height=o.height;var u=l.getContext(`2d`);if(a)try{u.drawImage(a,0,0,l.width,l.height),ps(l)}catch(H){console.error(`Invalid mask image`),console.error(H.toString())}var d=e.get(`sizeRange`),W=e.get(`rotationRange`),C=s.getDataExtent(`value`),m=Math.PI/180,y=e.get(`gridSize`);Xo(l,{list:s.mapArray(`value`,function(H,G){var pe=s.getItemModel(G);return[s.getName(G),pe.get(`textStyle.fontSize`,!0)||ST.linearMap(H,C,d),G]}).sort(function(H,G){return G[1]-H[1]}),fontFamily:e.get(`textStyle.fontFamily`)||e.get(`emphasis.textStyle.fontFamily`)||t.get(`textStyle.fontFamily`),fontWeight:e.get(`textStyle.fontWeight`)||e.get(`emphasis.textStyle.fontWeight`)||t.get(`textStyle.fontWeight`),gridSize:y,ellipticity:o.height/o.width,minRotation:W[0]*m,maxRotation:W[1]*m,clearCanvas:!a,rotateRatio:1,rotationStep:e.get(`rotationStep`)*m,drawOutOfBound:e.get(`drawOutOfBound`),shrinkToFit:e.get(`shrinkToFit`),layoutAnimation:e.get(`layoutAnimation`),shuffle:!1,shape:e.get(`shape`)});function D(H){var G=H.detail.item;H.detail.drawn&&e.layoutInstance.ondraw&&(H.detail.drawn.gx+=o.x/y,H.detail.drawn.gy+=o.y/y,e.layoutInstance.ondraw(G[0],G[1],G[2],H.detail.drawn))}l.addEventListener(`wordclouddrawn`,D),e.layoutInstance&&e.layoutInstance.dispose();var A=r.__wordCloudRunningLayouts=r.__wordCloudRunningLayouts||{},ce=e.seriesIndex;A[ce]&&A[ce].dispose(),e.layoutInstance={ondraw:null,dispose:function(){l.removeEventListener(`wordclouddrawn`,D),l.addEventListener(`wordclouddrawn`,function(H){H.preventDefault()})}},A[ce]=e.layoutInstance})});Rh(function(t){var r=(t||{}).series;!bT.isArray(r)&&(r=r?[r]:[]);var e=[`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`];bT.each(r,function(i){if(i&&i.type===`wordCloud`){var a=i.textStyle||{};o(a.normal),o(a.emphasis)}});function o(i){i&&bT.each(e,function(a){i.hasOwnProperty(a)&&(i[`text`+wT.capitalFirst(a)]=i[a])})}});function hs(t,r){var e=t.width,o=t.height;e>o*r?(t.x+=(e-o*r)/2,t.width=o*r):(t.y+=(o-e/r)/2,t.height=e/r)}Lu([TO,OA,LA]);var us=150;var fs=200;var eo=class{constructor(r,e){this.chartRegistry=r,this.handlers=e,this.highlightedWords=[],this.mustRestoreHighlightAfterLayout=!1,this.hasDrawnACloud=!1,this.containerSizeObserver=new RT,this.drawnWords=Tt(null),this.containerSize=this.containerSizeObserver.size,this.drawnWordCount=this.drawnWords.asReadonly()}attachTo(r){this.chart&&this.attachedContainer===r||(this.dispose(),this.attachedContainer=r,this.chart=Wz(r),this.chart.on(`finished`,()=>{this.handlers.onLayoutFinished(),this.scheduleLayoutSettled()}),this.chart.on(`click`,e=>this.reportClickedWord(e)),this.chart.getZr().on(`click`,e=>this.reportClickBesideEveryWord(e)),this.chart.on(`contextmenu`,e=>this.reportRightClickedWord(e)),r.addEventListener(`contextmenu`,SY),this.chartRegistry.register(this.chart),this.containerSizeObserver.observe(r))}reportRightClickedWord({name:r,event:e}){let o=e?.event;!r||!o||this.handlers.onWordRightClicked(r,o.clientX,o.clientY)}highlightWords(r){this.highlightedWords=r,this.applyHighlight()}restoreTheHighlightALayoutWiped(){this.mustRestoreHighlightAfterLayout&&(this.mustRestoreHighlightAfterLayout=!1,this.applyHighlight())}applyHighlight(){this.chart&&(this.chart.dispatchAction({type:`downplay`,seriesIndex:0}),this.highlightedWords.length>0&&this.chart.dispatchAction({type:`highlight`,seriesIndex:0,name:[...this.highlightedWords]}))}reportClickedWord({name:r}){r&&this.handlers.onWordClicked(r)}reportClickBesideEveryWord({target:r}){r||this.handlers.onBackgroundClicked()}render(r,e){if(this.cancelPendingRender(),!this.hasDrawnACloud){this.draw(r,e);return}this.renderTimeout=setTimeout(()=>{this.renderTimeout=void 0,this.draw(r,e)},us)}draw(r,e){this.hasMeasurableContainer()&&(this.hasDrawnACloud=!0,this.drawnWords.set(null),this.chart?.clear(),this.chart?.resize(),this.chart?.setOption(r,!0),this.mustRestoreHighlightAfterLayout=!0,e())}cancelPendingRender(){this.renderTimeout!==void 0&&(clearTimeout(this.renderTimeout),this.renderTimeout=void 0)}hasMeasurableContainer(){return this.attachedContainer!==void 0&&this.attachedContainer.clientWidth>0&&this.attachedContainer.clientHeight>0}dispose(){this.attachedContainer?.removeEventListener(`contextmenu`,SY),this.containerSizeObserver.disconnect(),this.cancelPendingRender(),this.layoutSettleTimeout!==void 0&&clearTimeout(this.layoutSettleTimeout),this.drawnWords.set(null),this.hasDrawnACloud=!1,this.chart&&this.chartRegistry.unregister(this.chart),this.chart?.dispose(),this.chart=void 0,this.attachedContainer=void 0}scheduleLayoutSettled(){this.layoutSettleTimeout!==void 0&&clearTimeout(this.layoutSettleTimeout),this.layoutSettleTimeout=setTimeout(()=>{this.layoutSettleTimeout=void 0,this.drawnWords.set(this.countWordsWithAGraphicElement()),this.restoreTheHighlightALayoutWiped()},fs)}countWordsWithAGraphicElement(){let r=this.chart?.getModel?.()?.getSeriesByIndex(0)?.getData();if(!r)return null;let e=0;for(let o=0;o<r.count();o++)r.getItemGraphicEl(o)&&e++;return e}};function In(t,r){let e=t.slice(0,3).map(i=>i.text).join(`, `),o=t.length===1?`domain term`:`domain terms`;return`Word cloud of ${t.length} ${o} for ${r}; largest: ${e}`}function On(t,r){return t===null||t>=r?null:`${t} of ${r} words fit \u2014 enlarge the window, reduce word spacing, or enable "Fit all words" or "Draw outside bounds"`}var vs=[`wordCloudCanvas`];var Ss=(t,r)=>r.text;function Cs(t,r){if(t&1){let e=Ir();rt(0,`div`,2),Wn$1(`click`,function(){Rn$1(e);return Nn$1(st().backgroundClicked.emit())}),rt(1,`p`,3),Et(2),ot(),rt(3,`button`,4),Wn$1(`click`,function(i){Rn$1(e);return Nn$1(st().showWholeMap(i))}),Et(4,`Show whole map`),ot()()}if(t&2){let e=st();ue(2),si(`No domain words for `,e.selectedNodeName(),`. Select a folder or another file in the explorer.`)}}function ws(t,r){if(t&1&&(rt(0,`output`,8),Et(1),ot()),t&2){let e=st(2);ue(),si(` `,e.droppedWordNotice(),` `)}}function xs(t,r){if(t&1&&(rt(0,`li`),Et(1),ot()),t&2){let e=r.$implicit;ue(),O$(``,e.text,`: `,e.frequency)}}function _s(t,r){if(t&1&&(rt(0,`figure`,5)(1,`figcaption`,6),Et(2),ot(),Hr(3,`div`,7,0),ot(),tn$1(5,ws,2,1,`output`,8),rt(6,`ol`,6),Fd(7,xs,2,2,`li`,null,Ss),ot()),t&2){let e=st();ue(2),Vr(e.description()),ue(3),nn$1(e.droppedWordNotice()?5:-1),ue(2),Rd(e.topWordsForScreenReaders())}}var ys=`(prefers-reduced-motion: reduce)`;function bs(t,r){return t!==null&&t.container===r.container&&t.words===r.words&&t.settings===r.settings&&t.maskImage===r.maskImage&&t.containerWidth===r.containerWidth&&t.containerHeight===r.containerHeight}var Yo=(()=>{class t{constructor(){this.wordCloudReadStore=N(pn),this.viewReadinessStore=N(jz),this.settings=Me(ci),this.selectedNodePath=Me(null),this.customShapeMask=Me(null),this.markedWords=Me([]),this.clearSelection=Kr$1(),this.backgroundClicked=Kr$1(),this.wordRightClicked=Kr$1(),this.wordClicked=Kr$1(),this.canvasRef=_i(`wordCloudCanvas`),this.chartHost=new eo(N(p3),{onLayoutFinished:()=>this.viewReadinessStore.markReady(`domain`),onWordRightClicked:(e,o,i)=>this.wordRightClicked.emit({word:e,clientX:o,clientY:i}),onWordClicked:e=>this.wordClicked.emit(e),onBackgroundClicked:()=>this.backgroundClicked.emit()}),this.words=Ri(tet(this.selectedNodePath).pipe(Ai(e=>this.wordCloudReadStore.wordsForSelectedNode(e))),{initialValue:[]}),this.selectedNodeName=sn$1(()=>this.wordCloudReadStore.selectedNodeName(this.selectedNodePath())),this.renderedWords=sn$1(()=>gt(this.words(),this.settings().sizingMode,this.settings().topN)),this.droppedWordNotice=sn$1(()=>On(this.chartHost.drawnWordCount(),this.renderedWords().length)),this.topWordsForScreenReaders=sn$1(()=>this.renderedWords().slice(0,10)),this.description=sn$1(()=>In(this.renderedWords(),this.selectedNodeName())),this.prefersReducedMotion=typeof matchMedia==`function`&&matchMedia(ys).matches,this.logoMaskImage=Tt(null),this.customMaskImage=Tt(null),this.lastRenderedInputs=null,this.loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(),Ps(()=>this.loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure()),Ps(()=>this.renderIntoTheChartOnceTheContainerIsMeasured()),Ps(()=>this.chartHost.highlightWords(this.markedWords()))}ngOnDestroy(){this.disposeChart()}disposeChart(){this.chartHost.dispose(),this.lastRenderedInputs=null}showWholeMap(e){e.stopPropagation(),this.clearSelection.emit()}renderIntoTheChartOnceTheContainerIsMeasured(){let e=this.words(),o=this.settings(),i=this.maskImageFor(o.shape),a=this.canvasRef()?.nativeElement;if(!a){this.disposeChart(),this.viewReadinessStore.markReady(`domain`);return}this.chartHost.attachTo(a);let{width:n,height:s}=this.chartHost.containerSize();if(n===0||s===0){this.chartHost.cancelPendingRender();return}let l={container:a,words:e,settings:o,maskImage:i,containerWidth:n,containerHeight:s};if(bs(this.lastRenderedInputs,l)){this.viewReadinessStore.markReady(`domain`);return}this.chartHost.render(bn(this.renderedWords(),o,{layoutAnimation:!this.prefersReducedMotion,containerWidth:n,maskImage:i}),()=>{this.lastRenderedInputs=l})}maskImageFor(e){if(e===za$1.logoM)return this.logoMaskImage()??void 0;if(e===za$1.custom)return this.customMaskImage()??void 0}loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(){Lo(fn).then(e=>this.logoMaskImage.set(e)).catch(()=>{})}loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure(){let e=this.customShapeMask();if(e===null){this.customMaskImage.set(null);return}Lo(e).then(o=>this.customMaskImage.set(o)).catch(()=>this.customMaskImage.set(null))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-word-cloud`]],viewQuery:function(o,i){o&1&&ii(i.canvasRef,vs,5),o&2&&yi()},hostAttrs:[1,`relative`,`block`,`h-full`,`w-full`],inputs:{settings:[1,`settings`],selectedNodePath:[1,`selectedNodePath`],customShapeMask:[1,`customShapeMask`],markedWords:[1,`markedWords`]},outputs:{clearSelection:`clearSelection`,backgroundClicked:`backgroundClicked`,wordRightClicked:`wordRightClicked`,wordClicked:`wordClicked`},decls:2,vars:1,consts:[[`wordCloudCanvas`,``],[`data-testid`,`word-cloud-empty-state`,1,`flex`,`h-full`,`w-full`,`flex-col`,`items-center`,`justify-center`,`gap-3`,`px-6`,`text-center`],[`data-testid`,`word-cloud-empty-state`,1,`flex`,`h-full`,`w-full`,`flex-col`,`items-center`,`justify-center`,`gap-3`,`px-6`,`text-center`,3,`click`],[1,`text-sm`,`opacity-60`],[`type`,`button`,1,`btn`,`btn-sm`,`btn-primary`,3,`click`],[1,`h-full`,`w-full`],[1,`sr-only`],[1,`word-cloud-canvas`,`relative`,`h-full`,`w-full`],[`data-testid`,`word-cloud-dropped-word-notice`,1,`pointer-events-none`,`absolute`,`bottom-2`,`left-1/2`,`-translate-x-1/2`,`whitespace-nowrap`,`rounded-lg`,`bg-base-200/90`,`px-3`,`py-1`,`text-xs`,`opacity-80`]],template:function(o,i){o&1&&tn$1(0,Cs,5,1,`div`,1)(1,_s,9,2),o&2&&nn$1(i.words().length===0?0:1)},encapsulation:2})}}return t})();var to={id:`words`,label:`Words`,icon:`fa-solid fa-font`,searchPlaceholder:`payment, invoice`,searchAriaLabel:`Search words`};var Nn=[fe$1,to];var Ko=(()=>{class t{constructor(){this.store=N(wt),this.pathsWithDomainWords=Ri(this.store.select(En$1),{requireSync:!0})}project(e){return Zn$1(e,{pathsWithDomainWords:this.pathsWithDomainWords()})}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var Ln={patternSelector:XCe,setPattern:$v,searchedNodePathsSelector:O(iCe,XCe,(t,r)=>new Set(aX(t,r).map(e=>e.path)))};var Ts=5;var Ms=`No domain words`;var Qo=(()=>{class t{constructor(){this.store=N(wt),this.domainSelectionStore=N(ar$1),this.domainBarReadStore=N(re),this.hoverTooltipService=N($J),this.domainWordIndex=Ri(this.store.select(Ie),{requireSync:!0}),this.clearsSelectionOnCollapse=!1}isSelected(e){return this.domainSelectionStore.selectedNodePath()===e.path}isHovered(){return!1}select(e){this.domainSelectionStore.select(e.path)}deselect(){this.domainSelectionStore.clear()}hover(e,o){let i=this.domainBarReadStore.settings().sizingMode,a=this.topWords(e.path,i);this.hoverTooltipService.show({title:e.name,rows:a.length>0?a.map(n=>({label:n.text,value:`${Qbt(n,i)}`})):[{label:Ms,value:``}]},o.right,o.top)}hoverEnd(){this.hoverTooltipService.hide()}topWords(e,o){return gt(this.domainWordIndex().wordsOf(e),o,Ts)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var Pn={options:[h0.NAME,h0.NUMBER_OF_FILES],optionSelector:YCe,ascendingSelector:ZCe,setOption:Xv,toggleAscending:t=>Yv({value:!t})};var Es=(t,r)=>O(iCe,e=>yo(J(e),t,r));var Zo=(()=>{class t{constructor(){this.store=N(wt)}rootNodeFor(e,o){return this.store.select(Es(e,o))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var An=(()=>{class t{constructor(){this.domainSelectionStore=N(ar$1),this.revealService=N(ne$1),this.modeService=N(H),Bp(`domain`,e=>this.showNode(e))}showNode(e){this.modeService.activate(fe$1.id),this.domainSelectionStore.select(e),this.revealService.revealNode(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵdir=On$1({type:t,selectors:[[``,`ccShowsHandedOverNode`,``]]})}}return t})();var Fn=(()=>{class t{constructor(){this.inspected=Tt(null),this.inspectedWord=this.inspected.asReadonly()}inspect(e){this.inspected.set(e)}toggle(e){this.inspected.update(o=>o===e?null:e)}clear(){this.inspected.set(null)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac,providedIn:`root`})}}return t})();var oo=(()=>{class t{constructor(){this.querySubject=new kt(``),this.pattern$=this.querySubject.asObservable(),this.isPatternEmpty$=this.pattern$.pipe(it(e=>e.trim().length===0))}setPattern(e){this.querySubject.next(e)}resetPattern(){this.setPattern(``)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();var zn={[ge.OCCURRENCES]:!1,[ge.NAME]:!0,[ge.RELEVANCE]:!1};var Ds={option:ge.OCCURRENCES,ascending:zn[ge.OCCURRENCES]};var io=(()=>{class t{constructor(){this.sortingSubject=new kt(Ds),this.options=Object.values(ge),this.sorting$=this.sortingSubject.asObservable(),this.option$=this.sorting$.pipe(it(({option:e})=>e)),this.ascending$=this.sorting$.pipe(it(({ascending:e})=>e))}setOption(e){this.sortingSubject.next({option:e,ascending:zn[e]})}toggleAscending(){let{ascending:e}=this.sortingSubject.value;this.sortingSubject.next(ne(T({},this.sortingSubject.value),{ascending:!e}))}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵprov=G({token:t,factory:t.ɵfac})}}return t})();function Bn(t,r,e,o){let i=o&&e.trim().length>0?pt(r,e).map(({text:a})=>a):[];return t===null||i.includes(t)?i:[t,...i]}function ks(t,r){if(t&1){let e=Ir();Ne(0,`span`,12),Et(1),ze(),Ne(2,`button`,13),lt(`click`,function(){Rn$1(e);return Nn$1(st().copySelectedPath())}),In$1(3,`i`,14),ze()}if(t&2){let e=st();Ct(`title`,e.selectedNodePath()),ue(),si(` `,e.selectedNodePath(),` `),ue(),Ct(`title`,e.copied()?`Copied!`:`Copy path`),ue(),oi(`fa-copy`,!e.copied())(`fa-check`,e.copied())}}function Is(t,r){if(t&1&&(Ne(0,`span`,5),Et(1),ze()),t&2){let e=st();ue(),Vr(e.selectedNodeName()||`No selection`)}}var cu=(()=>{class t{constructor(){this.domainBarReadStore=N(re),this.customShapeMaskStore=N(mt),this.explorerCollapseService=N(z),this.explorerModeService=N(H),this.domainSelectionStore=N(ar$1),this.domainWordInspectionStore=N(Fn),this.domainWordQueryStore=N(oo),this.domainWordSortStore=N(io),this.wordOccurrencesReadStore=N(He),this.hiddenWordsReadStore=N(ht),this.hiddenWordsWriteStore=N(ut),this.clipboard=N(Be),this.settings=this.domainBarReadStore.settings,this.customShapeMask=this.customShapeMaskStore.dataUri,this.copied=this.clipboard.copied,this.selectedNodePath=this.domainSelectionStore.selectedNodePath,this.selectedNodeName=sn$1(()=>cet(this.selectedNodePath(),``)),this.hiddenWordCount=sn$1(()=>this.hiddenWordsReadStore.hiddenWords().length),this.hiddenWordsTooltip=sn$1(()=>this.hiddenWordCount()===0?`No word is hidden`:`${this.hiddenWordCount()} hidden from the cloud and the word list`),this.rightClickedWord=Tt(null),this.inspectedWord=this.domainWordInspectionStore.inspectedWord,this.wordQuery=Ri(this.domainWordQueryStore.pattern$,{requireSync:!0}),this.wordSorting=Ri(this.domainWordSortStore.sorting$,{requireSync:!0}),this.projectWords=Ri(this.wordOccurrencesReadStore.projectWords$,{requireSync:!0}),this.markedWords=sn$1(()=>Bn(this.inspectedWord(),this.projectWords(),this.wordQuery(),!this.explorerModeService.isFilesMode()))}showWordOccurrences(e){this.explorerModeService.activate(to.id),this.explorerCollapseService.expand(),this.domainWordInspectionStore.inspect(e)}searchForWord(e){this.explorerModeService.activate(to.id),this.explorerCollapseService.expand(),this.domainWordQueryStore.setPattern(e)}toggleInspectedWord(e){this.domainWordInspectionStore.toggle(e)}hideWord(e){this.inspectedWord()===e&&this.domainWordInspectionStore.toggle(e),this.hiddenWordsWriteStore.hide(e)}closeWordMenu(){this.rightClickedWord.set(null)}selectNode(e){this.domainSelectionStore.select(e)}clearSelection(){this.domainSelectionStore.clear()}unpinWord(){this.domainWordInspectionStore.clear()}async copySelectedPath(){let e=this.selectedNodePath();e&&await this.clipboard.copy(e)}static{this.ɵfac=function(o){return new(o||t)}}static{this.ɵcmp=Ze({type:t,selectors:[[`cc-domain-view`]],features:[$s([Ko,{provide:Qe,useExisting:Ko},Qo,{provide:Ye,useExisting:Qo},Qn$1,{provide:Je$1,useExisting:Qn$1},Zo,{provide:Ge,useExisting:Zo},an$1(Pn),nn$2(Ln),{provide:U,useValue:{showRules:!1,showSearch:!0,showCounts:!1,modes:Nn}},oo,{provide:Ke,useExisting:oo},io,{provide:ze$1,useExisting:io},{provide:it$1,useValue:{showMapActions:!1,jumpTargetView:`metrics`}},Be,tn$2(`domain`),nSe()]),qce([An])],decls:16,vars:14,consts:[[`view`,`domain`],[`headerChips`,``,1,`flex`,`items-stretch`,`border`,`border-base-300`,`mx-2`,`mt-2`,`rounded-md`,`overflow-hidden`],[`label`,`Hidden`,`popoverId`,`domain-hidden-words`,`anchorName`,`domain-hidden-words-chip`,3,`count`,`tooltip`],[`explorerPopovers`,``,`popoverId`,`domain-hidden-words`,`anchorName`,`domain-hidden-words-chip`],[`collapsedContent`,``,1,`flex`,`flex-1`,`min-w-0`,`items-center`,`gap-1`],[1,`flex-1`,`min-w-0`,`truncate`,`text-xs`,`opacity-50`],[`modeBody`,``,3,`wordToggled`,`nodeClicked`,`query`,`sorting`,`expandedWord`,`selectedNodePath`],[1,`fixed`,`inset-x-0`,`top-[var(--cc-bars-height,49px)]`,`bottom-[var(--cc-bottom-bar-height,32px)]`],[3,`clearSelection`,`backgroundClicked`,`wordClicked`,`wordRightClicked`,`settings`,`customShapeMask`,`selectedNodePath`,`markedWords`],[1,`absolute`,`right-[10px]`,`top-[10px]`,`z-10`,`flex`],[3,`searchWord`,`hideWord`,`closed`,`rightClickedWord`],[3,`showSelectedWhenNotHovered`,`selectedNodePath`],[`data-testid`,`explorer-collapsed-path`,1,`flex-1`,`min-w-0`,`truncate`,`text-xs`,`opacity-70`,3,`title`],[`type`,`button`,`data-testid`,`explorer-copy-path-button`,1,`btn`,`btn-ghost`,`btn-sm`,`btn-square`,`shrink-0`,3,`click`,`title`],[1,`fa`]],template:function(o,i){o&1&&(In$1(0,`cc-loading-file-progress-spinner`,0),Ne(1,`cc-sidebar-explorer`)(2,`div`,1),In$1(3,`cc-explorer-count-chip`,2),ze(),In$1(4,`cc-hidden-words-popover`,3),Ne(5,`div`,4),tn$1(6,ks,4,7)(7,Is,2,1,`span`,5),ze(),Ne(8,`cc-domain-word-list`,6),lt(`wordToggled`,function(n){return i.toggleInspectedWord(n)})(`nodeClicked`,function(n){return i.selectNode(n)}),ze()(),Ne(9,`div`,7)(10,`cc-word-cloud`,8),lt(`clearSelection`,function(){return i.clearSelection()})(`backgroundClicked`,function(){return i.unpinWord()})(`wordClicked`,function(n){return i.showWordOccurrences(n)})(`wordRightClicked`,function(n){return i.rightClickedWord.set(n)}),ze(),In$1(11,`cc-domain-toolbox`,9),ze(),In$1(12,`cc-node-context-menu`),Ne(13,`cc-domain-word-menu`,10),lt(`searchWord`,function(n){return i.searchForWord(n)})(`hideWord`,function(n){return i.hideWord(n)})(`closed`,function(){return i.closeWordMenu()}),ze(),In$1(14,`cc-bottom-bar`,11)(15,`cc-domain-bar`)),o&2&&(ue(3),Ct(`count`,i.hiddenWordCount())(`tooltip`,i.hiddenWordsTooltip()),ue(3),nn$1(i.selectedNodePath()?6:7),ue(2),Ct(`query`,i.wordQuery())(`sorting`,i.wordSorting())(`expandedWord`,i.inspectedWord())(`selectedNodePath`,i.selectedNodePath()),ue(2),Ct(`settings`,i.settings())(`customShapeMask`,i.customShapeMask())(`selectedNodePath`,i.selectedNodePath())(`markedWords`,i.markedWords()),ue(3),Ct(`rightClickedWord`,i.rightClickedWord()),ue(),Ct(`showSelectedWhenNotHovered`,!0)(`selectedNodePath`,i.selectedNodePath()))},dependencies:[en$1,Yo,Ro,Do,ko,Gn,Oo,No,Ue,Bo$1,tSe],encapsulation:2})}}return t})();export{cu as DomainViewComponent};
@@ -0,0 +1 @@
1
+ import{$n as oi$1,B as $a$1,Bt as Rt,Dn as h3,Dr as wt$1,Er as wre,Et as O,Fr as ze,G as Ba$1,Gn as lu,Gt as UE,H as $s,Ht as T,J as CU,Jt as VIt,K as By,Mn as it,Mr as yi$1,Mt as Ps,Nn as jN,On as hH,Pn as jU,Q as EOe,Rn as kCe,Rt as Ri$1,Sn as dSe,Sr as vA,St as N,Tr as wp,Tt as Nn,Un as l3,Ut as Tt$1,Vt as Sc,Wn as lt,Wt as U$1,X as Ct,Xn as nn,Yn as ne,Yt as Vn,Z as Dy,Zn as nv,_t as Kr,an as ZP,at as G,bn as cm,br as ue$1,bt as Me,cr as qU,ct as Hd,et as EU,fn as _i$1,fr as sE,ft as In,gn as bn,hr as st,ht as KU,jn as ii$1,jr as yBe,jt as PU,kn as hy,kr as xc,kt as OT,ln as _Be,mr as sn,mt as Js,nn as Yne,on as Ze$1,ot as Gm,pn as aCe,pt as Ir,q as CH,qn as mA,rr as pH,rt as Fa$1,sn as Zt$1,sr as qP,tt as Et$1,ut as Hr,vr as tn,wt as Ne,yt as MOe,z as $N,zn as kc,zt as Rn}from"./main-W663WA53.js";import{A as RT,At as lt$1,B as Te,Bt as se,C as P,Ct as ie,Dt as lC,E as Pn,Et as ke,F as Se$1,G as V,H as Ue,Ht as up,I as Sm,K as VI,Kt as wU,Lt as qO,M as Rn$1,Nt as oe,O as R,Ot as la$1,P as SY,Pt as ot,Q as Wz,Qt as ze$1,R as TO,Rt as re,S as OA,St as he,T as Pe$1,Tt as ji$1,U as Uu,Ut as vp,V as U$2,Vt as sr,Wt as w$1,X as We,Y as WO,Yt as xR,Z as Ww,Zt as xo$1,_ as LA,at as Z,b as Lu,c as IO,ct as Zv,dt as at,f as Jt$1,g as L$1,gt as dt,h as Kn$1,ht as dr,i as Ga$1,it as Yt$1,lt as _T,nt as Xe$1,o as H,ot as Zn$1,p as K,q as Vt$1,qt as wY,r as Ce,rt as YL,s as I1,t as $e$1,tt as XO,u as J,ut as _y,v as LN,vt as gh,x as Me$1,xt as hT,y as Lr,yt as gl}from"./chunk-oHIaR8OO.js";function _t(e,t,r){if(bn(e))return null;let n=$n(e,t,r);return n.area>0?n:null}function $n(e,t,r){let n=e.children.filter(o=>!o.isExcluded).map(o=>bn(o)?ho(o,t,r):$n(o,t,r)).filter(o=>o.area>0),i=n.reduce((o,a)=>o+a.area,0);return ne(T({},Xn(e,t,r)),{isFile:!1,area:i,children:n})}function ho(e,t,r){return ne(T({},Xn(e,t,r)),{isFile:!0,area:e.attributes?.[t.areaMetric]??0,children:[]})}function Xn(e,t,r){return{path:e.path,name:e.name,colorValue:e.attributes?.[t.colorMetric],isFlat:r(e)}}function Se(e,t,r=()=>!0){return t===0?0:e.children.filter(r).reduce((n,i)=>Math.max(n,1+Se(i,t-1,r)),0)}function Et(e,t){let r=new Set,n=i=>{if(i.isFile){t(i)&&r.add(i.path);return}i.children.forEach(n)};return n(e),r}function Ge(e,t){let r=e.children.find(n=>!n.isFile&&Re(t,n.path));return r?Ge(r,t):e}function le(e,t,r=Number.POSITIVE_INFINITY){let n=r>0?e.children.find(i=>Re(t,i.path)):void 0;return n?le(n,t,r-1):e}function Re(e,t){return e===t||e.startsWith(`${t}/`)}function Ye(e,t){let r=e.children.find(n=>Re(t,n.path));if(r)return r.path===t?e:Ye(r,t)}function At(e,t){var r=e.mapDimensionsAll(`defaultedLabel`),n=r.length;if(n===1){var i=la$1(e,t,r[0]);return i!=null?i+``:null}else if(n){for(var o=[],a=0;a<r.length;a++)o.push(la$1(e,t,r[a]));return o.join(` `)}}function vo(e,t,r,n,i){var o=e.getArea(),a=o.x,s=o.y,c=o.width,u=o.height,l=r.get([`lineStyle`,`width`])||0;a-=l/2,s-=l/2,c+=l,u+=l,c=Math.ceil(c),a!==Math.floor(a)&&(a=Math.floor(a),c++);var f=new Pe$1({shape:{x:a,y:s,width:c,height:u}});if(t){var m=e.getBaseAxis(),v=m.isHorizontal(),y=m.inverse;v?(y&&(f.shape.x+=c),f.shape.width=0):(y||(f.shape.y+=u),f.shape.height=0);var _=V(i)?function(g){i(g,f)}:null;Kn$1(f,{shape:{width:c,height:u,x:a,y:s}},r,null,n,_)}return f}function go(e,t,r){var n=e.getArea(),i=Me$1(n.r0,1),o=Me$1(n.r,1),a=new xo$1({shape:{cx:Me$1(e.cx,1),cy:Me$1(e.cy,1),r0:i,r:o,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});if(t)e.getBaseAxis().dim===`angle`?a.shape.endAngle=n.startAngle:a.shape.r=i,Kn$1(a,{shape:{endAngle:n.endAngle,r:o}},r);return a}function qn(e,t,r,n,i){if(e){if(e.type===`polar`)return go(e,t,r);if(e.type===`cartesian2d`)return vo(e,t,r,n,i)}else return null;return null}function jn(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!==`tspan`&&(t===`text`||Ue(e,`text`)))}function Qn(e,t,r){var n=e,i,o,a;if(t===`text`)a=n;else{a={},Ue(n,`text`)&&(a.text=n.text),Ue(n,`rich`)&&(a.rich=n.rich),Ue(n,`textFill`)&&(a.fill=n.textFill),Ue(n,`textStroke`)&&(a.stroke=n.textStroke),Ue(n,`fontFamily`)&&(a.fontFamily=n.fontFamily),Ue(n,`fontSize`)&&(a.fontSize=n.fontSize),Ue(n,`fontStyle`)&&(a.fontStyle=n.fontStyle),Ue(n,`fontWeight`)&&(a.fontWeight=n.fontWeight),o={type:`text`,style:a,silent:!0},i={};var s=Ue(n,`textPosition`);r?i.position=s?n.textPosition:`inside`:s&&(i.position=n.textPosition),Ue(n,`textPosition`)&&(i.position=n.textPosition),Ue(n,`textOffset`)&&(i.offset=n.textOffset),Ue(n,`textRotation`)&&(i.rotation=n.textRotation),Ue(n,`textDistance`)&&(i.distance=n.textDistance)}return Kn(a,e),w$1(a.rich,function(c){Kn(c,c)}),{textConfig:i,textContent:o}}function Kn(e,t){t&&(t.font=t.textFont||t.font,Ue(t,`textStrokeWidth`)&&(e.lineWidth=t.textStrokeWidth),Ue(t,`textAlign`)&&(e.align=t.textAlign),Ue(t,`textVerticalAlign`)&&(e.verticalAlign=t.textVerticalAlign),Ue(t,`textLineHeight`)&&(e.lineHeight=t.textLineHeight),Ue(t,`textWidth`)&&(e.width=t.textWidth),Ue(t,`textHeight`)&&(e.height=t.textHeight),Ue(t,`textBackgroundColor`)&&(e.backgroundColor=t.textBackgroundColor),Ue(t,`textPadding`)&&(e.padding=t.textPadding),Ue(t,`textBorderColor`)&&(e.borderColor=t.textBorderColor),Ue(t,`textBorderWidth`)&&(e.borderWidth=t.textBorderWidth),Ue(t,`textBorderRadius`)&&(e.borderRadius=t.textBorderRadius),Ue(t,`textBoxShadowColor`)&&(e.shadowColor=t.textBoxShadowColor),Ue(t,`textBoxShadowBlur`)&&(e.shadowBlur=t.textBoxShadowBlur),Ue(t,`textBoxShadowOffsetX`)&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Ue(t,`textBoxShadowOffsetY`)&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function Pt(e,t,r){var n=e;n.textPosition=n.textPosition||r.position||`inside`,r.offset!=null&&(n.textOffset=r.offset),r.rotation!=null&&(n.textRotation=r.rotation),r.distance!=null&&(n.textDistance=r.distance);var i=n.textPosition.indexOf(`inside`)>=0,o=e.fill||Te.color.neutral99;Zn(n,t);var a=n.textFill==null;return i?a&&(n.textFill=r.insideFill||Te.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=o),n.textStrokeWidth??=2):(a&&(n.textFill=e.fill||r.outsideFill||Te.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,w$1(t.rich,function(s){Zn(s,s)}),n}function Zn(e,t){t&&(Ue(t,`fill`)&&(e.textFill=t.fill),Ue(t,`stroke`)&&(e.textStroke=t.fill),Ue(t,`lineWidth`)&&(e.textStrokeWidth=t.lineWidth),Ue(t,`font`)&&(e.font=t.font),Ue(t,`fontStyle`)&&(e.fontStyle=t.fontStyle),Ue(t,`fontWeight`)&&(e.fontWeight=t.fontWeight),Ue(t,`fontSize`)&&(e.fontSize=t.fontSize),Ue(t,`fontFamily`)&&(e.fontFamily=t.fontFamily),Ue(t,`align`)&&(e.textAlign=t.align),Ue(t,`verticalAlign`)&&(e.textVerticalAlign=t.verticalAlign),Ue(t,`lineHeight`)&&(e.textLineHeight=t.lineHeight),Ue(t,`width`)&&(e.textWidth=t.width),Ue(t,`height`)&&(e.textHeight=t.height),Ue(t,`backgroundColor`)&&(e.textBackgroundColor=t.backgroundColor),Ue(t,`padding`)&&(e.textPadding=t.padding),Ue(t,`borderColor`)&&(e.textBorderColor=t.borderColor),Ue(t,`borderWidth`)&&(e.textBorderWidth=t.borderWidth),Ue(t,`borderRadius`)&&(e.textBorderRadius=t.borderRadius),Ue(t,`shadowColor`)&&(e.textBoxShadowColor=t.shadowColor),Ue(t,`shadowBlur`)&&(e.textBoxShadowBlur=t.shadowBlur),Ue(t,`shadowOffsetX`)&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Ue(t,`shadowOffsetY`)&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Ue(t,`textShadowColor`)&&(e.textShadowColor=t.textShadowColor),Ue(t,`textShadowBlur`)&&(e.textShadowBlur=t.textShadowBlur),Ue(t,`textShadowOffsetX`)&&(e.textShadowOffsetX=t.textShadowOffsetX),Ue(t,`textShadowOffsetY`)&&(e.textShadowOffsetY=t.textShadowOffsetY))}Sm();var Jn=`__ec_stack_`;function ei(e){if(Jt$1(e.axis.scale)){for(var t=Uu(e.axis),r=[],n=0;n<e.count;n++)r.push(re({stackId:Jn+n},e));for(var i=xo({bandWidthResult:t,seriesInfo:r}),o=[],n=0;n<e.count;n++){var a=i[Jn+n];a.offsetCenter=a.offset+a.width/2,o.push(a)}return o}}function xo(e){var t=e.bandWidthResult.w,r=t,n=0,i,o,a=[],s={};w$1(e.seriesInfo,function(_,g){g||(o=_.defaultBarGap||0);var A=_.stackId;Ue(s,A)||n++;var R=s[A];R||(R=s[A]={width:0,maxWidth:0},a.push(A));var C=_.barWidth;C&&!R.width&&(R.width=C,C=ze$1(r,C),r-=C);var de=_.barMaxWidth;de&&(R.maxWidth=de);var Te=_.barMinWidth;Te&&(R.minWidth=Te);var we=_.barGap;we!=null&&(o=we);var be=_.barCategoryGap;be!=null&&(i=be)}),i??=he(35-a.length*4,15)+`%`;var c=lt$1(i,t),u=lt$1(o,1),l=(r-c)/(n+(n-1)*u);l=he(l,0),w$1(a,function(_){var g=s[_],A=g.maxWidth,R=g.minWidth;if(g.width){var C=g.width;A&&(C=ze$1(C,A)),R&&(C=he(C,R)),g.width=C,r-=C+u*C,n--}else{var C=l;A&&A<C&&(C=ze$1(A,r)),R&&R>C&&(C=R),C!==l&&(g.width=C,r-=C+u*C,n--)}}),l=(r-c)/(n+(n-1)*u),l=he(l,0);var f=0,m;w$1(a,function(_){var g=s[_];g.width||(g.width=l),m=g,f+=g.width*(1+u)}),m&&(f-=m.width*u);var v={},y=-f/2;return w$1(a,function(_){var g=s[_];v[_]=v[_]||{bandWidth:t,offset:y,width:g.width},y+=g.width*(1+u)}),v}var Co=0;var ti=1;var yo=2;var So=`view`;(function(e){se(t,e);function t(r,n,i){var o=e.call(this)||this;o.type=So,o.dimensions=[`x`,`y`];var a=o;a.invertY=r,a.lgCt=n,a.lgGeo=i;var s=a.trans=[];return s[Co]=VI(),s[ti]=VI(),s[yo]=VI(),a.mtRaw=ot(),a.mtRawInv=ot(),a.mtOverall=ot(),a.mtOverallInv=ot(),a.zoom=1,o}return t.prototype.getBoundingRect=function(){return Ro(null,this)},t.prototype.getViewRect=function(){return _o(null,this)},t.prototype.getRoamTransform=function(){return Ww(this.trans[ti])},t.prototype.dataToPoint=function(r,n,i){var o=n?this.mtRaw:this.mtOverall;return i=i||[],o?dt(i,r,o):IO(i,r)},t.prototype.pointToData=function(r,n,i){i=i||[];var o=this.mtOverallInv;return o?dt(i,r,o):IO(i,r)},t.prototype.convertToPixel=function(r,n,i){var o=ri(n);return o===this?o.dataToPoint(i):null},t.prototype.convertFromPixel=function(r,n,i){var o=ri(n);return o===this?o.pointToData(i):null},t.prototype.containPoint=function(r){var n=this;return Zv($e,n.dataRect),XO($e,$e,n.mtOverall),qO($e,r[0],r[1])},t.dimensions=[`x`,`y`],t})(Pn);var $e=WO();function ni(e){return e.zoom}function Ro(e,t){return Zv(e||WO(),t.dataRect)}function _o(e,t){return Zv(e||WO(),t.viewRect)}ot();ot();WO();ot();ot();function ri(e){var t=e.seriesModel;return t?t.coordinateSystem:null}VI();VI();var Tt={color:`fill`,borderColor:`stroke`};var ii={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1};var D=K();var oi=(function(e){se(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get(`zlevel`,!0),this.currentZ=this.get(`z`,!0)},t.prototype.getInitialData=function(r,n){return _T(null,this)},t.prototype.getDataParams=function(r,n,i){var o=e.prototype.getDataParams.call(this,r,n);return i&&(o.info=D(i).info),o},t.type=`series.custom`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,clip:!1},t})(Lr);function Ao(e,t){return t=t||[0,0],U$2([`x`,`y`],function(r,n){var i=this.getAxis(r),o=t[n],a=e[n]/2;return i.type===`category`?Uu(i).w:Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))},this)}function wt(e){var t=e.master.getRect();return{coordSys:{type:`cartesian2d`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:oe(Ao,e)}}}function Po(e,t){return t=t||[0,0],U$2([0,1],function(r){var n=t[r],i=e[r]/2,o=[],a=[];return o[r]=n-i,a[r]=n+i,o[1-r]=a[1-r]=t[1-r],Math.abs(this.dataToPoint(o)[r]-this.dataToPoint(a)[r])},this)}function bt(e){var t=e.view,r=t.getBoundingRect();return{coordSys:{type:`geo`,x:r.x,y:r.y,width:r.width,height:r.height,zoom:ni(t)},api:{coord:function(n){return e.dataToPoint(n)},size:oe(Po,e)}}}function To(e,t){var r=this.getAxis(),n=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return r.type===`category`?Uu(r).w:Math.abs(r.dataToCoord(n-i)-r.dataToCoord(n+i))}function Ot(e){var t=e.getRect();return{coordSys:{type:`singleAxis`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r){return e.dataToPoint(r)},size:oe(To,e)}}}function wo(e,t){return t=t||[0,0],U$2([`Radius`,`Angle`],function(r,n){var i=`get`+r+`Axis`,o=this[i](),a=t[n],s=e[n]/2,c=o.type===`category`?Uu(o).w:Math.abs(o.dataToCoord(a-s)-o.dataToCoord(a+s));return r===`Angle`&&(c=c*Math.PI/180),c},this)}function Nt(e){var t=e.getRadiusAxis(),r=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:`polar`,cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:function(i){var o=t.dataToRadius(i[0]),a=r.dataToAngle(i[1]),s=e.coordToPoint([o,a]);return s.push(o,a*Math.PI/180),s},size:oe(wo,e)}}}function Dt(e){var t=e.getRect(),r=e.getRangeInfo();return{coordSys:{type:`calendar`,x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return e.dataToPoint(n,i)},layout:function(n,i){return e.dataToLayout(n,i)}}}}function Lt(e){var t=e.getRect();return{coordSys:{type:`matrix`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(r,n){return e.dataToPoint(r,n)},layout:function(r,n){return e.dataToLayout(r,n)}}}}var ci={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]};var si=ie(ci);at(Rn$1,function(e,t){return e[t]=1,e},{});Rn$1.join(`, `);var _e=[``,`style`,`shape`,`extra`];var ue=K();function Ft(e,t,r,n,i){var o=e+`Animation`,a=lC(e,n,i)||{},s=ue(t).userDuring;return a.duration>0&&(a.during=s?oe(Mo,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),R(a,r[o]),a}function ui(e,t,r,n){n=n||{};var i=n.dataIndex,o=n.isInit,a=n.clearStyle,s=r.isAnimationEnabled(),c=ue(e),u=t.style;c.userDuring=t.during;var l={},f={};if(ko(e,t,f),e.type===`compound`)for(var m=e.shape.paths,v=t.shape.paths,y=0;y<v.length;y++){var _=v[y];Mt(`shape`,_,m[y])}else Mt(`shape`,t,f),Mt(`extra`,t,f);if(!o&&s&&(Fo(e,t,l),li(`shape`,e,t,l),li(`extra`,e,t,l),Vo(e,t,u,l)),f.style=u,Oo(e,f,a),Do(e,t),s)if(o){var g={};w$1(_e,function(R$1){var C=R$1?t[R$1]:t;C&&C.enterFrom&&(R$1&&(g[R$1]=g[R$1]||{}),R(R$1?g[R$1]:g,C.enterFrom))});var A=Ft(`enter`,e,t,r,i);A.duration>0&&e.animateFrom(g,A)}else No(e,t,i||0,r,l);bo(e,t),u?e.dirty():e.markRedraw()}function bo(e,t){for(var r=ue(e).leaveToProps,n=0;n<_e.length;n++){var i=_e[n],o=i?t[i]:t;o&&o.leaveTo&&(r||(r=ue(e).leaveToProps={}),i&&(r[i]=r[i]||{}),R(i?r[i]:r,o.leaveTo))}}function Xe(e,t,r,n){if(e){var i=e.parent,o=ue(e).leaveToProps;if(o){var a=Ft(`update`,e,t,r,0);a.done=function(){i&&i.remove(e),n&&n()},e.animateTo(o,a)}else i&&i.remove(e),n&&n()}}function ce(e){return e===`all`}function Oo(e,t,r){var n=t.style;if(!e.isGroup&&n){if(r){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var a=i[o];a.targetName===`style`&&a.changeTarget(e.style)}}e.setStyle(n)}t&&(t.style=null,t&&e.attr(t),t.style=n)}function No(e,t,r,n,i){if(i){var o=Ft(`update`,e,t,n,r);o.duration>0&&e.animateFrom(i,o)}}function Do(e,t){Ue(t,`silent`)&&(e.silent=t.silent),Ue(t,`ignore`)&&(e.ignore=t.ignore),e instanceof sr&&Ue(t,`invisible`)&&(e.invisible=t.invisible),e instanceof J&&Ue(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}var L={};var Lo={setTransform:function(e,t){return L.el[e]=t,this},getTransform:function(e){return L.el[e]},setShape:function(e,t){var r=L.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=L.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=L.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=L.el.style;if(t)return t[e]},setExtra:function(e,t){var r=L.el.extra||(L.el.extra={});return r[e]=t,this},getExtra:function(e){var t=L.el.extra;if(t)return t[e]}};function Mo(){var e=this,t=e.el;if(t){var r=ue(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}L.el=t,n(Lo)}}function li(e,t,r,n){var i=r[e];if(i){var o=t[e],a;if(o){var s=r.transition,c=i.transition;if(c)if(!a&&(a=n[e]={}),ce(c))R(a,o);else for(var u=Se$1(c),l=0;l<u.length;l++){var f=u[l],m=o[f];a[f]=m}else if(ce(s)||Z(s,e)>=0){!a&&(a=n[e]={});for(var v=ie(o),l=0;l<v.length;l++){var f=v[l],m=o[f];Bo(i[f],m)&&(a[f]=m)}}}}}function Mt(e,t,r){var n=t[e];if(n)for(var i=r[e]={},o=ie(n),a=0;a<o.length;a++){var s=o[a];i[s]=Ga$1(n[s])}}function Fo(e,t,r){for(var n=t.transition,i=ce(n)?Rn$1:Se$1(n||[]),o=0;o<i.length;o++){var a=i[o];if(!(a===`style`||a===`shape`||a===`extra`))r[a]=e[a]}}function ko(e,t,r){for(var n=0;n<si.length;n++){var i=si[n],o=ci[i],a=t[i];a&&(r[o[0]]=a[0],r[o[1]]=a[1])}for(var n=0;n<Rn$1.length;n++){var s=Rn$1[n];t[s]!=null&&(r[s]=t[s])}}function Vo(e,t,r,n){if(r){var i=e.style,o;if(i){var a=r.transition,s=t.transition;if(a&&!ce(a)){var c=Se$1(a);!o&&(o=n.style={});for(var u=0;u<c.length;u++){var l=c[u],f=i[l];o[l]=f}}else if(e.getAnimationStyleProps&&(ce(s)||ce(a)||Z(s,`style`)>=0)){var m=e.getAnimationStyleProps(),v=m?m.style:null;if(v){!o&&(o=n.style={});for(var y=ie(r),u=0;u<y.length;u++){var l=y[u];if(v[l]){var f=i[l];o[l]=f}}}}}}}function Bo(e,t){return ke(e)?e!==t:e!=null&&isFinite(e)}var fi=K();var Wo=[`percent`,`easing`,`shape`,`style`,`extra`];function di(e){e.stopAnimation(`keyframe`),e.attr(fi(e))}function kt(e,t,r){if(!(!r.isAnimationEnabled()||!t)){if(L$1(t)){w$1(t,function(s){kt(e,s,r)});return}var n=t.keyframes,i=t.duration;if(r&&i==null){var o=lC(`enter`,r,0);i=o&&o.duration}if(!(!n||!i)){var a=fi(e);w$1(_e,function(s){if(!(s&&!e[s])){var c;n.sort(function(l,f){return l.percent-f.percent}),w$1(n,function(l){var f=e.animators,m=s?l[s]:l;if(m){var v=ie(m);if(s||(v=Ce(v,function(g){return Z(Wo,g)<0})),!!v.length){c||(c=e.animate(s,t.loop,!0),c.scope=`keyframe`);for(var y=0;y<f.length;y++)f[y]!==c&&f[y].targetName===c.targetName&&f[y].stopTracks(v);s&&(a[s]=a[s]||{});var _=s?a[s]:a;w$1(v,function(g){_[g]=((s?e[s]:e)||{})[g]}),c.whenWithKeys(i*l.percent,m,v,l.easing)}}}),c&&c.delay(t.delay||0).duration(i).start(t.easing)}})}}}var k=`emphasis`;var U=`normal`;var It=`blur`;var zt=`select`;var I=[U,k,It,zt];var Vt={normal:[`itemStyle`],emphasis:[k,`itemStyle`],blur:[It,`itemStyle`],select:[zt,`itemStyle`]};var Bt={normal:[`label`],emphasis:[k,`label`],blur:[It,`label`],select:[zt,`label`]};var Ho=[`x`,`y`];var Uo=`e\0\0`;var w={normal:{},emphasis:{},blur:{},select:{}};var Io={cartesian2d:wt,geo:bt,single:Ot,polar:Nt,calendar:Dt,matrix:Lt};function Ht(e){return e instanceof J}function Ut(e){return e instanceof sr}function zo(e,t){t.copyTransform(e),Ut(t)&&Ut(e)&&(t.setStyle(e.style),t.z=e.z,t.z2=e.z2,t.zlevel=e.zlevel,t.invisible=e.invisible,t.ignore=e.ignore,Ht(t)&&Ht(e)&&t.setShape(e.shape))}var gi=(function(e){se(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i,o){this._progressiveEls=null;var a=this._data,s=r.getData(),c=this.group,u=pi(r,s,n,i);a||c.removeAll(),s.diff(a).add(function(f){Wt(i,null,f,u(f,o),r,c,s)}).remove(function(f){var m=a.getItemGraphicEl(f);m&&Xe(m,D(m).option,r)}).update(function(f,m){Wt(i,a.getItemGraphicEl(m),f,u(f,o),r,c,s)}).execute();var l=r.get(`clip`,!0)?qn(r.coordinateSystem,!1,r):null;l?c.setClipPath(l):c.removeClipPath(),this._data=s},t.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(r,n,i,o,a){var s=n.getData(),c=pi(n,s,i,o),u=this._progressiveEls=[];function l(v){v.isGroup||(v.incremental=xR(n),v.ensureState(`emphasis`).hoverLayer=2)}for(var f=r.start;f<r.end;f++){var m=Wt(null,null,f,c(f,a),n,this.group,s);m&&(m.traverse(l),u.push(m))}},t.prototype.eachRendered=function(r){vp(this._progressiveEls||this.group,r)},t.prototype.filterForExposedEvent=function(r,n,i,o){var a=n.element;if(a==null||i.name===a)return!0;for(;(i=i.__hostTarget||i.parent)&&i!==this.group;)if(i.name===a)return!0;return!1},t.type=`custom`,t})(dr);function Gt(e){var t=e.type,r;if(t===`path`){var n=e.shape,i=n.width!=null&&n.height!=null?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,o=yi(n);r=Zn$1(o,null,i,n.layout||`center`),D(r).customPathData=o}else if(t===`image`)r=new Vt$1({}),D(r).customImagePath=e.style.image;else if(t===`text`)r=new $e$1({});else if(t===`group`)r=new We;else if(t===`compoundPath`){var n=e.shape;if(!n||!n.paths){var a=``;Xe$1(a)}r=new gl({shape:{paths:U$2(n.paths,function(l){if(l.type===`path`)return Zn$1(l.shape.pathData,l,null);var f=up(l.type);if(!f)Xe$1(``);return new f})}})}else{var c=up(t);if(!c){var a=``;Xe$1(a)}r=new c}return D(r).customGraphicType=t,r.name=e.name,r.z2EmphasisLift=1,r.z2SelectLift=1,r}function Yt(e,t,r,n,i,o,a){di(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),n&&n.transition==null&&(n.transition=Ho);var c=n&&n.style;if(c){if(t.type===`text`){var u=c;Ue(u,`textFill`)&&(u.fill=u.textFill),Ue(u,`textStroke`)&&(u.stroke=u.textStroke)}var l=void 0,f=Ht(t)?c.decal:null;e&&f&&(f.dirty=!0,l=gh(f,e)),c.__decalPattern=l}if(Ut(t)&&c){var l=c.__decalPattern;l&&(c.decal=l)}ui(t,n,o,{dataIndex:r,isInit:a,clearStyle:!0}),kt(t,n.keyframeAnimation,o)}function xi(e,t,r,n,i){var o=t.isGroup?null:t,a=i&&i[e].cfg;if(o){var s=o.ensureState(e);if(n===!1){var c=o.getState(e);c&&(c.style=null)}else s.style=n||null;a&&(s.textConfig=a),I1(o)}}function Yo(e,t,r){if(!e.isGroup){var n=e,i=r.currentZ,o=r.currentZLevel;n.z=i,n.zlevel=o;var a=t.z2;a!=null&&(n.z2=a||0);for(var s=0;s<I.length;s++)$o(n,t,I[s])}}function $o(e,t,r){var n=r===U,i=n?t:qe(t,r),o=i?i.z2:null,a;o!=null&&(a=n?e:e.ensureState(r),a.z2=o||0)}function pi(e,t,r,n){var i=e.get(`renderItem`);if(typeof i==`string`){var o=wU(i);o&&(i=o)}var a=e.coordinateSystem,s={};a&&(s=a.prepareCustoms?a.prepareCustoms(a):Io[a.type](a));for(var c=re({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:Te$1,style:be,ordinalRawValue:we,styleEmphasis:so,visual:lo,barLayout:co,currentSeriesIndices:uo,font:fo},s.api||{}),u={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:s.coordSys,dataInsideLength:t.count(),encode:Xo(e.getData()),itemPayload:e.get(`itemPayload`)||{}},l,f,m={},v={},y={},_={},g=0;g<I.length;g++){var A=I[g];y[A]=e.getModel(Vt[A]),_[A]=e.getModel(Bt[A])}function R(h){return h===l?f||(f=t.getItemModel(h)):t.getItemModel(h)}function C(h,p){return t.hasItemOption?h===l?m[p]||(m[p]=R(h).getModel(Vt[p])):R(h).getModel(Vt[p]):y[p]}function de(h,p){return t.hasItemOption?h===l?v[p]||(v[p]=R(h).getModel(Bt[p])):R(h).getModel(Bt[p]):_[p]}return function(h,p){return l=h,f=null,m={},v={},i&&i(re({dataIndexInside:h,dataIndex:t.getRawIndex(h),actionType:p?p.type:null},u),c)};function Te$1(h,p){return p??=l,t.getStore().get(t.getDimensionIndex(h||0),p)}function we(h,p){p??=l,h=h||0;var E=t.getDimensionInfo(h);if(!E){var b=t.getDimensionIndex(h);return b>=0?t.getStore().get(b,p):void 0}var V=t.get(E.name,p),T=E&&E.ordinalMeta;return T?T.categories[V]:V}function be(h,p){p??=l;var E=t.getItemVisual(p,`style`),b=E&&E.fill,V=E&&E.opacity,T=C(p,U).getItemStyle();b!=null&&(T.fill=b),V!=null&&(T.opacity=V);var ar={inheritColor:P(b)?b:Te.color.neutral99},it=de(p,U),sr=ji$1(it,null,ar,!1,!0);sr.text=it.getShallow(`show`)?H(e.getFormattedLabel(p,U),At(t,p)):null;var po=LN(it,ar,!1);return or(h,T),T=Pt(T,sr,po),h&&ir(T,h),T.legacy=!0,T}function so(h,p){p??=l;var E=C(p,k).getItemStyle(),b=de(p,k),V=ji$1(b,null,null,!0,!0);V.text=b.getShallow(`show`)?Yt$1(e.getFormattedLabel(p,k),e.getFormattedLabel(p,U),At(t,p)):null;var T=LN(b,null,!0);return or(h,E),E=Pt(E,V,T),h&&ir(E,h),E.legacy=!0,E}function ir(h,p){for(var E in p)Ue(p,E)&&(h[E]=p[E])}function or(h,p){h&&(h.textFill&&(p.textFill=h.textFill),h.textPosition&&(p.textPosition=h.textPosition))}function lo(h,p){if(p??=l,Ue(Tt,h)){var E=t.getItemVisual(p,`style`);return E?E[Tt[h]]:null}if(Ue(ii,h))return t.getItemVisual(p,h)}function co(h){if(a.type===`cartesian2d`)return ei(re({axis:a.getBaseAxis()},h))}function uo(){return r.getCurrentSeriesIndices()}function fo(h){return _y(h,r)}}function Xo(e){var t={};return w$1(e.dimensions,function(r){var n=e.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,o=t[i]=t[i]||[];o[n.coordDimIndex]=e.getDimensionIndex(r)}}),t}function Wt(e,t,r,n,i,o,a){if(!n){o.remove(t);return}var s=$t(e,t,r,n,i,o);return s&&a.setItemGraphicEl(r,s),s&&YL(s,n.focus,n.blurScope,n.emphasisDisabled),s}function $t(e,t,r,n,i,o){var a=-1,s=t;t&&Ci(t,n,i)&&(a=Z(o.childrenRef(),t),t=null);var c=!t,u=t;u?u.clearStates():(u=Gt(n),s&&zo(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),w.normal.cfg=w.normal.conOpt=w.emphasis.cfg=w.emphasis.conOpt=w.blur.cfg=w.blur.conOpt=w.select.cfg=w.select.conOpt=null,w.isLegacy=!1,Ko(u,r,n,i,c,w),qo(u,r,n,i,c),Yt(e,u,r,n,w,i,c),Ue(n,`info`)&&(D(u).info=n.info);for(var l=0;l<I.length;l++){var f=I[l];if(f!==U){var m=qe(n,f),v=Xt(n,m,f);xi(f,u,m,v,w)}}return Yo(u,n,i),n.type===`group`&&Zo(e,u,r,n,i),a>=0?o.replaceAt(u,a):o.add(u),u}function Ci(e,t,r){var n=D(e),i=t.type,o=t.shape,a=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i===`path`&&ea(o)&&yi(o)!==n.customPathData||i===`image`&&Ue(a,`image`)&&a.image!==n.customImagePath}function qo(e,t,r,n,i){var o=r.clipPath;if(o===!1)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&Ci(a,o,n)&&(a=null),a||(a=Gt(o),e.setClipPath(a)),Yt(null,a,t,o,null,n,i)}}function Ko(e,t,r,n,i,o){if(!(e.isGroup||e.type===`compoundPath`)){hi(r,null,o),hi(r,k,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,c=o.blur.conOpt,u=o.select.conOpt;if(a!=null||s!=null||u!=null||c!=null){var l=e.getTextContent();if(a===!1)l&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:`text`},l?l.clearStates():(l=Gt(a),e.setTextContent(l)),Yt(null,l,t,a,null,n,i);for(var f=a&&a.style,m=0;m<I.length;m++){var v=I[m];if(v!==U){var y=o[v].conOpt;xi(v,l,y,Xt(a,y,v),null)}}f?l.dirty():l.markRedraw()}}}}function hi(e,t,r){var n=t?qe(e,t):e,i=t?Xt(e,n,k):e.style,o=e.type,a=n?n.textConfig:null,s=e.textContent,c=s?t?qe(s,t):s:null;if(i&&(r.isLegacy||jn(i,o,!!a,!!c))){r.isLegacy=!0;var u=Qn(i,o,!t);!a&&u.textConfig&&(a=u.textConfig),!c&&u.textContent&&(c=u.textContent)}if(!t&&c){var l=c;!l.type&&(l.type=`text`)}var f=t?r[t]:r.normal;f.cfg=a,f.conOpt=c}function qe(e,t){return t?e?e[t]:null:e}function Xt(e,t,r){var n=t&&t.style;return n==null&&r===k&&e&&(n=e.styleEmphasis),n}function Zo(e,t,r,n,i){var o=n.children,a=o?o.length:0,s=n.$mergeChildren,c=s===`byName`||n.diffChildrenByName,u=s===!1;if(!(!a&&!c&&!u)){if(c){Qo({api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:r,seriesModel:i,group:t});return}u&&t.removeAll();for(var l=0;l<a;l++){var f=o[l],m=t.childAt(l);f?(f.ignore??=!1,$t(e,m,r,f,i,t)):m.ignore=!0}for(var v=t.childCount()-1;v>=l;v--)jo(t,t.childAt(v),i)}}function jo(e,t,r){t&&Xe(t,D(e).option,r)}function Qo(e){new hT(e.oldChildren,e.newChildren,mi,mi,e).add(vi).update(vi).remove(Jo).execute()}function mi(e,t){return(e&&e.name)??Uo+t}function vi(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;$t(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function Jo(e){var t=this.context,r=t.oldChildren[e];r&&Xe(r,D(r).option,t.seriesModel)}function yi(e){return e&&(e.pathData||e.d)}function ea(e){return e&&(Ue(e,`pathData`)||Ue(e,`d`))}function qt(e){e.registerChartView(gi),e.registerSeriesModel(oi)}Lu([qt,TO,OA,LA]);var ta=120;var Ke=class{constructor(t,r){this.chartRegistry=t,this.handlers=r,this.highlightedPath=null,this.pathUnderPointer=null,this.containerSizeObserver=new RT,this.containerSize=this.containerSizeObserver.size}attachTo(t){if(this.chart&&this.attachedContainer===t)return;this.dispose(),this.attachedContainer=t,this.chart=Wz(t),this.chart.on(`click`,n=>this.reportClick(n)),this.chart.on(`mouseover`,n=>this.reportPointerEntered(n.data?.name??null)),this.chart.on(`mouseout`,()=>this.reportPointerLeftAfterGrace());let r=this.chart.getZr();r.on(`mousemove`,n=>{n.target||this.reportPointerOverNothing()}),r.on(`globalout`,()=>this.reportPointerOverNothing()),this.chart.on(`contextmenu`,n=>this.reportRightClick(n)),this.chart.on(`finished`,()=>t.setAttribute(`aria-busy`,`false`)),t.addEventListener(`contextmenu`,SY),this.chartRegistry.register(this.chart),this.containerSizeObserver.observe(t)}render(t,{keepsSegments:r=!1}={}){this.chart&&(this.attachedContainer?.setAttribute(`aria-busy`,`true`),this.chart.resize(),this.finishRunningAnimations(),this.chart.setOption(t),r||this.reportPointerLeft(),this.applyHighlight())}highlight(t){this.highlightedPath=t,!(t!==null&&t===this.pathUnderPointer)&&this.applyHighlight()}dispose(){this.cancelPointerLeave(),this.reportPointerLeft(),this.attachedContainer?.removeEventListener(`contextmenu`,SY),this.containerSizeObserver.disconnect(),this.chart&&(this.chartRegistry.unregister(this.chart),this.chart.dispose()),this.chart=void 0,this.attachedContainer=void 0}reportClick({data:t}){t&&(t.isCentre?this.handlers.onCentreClicked():t.isFile?this.handlers.onFileClicked(t.name):this.handlers.onFolderClicked(t.name))}reportPointerEntered(t){this.cancelPointerLeave(),this.pathUnderPointer=t,this.handlers.onNodeHovered(t)}reportPointerLeftAfterGrace(){this.cancelPointerLeave(),this.pointerLeaveTimeout=setTimeout(()=>{this.pointerLeaveTimeout=void 0,this.reportPointerLeft()},ta)}reportPointerOverNothing(){this.pathUnderPointer!==null&&this.pointerLeaveTimeout===void 0&&this.reportPointerLeftAfterGrace()}reportPointerLeft(){this.pathUnderPointer!==null&&(this.pathUnderPointer=null,this.handlers.onNodeHovered(null))}cancelPointerLeave(){this.pointerLeaveTimeout!==void 0&&(clearTimeout(this.pointerLeaveTimeout),this.pointerLeaveTimeout=void 0)}reportRightClick({data:t,event:r}){let n=r?.event;t&&n&&this.handlers.onNodeRightClicked(t.name,n.clientX,n.clientY)}finishRunningAnimations(){for(let t of this.chart.getZr().storage.getDisplayList())t.stopAnimation(void 0,!0)}applyHighlight(){this.chart&&(this.chart.dispatchAction({type:`downplay`,seriesIndex:0}),this.highlightedPath!==null&&this.chart.dispatchAction({type:`highlight`,seriesIndex:0,name:this.highlightedPath}))}};var ra=[`chartContainer`];var Zt=(()=>{class e{constructor(){this.shape=Me.required(),this.tree=Me.required(),this.centre=Me.required(),this.hoveredPath=Me(null),this.metrics=Me.required(),this.coloring=Me.required(),this.folderClicked=Kr(),this.fileClicked=Kr(),this.centreClicked=Kr(),this.nodeHovered=Kr(),this.nodeRightClicked=Kr(),this.chartContainer=_i$1.required(`chartContainer`),this.chartHost=new Ke(N(h3),{onFolderClicked:r=>this.folderClicked.emit(r),onFileClicked:r=>this.fileClicked.emit(r),onCentreClicked:()=>this.centreClicked.emit(),onNodeHovered:r=>this.nodeHovered.emit(r),onNodeRightClicked:(r,n,i)=>this.nodeRightClicked.emit({path:r,clientX:n,clientY:i})}),this.highlightedPath=sn(()=>{let r=this.hoveredPath(),n=this.centre();if(r===null||!Re(r,n.path))return null;let i=le(n,r,this.shape().visibleDepth);return i===n?null:i.path}),Ps(()=>this.chartHost.attachTo(this.chartContainer().nativeElement)),Ps(()=>this.renderOnceTheContainerIsMeasured()),Ps(()=>this.chartHost.highlight(this.highlightedPath()))}ngOnDestroy(){this.chartHost.dispose()}renderOnceTheContainerIsMeasured(){let{width:r,height:n}=this.chartHost.containerSize();if(r===0||n===0)return;let i={centre:this.centre(),shape:this.shape()},o=i.centre===this.renderedView?.centre&&i.shape===this.renderedView?.shape;this.renderedView=i,this.chartHost.render(i.shape.buildOption({centre:i.centre,isMapRoot:i.centre===this.tree(),metrics:this.metrics(),coloring:this.coloring()}),{keepsSegments:o})}static{this.ɵfac=function(n){return new(n||e)}}static{this.ɵcmp=Ze$1({type:e,selectors:[[`cc-radial-chart`]],viewQuery:function(n,i){n&1&&ii$1(i.chartContainer,ra,5),n&2&&yi$1()},hostAttrs:[1,`block`,`h-full`,`w-full`],inputs:{shape:[1,`shape`],tree:[1,`tree`],centre:[1,`centre`],hoveredPath:[1,`hoveredPath`],metrics:[1,`metrics`],coloring:[1,`coloring`]},outputs:{folderClicked:`folderClicked`,fileClicked:`fileClicked`,centreClicked:`centreClicked`,nodeHovered:`nodeHovered`,nodeRightClicked:`nodeRightClicked`},decls:2,vars:0,consts:[[`chartContainer`,``],[`data-testid`,`radial-chart`,1,`h-full`,`w-full`]],template:function(n,i){n&1&&Hr(0,`div`,1,0)},encapsulation:2})}}return e})();var na={[Ba$1.Sum]:e=>e.sum,[Ba$1.Max]:e=>e.max,[Ba$1.Min]:e=>e.min,[Ba$1.Median]:e=>aa(e.values),[Ba$1.MeanPerFile]:e=>e.sum/e.files,[Ba$1.AvgPerArea]:e=>e.areaWeightedSum/e.area};function jt(e,t){let r=new Map;Si(e,t,r);let n=na[t.folderValue],i=new Map;for(let[o,a]of r)a.files>0&&i.set(o,n(a));return i}function Si(e,t,r){if(bn(e))return ia(e,t);let n=Ri();for(let i of e.children)!i.isExcluded&&!t.isFlat(i)&&oa(n,Si(i,t,r));return r.set(e.path,n),n}function ia(e,{areaMetric:t,colorMetric:r,folderValue:n}){let i=e.attributes?.[t]??0,o=e.attributes?.[r];return i<=0||o===void 0?Ri():{files:1,sum:o,max:o,min:o,area:i,areaWeightedSum:o*i,values:n===Ba$1.Median?[o]:[]}}function Ri(){return{files:0,sum:0,max:Number.NEGATIVE_INFINITY,min:Number.POSITIVE_INFINITY,area:0,areaWeightedSum:0,values:[]}}function oa(e,t){e.files+=t.files,e.sum+=t.sum,e.max=Math.max(e.max,t.max),e.min=Math.min(e.min,t.min),e.area+=t.area,e.areaWeightedSum+=t.areaWeightedSum;for(let r of t.values)e.values.push(r)}function aa(e){let t=[...e].sort((n,i)=>n-i),r=Math.floor(t.length/2);return t.length%2===1?t[r]:(t[r-1]+t[r])/2}var fe=Math.PI/2;var _i=2*Math.PI;var z=`#ffffff`;var sa={duration:500,easing:`cubicOut`};var la=2e3;var ca={animationDuration:0,animationDurationUpdate:0};var ua=4;var fa=1;function Ei(e){let t=e<=la?{animationDurationUpdate:400}:ca;return T({animationThreshold:Number.POSITIVE_INFINITY,stateAnimation:sa},t)}function Ze(e){return .75/e}function Ai(e,t){return Ti(e,t)?e:0}function Pi(e,t,r){return Ti(t.widthPx,r)?t:{color:e,widthPx:fa}}function Ti(e,t){return t>=e*ua}var da=`#1f2937`;var pa=.5;var ha=.299;var ma=.587;var va=.114;var ga=255;function wi({path:e,isFile:t,colorValue:r,isFlat:n,isCentre:i=!1},o){let{mapColors:a}=o;return!i&&e===o.highlight.selectedPath?a.selected:!t&&!n?xa(e,r,o):r===void 0?a.base:n?a.flat:bi(r,o)}function xa(e,t,r){let{folders:n,mapColors:i}=r,o=Hd({path:e},n.markedPackages);if(o)return o;let a=n.values.get(e);return t===void 0||a===void 0?i.base:n.style===Sc.Neutral?yBe:_Be(bi(a,r),n.tint)}function bi(e,t){let{mapColors:r}=t;return t.isUnaryMetric?r.positive:Yne(r,t.colorRange,t.colorMode,t.colorMetricRange,e)}function Oi(e){let[t,r,n]=OT.hex.rgb(e);return(ha*t+ma*r+va*n)/ga>pa?da:z}var je=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function Ni(e,t){return{name:e.path,value:e.area,displayName:e.name,colorValue:e.colorValue,folderValueText:Ca(e,t.folders),isFile:e.isFile}}function Ca({path:e,isFile:t},r){let n=t?void 0:r.values.get(e);if(n!==void 0)return`${VIt(r.value).label} ${je.format(n)}`}var Ee=-Math.PI/2;var ya=1;var Sa=2;var Ra=3;var Mi={style:{opacity:.45}};var _a=/^#[\da-f]{6}$/i;var Fi={x:0,y:0,rotation:0};function Qe(e,t,r,n){return ne(T({type:e},Fi),{silent:!n,z2:n?ya:Sa,shape:t,style:r,blur:Mi})}function Qt({x:e,y:t,rotation:r},n){return{type:`text`,x:e,y:t,rotation:r,silent:!0,z2:Ra,style:n,blur:Mi}}function ki(e){return ne(T({type:`group`},Fi),{children:e})}function Jt(e){if(e.type===`group`)return ne(T({},e),{children:e.children.map(Jt)});let{fill:t,stroke:r}=e.style,n={fill:Di(t),stroke:Di(r)};return ne(T({},e),{style:T(T({},e.style),n),emphasis:{style:{fill:t,stroke:r}}})}function Di(e){if(!e||!_a.test(e))return e;let[t,r,n]=OT.hex.rgb(e);return`rgba(${t}, ${r}, ${n}, 0.45)`}var Vi=`…`;function Bi(e,t,r){let n=Ea([...e],t.lengthPx,r),i=n.map(c=>r(c)),o=Math.sin(t.midAngle)<0,a=o?1:-1,s=-Wi(i)/2;return n.map((c,u)=>{let l=t.midAngle+a*(s+i[u]/2)/t.radiusPx;return s+=i[u],{glyph:c,x:t.centreX+t.radiusPx*Math.cos(l),y:t.centreY+t.radiusPx*Math.sin(l),rotation:o?-(l+fe):fe-l}})}function Ea(e,t,r){let n=e.map(s=>r(s));if(Wi(n)<=t)return e;let i=t-r(Vi),o=0,a=0;for(;o<e.length&&a+n[o]<=i;)a+=n[o],o++;return o===0?[]:[...e.slice(0,o),Vi]}function Wi(e){return e.reduce((t,r)=>t+r,0)}var Aa=`sans-serif`;var Hi=new Map;var Je;function Ui(e,t){let r=`${e} ${t}px ${Aa}`;return n=>{let i=`${r}|${n}`,o=Hi.get(i);if(o!==void 0)return o;let a=Pa(n,r,t);return Hi.set(i,a),a}}function Pa(e,t,r){return Je??=document.createElement(`canvas`).getContext(`2d`),Je?(Je.font=t,Je.measureText(e).width):e.length*r*.6}var Ii=Math.PI;var Ta=11;var Gi=13;var Yi=4;var $i=28;function Xi(e,t,r){if(e.role===`outline`)return null;if(e.role===`centre`)return zi(Oa(r),t);let n=wa(e,r);return n.arcLengthPx>=n.depthPx?ba(n,t,r):zi(Na(n,r),t)}function wa(e,t){let r=e.innerRadius*t.radiusPx,n=e.outerRadius*t.radiusPx,i=(r+n)/2,o=e.endAngle-e.startAngle;return{midAngle:Ee+(e.startAngle+e.endAngle)/2,innerRadiusPx:r,midRadiusPx:i,angularSpan:o,arcLengthPx:o*i,depthPx:n-r}}function zi(e,t){if(e.lengthPx<$i||e.heightPx<Gi)return null;return Qt(e,ne(T({},qi(t)),{text:t.displayName,width:e.lengthPx-Yi,overflow:`truncate`}))}function ba(e,t,r){let n=e.arcLengthPx-Yi;if(n<$i||e.depthPx<Gi)return null;let i=qi(t),o={centreX:r.centreX,centreY:r.centreY,radiusPx:e.midRadiusPx,midAngle:e.midAngle,lengthPx:n},a=Bi(t.displayName,o,Ui(i.fontWeight,i.fontSize));return a.length===0?null:ki(a.map(u=>{var l=u,{glyph:s}=l;return Qt(Gm(l,[`glyph`]),ne(T({},i),{text:s}))}))}function qi(e){return{fill:Oi(e.color),fontSize:Ta,fontWeight:e.isCentre||e.isFile?`bold`:`normal`,align:`center`,verticalAlign:`middle`}}function Oa(e){let t=2*.2*e.radiusPx;return{x:e.centreX,y:e.centreY,rotation:0,lengthPx:t,heightPx:t}}function Na(e,t){return{x:t.centreX+e.midRadiusPx*Math.cos(e.midAngle),y:t.centreY+e.midRadiusPx*Math.sin(e.midAngle),rotation:Da(-e.midAngle),lengthPx:e.depthPx,heightPx:e.angularSpan*e.innerRadiusPx}}function Da(e){let t=Math.atan2(Math.sin(e),Math.cos(e));return t>fe?t-Ii:t<-fe?t+Ii:t}function Ki(e,t){return({data:r})=>{if(!r)return``;let n=[`<b>${wY(r.name)}</b>`,`${wY(e.areaMetric)}: ${je.format(r.value)}`,`${wY(e.colorMetric)}: ${r.colorValue===void 0?`–`:je.format(r.colorValue)}`];return r.folderValueText&&n.push(wY(r.folderValueText)),r.isCentre&&!t&&n.push(`<i>Click to go up one folder</i>`),n.join(`<br/>`)}}var Zi={color:z,widthPx:2.5};var La=0;var Ma=Number.POSITIVE_INFINITY;function et(e,t,r){let n=t.map(o=>Fa(o,e)),i=r.focus===`ancestors`?ka(t):()=>`self`;return{aria:{enabled:!0},hoverLayerThreshold:Ma,tooltip:{show:!0,confine:!0,formatter:Ki(e.metrics,e.isMapRoot)},series:[ne(T({type:`custom`,coordinateSystem:`none`,data:n,renderItem:({dataIndex:o},a)=>Ba(t[o],n[o],{frame:Va(a),border:r.border,focus:i(o)})},Ei(n.length)),{progressive:La})]}}function Fa({node:e,isCentre:t},{centre:r,coloring:n}){let{litPaths:i}=n.highlight;return ne(T({},Ni(e,n)),{id:`${r.path}|${e.path}`,isCentre:t,color:wi(ne(T({},e),{isCentre:t}),n),isFaded:i.size>0&&!i.has(e.path)})}function ka(e){let t=new Map(e.map(({node:r},n)=>[r.path,n]));return r=>{let n=[];for(let i=e[r].node.path;t.has(i);i=i.slice(0,i.lastIndexOf(`/`)))n.push(t.get(i));return n}}function Va(e){let t=e.getWidth(),r=e.getHeight();return{centreX:t/2,centreY:r/2,radiusPx:Math.min(t,r)/2}}function Ba(e,t,r){let n=e.sectors.map(a=>Wa(a,t.color,r)),i=e.sectors.map(a=>Xi(a,t,r.frame)).filter(a=>a!==null),o=[...n,...i];return{type:`group`,focus:r.focus,children:t.isFaded?o.map(Jt):o}}function Wa(e,t,{frame:r,border:n}){if(e.role===`outline`){let o=Ai(Zi.widthPx,ji(e,r));return Qe(`sector`,Qi(e,r),{fill:`none`,stroke:Zi.color,lineWidth:o},!1)}if(e.role===`centre`)return Qe(`circle`,{cx:r.centreX,cy:r.centreY,r:e.outerRadius*r.radiusPx},{fill:t,stroke:n.color,lineWidth:n.widthPx},!0);let i=Pi(t,n,ji(e,r));return Qe(`sector`,Qi(e,r),{fill:t,stroke:i.color,lineWidth:i.widthPx},!0)}function ji(e,t){let r=(e.endAngle-e.startAngle)*e.innerRadius*t.radiusPx,n=(e.outerRadius-e.innerRadius)*t.radiusPx;return Math.min(r,n)}function Qi(e,t){return{cx:t.centreX,cy:t.centreY,r0:e.innerRadius*t.radiusPx,r:e.outerRadius*t.radiusPx,startAngle:Ee+e.startAngle,endAngle:Ee+e.endAngle,clockwise:!0}}var Ae={startAngle:0,endAngle:_i};var tt=ne(T({role:`centre`},Ae),{innerRadius:0,outerRadius:.2});function rt(e){return[...e].sort(er)}function er(e,t){return t.area-e.area||e.path.localeCompare(t.path)}var Ha=.15;var Ua=.04;var Ia=.012;function Ji(e,t){let r={placements:new Map,bands:za(e,t)};return r.placements.set(e,{node:e,isCentre:!0,sectors:[]}),Pe(r,e,tt),eo(r,e,Ae,1),[...r.placements.values()]}function za(e,t){let r=Math.max(1,Se(e,t)),n=Ze(r);return{count:r,width:n,headerThickness:Math.min(n*Ha,Ua)}}function eo(e,t,r,n){let i=(r.endAngle-r.startAngle)/t.area,o=r.startAngle;for(let a of Ga(t)){let s=Ya(e,{startAngle:o,endAngle:o+a.area*i},n);a.folder?$a(e,a.folder,s,n):to(e,a.files,s),o=s.endAngle}}function Ga(e){let t=rt(e.children),r=t.filter(i=>!i.isFile).map(i=>({area:i.area,folder:i})),n=t.filter(i=>i.isFile);return n.length>0&&r.push({area:n.reduce((i,o)=>i+o.area,0),files:n}),r.sort((i,o)=>o.area-i.area)}function Ya(e,t,r){let n=.2+(r-1)*e.bands.width;return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:n,outerRadius:n+e.bands.width-Ia}}function $a(e,t,r,n){if(Pe(e,t,ne(T({},r),{role:`outline`})),n<e.bands.count){Pe(e,t,ne(T({},r),{role:`header`})),eo(e,t,r,n+1);return}let i=ne(T({},r),{innerRadius:r.innerRadius+e.bands.headerThickness});Pe(e,t,ne(T({},r),{outerRadius:i.innerRadius,role:`header`})),to(e,t.children,i)}function to(e,t,r){for(let n of Xa(t,r))Pe(e,n.node,ne(T({},n.sector),{role:`cell`}))}function Xa(e,t){let r=(t.endAngle-t.startAngle)*(t.innerRadius+t.outerRadius)/2,n=t.outerRadius-t.innerRadius,i={path:``,name:``,isFile:!1,area:0,colorValue:void 0,isFlat:!1,children:e},o=Zt$1(i,s=>s===i?s.children:void 0).sum(s=>s===i?0:s.area).sort((s,c)=>er(s.data,c.data));return $N().tile(jN).size([r,n])(o).children.map(s=>({node:s.data,sector:qa(s,t,r,n)}))}function qa(e,t,r,n){let i=t.endAngle-t.startAngle,o=a=>Math.sqrt(t.innerRadius**2+a/n*(t.outerRadius**2-t.innerRadius**2));return{startAngle:t.startAngle+e.x0/r*i,endAngle:t.startAngle+e.x1/r*i,innerRadius:o(e.y0),outerRadius:o(e.y1)}}function Pe(e,t,r){let n=e.placements.get(t)??{node:t,isCentre:!1,sectors:[]};n.sectors.push(r),e.placements.set(t,n)}var Ka={color:z,widthPx:.5};function tr(e){return{visibleDepth:e+1,buildOption:t=>Za(t,e)}}function Za(e,t){return et(e,Ji(e.centre,t),{border:Ka,focus:`self`})}function ro(e,t){let r=Math.max(1,Se(e,t)),n=[{node:e,isCentre:!0,sectors:[tt]}];return no(n,{count:r,width:Ze(r)},e,Ae,1),n}function no(e,t,r,n,i){if(i>t.count)return;let o=(n.endAngle-n.startAngle)/r.area,a=.2+(i-1)*t.width,s=n.startAngle;for(let c of rt(r.children)){let u={startAngle:s,endAngle:s+c.area*o};e.push({node:c,isCentre:!1,sectors:[ne(T({role:`ring`},u),{innerRadius:a,outerRadius:a+t.width})]}),no(e,t,c,u,i+1),s=u.endAngle}}var ja={color:z,widthPx:1};function rr(e){return{visibleDepth:e,buildOption:t=>Qa(t,e)}}function Qa(e,t){return et(e,ro(e.centre,t),{border:ja,focus:`ancestors`})}var nt=O(nv,vA,(e,t)=>({areaMetric:e,colorMetric:t}));var nr=O(Js,kc,CU,nt,kCe,({unifiedMapNode:e},t,r,n,i)=>{let o=r&&t.get(r)||e;return o?_t(o,n,i):null});var es=O(O(Js,nt,hH,kCe,({unifiedMapNode:e},t,r,n)=>e?jt(e,ne(T({},t),{folderValue:r,isFlat:n})):new Map),hH,wp,cm,EU,(e,t,r,n,i)=>({values:e,value:t,style:r,tint:n,markedPackages:i}));var ts=O(mA,By,aCe,nr,(e,t,r,n)=>({selectedPath:e,litPaths:new Set([...t,...rs(n,r)])}));function rs(e,t){return!e||t.length===0?[]:Et(e,r=>t.includes(wre.estimateFileExtension(r.name)))}var io=O(vA,qU,KU,lu,$a$1,es,ts,(e,t,r,n,i,o,a)=>({isUnaryMetric:e===xc,colorRange:t,colorMode:r,mapColors:n,colorMetricRange:i,folders:o,highlight:a}));var oo=(()=>{class e{constructor(r){this.store=r,this.tree$=this.store.select(nr),this.layoutAlgorithm$=this.store.select(UE),this.radialLevels$=this.store.select(pH),this.metrics$=this.store.select(nt),this.coloring$=this.store.select(io),this.hoveredNodePath$=this.store.select(Dy),this.selectedNodePath$=this.store.select(mA),this.isDeltaState$=this.store.select(qP),this.isFocused$=this.store.select(CU).pipe(it(Boolean))}static{this.ɵfac=function(n){return new(n||e)(U$1(wt$1))}}static{this.ɵprov=G({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var ao=(()=>{class e{constructor(r,n){this.store=r,this.nodeInteraction=n}selectNode(r){this.nodeInteraction.selectNode(r),this.nodeInteraction.clearKeptHighlight()}hoverNode(r){this.nodeInteraction.hoverNode(r)}openContextMenu(r,n,i){this.store.dispatch(jU({value:{nodeId:r,xPositionOfRightClickEvent:n,yPositionOfRightClickEvent:i,origin:`radialMap`}}))}unfocus(){this.store.dispatch(PU())}static{this.ɵfac=function(n){return new(n||e)(U$1(wt$1),U$1(CH))}}static{this.ɵprov=G({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();function ss(e,t){e&1&&(Ne(0,`div`,0)(1,`output`,1)(2,`span`),Et$1(3,`This layout shows a single map. Switch to another map layout to compare two maps.`),ze()()())}function ls(e,t){if(e&1){let r=Ir();Ne(0,`cc-radial-chart`,2),lt(`folderClicked`,function(i){Rn(r);return Nn(st().selectNode(i))})(`centreClicked`,function(){Rn(r);return Nn(st().goUp())})(`fileClicked`,function(i){Rn(r);return Nn(st().selectNode(i))})(`nodeHovered`,function(i){Rn(r);return Nn(st().hover(i))})(`nodeRightClicked`,function(i){Rn(r);return Nn(st().openContextMenu(i))}),ze(),Ne(1,`div`,3),In(2,`cc-toolbox-screenshot-button`,4),ze()}if(e&2){let r=t,n=st();Ct(`shape`,n.shape())(`tree`,r.tree)(`centre`,r.centre)(`hoveredPath`,n.hoveredPath())(`metrics`,n.metrics())(`coloring`,n.coloring())}}function cs(e,t){if(e&1){let r=Ir();Ne(0,`button`,6),lt(`click`,function(){Rn(r);return Nn(st(2).unfocus())}),Et$1(1,`Unfocus`),ze()}}function us(e,t){if(e&1&&(Ne(0,`div`,0)(1,`output`,1)(2,`span`),Et$1(3,`There are no files with an area to show.`),ze(),tn(4,cs,2,0,`button`,5),ze()()),e&2){let r=st();ue$1(4),nn(r.isFocused()?4:-1)}}var fs=`calc(${[`var(${sE}, 32px)`,`var(${ZP}, 17px)`,`var(${dSe}, 0px)`,`12px`].join(` + `)})`;var ds=(()=>{class e{constructor(){this.bottomInset=fs,this.readStore=N(oo),this.writeStore=N(ao),this.tree=Ri$1(this.readStore.tree$,{requireSync:!0}),this.layoutAlgorithm=Ri$1(this.readStore.layoutAlgorithm$,{requireSync:!0}),this.radialLevels=Ri$1(this.readStore.radialLevels$,{requireSync:!0}),this.shape=sn(()=>this.layoutAlgorithm()===Fa$1.RadialTreeMap?tr(this.radialLevels()):rr(this.radialLevels())),this.metrics=Ri$1(this.readStore.metrics$,{requireSync:!0}),this.coloring=Ri$1(this.readStore.coloring$,{requireSync:!0}),this.hoveredPath=Ri$1(this.readStore.hoveredNodePath$,{requireSync:!0}),this.isDeltaState=Ri$1(this.readStore.isDeltaState$,{requireSync:!0}),this.isFocused=Ri$1(this.readStore.isFocused$,{requireSync:!0}),this.isLoadingFile=Ri$1(N(hy).isLoadingFile$,{initialValue:!1}),this.selectedPath=Ri$1(this.readStore.selectedNodePath$,{requireSync:!0}),this.requestedCentrePath=Tt$1(null),this.view=sn(()=>{let r=this.tree();if(!r)return null;let n=this.requestedCentrePath();return{tree:r,centre:n===null?r:Ge(r,n)}}),Ps(()=>this.centreOnTheSelection())}selectNode(r){this.writeStore.selectNode(r)}goUp(){let r=this.view(),n=r&&Ye(r.tree,r.centre.path);n&&this.selectNode(n.path)}openContextMenu({path:r,clientX:n,clientY:i}){this.writeStore.openContextMenu(r,n,i)}unfocus(){this.writeStore.unfocus()}hover(r){this.writeStore.hoverNode(r)}centreOnTheSelection(){let r=this.selectedPath(),{visibleDepth:n}=this.shape();Rt(()=>{r!==null&&!this.isFileShownAroundTheCentre(r,n)&&this.requestedCentrePath.set(r)})}isFileShownAroundTheCentre(r,n){let i=this.view();if(!i)return!1;let o=le(i.centre,r,n);return o.isFile&&o.path===r}static{this.ɵfac=function(n){return new(n||e)}}static{this.ɵcmp=Ze$1({type:e,selectors:[[`cc-radial-map`]],hostAttrs:[1,`fixed`,`inset-x-0`,`z-0`,`top-[var(--cc-bars-height,49px)]`],hostVars:4,hostBindings:function(n,i){n&2&&(Vn(`bottom`,i.bottomInset),oi$1(`hidden`,i.isLoadingFile()))},features:[$s([{provide:l3,useExisting:MOe}])],decls:3,vars:1,consts:[[1,`flex`,`h-full`,`items-center`,`justify-center`,`p-4`],[1,`alert`,`max-w-md`],[3,`folderClicked`,`centreClicked`,`fileClicked`,`nodeHovered`,`nodeRightClicked`,`shape`,`tree`,`centre`,`hoveredPath`,`metrics`,`coloring`],[1,`join`,`absolute`,`right-[10px]`,`top-[10px]`,`rounded`,`bg-base-100`,`shadow-md`],[`view`,`metrics`],[`type`,`button`,1,`btn`,`btn-sm`],[`type`,`button`,1,`btn`,`btn-sm`,3,`click`]],template:function(n,i){if(n&1&&tn(0,ss,4,0,`div`,0)(1,ls,3,6)(2,us,5,1,`div`,0),n&2){let o;nn(i.isDeltaState()?0:(o=i.view())?1:2,o)}},dependencies:[Zt,EOe],encapsulation:2})}}return e})();export{ds as RadialMapComponent};