codecharta-visualization 2.7.0 → 2.9.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{A as s,Fb as c,f as o}from"./chunk-6XSAPXQT.js";var d=(()=>{class e{constructor(){this.selectedNodePathSubject=new o(null),this.selectedNodePath$=this.selectedNodePathSubject.asObservable(),this.selectedNodePath=c(this.selectedNodePath$,{requireSync:!0})}select(r){this.selectedNodePathSubject.next(r)}clear(){this.selectedNodePathSubject.next(null)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function u(e,t){return e===t||e.startsWith(`${t}/`)}export{u as a,d as b};
@@ -0,0 +1 @@
1
+ import{a as Xt,b as it}from"./chunk-B44GAPHB.js";import{$l as tn,A as V,Aa as mt,Ai as Yi,Aj as cr,Ak as we,Bi as Ki,Bj as lr,D as m,Dj as mr,E as Z,Eb as At,Ej as pr,F as Q,Fa as kt,Fb as ie,Fj as hr,Fk as Io,Ga as Nt,Gb as de,Gi as ot,Gj as ur,Gl as jr,Ha as Ae,Hb as ye,Hj as fr,Hl as Fo,Ia as ze,Ij as gr,Il as Vr,Ja as Lt,Jj as vr,Jk as Or,Jl as qr,K as re,Ka as ui,Kj as Sr,Kk as kr,L as Fe,La as x,Lj as Cr,Lk as Nr,Ma as me,Mi as Ne,Ml as Ur,Na as _e,Nj as wr,Nl as $r,O as pi,Oa as fi,Oj as xr,Ok as Lr,Ol as Gr,Pd as Je,Pi as Zi,Pj as _r,Pk as je,Pl as gt,Qb as zt,Qh as Di,Qj as yr,Qk as Pr,Ri as He,Rj as br,Rl as Xr,Sf as wi,Sh as Ii,Sj as Wr,T as p,Th as et,Tl as Yr,Ua as gi,Ul as Kr,Va as Pt,Vl as Oe,Wa as yo,Wk as Oo,Wl as Zr,Xh as Oi,Xl as Qr,Y as O,Yj as To,Yl as Jr,Z as hi,Zb as bo,Zj as Tr,Zl as oo,_j as pt,_k as ft,_l as en,a as Ye,aa as Rt,ab as vi,ak as Mr,am as io,b as Ke,ba as Dt,bg as jt,bi as tt,bk as Er,bl as to,bm as on,cb as _,ci as Wo,ck as Mo,cl as ko,cm as Ao,di as ki,dl as No,dm as rn,ef as Ht,ei as Ni,em as nn,f as Et,fa as Qe,fb as se,fi as Li,fj as Gt,fk as Rr,ga as $,gb as W,gg as xi,gi as Ie,gj as Qi,gk as Eo,h as ct,ha as G,hi as Ee,hj as Ji,ib as Ft,ii as Vt,ij as er,ik as ht,il as Fr,ja as It,ji as Be,jj as tr,ka as Te,ki as qt,la as Me,li as Ut,lj as or,lk as Jt,ll as Lo,ma as C,mh as _i,mi as $t,mj as ir,mk as Dr,ml as Po,na as u,nh as yi,ni as Pi,nj as Yt,nl as Ar,oa as f,oe as Bt,oi as Fi,oj as rr,pa as F,ph as bi,pi as Ai,pj as Kt,pk as Ro,qa as J,qb as Si,qh as Wi,qi as zi,qj as Zt,ra as X,rh as Ti,ri as Bi,rj as nr,rk as ut,sa as lt,sh as Mi,si as Hi,ta as _o,ti as ji,tj as ar,ua as he,ui as Vi,uj as Qt,v as Ze,va as ke,vi as qi,vk as Ir,vl as zr,wa as M,wi as Ui,wl as Br,xa as De,xh as Ei,xi as $i,xk as Do,ya as E,yi as Gi,yj as sr,yk as eo,za as Ot,ze as Ci,zh as Ri,zi as Xi,zj as dr,zl as Hr}from"./chunk-6XSAPXQT.js";var ne=(()=>{class t{constructor(){this.domainStateReadWindow=m(Li),this.store=m(de),this.settings=ie(this.domainStateReadWindow.wordCloudSettings$,{initialValue:qt}),this.hasTfidfData=ie(this.store.select(Ji),{initialValue:!1})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ua=[[["","body",""]],"*"],fa=["[body]","*"],ga=["ngProjectAs","[body]",5,["","body",""]],an=(()=>{class t{constructor(){this.label=W.required(),this.value=W.required(),this.idPrefix=W.required(),this.minWidthClass=W("min-w-[120px]"),this.popoverId=_(()=>`${this.idPrefix()}-popover`),this.anchorName=_(()=>`${this.idPrefix()}-cog`),this.segmentTestId=_(()=>`${this.idPrefix()}-segment`),this.cogTestId=_(()=>`${this.idPrefix()}-cog`)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-segment"]],hostAttrs:[1,"contents"],inputs:{label:[1,"label"],value:[1,"value"],idPrefix:[1,"idPrefix"],minWidthClass:[1,"minWidthClass"]},ngContentSelectors:fa,decls:3,vars:8,consts:[[3,"label","metricName","hasCog","cogPopoverId","cogAnchorName","testId","cogTestId","minWidthClass"]],template:function(o,i){o&1&&(Ot(ua),u(0,"cc-axis-card",0),mt(1,0,ga),f(),mt(2,1)),o&2&&C("label",i.label())("metricName",i.value())("hasCog",!0)("cogPopoverId",i.popoverId())("cogAnchorName",i.anchorName())("testId",i.segmentTestId())("cogTestId",i.cogTestId())("minWidthClass",i.minWidthClass())},dependencies:[_i],encapsulation:2})}}return t})();var xe=(()=>{class t{constructor(){this.store=m(de)}setShape(e){this.store.dispatch(qi({value:e}))}setSizeRange(e){this.store.dispatch($i({value:e}))}setRotationRange(e){this.store.dispatch(Hi({value:e}))}setRotationStep(e){this.store.dispatch(ji({value:e}))}setGridSize(e){this.store.dispatch(Fi({value:e}))}setSizingMode(e){this.store.dispatch(Gi({value:e}))}setTopN(e){this.store.dispatch(Ki({value:e}))}setShrinkToFit(e){this.store.dispatch(Ui({value:e}))}setDrawOutOfBound(e){this.store.dispatch(Pi({value:e}))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var sn=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.popoverId=W.required(),this.anchorName=W.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(Ut(this.settings().rotationRange,e))}onRotationRangeMaxChange(e){this.writeStore.setRotationRange($t(this.settings().rotationRange,e))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&(u(0,"cc-settings-popover-shell",0)(1,"div",1)(2,"div",2)(3,"span",3),x(4,"Min Rotation"),f(),u(5,"cc-slider-number-input",4),M("valueChange",function(a){return i.onRotationRangeMinChange(a)}),f()(),u(6,"div",5)(7,"span",3),x(8,"Max Rotation"),f(),u(9,"cc-slider-number-input",6),M("valueChange",function(a){return i.onRotationRangeMaxChange(a)}),f()(),u(10,"div",7)(11,"span",3),x(12,"Rotation Step"),f(),u(13,"cc-slider-number-input",8),M("valueChange",function(a){return i.onRotationStepChange(a)}),f()()(),F(14,"cc-reset-settings-button",9),f()),o&2&&(C("popoverId",i.popoverId())("anchorName",i.anchorName()),p(5),C("min",i.minRotationBounds.min)("max",i.minRotationBounds.max)("value",i.settings().rotationRange[0]),p(4),C("min",i.maxRotationBounds.min)("max",i.maxRotationBounds.max)("value",i.settings().rotationRange[1]),p(4),C("min",i.rotationStepBounds.min)("max",i.rotationStepBounds.max)("step",i.rotationStepBounds.step)("value",i.settings().rotationStep),p(),C("settingsKeys",i.resetKeys)("small",!0))},dependencies:[ot,et,Ne],encapsulation:2})}}return t})();var vt=(()=>{class t{constructor(){this.uploaded=re(null),this.mask=this.uploaded.asReadonly(),this.dataUri=_(()=>this.uploaded()?.dataUri??null)}accept(e){this.uploaded.set(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var dn="image/svg+xml",va=["script","foreignObject"],Sa=["href","xlink:href"];function cn(t){let r=new DOMParser().parseFromString(t,dn),e=r.documentElement;if(r.querySelector("parsererror")||e.localName!=="svg")return{rejection:"That file is not an SVG."};let o=va.find(n=>e.getElementsByTagName(n).length>0);if(o)return{rejection:`An SVG carrying a <${o}> cannot be used as a shape.`};if(Ca(e))return{rejection:"An SVG that references another file cannot be used as a shape."};let i=wa(e);return i?{dataUri:`data:${dn},${encodeURIComponent(new XMLSerializer().serializeToString(i))}`}:{rejection:"That SVG states neither a size nor a viewBox, so it has no shape to fill."}}function Ca(t){return[t,...t.querySelectorAll("*")].some(r=>Sa.some(e=>{let o=r.getAttribute(e);return o!==null&&!o.startsWith("#")}))}function wa(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 xa(t,r){if(t&1&&(u(0,"option",4),x(1),f()),t&2){let e=r.$implicit,o=E();C("value",e)("selected",e===o.settings().shape),p(),me(o.shapeLabels[e])}}function _a(t,r){t&1&&(u(0,"p",8),x(1),f()),t&2&&(p(),me(r))}function ya(t,r){t&1&&(u(0,"p",9),x(1),f()),t&2&&(p(),_e(" ",r.fileName," \u2014 words fill the opaque areas of the shape. "))}function ba(t,r){t&1&&(u(0,"p",10),x(1," The cloud stays round until you upload a shape, and an uploaded one is forgotten on reload. "),f())}function Wa(t,r){if(t&1){let e=he();u(0,"label",6)(1,"span",2),x(2,"SVG file"),f(),u(3,"input",7),M("change",function(i){Z(e);let n=E();return Q(n.onShapeFileChosen(i))}),f()(),$(4,_a,2,1,"p",8)(5,ya,2,1,"p",9)(6,ba,2,0,"p",10)}if(t&2){let e,o=E();p(4),G((e=o.rejection())?4:(e=o.uploadedMask())?5:6,e)}}var ln=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.customShapeMaskStore=m(vt),this.popoverId=W.required(),this.anchorName=W.required(),this.settings=this.readStore.settings,this.shapes=Object.values(Ee),this.shapeLabels=Vt,this.resetKeys=["domainState.shape"],this.isCustomShape=_(()=>this.settings().shape===Ee.custom),this.uploadedMask=this.customShapeMaskStore.mask,this.rejection=re(null)}onShapeChange(e){this.writeStore.setShape(e)}async onShapeFileChosen(e){let o=e.target.files?.[0];if(!o)return;let i=cn(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.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&(u(0,"cc-settings-popover-shell",0)(1,"label",1)(2,"span",2),x(3,"Shape"),f(),u(4,"select",3),M("change",function(a){return i.onShapeChange(a.target.value)}),Te(5,xa,2,3,"option",4,It),f()(),$(7,Wa,7,1),F(8,"cc-reset-settings-button",5),f()),o&2&&(C("popoverId",i.popoverId())("anchorName",i.anchorName()),p(5),Me(i.shapes),p(2),G(i.isCustomShape()?7:-1),p(),C("settingsKeys",i.resetKeys)("small",!0))},dependencies:[ot,et],encapsulation:2})}}return t})();var mn=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.settings=this.readStore.settings,this.wordCountBounds={min:10,max:1e3,step:10}}onTopNChange(e){this.writeStore.setTopN(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&(u(0,"div",0)(1,"span",1),x(2,"Words"),f(),u(3,"cc-slider-number-input",2),M("valueChange",function(a){return i.onTopNChange(a)}),f()()),o&2&&(p(3),C("min",i.wordCountBounds.min)("max",i.wordCountBounds.max)("step",i.wordCountBounds.step)("value",i.settings().topN))},dependencies:[Ne],encapsulation:2})}}return t})();var pn=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.settings=this.readStore.settings,this.smallestWordBounds={min:10,max:40},this.largestWordBounds={min:40,max:120},this.shrinkToFitTitle=_(()=>this.settings().shrinkToFit?"On \u2014 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 \u2014 words that do not fit are left out, so Smallest Word is exact but fewer words than requested appear."),this.drawOutOfBoundTitle=_(()=>this.settings().drawOutOfBound?"On \u2014 words may render partially outside the layout area instead of being dropped or shrunk, so more words fit at their true size.":"Off \u2014 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(Ut(this.settings().sizeRange,e))}onSizeRangeMaxChange(e){this.writeStore.setSizeRange($t(this.settings().sizeRange,e))}onShrinkToFitChange(e){this.writeStore.setShrinkToFit(e)}onDrawOutOfBoundChange(e){this.writeStore.setDrawOutOfBound(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&(u(0,"div",0)(1,"div",1)(2,"span",2),x(3,"Smallest Word"),f(),u(4,"cc-slider-number-input",3),M("valueChange",function(a){return i.onSizeRangeMinChange(a)}),f()(),u(5,"div",4)(6,"span",2),x(7,"Largest Word"),f(),u(8,"cc-slider-number-input",5),M("valueChange",function(a){return i.onSizeRangeMaxChange(a)}),f()(),u(9,"label",6)(10,"input",7),M("change",function(a){return i.onShrinkToFitChange(a.target.checked)}),f(),u(11,"span",2),x(12,"Fit All Words"),f()(),u(13,"label",8)(14,"input",7),M("change",function(a){return i.onDrawOutOfBoundChange(a.target.checked)}),f(),u(15,"span",2),x(16,"Draw Outside Bounds"),f()()()),o&2&&(p(4),C("min",i.smallestWordBounds.min)("max",i.smallestWordBounds.max)("value",i.settings().sizeRange[0]),p(4),C("min",i.largestWordBounds.min)("max",i.largestWordBounds.max)("value",i.settings().sizeRange[1]),p(),C("title",i.shrinkToFitTitle()),p(),C("checked",i.settings().shrinkToFit),p(3),C("title",i.drawOutOfBoundTitle()),p(),C("checked",i.settings().drawOutOfBound))},dependencies:[Ne],encapsulation:2})}}return t})();function Ta(t,r){t&1&&(J(0,"span",5),x(1,"TF-IDF is unavailable: the loaded file has no TF-IDF scores."),X())}var hn=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.settings=this.readStore.settings,this.hasTfidfData=this.readStore.hasTfidfData,this.WordCloudSizingMode=Be,this.tfidfOptionTitle=_(()=>this.hasTfidfData()?"TF-IDF (relative importance) \u2014 sizes words by how distinctive they are, not by raw count":"TF-IDF (relative importance) \u2014 not available: the loaded file has no TF-IDF scores")}onSizingModeChange(e){this.writeStore.setSizingMode(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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 \u2014 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&&(J(0,"label",0)(1,"span",1),x(2,"Word Sizing"),X(),J(3,"select",2),De("change",function(a){return i.onSizingModeChange(a.target.value)}),J(4,"option",3),x(5," Frequency "),X(),J(6,"option",4),x(7," TF-IDF "),X()(),$(8,Ta,2,0,"span",5),X()),o&2&&(p(4),ke("value",i.WordCloudSizingMode.frequency)("selected",i.settings().sizingMode===i.WordCloudSizingMode.frequency),p(2),ke("value",i.WordCloudSizingMode.tfidf)("selected",i.settings().sizingMode===i.WordCloudSizingMode.tfidf)("disabled",!i.hasTfidfData())("title",i.tfidfOptionTitle()),p(2),G(i.hasTfidfData()?-1:8))},encapsulation:2})}}return t})();var un=(()=>{class t{constructor(){this.readStore=m(ne),this.writeStore=m(xe),this.settings=this.readStore.settings,this.wordSpacingBounds={min:4,max:16,step:4}}onGridSizeChange(e){this.writeStore.setGridSize(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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 \u2014 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&&(u(0,"div",0)(1,"span",1),x(2,"Word Spacing"),f(),u(3,"cc-slider-number-input",2),M("valueChange",function(a){return i.onGridSizeChange(a)}),f()()),o&2&&(p(3),C("min",i.wordSpacingBounds.min)("max",i.wordSpacingBounds.max)("step",i.wordSpacingBounds.step)("value",i.settings().gridSize))},dependencies:[Ne],encapsulation:2})}}return t})();var fn=(()=>{class t{constructor(){this.popoverId=W.required(),this.anchorName=W.required(),this.resetKeys=["domainState.sizingMode","domainState.topN","domainState.sizeRange","domainState.gridSize","domainState.shrinkToFit","domainState.drawOutOfBound"]}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&(u(0,"cc-settings-popover-shell",0),F(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),f()),o&2&&(C("popoverId",i.popoverId())("anchorName",i.anchorName()),p(5),C("settingsKeys",i.resetKeys)("small",!0))},dependencies:[ot,et,hn,mn,pn,un],encapsulation:2})}}return t})();var Ma=[[["","barTools",""]]],Ea=["[barTools]"],zo=(()=>{class t{constructor(){this.barBottom=yi,this.readStore=m(ne),this.settings=this.readStore.settings,this.shapeLabel=_(()=>Vt[this.settings().shape]),this.sizingModeLabel=_(()=>this.settings().sizingMode===Be.tfidf?"TF-IDF":"Frequency"),this.rotationRangeLabel=_(()=>{let[e,o]=this.settings().rotationRange;return`${e}\xB0 \u2013 ${o}\xB0`})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-bar"]],hostVars:2,hostBindings:function(o,i){o&2&&ze("bottom",i.barBottom)},features:[Rt([bi])],ngContentSelectors:Ea,decls:13,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&&(Ot(Ma),u(0,"cc-bar-tools-tab"),mt(1),f(),u(2,"cc-domain-segment",3,0),F(4,"cc-shape-settings-popover",4),f(),u(5,"cc-domain-segment",5,1)(7,"div",6),x(8),f(),F(9,"cc-word-sizing-settings-popover",4),f(),u(10,"cc-domain-segment",7,2),F(12,"cc-rotation-settings-popover",4),f()),o&2){let n=Ae(3),a=Ae(6),s=Ae(11);p(2),C("value",i.shapeLabel()),p(2),C("popoverId",n.popoverId())("anchorName",n.anchorName()),p(),C("value",i.sizingModeLabel()),p(3),_e("",i.settings().topN," words"),p(),C("popoverId",a.popoverId())("anchorName",a.anchorName()),p(),C("value",i.rotationRangeLabel()),p(2),C("popoverId",s.popoverId())("anchorName",s.anchorName())}},dependencies:[Mi,an,ln,fn,sn],encapsulation:2})}}return t})();var St=(()=>{class t{constructor(){this.fitRequestCount=re(0),this.fitRequest=this.fitRequestCount.asReadonly()}requestFit(){this.fitRequestCount.update(e=>e+1)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ra(t,r){t&1&&F(0,"cc-bar-tools-divider",1)}var Bo=(()=>{class t{constructor(){this.focusStore=m(He),this.viewStore=m(St),this.isFocused=this.focusStore.isFocused}showWholeCloud(){this.viewStore.requestFit()}unfocus(){this.focusStore.unfocus()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-toolbox"]],hostAttrs:[1,"flex","items-center","gap-0.5"],features:[Pt([{provide:br,useExisting:Tr}])],decls:4,vars:2,consts:[["testId","domain-bar-unfocus",3,"unfocused","isFocused"],["data-testid","domain-tools-divider"],["label","Show whole cloud","icon","fa-solid fa-expand","testId","domain-reset-view",3,"activated"],["view","domain"]],template:function(o,i){o&1&&(u(0,"cc-unfocus-tool",0),M("unfocused",function(){return i.unfocus()}),f(),$(1,Ra,1,0,"cc-bar-tools-divider",1),u(2,"cc-bar-tool",2),M("activated",function(){return i.showWholeCloud()}),f(),F(3,"cc-toolbox-screenshot-button",3)),o&2&&(C("isFocused",i.isFocused()),p(),G(i.isFocused()?1:-1))},dependencies:[Wi,Ti,Wr,Zi],encapsulation:2})}}return t})();function Da(t,r){if(t&1){let e=he();u(0,"cc-floating-menu",1),M("dismissed",function(){Z(e);let i=E();return Q(i.close())}),u(1,"button",2),M("click",function(){Z(e);let i=E();return Q(i.copyWord())}),F(2,"i"),u(3,"span",3),x(4),f()(),F(5,"div",4),u(6,"cc-context-menu-item",5),M("itemClick",function(){Z(e);let i=E();return Q(i.searchForThisWord())}),x(7," Search word "),f(),u(8,"cc-context-menu-item",6),M("itemClick",function(){Z(e);let i=E();return Q(i.hideThisWord())}),x(9," Hide word "),f()()}if(t&2){let e=E();C("anchor",r),p(2),ui(gi("w-4 text-center ",e.wasWordCopied()?"fa-solid fa-check text-success":"fa-regular fa-copy")),p(2),me(e.rightClickedWord()?.word)}}var Ho=(()=>{class t{constructor(){this.clipboard=m(pt),this.rightClickedWord=W(null),this.searchWord=se(),this.hideWord=se(),this.closed=se(),this.anchor=_(()=>{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.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&$(0,Da,10,5,"cc-floating-menu",0),o&2){let n;G((n=i.anchor())?0:-1,n)}},dependencies:[Ei,Ri],encapsulation:2})}}return t})();function ro(t,r){if(r.length===0)return t;let e=new Set(r);return t.filter(o=>!e.has(o.text))}var Ia=ye(Gt,Je,(t,r)=>t.wordsOf(r??zt.rootPath)),Oa=ye(Je,t=>t!==void 0),ka=ye(Ia,tt,ro),Ve=(()=>{class t{constructor(){this.store=m(de),this.wordsInFocus$=this.store.select(ka),this.isFolderFocused$=this.store.select(Oa)}occurrencesInFocusOf(e){return this.store.select(Je).pipe(Ze(o=>this.store.select(tr(o??null,e))))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ct(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||{}),Na={[ge.OCCURRENCES]:(t,r)=>t.frequency-r.frequency,[ge.NAME]:(t,r)=>t.text.localeCompare(r.text),[ge.RELEVANCE]:(t,r)=>Ie(t,Be.tfidf)-Ie(r,Be.tfidf)};function gn(t,{option:r,ascending:e}){let o=Na[r],i=e?1:-1;return[...t].sort((n,a)=>i*o(n,a)||n.text.localeCompare(a.text))}function Sn(t){let{rowCount:r,rowHeight:e,scrolledPast:o,viewportHeight:i}=t;if(r===0)return La(t);if(e<=0||i<=0)return Pa(t);let n=vn(Math.floor(o/e)-6,0,r-1),a=vn(Math.floor((o+i)/e)+6,n,r-1);return{firstIndex:n,lastIndex:a,topSpacerHeight:n*e,bottomSpacerHeight:(r-a-1)*e}}function La({rowCount:t}){return{firstIndex:0,lastIndex:t-1,topSpacerHeight:0,bottomSpacerHeight:0}}function Pa({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 vn(t,r,e){return Math.min(Math.max(t,r),e)}function no(t){let r=t*100;return r>0&&r<1?"<1%":`${Math.round(r)}%`}var Cn=(()=>{class t{constructor(){this.contextMenu=m(vr),this.node=W.required(),this.word=W.required(),this.isExpanded=W(!1),this.isSelected=W(!1),this.clicked=se(),this.isExpandable=_(()=>this.node().children.length>0),this.isMarked=_(()=>this.contextMenu.isMarked(this.node().path)),this.decoration=_(()=>`${no(this.node().share)} of "${this.word()}" \xB7 ${Yt(this.node().count)}`)}openContextMenu(e){this.contextMenu.openFor(this.node().path,e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-word-occurrence-row"]],hostAttrs:[1,"block"],hostVars:1,hostBindings:function(o,i){o&1&&M("click",function(){return i.clicked.emit()})("contextmenu",function(a){return i.openContextMenu(a)}),o&2&&Qe("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&&(u(0,"cc-explorer-row",0),F(1,"cc-explorer-tree-item-icon",1),u(2,"span",2),x(3),f()()),o&2&&(C("isSelected",i.isSelected())("isMarked",i.isMarked())("barShare",i.node().share)("decoration",i.decoration()),p(),C("isFolder",i.node().isFolder)("isOpen",i.isExpanded()),p(2),me(i.node().name))},dependencies:[Kt,sr],encapsulation:2})}}return t})();var wn=t=>({$implicit:t}),Fa=(t,r)=>r.path;function Aa(t,r){if(t&1&&(u(0,"p",1),x(1),f()),t&2){let e=E();p(),_e("",e.word()," does not occur in any file.")}}function za(t,r){t&1&&_o(0)}function Ba(t,r){if(t&1&&(u(0,"div",2),Dt(1,za,1,0,"ng-container",3),f()),t&2){let e=E(),o=Ae(3);p(),C("ngTemplateOutlet",o)("ngTemplateOutletContext",yo(2,wn,e.topLevelOccurrences()))}}function Ha(t,r){t&1&&_o(0)}function ja(t,r){if(t&1&&Dt(0,Ha,1,0,"ng-container",3),t&2){let e=E().$implicit;E(2);let o=Ae(3);C("ngTemplateOutlet",o)("ngTemplateOutletContext",yo(2,wn,e.children))}}function Va(t,r){if(t&1){let e=he();u(0,"cc-domain-word-occurrence-row",4),M("clicked",function(){let i=Z(e).$implicit,n=E(2);return Q(n.clickRow(i))}),f(),u(1,"div",5),$(2,ja,1,4,"ng-container"),f()}if(t&2){let e=r.$implicit,o=E(2);C("node",e)("word",o.word())("isExpanded",o.isExpanded(e.path))("isSelected",e.path===o.selectedNodePath()),p(2),G(o.isExpanded(e.path)?2:-1)}}function qa(t,r){if(t&1&&Te(0,Va,3,5,null,null,Fa),t&2){let e=r.$implicit;Me(e)}}var xn=(()=>{class t{constructor(){this.readStore=m(Ve),this.word=W.required(),this.selectedNodePath=W(null),this.nodeClicked=se(),this.occurrences=ie(At(this.word).pipe(Ze(e=>this.readStore.occurrencesInFocusOf(e))),{initialValue:null}),this.topLevelOccurrences=_(()=>this.occurrences()?.children??[]),this.expandedPaths=re(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.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&($(0,Aa,2,1,"p",1)(1,Ba,2,4,"div",2),Dt(2,qa,2,0,"ng-template",null,0,vi)),o&2&&G(i.topLevelOccurrences().length===0?0:1)},dependencies:[Si,Cn],encapsulation:2})}}return t})();var Ua=t=>`domain-word-row-${t}`,_n=(()=>{class t{constructor(){this.word=W.required(),this.share=W(0),this.isExpanded=W(!1),this.toggled=se(),this.rowId=_(()=>Ua(this.word().text)),this.decoration=_(()=>`${no(this.share())} of all words \xB7 ${Yt(this.word().frequency)}`)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-word-row"]],hostAttrs:[1,"block"],hostVars:3,hostBindings:function(o,i){o&1&&M("click",function(){return i.toggled.emit()}),o&2&&(ke("id",i.rowId()),Qe("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&&(u(0,"cc-explorer-row",0),F(1,"span",1),u(2,"span",2),x(3),f()()),o&2&&(C("barShare",i.share())("decoration",i.decoration()),p(2),Lt("font-semibold",i.isExpanded()),p(),me(i.word().text))},dependencies:[Kt],encapsulation:2})}}return t})();var yn=28,$a="cc-domain-word-row",jo={scrolledPast:0,viewportHeight:0,rowHeight:yn},ao=class{constructor(){this.scrollHost=null,this.measured=re(jo,{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(jo);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(jo);return}this.measured.set({scrolledPast:Math.max(0,e.getBoundingClientRect().top-r.getBoundingClientRect().top),viewportHeight:e.clientHeight,rowHeight:r.querySelector($a)?.offsetHeight||yn})}}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 Ga=(t,r)=>r.text;function Xa(t,r){if(t&1){let e=he();u(0,"div",0)(1,"div",1)(2,"span",2),x(3,"Pinned"),f(),u(4,"button",3),M("click",function(){let i=Z(e),n=E();return Q(n.wordToggled.emit(i.text))}),F(5,"i",4),f()(),u(6,"cc-domain-word-row",5),M("toggled",function(){let i=Z(e),n=E();return Q(n.wordToggled.emit(i.text))}),f(),u(7,"div",6)(8,"cc-domain-word-occurrence-tree",7),M("nodeClicked",function(i){Z(e);let n=E();return Q(n.nodeClicked.emit(i))}),f()()()}if(t&2){let e=r,o=E();p(6),C("word",e)("share",o.shareOf(e))("isExpanded",!0),p(2),C("word",e.text)("selectedNodePath",o.selectedNodePath())}}function Ya(t,r){t&1&&(u(0,"p",8),x(1),f()),t&2&&(p(),me(r))}function Ka(t,r){if(t&1&&$(0,Ya,2,1,"p",8),t&2){let e,o=E();G((e=o.emptyHint())?0:-1,e)}}function Za(t,r){if(t&1){let e=he();u(0,"cc-domain-word-row",10),M("toggled",function(){let i=Z(e).$implicit,n=E(2);return Q(n.wordToggled.emit(i.text))}),f()}if(t&2){let e=r.$implicit,o=E(2);C("word",e)("share",o.shareOf(e))}}function Qa(t,r){if(t&1&&(F(0,"div"),Te(1,Za,1,2,"cc-domain-word-row",9,Ga),F(3,"div")),t&2){let e=E();ze("height",e.window().topSpacerHeight,"px"),p(),Me(e.renderedWords()),p(2),ze("height",e.window().bottomSpacerHeight,"px")}}var Vo=(()=>{class t{constructor(){this.readStore=m(Ve),this.hostElement=m(pi),this.scrollHostService=m(cr),this.viewport=new ao,this.query=W(""),this.sorting=W({option:ge.OCCURRENCES,ascending:!1}),this.expandedWord=W(null),this.selectedNodePath=W(null),this.wordToggled=se(),this.nodeClicked=se(),this.wordsInFocus=ie(this.readStore.wordsInFocus$,{requireSync:!0}),this.isFolderFocused=ie(this.readStore.isFolderFocused$,{requireSync:!0}),this.pinnedWord=_(()=>this.wordsInFocus().find(e=>e.text===this.expandedWord())??null),this.matchedWords=_(()=>Ct(this.wordsInFocus(),this.query())),this.visibleWords=_(()=>gn(this.matchedWords().filter(e=>e.text!==this.expandedWord()),this.sorting())),this.emptyHint=_(()=>this.wordsInFocus().length===0?this.isFolderFocused()?"The focused folder carries no words.":"This project carries no words.":this.matchedWords().length===0?`No word contains "${this.query().trim()}".`:null),this.geometry=_(()=>Ke(Ye({},this.viewport.geometry()),{rowCount:this.visibleWords().length})),this.window=_(()=>Sn(this.geometry())),this.renderedWords=_(()=>{let{firstIndex:e,lastIndex:o}=this.window();return this.visibleWords().slice(e,o+1)}),this.totalOccurrences=_(()=>this.wordsInFocus().reduce((e,o)=>e+o.frequency,0)),Fe(()=>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.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({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&&($(0,Xa,9,5,"div",0),$(1,Ka,1,1)(2,Qa,4,4)),o&2){let n;G((n=i.pinnedWord())?0:-1,n),p(),G(i.visibleWords().length===0?1:2)}},dependencies:[_n,xn],encapsulation:2})}}return t})();var wt=(()=>{class t{constructor(){this.store=m(de),this.hiddenWords=ie(this.store.select(tt),{initialValue:[]})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var xt=(()=>{class t{constructor(){this.store=m(de)}hide(e){this.store.dispatch(Ai({word:e}))}restore(e){this.store.dispatch(zi({word:e}))}restoreAll(){this.store.dispatch(Bi())}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ja=["popover"];function es(t,r){t&1&&(J(0,"div",6),x(1," Right-click a word in the cloud to drop it from the cloud and the word list. "),X())}function ts(t,r){if(t&1){let e=he();J(0,"li",8)(1,"span",10),x(2),X(),J(3,"button",11),De("click",function(){let i=Z(e).$implicit,n=E(2);return Q(n.restore(i))}),lt(4,"i",12),X()()}if(t&2){let e=r.$implicit;p(2),me(e),p(),ke("title","Show "+e+" again"),Qe("aria-label","Show "+e+" again")("data-testid","domain-restore-"+e)}}function os(t,r){if(t&1){let e=he();J(0,"ul",7),Te(1,ts,5,4,"li",8,It),X(),J(3,"button",9),De("click",function(){Z(e);let i=E();return Q(i.restoreAll())}),x(4," Show all words again "),X()}if(t&2){let e=E();p(),Me(e.hiddenWords())}}var qo=(()=>{class t{constructor(){this.readStore=m(wt),this.writeStore=m(xt),this.popoverId=W.required(),this.anchorName=W.required(),this.hiddenWords=_(()=>[...this.readStore.hiddenWords()].sort((e,o)=>e.localeCompare(o))),this.popover=Ft.required("popover")}closePopover(){this.popover().nativeElement.hidePopover()}restore(e){this.writeStore.restore(e)}restoreAll(){this.writeStore.restoreAll()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-hidden-words-popover"]],viewQuery:function(o,i){o&1&&kt(i.popover,Ja,5),o&2&&Nt()},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&&(J(0,"div",1,0)(2,"div",2)(3,"span",3),x(4,"Hidden Words"),X(),J(5,"button",4),De("click",function(){return i.closePopover()}),lt(6,"i",5),X()(),$(7,es,2,0,"div",6)(8,os,5,0),X()),o&2&&(ze("position-anchor","--"+i.anchorName()),ke("id",i.popoverId()),p(7),G(i.hiddenWords().length===0?7:8))},encapsulation:2})}}return t})();var bn=(()=>{class t{constructor(){this.store=m(de)}wordsForSelectedNode(e){return this.store.select(ye(er(e),tt,ro))}selectedNodeName(e){return Bt(e,zt.rootName)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function yt(t,r,e){if(e<=0)return[];let o=[];for(let i=0;i<t.length;i++){let n={word:t[i],value:Ie(t[i],r),index:i};if(o.length<e){is(o,o.push(n)-1);continue}_t(n,o[0])&&(o[0]=n,rs(o,0))}return o.sort((i,n)=>_t(i,n)?-1:1),o.map(({word:i})=>i)}function _t(t,r){return t.value>r.value||t.value===r.value&&t.index<r.index}function is(t,r){let e=r;for(;e>0;){let o=e-1>>1;if(!_t(t[o],t[e]))return;Tn(t,e,o),e=o}}function rs(t,r){let e=r;for(;ns(t,e);){let o=as(t,e);if(o===e)return;Tn(t,e,o),e=o}}var ns=(t,r)=>Wn(r)<t.length;function as(t,r){let e=Wn(r),o=e+1,i=r;return _t(t[i],t[e])&&(i=e),o<t.length&&_t(t[i],t[o])&&(i=o),i}var Wn=t=>2*t+1;function Tn(t,r,e){let o=t[r];t[r]=t[e],t[e]=o}var ss='<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>',Mn=`data:image/svg+xml,${encodeURIComponent(ss)}`;function Uo(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 $o="#e6007e",Go="#0030ff",ds="--wordCloudColorStart",cs="--wordCloudColorEnd",ls=/^#[0-9A-Fa-f]{6}$/;function Rn(){if(typeof document>"u"||typeof getComputedStyle>"u")return[$o,Go];let t=getComputedStyle(document.documentElement);return[En(t,ds,$o),En(t,cs,Go)]}function En(t,r,e){let o=t.getPropertyValue(r).trim();return Xo(o,e)}function Xo(t,r){return ls.test(t)?t:r}function Dn(t,r,e){let o=Math.min(1,Math.max(0,e)),i=jt.convertHexToColorObject(Xo(t,$o)),n=jt.convertHexToColorObject(Xo(r,Go));return jt.convertColorToHex(new Ci().lerpColors(i,n,o))}function In(t,r,e,o){let[i,n]=t;if(e||!o||r.length===0)return t;let a=Math.max(...r.map(g=>g.text.length)),s=o*.9/(a*.62),l=Math.max(Math.min(n,Math.floor(s)),1);return[Math.min(i,l),l]}var ms=3;function On(){return({name:t,data:r})=>{let e=[`<b>${rn(t)}</b>`,`Frequency: ${r.frequency}`];return r.tfidf!==void 0&&e.push(`TF-IDF: ${r.tfidf.toFixed(ms)}`),e.join("<br/>")}}var ps=31,kn=1e3;function Nn(t,r,e){return Dn(r,e,hs(t))}function hs(t){let r=0;for(let e of t)r=(r*ps+(e.codePointAt(0)??0))%kn;return r/kn}var us=10,fs="#333",gs='Roboto, "Helvetica Neue", sans-serif',vs=.55;function Pn(t,r,e={}){let o=In(r.sizeRange,t,r.drawOutOfBound,e.containerWidth),{shape:i,maskImage:n,keepAspect:a}=Cs(r.shape,e.maskImage);return{aria:{enabled:!0},tooltip:{show:!0,formatter:On()},series:[{type:"wordCloud",shape:i,maskImage:n,keepAspect:a,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:gs,fontWeight:"bold"},emphasis:{textStyle:{textShadowBlur:us,textShadowColor:fs}},blur:{textStyle:{opacity:vs}},data:Ss(t,r)}]}}function Ss(t,r){let[e,o]=Rn();return t.map(i=>({name:i.text,value:Ie(i,r.sizingMode),frequency:i.frequency,tfidf:i.tfidf,textStyle:{color:Nn(i.text,e,o)}}))}function Cs(t,r){return t===Ee.logoM||t===Ee.custom?{shape:Ee.circle,maskImage:r,keepAspect:!0}:{shape:t,maskImage:void 0,keepAspect:!1}}var bt=Math.PI*2,qe=Lr.CMD,ws=["top","right","bottom","left"];function xs(t,r,e,o,i){var n=e.width,a=e.height;switch(t){case"top":o.set(e.x+n/2,e.y-r),i.set(0,-1);break;case"bottom":o.set(e.x+n/2,e.y+a+r),i.set(0,1);break;case"left":o.set(e.x-r,e.y+a/2),i.set(-1,0);break;case"right":o.set(e.x+n+r,e.y+a/2),i.set(1,0);break}}function _s(t,r,e,o,i,n,a,s,l){a-=t,s-=r;var g=Math.sqrt(a*a+s*s);a/=g,s/=g;var d=a*e+t,T=s*e+r;if(Math.abs(o-i)%bt<1e-4)return l[0]=d,l[1]=T,g-e;if(n){var w=o;o=je(i),i=je(w)}else o=je(o),i=je(i);o>i&&(i+=bt);var h=Math.atan2(s,a);if(h<0&&(h+=bt),h>=o&&h<=i||h+bt>=o&&h+bt<=i)return l[0]=d,l[1]=T,g-e;var y=e*Math.cos(o)+t,D=e*Math.sin(o)+r,z=e*Math.cos(i)+t,le=e*Math.sin(i)+r,H=(y-a)*(y-a)+(D-s)*(D-s),Y=(z-a)*(z-a)+(le-s)*(le-s);return H<Y?(l[0]=y,l[1]=D,Math.sqrt(H)):(l[0]=z,l[1]=le,Math.sqrt(Y))}function Ko(t,r,e,o,i,n,a,s){var l=i-t,g=n-r,d=e-t,T=o-r,w=Math.sqrt(d*d+T*T);d/=w,T/=w;var h=l*d+g*T,y=h/w;s&&(y=Math.min(Math.max(y,0),1)),y*=w;var D=a[0]=t+y*d,z=a[1]=r+y*T;return Math.sqrt((D-i)*(D-i)+(z-n)*(z-n))}function An(t,r,e,o,i,n,a){e<0&&(t=t+e,e=-e),o<0&&(r=r+o,o=-o);var s=t+e,l=r+o,g=a[0]=Math.min(Math.max(i,t),s),d=a[1]=Math.min(Math.max(n,r),l);return Math.sqrt((g-i)*(g-i)+(d-n)*(d-n))}var be=[];function ys(t,r,e){var o=An(r.x,r.y,r.width,r.height,t.x,t.y,be);return e.set(be[0],be[1]),o}function bs(t,r,e){for(var o=0,i=0,n=0,a=0,s,l,g=1/0,d=r.data,T=t.x,w=t.y,h=0;h<d.length;){var y=d[h++];h===1&&(o=d[h],i=d[h+1],n=o,a=i);var D=g;switch(y){case qe.M:n=d[h++],a=d[h++],o=n,i=a;break;case qe.L:D=Ko(o,i,d[h],d[h+1],T,w,be,!0),o=d[h++],i=d[h++];break;case qe.C:D=kr(o,i,d[h++],d[h++],d[h++],d[h++],d[h],d[h+1],T,w,be),o=d[h++],i=d[h++];break;case qe.Q:D=Nr(o,i,d[h++],d[h++],d[h],d[h+1],T,w,be),o=d[h++],i=d[h++];break;case qe.A:var z=d[h++],le=d[h++],H=d[h++],Y=d[h++],pe=d[h++],Le=d[h++];h+=1;var at=!!(1-d[h++]);s=Math.cos(pe)*H+z,l=Math.sin(pe)*Y+le,h<=1&&(n=s,a=l);var Ge=(T-z)*Y/H+z;D=_s(z,le,Y,pe,pe+Le,at,Ge,w,be),o=Math.cos(pe+Le)*H+z,i=Math.sin(pe+Le)*Y+le;break;case qe.R:n=o=d[h++],a=i=d[h++];var st=d[h++],Mt=d[h++];D=An(n,a,st,Mt,T,w,be);break;case qe.Z:D=Ko(o,i,n,a,T,w,be,!0),o=n,i=a;break}D<g&&(g=D,e.set(be[0],be[1]))}return g}var $e=new we,ce=new we,Ce=new we,rt=new we,Wt=new we;function Zo(t,r){if(t){var e=t.getTextGuideLine(),o=t.getTextContent();if(o&&e){var i=t.textGuideLineConfig||{},n=[[0,0],[0,0],[0,0]],a=i.candidates||ws,s=o.getBoundingRect().clone();s.applyTransform(o.getComputedTransform());var l=1/0,g=i.anchor,d=t.getComputedTransform(),T=d&&Ir([],d),w=r.get("length2")||0;g&&Ce.copy(g);for(var h=0;h<a.length;h++){var y=a[h];xs(y,0,s,$e,rt),we.scaleAndAdd(ce,$e,rt,w),ce.transform(T);var D=t.getBoundingRect(),z=g?g.distance(ce):t instanceof Pr?bs(ce,t.path,Ce):ys(ce,D,Ce);z<l&&(l=z,ce.transform(d),Ce.transform(d),Ce.toArray(n[0]),ce.toArray(n[1]),$e.toArray(n[2]))}Ws(n,r.get("minTurnAngle")),e.setShape({points:n})}}}var Fn=[],Ue=new we;function Ws(t,r){if(r<=180&&r>0){r=r/180*Math.PI,$e.fromArray(t[0]),ce.fromArray(t[1]),Ce.fromArray(t[2]),we.sub(rt,$e,ce),we.sub(Wt,Ce,ce);var e=rt.len(),o=Wt.len();if(!(e<.001||o<.001)){rt.scale(1/e),Wt.scale(1/o);var i=rt.dot(Wt),n=Math.cos(r);if(n<i){var a=Ko(ce.x,ce.y,Ce.x,Ce.y,$e.x,$e.y,Fn,!1);Ue.fromArray(Fn),Ue.scaleAndAdd(Wt,a/Math.tan(Math.PI-r));var s=Ce.x!==ce.x?(Ue.x-ce.x)/(Ce.x-ce.x):(Ue.y-ce.y)/(Ce.y-ce.y);if(isNaN(s))return;s<0?we.copy(Ue,ce):s>1&&we.copy(Ue,Ce),Ue.toArray(t[1])}}}}function Yo(t,r,e,o){var i=e==="normal",n=i?t:t.ensureState(e);n.ignore=r;var a=o.get("smooth");a=a===!0?.3:Math.max(+a,0)||0,n.shape=n.shape||{},n.shape.smooth=a;var s=o.getModel("lineStyle").getLineStyle();i?t.useStyle(s):n.style=s}function Ts(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=Do(o[0],o[1]),n=Do(o[1],o[2]);if(!i||!n){t.lineTo(o[1][0],o[1][1]),t.lineTo(o[2][0],o[2][1]);return}var a=Math.min(i,n)*e,s=eo([],o[1],o[0],a/i),l=eo([],o[1],o[2],a/n),g=eo([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],g[0],g[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 zn(t,r,e){var o=t.getTextGuideLine(),i=t.getTextContent();if(!i){o&&t.removeTextGuideLine();return}for(var n=r.normal,a=n.get("show"),s=i.ignore,l=0;l<No.length;l++){var g=No[l],d=r[g],T=g==="normal";if(d){var w=d.get("show"),h=T?s:ut(i.states[g]&&i.states[g].ignore,s);if(h||!ut(w,a)){var y=T?o:o&&o.states[g];y&&(y.ignore=!0),o&&Yo(o,!0,g,d);continue}o||(o=new Fr,t.setTextGuideLine(o),!T&&(s||!a)&&Yo(o,!0,"normal",r.normal),t.stateProxy&&(o.stateProxy=t.stateProxy)),Yo(o,!1,g,d)}}if(o){Rr(o.style,e),o.style.fill=null;var D=n.get("showAbove"),z=t.textGuideLineConfig=t.textGuideLineConfig||{};z.showAbove=D||!1,o.buildPath=Ts}}function Bn(t,r){r=r||"labelLine";for(var e={normal:t.getModel(r)},o=0;o<ko.length;o++){var i=ko[o];e[i]=t.getModel([i,r])}return e}function Ms(t){if(t){for(var r=[],e=0;e<t.length;e++)r.push(t[e].slice());return r}}function Es(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:Ms(o&&o.shape.points)}}var Hn=["align","verticalAlign","width","height","fontSize"],fe=new Or,Qo=ft(),Rs=ft();function so(t,r,e){for(var o=0;o<e.length;o++){var i=e[o];r[i]!=null&&(t[i]=r[i])}}var co=["x","y","rotation"],Ds=(function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(r,e,o,i,n){var a=i.style,s=i.__hostTarget,l=s.textConfig||{},g=i.getComputedTransform(),d=i.getBoundingRect().plain();Io.applyTransform(d,d,g),g?fe.setLocalTransform(g):(fe.x=fe.y=fe.rotation=fe.originX=fe.originY=0,fe.scaleX=fe.scaleY=1),fe.rotation=je(fe.rotation);var T=i.__hostTarget,w;if(T){w=T.getBoundingRect().plain();var h=T.getComputedTransform();Io.applyTransform(w,w,h)}var y=w&&T.getTextGuideLine();this._labelList.push({label:i,labelLine:y,seriesModel:o,dataIndex:r,dataType:e,layoutOptionOrCb:n,layoutOption:null,rect:d,hostRect:w,priority:w?w.width*w.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:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.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");(Ro(i)||Dr(i).length)&&r.group.traverse(function(n){if(n.ignore)return!0;var a=n.getTextContent(),s=to(n);a&&!a.disableLabelLayout&&e._addLabel(s.dataIndex,s.dataType,o,a,i)})},t.prototype.updateLayoutConfig=function(r){var e=r.getWidth(),o=r.getHeight();function i(Y,pe){return function(){Zo(Y,pe)}}for(var n=0;n<this._labelList.length;n++){var a=this._labelList[n],s=a.label,l=s.__hostTarget,g=a.defaultAttr,d=void 0;Ro(a.layoutOptionOrCb)?d=a.layoutOptionOrCb(Es(a,l)):d=a.layoutOptionOrCb,d=d||{},a.layoutOption=d;var T=Math.PI/180;l&&l.setTextConfig({local:!1,position:d.x!=null||d.y!=null?null:g.attachedPos,rotation:d.rotate!=null?d.rotate*T:g.attachedRot,offset:[d.dx||0,d.dy||0]});var w=!1;if(d.x!=null?(s.x=Oo(d.x,e),s.setStyle("x",0),w=!0):(s.x=g.x,s.setStyle("x",g.style.x)),d.y!=null?(s.y=Oo(d.y,o),s.setStyle("y",0),w=!0):(s.y=g.y,s.setStyle("y",g.style.y)),d.labelLinePoints){var h=l.getTextGuideLine();h&&(h.setShape({points:d.labelLinePoints}),w=!1)}var y=Qo(s);y.needsUpdateLabelLine=w,s.rotation=d.rotate!=null?d.rotate*T:g.rotation,s.scaleX=g.scaleX,s.scaleY=g.scaleY;for(var D=0;D<Hn.length;D++){var z=Hn[D];s.setStyle(z,d[z]!=null?d[z]:g.style[z])}if(d.draggable){if(s.draggable=!0,s.cursor="move",l){var le=a.seriesModel;if(a.dataIndex!=null){var H=a.seriesModel.getData(a.dataType);le=H.getItemModel(a.dataIndex)}s.on("drag",i(l,le.getModel("labelLine")))}}else s.off("drag"),s.cursor=g.cursor}},t.prototype.layout=function(r){var e=r.getWidth(),o=r.getHeight(),i=[];ht(this._labelList,function(l){l.defaultAttr.ignore||i.push(jr({},l))});var n=Jt(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),a=Jt(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});Fo(n,0,0,e),Fo(a,1,0,o);var s=Jt(i,function(l){return l.layoutOption.hideOverlap});Vr(s),qr(s)},t.prototype.processLabelsOverall=function(){var r=this;ht(this._chartViewList,function(e){var o=e.__model,i=e.ignoreLabelLineUpdate,n=o.isAnimationEnabled();e.group.traverse(function(a){if(a.ignore&&!a.forceLabelAnimation)return!0;var s=!i,l=a.getTextContent();!s&&l&&(s=Qo(l).needsUpdateLabelLine),s&&r._updateLabelLine(a,o),n&&r._animateLabels(a,o)})})},t.prototype._updateLabelLine=function(r,e){var o=r.getTextContent(),i=to(r),n=i.dataIndex;if(o&&n!=null){var a=e.getData(i.dataType),s=a.getItemModel(n),l={},g=a.getItemVisual(n,"style");if(g){var d=a.getVisual("drawType");l.stroke=g[d]}var T=s.getModel("labelLine");zn(r,Bn(s),l),Zo(r,T)}},t.prototype._animateLabels=function(r,e){var o=r.getTextContent(),i=r.getTextGuideLine();if(o&&(r.forceLabelAnimation||!o.ignore&&!o.invisible&&!r.disableLabelAnimation&&!Ar(r))){var n=Qo(o),a=n.oldLayout,s=to(r),l=s.dataIndex,g={x:o.x,y:o.y,rotation:o.rotation},d=e.getData(s.dataType);if(a){o.attr(a);var w=r.prevStates;w&&(Eo(w,"select")>=0&&o.attr(n.oldLayoutSelect),Eo(w,"emphasis")>=0&&o.attr(n.oldLayoutEmphasis)),Lo(o,g,e,l)}else if(o.attr(g),!zr(o).valueAnimation){var T=ut(o.style.opacity,1);o.style.opacity=0,Po(o,{style:{opacity:T}},e,l)}if(n.oldLayout=g,o.states.select){var h=n.oldLayoutSelect={};so(h,g,co),so(h,o.states.select,co)}if(o.states.emphasis){var y=n.oldLayoutEmphasis={};so(y,g,co),so(y,o.states.emphasis,co)}Br(o,l,d,e,e)}if(i&&!i.ignore&&!i.invisible){var n=Rs(i),a=n.oldLayout,D={points:i.shape.points};a?(i.attr({shape:a}),Lo(i,{shape:D},e)):(i.setShape(D),i.style.strokePercent=0,Po(i,{style:{strokePercent:1}},e)),n.oldLayout=D}},t})(),jn=Ds;var Jo=ft();function Vn(t){t.registerUpdateLifecycle("series:beforeupdate",function(r,e,o){var i=Jo(e).labelManager;i||(i=Jo(e).labelManager=new jn),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(r,e,o){var i=Jo(e).labelManager;ht(o.updatedSeries,function(n){i.addLabelsOfSeries(e.getViewOfSeriesModel(n))}),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()})}gt([io,Kr]);gt(Vn);en({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 e=Oe.createDimensions(t.data,{coordDimensions:["value"]}),o=new Hr(e,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"}}});tn({type:"wordCloud",render:function(t,r,e){var o=this.group;o.removeAll();var i=t.getData(),n=t.get("gridSize");t.layoutInstance.ondraw=function(a,s,l,g){var d=i.getItemModel(l),T=d.getModel("textStyle"),w=new Qr.Text({style:Oe.createTextStyle(T),scaleX:1/g.info.mu,scaleY:1/g.info.mu,x:(g.gx+g.info.gw/2)*n,y:(g.gy+g.info.gh/2)*n,rotation:g.rot});w.setStyle({x:g.info.fillTextOffsetX,y:g.info.fillTextOffsetY+s*.5,text:a,verticalAlign:"middle",fill:i.getItemVisual(l,"style").fill,fontSize:s}),o.add(w),i.setItemGraphicEl(l,w),w.ensureState("emphasis").style=Oe.createTextStyle(d.getModel(["emphasis","textStyle"]),{state:"emphasis"}),w.ensureState("blur").style=Oe.createTextStyle(d.getModel(["blur","textStyle"]),{state:"blur"}),Oe.enableHoverEmphasis(w,d.get(["emphasis","focus"]),d.get(["emphasis","blurScope"])),w.stateTransition={duration:t.get("animation")?t.get(["stateAnimation","duration"]):0,easing:t.get(["stateAnimation","easing"])},w.__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(a){var s=e.length;return e.push(a),window.postMessage(o+s.toString(36),"*"),s};return window.addEventListener("message",function(a){if(!(typeof a.data!="string"||a.data.substr(0,o.length)!==o)){a.stopImmediatePropagation();var s=parseInt(a.data.substr(o.length),36);e[s]&&(e[s](),e[s]=void 0)}},!0),window.clearImmediate=function(a){e[a]&&(e[a]=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 oi=(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)})(),ti=(function(){if(oi){for(var r=document.createElement("canvas").getContext("2d"),e=20,o,i;e;){if(r.font=e.toString(10)+"px sans-serif",r.measureText("\uFF37").width===o&&r.measureText("m").width===i)return e+1;o=r.measureText("\uFF37").width,i=r.measureText("m").width,e--}return 0}})(),Is=function(t){if(Array.isArray(t)){var r=t.slice();return r.splice(0,2),r}else return[]},Os=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},nt={},ii=function(r,e){if(!oi)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", "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4", "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 n in e)n in i&&(i[n]=e[n]);if(typeof i.weightFactor!="function"){var a=i.weightFactor;i.weightFactor=function(c){return c*a}}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,g=Math.abs(i.maxRotation-i.minRotation),d=Math.min(i.maxRotation,i.minRotation),T=i.rotationStep,w,h,y,D,z,le,H;function Y(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 Y(10,50)};break;case"random-light":H=function(){return Y(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 at=!1,Ge=[],st,Mt=function(c){var v=c.currentTarget,S=v.getBoundingClientRect(),R,b;c.touches?(R=c.touches[0].clientX,b=c.touches[0].clientY):(R=c.clientX,b=c.clientY);var B=R-S.left,k=b-S.top,P=Math.floor(B*(v.width/S.width||1)/s),U=Math.floor(k*(v.height/S.height||1)/s);return Ge[P]?Ge[P][U]:null},li=function(c){var v=Mt(c);if(st!==v){if(st=v,!v){i.hover(void 0,void 0,c);return}i.hover(v.item,v.dimension,c)}},go=function(c){var v=Mt(c);v&&(i.click(v.item,v.dimension,c),c.preventDefault())},vo=[],ra=function(c){if(vo[c])return vo[c];var v=c*8,S=v,R=[];for(c===0&&R.push([D[0],D[1],0]);S--;){var b=1;i.shape!=="circle"&&(b=i.shape(S/v*2*Math.PI)),R.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 vo[c]=R,R},So=function(){return i.abortThreshold>0&&new Date().getTime()-le>i.abortThreshold},na=function(){return i.rotateRatio===0||Math.random()>i.rotateRatio?0:g===0?d:d+Math.round(Math.random()*g/T)*T},aa=function(c,v,S,R){var b=!1,B=i.weightFactor(v);if(B<=i.minSize)return!1;var k=1;B<ti&&(k=(function(){for(var xo=2;xo*B<ti;)xo+=2;return xo})());var P;pe?P=pe(c,v,B,R):P=i.fontWeight;var U=document.createElement("canvas"),I=U.getContext("2d",{willReadFrequently:!0});I.font=P+" "+(B*k).toString(10)+"px "+i.fontFamily;var q=I.measureText(c).width/k,j=Math.max(B*k,I.measureText("m").width,I.measureText("\uFF37").width)/k,ee=q+j*2,ae=j*3,ve=Math.ceil(ee/s),te=Math.ceil(ae/s);ee=ve*s,ae=te*s;var N=-q/2,K=-j*.4,oe=Math.ceil((ee*Math.abs(Math.sin(S))+ae*Math.abs(Math.cos(S)))/s),Se=Math.ceil((ee*Math.abs(Math.cos(S))+ae*Math.abs(Math.sin(S)))/s),Pe=Se*s,Xe=oe*s;U.setAttribute("width",Pe),U.setAttribute("height",Xe),b&&(document.body.appendChild(U),I.save()),I.scale(1/k,1/k),I.translate(Pe*k/2,Xe*k/2),I.rotate(-S),I.font=P+" "+(B*k).toString(10)+"px "+i.fontFamily,I.fillStyle="#000",I.textBaseline="middle",I.fillText(c,N*k,(K+B*.5)*k);var ha=I.getImageData(0,0,Pe,Xe).data;if(So())return!1;b&&(I.strokeRect(N*k,K,q*k,j*k),I.restore());for(var mi=[],Re=Se,We,Co,wo,ue=[oe/2,Se/2,oe/2,Se/2];Re--;)for(We=oe;We--;){wo=s;e:for(;wo--;)for(Co=s;Co--;)if(ha[((We*s+wo)*Pe+(Re*s+Co))*4+3]){mi.push([Re,We]),Re<ue[3]&&(ue[3]=Re),Re>ue[1]&&(ue[1]=Re),We<ue[0]&&(ue[0]=We),We>ue[2]&&(ue[2]=We),b&&(I.fillStyle="rgba(255, 0, 0, 0.5)",I.fillRect(Re*s,We*s,s-.5,s-.5));break e}b&&(I.fillStyle="rgba(0, 0, 255, 0.5)",I.fillRect(Re*s,We*s,s-.5,s-.5))}return b&&(I.fillStyle="rgba(0, 255, 0, 0.5)",I.fillRect(ue[3]*s,ue[0]*s,(ue[1]-ue[3]+1)*s,(ue[2]-ue[0]+1)*s)),{mu:k,occupied:mi,bounds:ue,gw:Se,gh:oe,fillTextOffsetX:N,fillTextOffsetY:K,fillTextWidth:q,fillTextHeight:j,fontSize:B}},sa=function(c,v,S,R,b){for(var B=b.length;B--;){var k=c+b[B][0],P=v+b[B][1];if(k>=h||P>=y||k<0||P<0){if(!i.drawOutOfBound)return!1;continue}if(!w[k][P])return!1}return!0},da=function(c,v,S,R,b,B,k,P,U,I){var q=S.fontSize,j;H?j=H(R,b,q,B,k,I):j=i.color;var ee;pe?ee=pe(R,b,q,I):ee=i.fontWeight;var ae;Le?ae=Le(R,b,q,I):ae=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+" "+(q*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(R,S.fillTextOffsetX*N,(S.fillTextOffsetY+q*.5)*N),te.restore()}else{var K=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+" "+q*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:q+"px",whiteSpace:"nowrap",transform:oe,webkitTransform:oe,msTransform:oe,transformOrigin:"50% 40%",webkitTransformOrigin:"50% 40%",msTransformOrigin:"50% 40%"};j&&(Se.color=j),K.textContent=R;for(var Pe in Se)K.style[Pe]=Se[Pe];if(U)for(var Xe in U)K.setAttribute(Xe,U[Xe]);ae&&(K.className+=ae),ve.appendChild(K)}})},ca=function(c,v,S,R,b){if(!(c>=h||v>=y||c<0||v<0)){if(w[c][v]=!1,S){var B=r[0].getContext("2d");B.fillRect(c*s,v*s,l,l)}at&&(Ge[c][v]={item:b,dimension:R})}},la=function(c,v,S,R,b,B){var k=b.occupied,P=i.drawMask,U;P&&(U=r[0].getContext("2d"),U.save(),U.fillStyle=i.maskColor);var I;if(at){var q=b.bounds;I={x:(c+q[3])*s,y:(v+q[0])*s,w:(q[1]-q[3]+1)*s,h:(q[2]-q[0]+1)*s}}for(var j=k.length;j--;){var ee=c+k[j][0],ae=v+k[j][1];ee>=h||ae>=y||ee<0||ae<0||ca(ee,ae,P,I,B)}P&&U.restore()},ma=function L(c,v){if(v>20)return null;var S,R,b;Array.isArray(c)?(S=c[0],R=c[1]):(S=c.word,R=c.weight,b=c.attributes);var B=na(),k=Is(c),P=aa(S,R,B,k);if(!P||So())return!1;if(!i.drawOutOfBound&&!i.shrinkToFit){var U=P.bounds;if(U[1]-U[3]+1>h||U[2]-U[0]+1>y)return!1}for(var I=z+1,q=function(ve){var te=Math.floor(ve[0]-P.gw/2),N=Math.floor(ve[1]-P.gh/2),K=P.gw,oe=P.gh;return sa(te,N,K,oe,P.occupied)?(da(te,N,P,S,R,z-I,ve[2],B,b,k),la(te,N,K,oe,P,c),{gx:te,gy:N,rot:B,info:P}):!1};I--;){var j=ra(z-I);i.shuffle&&(j=[].concat(j),Os(j));for(var ee=0;ee<j.length;ee++){var ae=q(j[ee]);if(ae)return ae}}return i.shrinkToFit?(Array.isArray(c)?c[1]=c[1]*3/4:c.weight=c.weight*3/4,L(c,v+1)):null},dt=function(c,v,S){if(v)return!r.some(function(R){var b=new CustomEvent(c,{cancelable:!0,detail:S||{}});return!R.dispatchEvent(b)},this);r.forEach(function(R){var b=new CustomEvent(c,{detail:S||{}});R.dispatchEvent(b)},this)},pa=function(){var c=r[0];if(c.getContext)h=Math.ceil(c.width/s),y=Math.ceil(c.height/s);else{var v=c.getBoundingClientRect();h=Math.ceil(v.width/s),y=Math.ceil(v.height/s)}if(dt("wordcloudstart",!0)){D=i.origin?[i.origin[0]/s,i.origin[1]/s]:[h/2,y/2],z=Math.floor(Math.sqrt(h*h+y*y)),w=[];var S,R,b;if(!c.getContext||i.clearCanvas)for(r.forEach(function(N){if(N.getContext){var K=N.getContext("2d");K.fillStyle=i.backgroundColor,K.clearRect(0,0,h*(s+1),y*(s+1)),K.fillRect(0,0,h*(s+1),y*(s+1))}else N.textContent="",N.style.backgroundColor=i.backgroundColor,N.style.position="relative"}),S=h;S--;)for(w[S]=[],R=y;R--;)w[S][R]=!0;else{var B=document.createElement("canvas").getContext("2d");B.fillStyle=i.backgroundColor,B.fillRect(0,0,1,1);var k=B.getImageData(0,0,1,1).data,P=c.getContext("2d").getImageData(0,0,h*s,y*s).data;S=h;for(var U,I;S--;)for(w[S]=[],R=y;R--;){I=s;e:for(;I--;)for(U=s;U--;)for(b=4;b--;)if(P[((R*s+I)*h*s+(S*s+U))*4+b]!==k[b]){w[S][R]=!1;break e}w[S][R]!==!1&&(w[S][R]=!0)}P=B=k=void 0}if(i.hover||i.click){for(at=!0,S=h+1;S--;)Ge[S]=[];i.hover&&c.addEventListener("mousemove",li),i.click&&(c.addEventListener("click",go),c.addEventListener("touchstart",go),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",li),c.removeEventListener("click",go),st=void 0})}b=0;var q,j,ee=!0;i.layoutAnimation?i.wait!==0?(q=window.setTimeout,j=window.clearTimeout):(q=window.setImmediate,j=window.clearImmediate):(q=function(N){N()},j=function(){ee=!1});var ae=function(K,oe){r.forEach(function(Se){Se.addEventListener(K,oe)},this)},ve=function(K,oe){r.forEach(function(Se){Se.removeEventListener(K,oe)},this)},te=function N(){ve("wordcloudstart",N),j(nt[o])};ae("wordcloudstart",te),nt[o]=(i.layoutAnimation?q:setTimeout)(function N(){if(ee){if(b>=i.list.length){j(nt[o]),dt("wordcloudstop",!1),ve("wordcloudstart",te),delete nt[o];return}le=new Date().getTime();var K=ma(i.list[b],0),oe=!dt("wordclouddrawn",!0,{item:i.list[b],drawn:K});if(So()||oe){j(nt[o]),i.abort(),dt("wordcloudabort",!1),dt("wordcloudstop",!1),ve("wordcloudstart",te);return}b++,nt[o]=q(N,i.wait)}},i.wait)}};pa()};ii.isSupported=oi;ii.minFontSize=ti;var ri=ii;if(!ri.isSupported)throw new Error("Sorry your browser not support wordCloud");function ks(t){for(var r=t.getContext("2d"),e=r.getImageData(0,0,t.width,t.height),o=r.createImageData(e),i=0,n=0,a=0;a<e.data.length;a+=4){var s=e.data[a+3];if(s>128){var l=e.data[a]+e.data[a+1]+e.data[a+2];i+=l,++n}}for(var g=i/n,a=0;a<e.data.length;a+=4){var l=e.data[a]+e.data[a+1]+e.data[a+2],s=e.data[a+3];s<128||l>g?(o.data[a]=0,o.data[a+1]=0,o.data[a+2]=0,o.data[a+3]=0):(o.data[a]=255,o.data[a+1]=255,o.data[a+2]=255,o.data[a+3]=255)}r.putImageData(o,0,0)}Gr(function(t,r){t.eachSeriesByType("wordCloud",function(e){var o=Oe.getLayoutRect(e.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()}),i=e.get("keepAspect"),n=e.get("maskImage"),a=n?n.width/n.height:1;i&&Ns(o,a);var s=e.getData(),l=document.createElement("canvas");l.width=o.width,l.height=o.height;var g=l.getContext("2d");if(n)try{g.drawImage(n,0,0,l.width,l.height),ks(l)}catch(H){console.error("Invalid mask image"),console.error(H.toString())}var d=e.get("sizeRange"),T=e.get("rotationRange"),w=s.getDataExtent("value"),h=Math.PI/180,y=e.get("gridSize");ri(l,{list:s.mapArray("value",function(H,Y){var pe=s.getItemModel(Y);return[s.getName(Y),pe.get("textStyle.fontSize",!0)||Zr.linearMap(H,w,d),Y]}).sort(function(H,Y){return Y[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:T[0]*h,maxRotation:T[1]*h,clearCanvas:!n,rotateRatio:1,rotationStep:e.get("rotationStep")*h,drawOutOfBound:e.get("drawOutOfBound"),shrinkToFit:e.get("shrinkToFit"),layoutAnimation:e.get("layoutAnimation"),shuffle:!1,shape:e.get("shape")});function D(H){var Y=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(Y[0],Y[1],Y[2],H.detail.drawn))}l.addEventListener("wordclouddrawn",D),e.layoutInstance&&e.layoutInstance.dispose();var z=r.__wordCloudRunningLayouts=r.__wordCloudRunningLayouts||{},le=e.seriesIndex;z[le]&&z[le].dispose(),e.layoutInstance={ondraw:null,dispose:function(){l.removeEventListener("wordclouddrawn",D),l.addEventListener("wordclouddrawn",function(H){H.preventDefault()})}},z[le]=e.layoutInstance})});$r(function(t){var r=(t||{}).series;!oo.isArray(r)&&(r=r?[r]:[]);var e=["shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];oo.each(r,function(i){if(i&&i.type==="wordCloud"){var n=i.textStyle||{};o(n.normal),o(n.emphasis)}});function o(i){i&&oo.each(e,function(n){i.hasOwnProperty(n)&&(i["text"+Jr.capitalFirst(n)]=i[n])})}});function Ns(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)}var Tt={scale:1,x:0,y:0},Ls=8,ni=1.2;function Un(t){return t.scale===Tt.scale}function $n(t,r,e,o){let i=Math.min(Ls,Math.max(Tt.scale,t.scale*e)),n=i/t.scale;return lo({scale:i,x:r.x-(r.x-t.x)*n,y:r.y-(r.y-t.y)*n},o)}function Gn(t,r,e){return lo(Ke(Ye({},t),{x:t.x+r.x,y:t.y+r.y}),e)}function lo(t,r){return{scale:t.scale,x:qn(t.x,r.width,t.scale),y:qn(t.y,r.height,t.scale)}}function qn(t,r,e){let o=r*(1-e);return Math.min(0,Math.max(o,t))}var Ps=0,mo=class{constructor(r){this.chart=r,this.viewport=Tt,this.lastDragPoint=null;let e=r.getZr();e.on("mousewheel",o=>this.zoom(o)),e.on("mousedown",o=>this.startDragging(o)),e.on("mousemove",o=>this.drag(o)),e.on("mouseup",()=>this.stopDragging()),e.on("globalout",()=>this.stopDragging())}showWholeCloud(){this.show(Tt)}restoreAfterLayout(){Un(this.viewport)||this.show(lo(this.viewport,this.containerSize()))}zoom(r){let e=r.wheelDelta??0;if(e===0)return;r.event?.preventDefault();let o=e>0?ni:1/ni;this.show($n(this.viewport,{x:r.offsetX,y:r.offsetY},o,this.containerSize()))}startDragging(r){Fs(r)&&(this.lastDragPoint={x:r.offsetX,y:r.offsetY})}drag(r){let e=this.lastDragPoint;if(!e)return;let o={x:r.offsetX,y:r.offsetY};this.lastDragPoint=o,this.show(Gn(this.viewport,{x:o.x-e.x,y:o.y-e.y},this.containerSize()))}stopDragging(){this.lastDragPoint=null}show(r){this.viewport=r,this.wordGroup()?.attr({x:r.x,y:r.y,scaleX:r.scale,scaleY:r.scale})}wordGroup(){let r=this.chart,e=r.getModel()?.getSeriesByIndex(0);return e?r.getViewOfSeriesModel(e)?.group:void 0}containerSize(){return{width:this.chart.getWidth(),height:this.chart.getHeight()}}};function Fs({event:t}){return!t||!("button"in t)||t.button===Ps}gt([io,Xr,Yr]);var As=150,zs=200,po=class{constructor(r,e){this.chartRegistry=r,this.handlers=e,this.highlightedWords=[],this.mustRestoreHighlightAfterLayout=!1,this.hasDrawnACloud=!1,this.containerSizeObserver=new on,this.drawnWords=re(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=Ur(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)),this.panZoom=new mo(this.chart),r.addEventListener("contextmenu",Ao),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)},As)}draw(r,e){this.hasMeasurableContainer()&&(this.hasDrawnACloud=!0,this.drawnWords.set(null),this.chart?.clear(),this.chart?.resize(),this.chart?.setOption(r,!0),this.panZoom?.restoreAfterLayout(),this.mustRestoreHighlightAfterLayout=!0,e())}showWholeCloud(){this.panZoom?.showWholeCloud()}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",Ao),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.panZoom=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()},zs)}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 Xn(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 Yn(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 Hs=["wordCloudCanvas"],js=(t,r)=>r.text;function Vs(t,r){if(t&1){let e=he();J(0,"div",2),De("click",function(){Z(e);let i=E();return Q(i.backgroundClicked.emit())}),J(1,"p",3),x(2),X(),J(3,"button",4),De("click",function(i){Z(e);let n=E();return Q(n.showWholeMap(i))}),x(4,"Show whole map"),X()()}if(t&2){let e=E();p(2),_e("No domain words for ",e.selectedNodeName(),". Select a folder or another file in the explorer.")}}function qs(t,r){if(t&1&&(J(0,"output",8),x(1),X()),t&2){let e=E(2);p(),_e(" ",e.droppedWordNotice()," ")}}function Us(t,r){if(t&1&&(J(0,"li"),x(1),X()),t&2){let e=r.$implicit;p(),fi("",e.text,": ",e.frequency)}}function $s(t,r){if(t&1&&(J(0,"figure",5)(1,"figcaption",6),x(2),X(),lt(3,"div",7,0),X(),$(5,qs,2,1,"output",8),J(6,"ol",6),Te(7,Us,2,2,"li",null,js),X()),t&2){let e=E();p(2),me(e.description()),p(3),G(e.droppedWordNotice()?5:-1),p(2),Me(e.topWordsForScreenReaders())}}var Gs="(prefers-reduced-motion: reduce)";function Xs(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 ai=(()=>{class t{constructor(){this.wordCloudReadStore=m(bn),this.viewReadinessStore=m(Di),this.settings=W(qt),this.selectedNodePath=W(null),this.customShapeMask=W(null),this.markedWords=W([]),this.fitRequest=W(0),this.clearSelection=se(),this.backgroundClicked=se(),this.wordRightClicked=se(),this.wordClicked=se(),this.canvasRef=Ft("wordCloudCanvas"),this.chartHost=new po(m(To),{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=ie(At(this.selectedNodePath).pipe(Ze(e=>this.wordCloudReadStore.wordsForSelectedNode(e))),{initialValue:[]}),this.selectedNodeName=_(()=>this.wordCloudReadStore.selectedNodeName(this.selectedNodePath())),this.renderedWords=_(()=>yt(this.words(),this.settings().sizingMode,this.settings().topN)),this.droppedWordNotice=_(()=>Yn(this.chartHost.drawnWordCount(),this.renderedWords().length)),this.topWordsForScreenReaders=_(()=>this.renderedWords().slice(0,10)),this.description=_(()=>Xn(this.renderedWords(),this.selectedNodeName())),this.prefersReducedMotion=typeof matchMedia=="function"&&matchMedia(Gs).matches,this.logoMaskImage=re(null),this.customMaskImage=re(null),this.lastRenderedInputs=null,this.loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(),Fe(()=>this.loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure()),Fe(()=>this.renderIntoTheChartOnceTheContainerIsMeasured()),Fe(()=>this.chartHost.highlightWords(this.markedWords())),Fe(()=>this.showTheWholeCloudOnRequest())}ngOnDestroy(){this.disposeChart()}disposeChart(){this.chartHost.dispose(),this.lastRenderedInputs=null}showWholeMap(e){e.stopPropagation(),this.clearSelection.emit()}showTheWholeCloudOnRequest(){this.fitRequest()>0&&this.chartHost.showWholeCloud()}renderIntoTheChartOnceTheContainerIsMeasured(){let e=this.words(),o=this.settings(),i=this.maskImageFor(o.shape),n=this.canvasRef()?.nativeElement;if(!n){this.disposeChart(),this.viewReadinessStore.markReady("domain");return}this.chartHost.attachTo(n);let{width:a,height:s}=this.chartHost.containerSize();if(a===0||s===0){this.chartHost.cancelPendingRender();return}let l={container:n,words:e,settings:o,maskImage:i,containerWidth:a,containerHeight:s};if(Xs(this.lastRenderedInputs,l)){this.viewReadinessStore.markReady("domain");return}this.chartHost.render(Pn(this.renderedWords(),o,{layoutAnimation:!this.prefersReducedMotion,containerWidth:a,maskImage:i}),()=>{this.lastRenderedInputs=l})}maskImageFor(e){if(e===Ee.logoM)return this.logoMaskImage()??void 0;if(e===Ee.custom)return this.customMaskImage()??void 0}loadTheLogoMaskAndKeepTheCircleFallbackOnFailure(){Uo(Mn).then(e=>this.logoMaskImage.set(e)).catch(()=>{})}loadTheUploadedShapeAndKeepTheCircleFallbackOnFailure(){let e=this.customShapeMask();if(e===null){this.customMaskImage.set(null);return}Uo(e).then(o=>this.customMaskImage.set(o)).catch(()=>this.customMaskImage.set(null))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-word-cloud"]],viewQuery:function(o,i){o&1&&kt(i.canvasRef,Hs,5),o&2&&Nt()},hostAttrs:[1,"relative","block","h-full","w-full"],inputs:{settings:[1,"settings"],selectedNodePath:[1,"selectedNodePath"],customShapeMask:[1,"customShapeMask"],markedWords:[1,"markedWords"],fitRequest:[1,"fitRequest"]},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&&$(0,Vs,5,1,"div",1)(1,$s,9,2),o&2&&G(i.words().length===0?0:1)},encapsulation:2})}}return t})();var ho={id:"words",label:"Words",icon:"fa-solid fa-font",searchPlaceholder:"payment, invoice",searchAriaLabel:"Search words"},Kn=[Zt,ho];var si=(()=>{class t{constructor(){this.store=m(de),this.pathsWithDomainWords=ie(this.store.select(Qi),{requireSync:!0})}project(e){return nn(e,{pathsWithDomainWords:this.pathsWithDomainWords()})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var Ys=ye(Ht,Wo,(t,r)=>new Set(wi(t,r).map(e=>e.path))),Zn={patternSelector:Wo,setPattern:Vi,searchedNodePathsSelector:Ys};var Ks=5,Zs="No domain words",di=(()=>{class t{constructor(){this.store=m(de),this.domainSelectionStore=m(it),this.domainBarReadStore=m(ne),this.hoverTooltipService=m(xi),this.domainWordIndex=ie(this.store.select(Gt),{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,n=this.topWords(e.path,i);this.hoverTooltipService.show({title:e.name,rows:n.length>0?n.map(a=>({label:a.text,value:`${Ie(a,i)}`})):[{label:Zs,value:""}]},o.right,o.top)}hoverEnd(){this.hoverTooltipService.hide()}topWords(e,o){return yt(this.domainWordIndex().wordsOf(e),o,Ks)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var Qn={options:[bo.NAME,bo.NUMBER_OF_FILES],optionSelector:ki,ascendingSelector:Ni,setOption:Xi,toggleAscending:t=>Yi({value:!t})};var Qs=ye(Ht,Je,(t,r)=>t&&r&&Jn(t,r)||t),Js=(t,r)=>ye(Qs,e=>wr(yr(e),t,r));function Jn(t,r){if(t.path===r)return t;let e=t.children?.find(o=>o.path!==void 0&&Xt(r,o.path));return e&&Jn(e,r)}var ci=(()=>{class t{constructor(){this.store=m(de)}rootNodeFor(e,o){return this.store.select(Js(e,o))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var ea=(()=>{class t{constructor(){this.domainSelectionStore=m(it),this.revealService=m(fr),this.modeService=m(Qt),this.focusStore=m(He),ir("domain",e=>this.showNode(e))}showNode(e){let o=this.focusStore.focusedNodePath();o&&!Xt(e,o)&&this.focusStore.unfocus(),this.modeService.activate(Zt.id),this.domainSelectionStore.select(e),this.revealService.revealNode(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275dir=hi({type:t,selectors:[["","ccShowsHandedOverNode",""]]})}}return t})();var ta=(()=>{class t{constructor(){this.inspected=re(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.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var uo=(()=>{class t{constructor(){this.querySubject=new Et(""),this.pattern$=this.querySubject.asObservable(),this.isPatternEmpty$=this.pattern$.pipe(ct(e=>e.trim().length===0))}setPattern(e){this.querySubject.next(e)}resetPattern(){this.setPattern("")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();var oa={[ge.OCCURRENCES]:!1,[ge.NAME]:!0,[ge.RELEVANCE]:!1},td={option:ge.OCCURRENCES,ascending:oa[ge.OCCURRENCES]},fo=(()=>{class t{constructor(){this.sortingSubject=new Et(td),this.options=Object.values(ge),this.sorting$=this.sortingSubject.asObservable(),this.option$=this.sorting$.pipe(ct(({option:e})=>e)),this.ascending$=this.sorting$.pipe(ct(({ascending:e})=>e))}setOption(e){this.sortingSubject.next({option:e,ascending:oa[e]})}toggleAscending(){let{ascending:e}=this.sortingSubject.value;this.sortingSubject.next(Ke(Ye({},this.sortingSubject.value),{ascending:!e}))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=V({token:t,factory:t.\u0275fac})}}return t})();function ia(t,r,e,o){let i=o&&e.trim().length>0?Ct(r,e).map(({text:n})=>n):[];return t===null||i.includes(t)?i:[t,...i]}function od(t,r){if(t&1){let e=he();u(0,"span",12),x(1),f(),u(2,"button",13),M("click",function(){Z(e);let i=E();return Q(i.copySelectedPath())}),F(3,"i",14),f()}if(t&2){let e=E();C("title",e.selectedNodePath()),p(),_e(" ",e.selectedNodePath()," "),p(),C("title",e.copied()?"Copied!":"Copy path"),p(),Lt("fa-copy",!e.copied())("fa-check",e.copied())}}function id(t,r){if(t&1&&(u(0,"span",5),x(1),f()),t&2){let e=E();p(),me(e.selectedNodeName()||"No selection")}}var tf=(()=>{class t{constructor(){this.domainBarReadStore=m(ne),this.customShapeMaskStore=m(vt),this.explorerCollapseService=m(dr),this.explorerModeService=m(Qt),this.domainSelectionStore=m(it),this.domainWordInspectionStore=m(ta),this.domainWordQueryStore=m(uo),this.domainWordSortStore=m(fo),this.wordOccurrencesReadStore=m(Ve),this.hiddenWordsReadStore=m(wt),this.hiddenWordsWriteStore=m(xt),this.clipboard=m(pt),this.focusStore=m(He),this.settings=this.domainBarReadStore.settings,this.customShapeMask=this.customShapeMaskStore.dataUri,this.copied=this.clipboard.copied,this.selectedNodePath=this.domainSelectionStore.selectedNodePath,this.selectedNodeName=_(()=>Bt(this.selectedNodePath(),"")),this.cloudNodePath=_(()=>this.selectedNodePath()??this.focusStore.focusedNodePath()??null),this.cloudFitRequest=m(St).fitRequest,this.hiddenWordCount=_(()=>this.hiddenWordsReadStore.hiddenWords().length),this.hiddenWordsTooltip=_(()=>this.hiddenWordCount()===0?"No word is hidden":`${this.hiddenWordCount()} hidden from the cloud and the word list`),this.rightClickedWord=re(null),this.inspectedWord=this.domainWordInspectionStore.inspectedWord,this.wordQuery=ie(this.domainWordQueryStore.pattern$,{requireSync:!0}),this.wordSorting=ie(this.domainWordSortStore.sorting$,{requireSync:!0}),this.wordsInFocus=ie(this.wordOccurrencesReadStore.wordsInFocus$,{requireSync:!0}),this.markedWords=_(()=>ia(this.inspectedWord(),this.wordsInFocus(),this.wordQuery(),!this.explorerModeService.isFilesMode()))}showWordOccurrences(e){this.explorerModeService.activate(ho.id),this.explorerCollapseService.expand(),this.domainWordInspectionStore.inspect(e)}searchForWord(e){this.explorerModeService.activate(ho.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)}showWholeMap(){this.domainSelectionStore.clear(),this.focusStore.unfocus()}unpinWord(){this.domainWordInspectionStore.clear()}async copySelectedPath(){let e=this.selectedNodePath();e&&await this.clipboard.copy(e)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=O({type:t,selectors:[["cc-domain-view"]],features:[Pt([si,{provide:hr,useExisting:si},di,{provide:ur,useExisting:di},Mo,{provide:gr,useExisting:Mo},ci,{provide:pr,useExisting:ci},_r(Qn),xr(Zn),{provide:nr,useValue:{showRules:!1,showSearch:!0,showCounts:!1,canFlatten:!1,modes:Kn}},uo,{provide:ar,useExisting:uo},fo,{provide:mr,useExisting:fo},{provide:lr,useExisting:He},{provide:Mr,useValue:{focusableNodes:"folders",showMapActions:!1,showExclude:!1}},pt,Cr("domain"),Oi()]),Rt([ea])],decls:16,vars:15,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","fitRequest"],[3,"searchWord","hideWord","closed","rightClickedWord"],[3,"showSelectedWhenNotHovered","selectedNodePath"],["barTools",""],["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&&(F(0,"cc-loading-file-progress-spinner",0),u(1,"cc-sidebar-explorer")(2,"div",1),F(3,"cc-explorer-count-chip",2),f(),F(4,"cc-hidden-words-popover",3),u(5,"div",4),$(6,od,4,7)(7,id,2,1,"span",5),f(),u(8,"cc-domain-word-list",6),M("wordToggled",function(a){return i.toggleInspectedWord(a)})("nodeClicked",function(a){return i.selectNode(a)}),f()(),u(9,"div",7)(10,"cc-word-cloud",8),M("clearSelection",function(){return i.showWholeMap()})("backgroundClicked",function(){return i.unpinWord()})("wordClicked",function(a){return i.showWordOccurrences(a)})("wordRightClicked",function(a){return i.rightClickedWord.set(a)}),f()(),F(11,"cc-node-context-menu"),u(12,"cc-domain-word-menu",9),M("searchWord",function(a){return i.searchForWord(a)})("hideWord",function(a){return i.hideWord(a)})("closed",function(){return i.closeWordMenu()}),f(),F(13,"cc-bottom-bar",10),u(14,"cc-domain-bar"),F(15,"cc-domain-toolbox",11),f()),o&2&&(p(3),C("count",i.hiddenWordCount())("tooltip",i.hiddenWordsTooltip()),p(3),G(i.selectedNodePath()?6:7),p(2),C("query",i.wordQuery())("sorting",i.wordSorting())("expandedWord",i.inspectedWord())("selectedNodePath",i.selectedNodePath()),p(2),C("settings",i.settings())("customShapeMask",i.customShapeMask())("selectedNodePath",i.cloudNodePath())("markedWords",i.markedWords())("fitRequest",i.cloudFitRequest()),p(2),C("rightClickedWord",i.rightClickedWord()),p(),C("showSelectedWhenNotHovered",!0)("selectedNodePath",i.selectedNodePath()))},dependencies:[Sr,ai,zo,Bo,Ho,Er,Vo,qo,rr,or,Ii],encapsulation:2})}}return t})();export{tf as DomainViewComponent};
@@ -0,0 +1,2 @@
1
+ import{$a as Ir,$d as no,$f as _e,$k as Qo,A as H,Al as li,B as et,Bk as Ue,Bl as Oe,C as ce,Ck as mt,Cl as pi,D as y,Df as fo,Dk as Uo,Dl as di,E as tt,Ea as Fr,Ek as jo,El as mi,F as rt,Fb as M,Fc as eo,Fl as ue,G as _r,Ga as Br,Gb as G,Gc as at,Gg as xo,Gj as ko,Gk as Go,H as Pr,Hb as W,Hf as uo,Hg as So,Hj as Lo,Hk as Ae,I as Tr,Ia as J,If as vo,Ik as ke,Ja as ie,Jb as Tt,Jh as _o,Jk as Yo,K as le,Ka as it,Kb as Ur,Kd as st,Kf as dt,Kl as fi,La as g,Lb as jr,Lf as At,Ll as ui,Ma as U,Md as ct,Mj as Oo,Mk as qo,Na as j,Nc as to,Nf as ho,Nj as kt,Nk as ft,O as Nr,Oa as Vr,Pd as lt,Ph as He,Q as Ee,Qi as To,Qj as Lt,Qk as ut,Rg as bo,Rk as Xo,Si as No,Sk as Ko,T as f,Ta as Wr,Tk as Zo,U as Pt,Ub as Gr,Ud as Nt,Uf as go,Uh as Po,Uk as vt,Vd as me,Vh as Pe,Vk as je,Wg as wo,Wk as Bt,X as oe,Xg as Eo,Xk as Ge,Y as x,Ya as pe,Yb as Yr,Yd as io,Yg as Do,Yk as ht,Z as Ar,Zb as nt,Zf as Co,Zk as gt,_ as kr,_a as Re,_f as yo,_k as Le,a as Er,ae as ao,al as Jo,b as Dr,ba as Lr,bd as ro,cb as E,cd as oo,ce as so,dc as qr,de as co,df as mo,dk as Te,e as Vn,ek as ze,el as ei,fa as Q,fb as $r,fc as Xr,fh as Mo,fk as Ne,fl as ti,ga as P,gb as N,gc as Kr,gd as de,ge as lo,gh as Ro,gk as xe,gl as ri,h as _t,ha as T,hc as Wn,hk as Fo,hl as oi,ic as Zr,ik as z,jb as Hr,jc as Qr,jk as fe,jl as ii,ka as De,kc as Jr,kk as Bo,kl as Ct,l as Ze,la as Me,lk as Vo,ma as I,mj as Ao,mk as Se,ml as Vt,na as R,nk as ee,o as Qe,oa as w,ok as Wo,ol as ni,pa as _,pk as Io,pl as Wt,qa as S,qb as zr,qk as $o,ql as It,r as Mr,ra as b,re as po,rk as Ho,rl as ai,sa as q,sk as zo,sl as $t,ta as Or,te as $e,tk as m,tl as Ht,ua as ot,uk as ne,ul as si,va as X,wa as ye,wk as Ot,x as Je,xa as Ie,xl as ci,ya as O,yf as pt,yl as zt,z as Rr,zk as Ft}from"./chunk-6XSAPXQT.js";var yt="var(--cc-bottom-bar-height, 32px) + var(--cc-file-extension-bar-height, 17px)";var vi=(()=>{class e{constructor(){this.isOpen=N.required(),this.isMovedAsideByInspector=N.required(),this.togglePanel=$r(),this.buttonBottom=`calc(${yt} + 32px)`,this.buttonRight=E(()=>this.isMovedAsideByInspector()?"calc(var(--cc-inspector-width) - 28px)":"-28px")}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-toggle-button"]],hostAttrs:[1,"contents"],inputs:{isOpen:[1,"isOpen"],isMovedAsideByInspector:[1,"isMovedAsideByInspector"]},outputs:{togglePanel:"togglePanel"},decls:2,vars:6,consts:[["id","legend-panel-button","data-testid","legend-panel-button","aria-controls","legend-panel",1,"btn","btn-primary","btn-sm","fixed","z-[60]","w-[88px]","rotate-90","rounded-t-none","transition-[right]","duration-300",3,"click","title"]],template:function(r,i){r&1&&(S(0,"button",0),Ie("click",function(){return i.togglePanel.emit()}),g(1,` LEGEND
2
+ `),b()),r&2&&(J("right",i.buttonRight())("bottom",i.buttonBottom),X("title",i.isOpen()?"Hide panel":"Show panel"),Q("aria-expanded",i.isOpen()))},encapsulation:2})}}return e})();function In(e,t){if(e&1&&(R(0,"div",2)(1,"div",3),Or(2,4),w()()),e&2){let o=O();J("right",o.panelRight())("bottom",o.panelBottom),f(2),I("ngTemplateOutlet",o.legendContent())}}var Ut=(()=>{class e{constructor(){this.elementReference=y(Nr),this.isMovedAsideByInspector=N(!1),this.legendContent=Hr.required(Pt),this.isOpen=le(!1),this.panelBottom=`calc(${yt} + 12px)`,this.panelRight=E(()=>this.isMovedAsideByInspector()?"calc(var(--cc-inspector-width) + 40px)":"40px"),this.mouseDownListener=o=>this.closeOnOutsideClick(o)}ngOnInit(){document.addEventListener("mousedown",this.mouseDownListener)}ngOnDestroy(){document.removeEventListener("mousedown",this.mouseDownListener)}toggleIsOpen(){this.isOpen.update(o=>!o)}closeOnOutsideClick(o){this.isOpen()&&o.target instanceof Node&&!this.elementReference.nativeElement.contains(o.target)&&this.isOpen.set(!1)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-drawer"]],contentQueries:function(r,i,n){r&1&&Fr(n,i.legendContent,Pt,5),r&2&&Br()},inputs:{isMovedAsideByInspector:[1,"isMovedAsideByInspector"]},decls:2,vars:3,consts:[["id","legend-panel","data-testid","legend-panel",1,"rounded-box","border-base-300","bg-base-100","fixed","z-[60]","flex","w-72","max-w-[30vw]","flex-col","border","shadow-lg","transition-[right]","duration-300",3,"right","bottom"],[3,"togglePanel","isOpen","isMovedAsideByInspector"],["id","legend-panel","data-testid","legend-panel",1,"rounded-box","border-base-300","bg-base-100","fixed","z-[60]","flex","w-72","max-w-[30vw]","flex-col","border","shadow-lg","transition-[right]","duration-300"],[1,"flex","flex-col","gap-3","p-3"],[3,"ngTemplateOutlet"]],template:function(r,i){r&1&&(P(0,In,3,5,"div",0),R(1,"cc-legend-toggle-button",1),ye("togglePanel",function(){return i.toggleIsOpen()}),w()),r&2&&(T(i.isOpen()?0:-1),f(),I("isOpen",i.isOpen())("isMovedAsideByInspector",i.isMovedAsideByInspector()))},dependencies:[vi,zr],encapsulation:2})}}return e})();var $n=(e,t,o,r,i)=>{let n=[],a=jt("area",e.areaMetric,t,i);a&&n.push(a);let s=jt("height",e.heightMetric,t,i);s&&n.push(s);let l=jt("color",e.colorMetric,t,i);l&&!r&&n.push(Dr(Er({},l),{inverted:o.isColorRangeInverted===!0}));let p=Hn(e.edgeMetric,t,i);return p&&n.push(p),n},jt=(e,t,o,r)=>{if(t)return{kind:e,metricName:t,value:r?.attributes?.[t],descriptor:o?.[t]}},Hn=(e,t,o)=>{if(!e)return;let r=o?.edgeAttributes?.[e];if(r)return{kind:"edge",metricName:e,incoming:r.incoming??0,outgoing:r.outgoing??0,descriptor:t?.[e]}},hi=W(yo,pt,oo,eo,_e,$n);var zn=.3333333333333333,Un=2/3,Gt=(e,t,o,r)=>{if(t===void 0||o===void 0||o===t)return{fraction:1,severity:"neutral"};let i=jn((e-t)/(o-t));return{fraction:i,severity:Gn(r===1?1-i:i)}},jn=e=>Math.min(1,Math.max(0,e)),Gn=e=>e<zn?"success":e<Un?"warning":"error";var Yt=e=>e===void 0||e===0||Number.isNaN(e),qt=e=>Yt(e.value)&&!e.delta,gi={fraction:0,severity:"neutral"},Yn="unary",qn=(e,t,o,r)=>e?.attributes?Object.keys(e.attributes).filter(i=>i!==Yn).sort((i,n)=>i.localeCompare(n)).map(i=>Xn(i,e,t,o,r)):[],Xn=(e,t,o,r,i)=>{let n=i?.[e],a=t.attributes[e];return{name:e,value:a,delta:t.deltas?.[e],mapBar:Kn(e,a,o,n),rangeBar:Zn(e,a,r,n),descriptor:n}},Kn=(e,t,o,r)=>{if(Yt(t))return gi;let i=o?.attributes?.[e];return Gt(t,0,i,r?.direction)},Zn=(e,t,o,r)=>{if(Yt(t))return gi;let i=o.nodeMetricData.find(n=>n.name===e);return Gt(t,i?.minValue,i?.maxValue,r?.direction)},Ci=W(_e,dt,uo,pt,(e,t,o,r)=>qn(e,t.unifiedMapNode,{nodeMetricData:o},r));var ve=(()=>{class e{constructor(o){this.store=o,this.selectedNode$=this.store.select(_e),this.mappingBlocks$=this.store.select(hi),this.metricRows$=this.store.select(Ci)}static{this.\u0275fac=function(r){return new(r||e)(ce(G))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var be=(()=>{class e{constructor(){this.readStore=y(ve),this.threeSceneService=y(So),this.threeRendererService=y(xo),this.selectedNode=M(this.readStore.selectedNode$,{initialValue:void 0}),this.isVisible=E(()=>this.selectedNode()!=null)}close(){this.threeSceneService.clearSelection(),this.threeRendererService.render()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var xi=e=>{if(e)return{all:e.attributes?.unary??0,added:e.fileCount?.added??0,removed:e.fileCount?.removed??0,changed:e.fileCount?.changed??0}};function Qn(e,t){if(e&1&&(S(0,"span",2)(1,"span",3),g(2),b(),S(3,"span",4),g(4),b(),S(5,"span",5),g(6),b()()),e&2){let o=O();f(2),j("\u0394",o.added),f(2),j("\u0394",o.removed>0?-o.removed:0),f(2),j("\u0394",o.changed)}}function Jn(e,t){if(e&1&&(S(0,"span",1),g(1),b(),P(2,Qn,7,3,"span",2)),e&2){let o=t,r=O();f(),Vr(" ",o.all," ",o.all===1?"file":"files"," "),f(),T(r.isDeltaState()?2:-1)}}var Si=(()=>{class e{constructor(){this.isFolder=N.required(),this.fileCount=N(),this.isDeltaState=N.required()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-node-badges"]],hostAttrs:["data-testid","inspector-node-badges",1,"mt-1","flex","flex-wrap","items-center","gap-1"],inputs:{isFolder:[1,"isFolder"],fileCount:[1,"fileCount"],isDeltaState:[1,"isDeltaState"]},decls:3,vars:2,consts:[["data-testid","inspector-node-type",1,"badge","badge-ghost","badge-sm"],["data-testid","inspector-file-count",1,"badge","badge-ghost","badge-sm"],[1,"text-xs","opacity-60"],["title","Number of added files",1,"text-success"],["title","Number of removed files",1,"text-error"],["title","Number of files with metric changes"]],template:function(r,i){if(r&1&&(S(0,"span",0),g(1),b(),P(2,Jn,3,3)),r&2){let n;f(),U(i.isFolder()?"folder":"file"),f(),T((n=i.isFolder()&&i.fileCount())?2:-1,n)}},encapsulation:2})}}return e})();function ea(e,t){if(e&1&&(S(0,"p",0),g(1),b()),e&2){let o=O();f(),U(o.parentPath())}}function ta(e,t){if(e&1&&(S(0,"a",2),q(1,"i",3),b()),e&2){let o=t;X("href",o,Ee)("title",o)}}var bi=(()=>{class e{constructor(){this.parentPath=N.required(),this.nodeName=N.required(),this.link=N()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-node-path"]],hostAttrs:[1,"block"],inputs:{parentPath:[1,"parentPath"],nodeName:[1,"nodeName"],link:[1,"link"]},decls:4,vars:3,consts:[["data-testid","inspector-parent-path",1,"break-all","text-sm","leading-snug","opacity-60"],["data-testid","inspector-node-name",1,"break-all","text-lg","font-semibold","leading-snug","text-primary"],["target","_blank","rel","noopener noreferrer","data-testid","inspector-node-link",1,"text-sm",3,"href","title"],[1,"fa","fa-external-link"]],template:function(r,i){if(r&1&&(P(0,ea,2,1,"p",0),S(1,"p",1),g(2),P(3,ta,2,2,"a",2),b()),r&2){let n;T(i.parentPath()?0:-1),f(2),j(" ",i.nodeName()," "),f(),T((n=i.link())?3:-1,n)}},encapsulation:2})}}return e})();function ra(e,t){if(e&1){let o=ot();R(0,"div",4)(1,"div",5),_(2,"cc-inspector-node-path",6)(3,"cc-inspector-node-badges",7),w(),R(4,"button",8),ye("click",function(){tt(o);let i=O();return rt(i.copyPath())}),_(5,"i",9),w()()}if(e&2){let o=O();f(2),I("parentPath",o.parentPath())("nodeName",o.nodeName())("link",o.nodeLink()),f(),I("isFolder",o.isFolder())("fileCount",o.fileCount())("isDeltaState",o.isDeltaState()),f(),I("title",o.copied()?"Copied!":"Copy path"),f(),ie("fa-copy",!o.copied())("fa-check",o.copied())}}var wi=(()=>{class e{static{this.COPY_FEEDBACK_MS=1500}constructor(){this.readStore=y(ve),this.fileStoreReadWindow=y(at),this.visibilityService=y(be),this.selectedNode=M(this.readStore.selectedNode$,{requireSync:!0}),this.isDeltaState=M(this.fileStoreReadWindow.isDeltaState$,{requireSync:!0}),this.copied=le(!1),this.nodeName=E(()=>this.selectedNode()?.name??""),this.nodeLink=E(()=>this.selectedNode()?.link),this.parentPath=E(()=>{let o=this.selectedNode();return o?.path?o.path.slice(0,o.path.length-o.name.length):""}),this.isFolder=E(()=>this.selectedNode()?.type===Yr.FOLDER),this.fileCount=E(()=>xi(this.selectedNode())),y(Tr).onDestroy(()=>clearTimeout(this.copyFeedbackTimeout))}close(){this.visibilityService.close()}async copyPath(){let o=this.selectedNode()?.path;o&&(await navigator.clipboard.writeText(o),this.copied.set(!0),clearTimeout(this.copyFeedbackTimeout),this.copyFeedbackTimeout=setTimeout(()=>this.copied.set(!1),e.COPY_FEEDBACK_MS))}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-header"]],hostAttrs:[1,"block","shrink-0","px-3","py-2"],decls:6,vars:1,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["type","button","title","Close inspector","data-testid","inspector-close-button",1,"btn","btn-ghost","btn-xs","btn-square",3,"click"],[1,"fa","fa-times"],[1,"mt-1","flex","items-start","justify-between","gap-2"],[1,"min-w-0"],[3,"parentPath","nodeName","link"],[3,"isFolder","fileCount","isDeltaState"],["type","button","data-testid","inspector-copy-path-button",1,"btn","btn-ghost","btn-sm","btn-square","shrink-0",3,"click","title"],[1,"fa"]],template:function(r,i){r&1&&(R(0,"div",0)(1,"span",1),g(2,"Inspector"),w(),R(3,"button",2),ye("click",function(){return i.close()}),_(4,"i",3),w()(),P(5,ra,6,11,"div",4)),r&2&&(f(5),T(i.selectedNode()?5:-1))},dependencies:[bi,Si],encapsulation:2})}}return e})();var we=e=>e===void 0||Number.isNaN(e)?"-":e.toLocaleString("en-US");function oa(e,t){if(e&1&&(S(0,"a",4),q(1,"i",7),b()),e&2){let o=O();X("href",t,Ee),Q("data-testid","mapping-block-link-"+o.block().kind)}}function ia(e,t){if(e&1&&(g(0),S(1,"span",8),g(2,"(in/out)"),b()),e&2){let o=O();j(" ",o.edgeCountText()," ")}}function na(e,t){if(e&1&&g(0),e&2){let o=O();j(" ",o.formattedValue()," ")}}function aa(e,t){e&1&&(S(0,"span",6),g(1,"\xB7 inverted"),b())}var Ei=(()=>{class e{constructor(){this.block=N.required(),this.iconClasses=E(()=>`${e.ICONS[this.block().kind]} text-xs text-primary`),this.formattedValue=E(()=>we(this.block().value)),this.edgeCountText=E(()=>`${we(this.block().incoming)}/${we(this.block().outgoing)}`)}static{this.ICONS={area:"fa fa-arrows-alt",height:"fa fa-arrows-v",color:"fa fa-paint-brush",edge:"fa fa-exchange"}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-mapping-block"]],hostAttrs:[1,"block","py-2"],inputs:{block:[1,"block"]},decls:12,vars:13,consts:[[1,"flex","items-center","gap-2"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["aria-hidden","true"],[1,"break-all","leading-snug",3,"title"],["target","_blank","rel","noopener noreferrer",1,"text-sm","opacity-70",3,"href"],[1,"text-base","font-semibold","tabular-nums","leading-snug"],["data-testid","mapping-block-inverted",1,"text-sm","font-normal","opacity-60"],[1,"fa","fa-external-link"],[1,"text-sm","font-normal","opacity-70"]],template:function(r,i){if(r&1&&(S(0,"div",0)(1,"span",1),g(2),b(),q(3,"i",2),b(),S(4,"p",3),pe(5,"attributeDescriptorTooltip"),g(6),P(7,oa,2,2,"a",4),b(),S(8,"p",5),P(9,ia,3,1)(10,na,1,1),P(11,aa,2,0,"span",6),b()),r&2){let n;f(2),U(i.block().kind),f(),it(i.iconClasses()),f(),X("title",Re(5,10,i.block().descriptor,i.block().metricName)),Q("data-testid","mapping-block-name-"+i.block().kind),f(2),j(" ",i.block().metricName," "),f(),T((n=i.block().descriptor?.link)?7:-1,n),f(),Q("data-testid","mapping-block-value-"+i.block().kind),f(),T(i.block().kind==="edge"?9:10),f(2),T(i.block().inverted?11:-1)}},dependencies:[Pe],encapsulation:2})}}return e})();var sa=(e,t)=>t.kind;function ca(e,t){if(e&1&&_(0,"cc-inspector-mapping-block",2),e&2){let o=t.$implicit;I("block",o)}}var Di=(()=>{class e{constructor(){this.readStore=y(ve),this.mappingBlocks=M(this.readStore.mappingBlocks$,{requireSync:!0})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-metric-mapping"]],hostAttrs:[1,"block","shrink-0","border-t","border-base-300","px-3","py-2"],decls:5,vars:0,consts:[[1,"text-xs","uppercase","tracking-widest","opacity-60"],[1,"mt-1","divide-y","divide-base-200"],[3,"block"]],template:function(r,i){r&1&&(R(0,"span",0),g(1,"Metric Mapping"),w(),R(2,"div",1),De(3,ca,1,1,"cc-inspector-mapping-block",2,sa),w()),r&2&&(f(3),Me(i.mappingBlocks()))},dependencies:[Ei],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.comparisonMode=le("map")}setComparisonMode(o){this.comparisonMode.set(o)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Mi=(()=>{class e{constructor(){this.comparisonModeService=y(xt),this.comparisonMode=this.comparisonModeService.comparisonMode}setComparisonMode(o){this.comparisonModeService.setComparisonMode(o)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-comparison-toggle"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[["data-testid","inspector-comparison-toggle",1,"join"],["type","button","title","Compare each value against the whole map","data-testid","inspector-comparison-map",1,"btn","btn-xs","join-item",3,"click"],["type","button","title","Compare each value against the min/max range of all files","data-testid","inspector-comparison-range",1,"btn","btn-xs","join-item",3,"click"]],template:function(r,i){r&1&&(S(0,"div",0)(1,"button",1),Ie("click",function(){return i.setComparisonMode("map")}),g(2," map "),b(),S(3,"button",2),Ie("click",function(){return i.setComparisonMode("range")}),g(4," range "),b()()),r&2&&(f(),ie("btn-active",i.comparisonMode()==="map"),f(2),ie("btn-active",i.comparisonMode()==="range"))},encapsulation:2})}}return e})();function la(e,t){e&1&&(S(0,"a",2),q(1,"i",7),b()),e&2&&X("href",t,Ee)}function pa(e,t){if(e&1&&(S(0,"span",8),g(1),b()),e&2){let o=O();J("color",o.deltaColor()),f(),U(o.formattedDelta())}}var St=(()=>{class e{constructor(){this.row=N.required(),this.comparisonMode=N.required(),this.positiveDeltaColor=N.required(),this.negativeDeltaColor=N.required(),this.bar=E(()=>this.comparisonMode()==="map"?this.row().mapBar:this.row().rangeBar),this.formattedValue=E(()=>we(this.row().value)),this.hasDelta=E(()=>!!this.row().delta),this.formattedDelta=E(()=>`\u0394${we(this.row().delta)}`),this.deltaColor=E(()=>(this.row().delta??0)>0?this.positiveDeltaColor():this.negativeDeltaColor()),this.barClasses=E(()=>`h-full rounded ${e.SEVERITY_CLASSES[this.bar().severity]}`),this.barWidthPercentage=E(()=>this.bar().fraction*100)}static{this.SEVERITY_CLASSES={success:"bg-success",warning:"bg-warning",error:"bg-error",neutral:"bg-base-content/30"}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-metric-row"]],hostAttrs:[1,"block"],inputs:{row:[1,"row"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:10,vars:12,consts:[[1,"flex","items-baseline","justify-between","gap-2"],[1,"min-w-0","truncate","text-sm",3,"title"],["target","_blank","rel","noopener noreferrer","data-testid","metric-row-link",1,"opacity-70",3,"href"],[1,"shrink-0","text-sm","tabular-nums"],["data-testid","metric-row-delta",1,"mr-1",3,"color"],[1,"mt-0.5","h-1","overflow-hidden","rounded","bg-base-300"],["data-testid","metric-row-bar"],[1,"fa","fa-external-link"],["data-testid","metric-row-delta",1,"mr-1"]],template:function(r,i){if(r&1&&(S(0,"div",0)(1,"span",1),pe(2,"attributeDescriptorTooltip"),g(3),P(4,la,2,1,"a",2),b(),S(5,"span",3),P(6,pa,2,3,"span",4),g(7),b()(),S(8,"div",5),q(9,"div",6),b()),r&2){let n;f(),X("title",Re(2,9,i.row().descriptor,i.row().name)),f(2),j(" ",i.row().name," "),f(),T((n=i.row().descriptor?.link)?4:-1,n),f(2),T(i.hasDelta()?6:-1),f(),j(" ",i.formattedValue()," "),f(2),it(i.barClasses()),J("width",i.barWidthPercentage(),"%")}},dependencies:[Pe],encapsulation:2})}}return e})();var da=(e,t)=>t.name;function ma(e,t){if(e&1&&_(0,"cc-inspector-metric-row",3),e&2){let o=t.$implicit,r=O(3);I("row",o)("comparisonMode",r.comparisonMode())("positiveDeltaColor",r.positiveDeltaColor())("negativeDeltaColor",r.negativeDeltaColor())}}function fa(e,t){if(e&1&&(R(0,"div",2),De(1,ma,1,4,"cc-inspector-metric-row",3,da),w()),e&2){let o=O(2);f(),Me(o.rows())}}function ua(e,t){if(e&1){let o=ot();R(0,"button",0),ye("click",function(){tt(o);let i=O();return rt(i.toggleEmptyMetrics())}),_(1,"i",1),g(2),w(),P(3,fa,3,0,"div",2)}if(e&2){let o=O();f(),ie("fa-chevron-right",!o.showEmptyMetrics())("fa-chevron-down",o.showEmptyMetrics()),f(),j(" Empty metrics (",o.rows().length,") "),f(),T(o.showEmptyMetrics()?3:-1)}}var Ri=(()=>{class e{constructor(){this.rows=N.required(),this.comparisonMode=N.required(),this.positiveDeltaColor=N.required(),this.negativeDeltaColor=N.required(),this.showEmptyMetrics=le(!1)}toggleEmptyMetrics(){this.showEmptyMetrics.update(o=>!o)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-empty-metrics"]],hostAttrs:[1,"block"],inputs:{rows:[1,"rows"],comparisonMode:[1,"comparisonMode"],positiveDeltaColor:[1,"positiveDeltaColor"],negativeDeltaColor:[1,"negativeDeltaColor"]},decls:1,vars:1,consts:[["type","button","data-testid","inspector-empty-metrics-toggle",1,"mt-3","flex","items-center","gap-1.5","text-xs","uppercase","tracking-widest","opacity-60",3,"click"],[1,"fa","text-[10px]"],["data-testid","inspector-empty-metrics",1,"mt-2","flex","flex-col","gap-2","opacity-60"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(r,i){r&1&&P(0,ua,4,6),r&2&&T(i.rows().length>0?0:-1)},dependencies:[St],encapsulation:2})}}return e})();var va=(e,t)=>t.name;function ha(e,t){e&1&&_(0,"cc-inspector-comparison-toggle")}function ga(e,t){e&1&&(R(0,"p",2),g(1,"No metrics available"),w())}function Ca(e,t){if(e&1&&_(0,"cc-inspector-metric-row",4),e&2){let o=t.$implicit,r=O(2);I("row",o)("comparisonMode",r.comparisonMode())("positiveDeltaColor",r.mapColors().positiveDelta)("negativeDeltaColor",r.mapColors().negativeDelta)}}function ya(e,t){if(e&1&&(R(0,"div",3),De(1,Ca,1,4,"cc-inspector-metric-row",4,va),w(),_(3,"cc-inspector-empty-metrics",5)),e&2){let o=O();f(),Me(o.metricRowsWithValues()),f(2),I("rows",o.emptyMetricRows())("comparisonMode",o.comparisonMode())("positiveDeltaColor",o.mapColors().positiveDelta)("negativeDeltaColor",o.mapColors().negativeDelta)}}var _i=(()=>{class e{constructor(){this.readStore=y(ve),this.mapStateReadWindow=y(de),this.comparisonModeService=y(xt),this.metricRows=M(this.readStore.metricRows$,{requireSync:!0}),this.mapColors=M(this.mapStateReadWindow.mapColors$,{requireSync:!0}),this.comparisonMode=this.comparisonModeService.comparisonMode,this.metricRowsWithValues=E(()=>this.metricRows().filter(o=>!qt(o))),this.emptyMetricRows=E(()=>this.metricRows().filter(o=>qt(o)))}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-inspector-metrics-list"]],hostAttrs:[1,"block","border-t","border-base-300","px-3","py-2"],decls:6,vars:2,consts:[[1,"flex","items-center","justify-between"],[1,"text-xs","uppercase","tracking-widest","opacity-60"],["data-testid","inspector-metrics-empty",1,"mt-2","text-sm","opacity-60"],[1,"mt-2","flex","flex-col","gap-2"],[3,"row","comparisonMode","positiveDeltaColor","negativeDeltaColor"],[3,"rows","comparisonMode","positiveDeltaColor","negativeDeltaColor"]],template:function(r,i){r&1&&(R(0,"div",0)(1,"span",1),g(2,"Metrics"),w(),P(3,ha,1,0,"cc-inspector-comparison-toggle"),w(),P(4,ga,2,0,"p",2)(5,ya,4,4)),r&2&&(f(3),T(i.metricRows().length>0?3:-1),f(),T(i.metricRows().length===0?4:5))},dependencies:[Mi,Ri,St],encapsulation:2})}}return e})();var xa=(()=>{class e{constructor(){this.visibilityService=y(be),this.isVisible=this.visibilityService.isVisible}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-sidebar-inspector"]],hostAttrs:[1,"fixed","right-0","z-[60]","w-[var(--cc-inspector-width)]","max-w-[90vw]","bg-base-100","overflow-hidden","flex","flex-col","shadow-[-2px_0_8px_-2px_rgba(0,0,0,0.15)]","transition-transform","duration-300"],hostVars:9,hostBindings:function(r,i){r&2&&(Q("aria-hidden",!i.isVisible()),J("top","var(--cc-bars-height, 49px)")("height","calc(100vh - var(--cc-bars-height, 49px) - var(--cc-file-extension-bar-height, 17px) - var(--cc-bottom-bar-height, 32px))"),ie("translate-x-full",!i.isVisible())("pointer-events-none",!i.isVisible()))},decls:5,vars:0,consts:[[1,"min-h-0","flex-1","overflow-y-auto"]],template:function(r,i){r&1&&(_(0,"cc-inspector-resize-handle")(1,"cc-inspector-header")(2,"cc-inspector-metric-mapping"),R(3,"div",0),_(4,"cc-inspector-metrics-list"),w())},dependencies:[wi,Di,_i,_o],encapsulation:2})}}return e})();var Pi=(()=>{class e{static{this.NO_MATCHING="\u2013 (no matching buildings)"}transform(o,r,i,n){switch(o){case"positive":{let a=n==="unary",s=i.minValue===r.from,l=i.maxValue===r.from;return a?`${i.minValue} - ${i.maxValue}`:s?e.NO_MATCHING:l?`${i.minValue} to ${this.formatNumber(r.from)}`:`${i.minValue} to ${this.formatNumber(r.from-1)}`}case"neutral":{let a=r.from===r.to,s=r.to===i.maxValue;return a?e.NO_MATCHING:s?`${this.formatNumber(r.from)} to ${this.formatNumber(r.to)}`:`${this.formatNumber(r.from)} to ${this.formatNumber(r.to-1)}`}case"negative":return i.maxValue===r.to?e.NO_MATCHING:`${this.formatNumber(r.to)} to ${this.formatNumber(i.maxValue)}`;case"positiveDelta":return"+\u0394 positive delta";case"negativeDelta":return"\u2013\u0394 negative delta";case"selected":return"selected";case"outgoingEdge":return"Outgoing Edge";case"incomingEdge":return"Incoming Edge"}}formatNumber(o){return(o||0).toLocaleString()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275pipe=kr({name:"mapColorLabel",type:e,pure:!0})}}return e})();var Ti=(()=>{class e{constructor(o){this.store=o,this.selectedColorMetricData$=this.store.select(vo)}static{this.\u0275fac=function(r){return new(r||e)(ce(G))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var he=(()=>{class e{constructor(o,r){this.mapStateReadWindow=o,this.legendMetricRangeStore=r,this.mapColorFor=N.required(),this.colorMetric=M(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.colorRange=M(this.mapStateReadWindow.colorRange$,{initialValue:{from:0,to:0}}),this.nodeMetricRange=M(this.legendMetricRangeStore.selectedColorMetricData$,{initialValue:{values:[],minValue:0,maxValue:0}}),this.mapColors=M(this.mapStateReadWindow.mapColors$,{initialValue:ro}),this.color=E(()=>this.mapColors()[this.mapColorFor()])}static{this.\u0275fac=function(r){return new(r||e)(oe(de),oe(Ti))}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-color-row"]],inputs:{mapColorFor:[1,"mapColorFor"]},decls:7,vars:8,consts:[[1,"flex","items-center","gap-2"],[1,"h-4","w-4","shrink-0","rounded-sm","border","border-base-300"],["width","100%","height","100%"],[1,"min-w-0","flex-1","truncate","text-sm"]],template:function(r,i){if(r&1&&(Wr(0),pe(1,"mapColorLabel"),S(2,"div",0),_r(),S(3,"svg",1),q(4,"rect",2),b(),Pr(),S(5,"span",3),g(6),b()()),r&2){let n=Ir(1,3,i.mapColorFor(),i.colorRange(),i.nodeMetricRange(),i.colorMetric());f(3),Q("aria-label","Color for "+n),f(),Q("fill",i.color()),f(2),U(n)}},dependencies:[Pi],encapsulation:2})}}return e})();var Ai=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-color-scale-section"]],hostAttrs:[1,"contents"],decls:6,vars:0,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positive"],["mapColorFor","neutral"],["mapColorFor","negative"]],template:function(r,i){r&1&&(R(0,"div",0)(1,"span",1),g(2,"Color scale"),w(),_(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3)(5,"cc-legend-color-row",4),w())},dependencies:[he],encapsulation:2})}}return e})();var ki=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-delta-colors-section"]],hostAttrs:[1,"contents"],decls:5,vars:0,consts:[[1,"flex","flex-col","gap-1"],[1,"text-xs","uppercase","tracking-wider","opacity-60"],["mapColorFor","positiveDelta"],["mapColorFor","negativeDelta"]],template:function(r,i){r&1&&(R(0,"div",0)(1,"span",1),g(2,"Delta colors"),w(),_(3,"cc-legend-color-row",2)(4,"cc-legend-color-row",3),w())},dependencies:[he],encapsulation:2})}}return e})();function ba(e,t){e&1&&(R(0,"div",0),_(1,"cc-legend-color-row",1)(2,"cc-legend-color-row",2),w())}var Li=(()=>{class e{constructor(o){this.mapStateReadWindow=o,this.edgeMetric=M(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(r){return new(r||e)(oe(de))}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-edge-colors-section"]],hostAttrs:[1,"contents"],decls:1,vars:1,consts:[[1,"border-base-300","flex","flex-col","gap-1","border-t","pt-2"],["mapColorFor","outgoingEdge"],["mapColorFor","incomingEdge"]],template:function(r,i){r&1&&P(0,ba,3,0,"div",0),r&2&&T(i.edgeMetric()?0:-1)},dependencies:[he],encapsulation:2})}}return e})();var Oi=(()=>{class e{constructor(){this.preferencesReadWindow=y(Do),this.folderValue=M(this.preferencesReadWindow.radialFolderValue$,{requireSync:!0}),this.isNeutral=M(this.preferencesReadWindow.isRadialFolderNeutral$,{requireSync:!0}),this.swatch=M(this.preferencesReadWindow.radialFolderSwatch$,{requireSync:!0}),this.label=E(()=>this.isNeutral()?"folders: neutral":`folders: ${bo(this.folderValue()).legend}, tinted`)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-folders-row"]],decls:4,vars:3,consts:[["data-testid","legend-folders-row",1,"flex","items-center","gap-2"],[1,"h-4","w-4","shrink-0","rounded-sm","border","border-base-300"],[1,"min-w-0","flex-1","text-sm"]],template:function(r,i){r&1&&(S(0,"div",0),q(1,"span",1),S(2,"span",2),g(3),b()()),r&2&&(f(),J("background",i.swatch()),f(2),U(i.label()))},encapsulation:2})}}return e})();var Fi=(()=>{class e{constructor(o){this.metricsLensFacade=o,this.label=N.required(),this.metricName=N.required(),this.attributeDescriptors=M(this.metricsLensFacade.descriptors$,{initialValue:{}}),this.descriptor=E(()=>this.attributeDescriptors()[this.metricName()]),this.title=E(()=>this.descriptor()?.title||Po.get(this.metricName())||this.metricName())}static{this.\u0275fac=function(r){return new(r||e)(oe(fo))}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-metric-row"]],inputs:{label:[1,"label"],metricName:[1,"metricName"]},decls:6,vars:6,consts:[[1,"flex","items-baseline","gap-3",3,"title"],[1,"w-16","shrink-0","text-xs","uppercase","tracking-wider","opacity-60"],[1,"min-w-0","truncate","text-sm","font-semibold"]],template:function(r,i){r&1&&(S(0,"div",0),pe(1,"attributeDescriptorTooltip"),S(2,"span",1),g(3),b(),S(4,"span",2),g(5),b()()),r&2&&(X("title",Re(1,3,i.descriptor(),i.metricName())),f(3),U(i.label()),f(2),U(i.title()))},dependencies:[Pe],encapsulation:2})}}return e})();function wa(e,t){e&1&&_(0,"cc-legend-metric-row",4),e&2&&I("metricName",t)}var Bi=(()=>{class e{constructor(o){this.mapStateReadWindow=o,this.areaMetric=M(this.mapStateReadWindow.areaMetric$,{initialValue:""}),this.heightMetric=M(this.mapStateReadWindow.heightMetric$,{initialValue:""}),this.colorMetric=M(this.mapStateReadWindow.colorMetric$,{initialValue:""}),this.edgeMetric=M(this.mapStateReadWindow.edgeMetric$,{initialValue:null})}static{this.\u0275fac=function(r){return new(r||e)(oe(de))}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-metrics-section"]],hostAttrs:[1,"contents"],decls:5,vars:4,consts:[[1,"flex","flex-col","gap-2"],["label","Area",3,"metricName"],["label","Height",3,"metricName"],["label","Color",3,"metricName"],["label","Edge",3,"metricName"]],template:function(r,i){if(r&1&&(R(0,"div",0),_(1,"cc-legend-metric-row",1)(2,"cc-legend-metric-row",2)(3,"cc-legend-metric-row",3),P(4,wa,1,1,"cc-legend-metric-row",4),w()),r&2){let n;f(),I("metricName",i.areaMetric()??""),f(),I("metricName",i.heightMetric()??""),f(),I("metricName",i.colorMetric()??""),f(),T((n=i.edgeMetric())?4:-1,n)}},dependencies:[Fi],encapsulation:2})}}return e})();function Ea(e,t){e&1&&_(0,"cc-legend-delta-colors-section")}function Da(e,t){e&1&&_(0,"cc-legend-folders-row")}function Ma(e,t){if(e&1&&(_(0,"cc-legend-metrics-section")(1,"cc-legend-color-scale-section"),P(2,Da,1,0,"cc-legend-folders-row")),e&2){let o=O(2);f(2),T(o.isRadialLayout()?2:-1)}}function Ra(e,t){if(e&1&&(P(0,Ea,1,0,"cc-legend-delta-colors-section")(1,Ma,3,1),R(2,"div",1),_(3,"cc-legend-color-row",2),w(),_(4,"cc-legend-edge-colors-section")),e&2){let o=O();T(o.isDeltaState()?0:1)}}var _a=(()=>{class e{constructor(){this.fileStoreReadWindow=y(at),this.isDeltaState=M(this.fileStoreReadWindow.isDeltaState$,{initialValue:!1}),this.isRadialLayout=No(),this.isInspectorVisible=y(be).isVisible}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=x({type:e,selectors:[["cc-legend-panel"]],decls:2,vars:1,consts:[[3,"isMovedAsideByInspector"],[1,"border-base-300","border-t","pt-2"],["mapColorFor","selected"]],template:function(r,i){r&1&&(R(0,"cc-legend-drawer",0),Lr(1,Ra,5,1,"ng-template"),w()),r&2&&I("isMovedAsideByInspector",i.isInspectorVisible())},dependencies:[Ut,Bi,Ai,ki,Li,he,Oi],encapsulation:2})}}return e})();var Xt=new et("HANDED_OVER_MAP_NODE_ARRIVAL");var Kt=new et("MAP_EXPLORER_VIEW");var Vi=(()=>{class e{constructor(){this.store=y(G)}currentNodeAt(o){return this.store.select(Co(o)).pipe(Qe(1))}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Pa=(()=>{class e{constructor(){this.mapNodeByPathStore=y(Vi),this.selection=y(ko),this.revealService=y(Lo),this.arrival=y(Xt,{optional:!0}),Ao(y(Kt),o=>this.showNode(o))}showNode(o){this.mapNodeByPathStore.currentNodeAt(o).subscribe(r=>{r&&(this.arrival?.receive(o),this.selection.select(r),this.revealService.revealNode(o))})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275dir=Ar({type:e,selectors:[["","ccShowsHandedOverMapNode",""]]})}}return e})();var bt=W(me,Oo);var Ta={patternSelector:me,setPattern:$e,isPatternEmptySelector:bt,searchedNodePathsSelector:go};var Na={options:Object.values(nt),optionSelector:wo,ascendingSelector:Eo,setOption:Mo,toggleAscending:()=>Ro()};var Fe=e=>(e=e.trim(),e.startsWith("*")||e.endsWith("*")||e.startsWith("/")||e.startsWith("./")?e:!e.startsWith('"')&&!e.endsWith('"')?e.startsWith("!")?e:`*${e}*`:e);var Wi=e=>{let t=[],o=e.split(",");if(o[0].startsWith("!")){o[0]=o[0].slice(1);for(let r of o)r.length>0&&t.push({path:`!${Fe(r)}`});return t}for(let r of o){if(r.startsWith("!"))break;r.length>0&&t.push({path:Fe(r)})}return t};var Ii=e=>({type:"RuleFromSearchPatternAction",action:{effect:e}}),Cd=(()=>{class e{constructor(o,r,i){this.actions$=o,this.store=r,this.excludeGuard=i,this.searchPatternToRules$=this.actions$.pipe(jr("RuleFromSearchPatternAction"),Rr(this.store.select(me)),_t(([n,a])=>({effect:n.action.effect,rules:Wi(a)})),Mr()),this.flattenSearchPattern$=Tt(()=>this.searchPatternToRules$.pipe(Ze(({effect:n})=>n==="flatten"),Je(({rules:n})=>{this.store.dispatch(so({items:n})),this.store.dispatch($e({value:""}))})),{dispatch:!1}),this.excludeSearchPattern$=Tt(()=>this.searchPatternToRules$.pipe(Ze(({effect:n})=>n==="exclude"),Je(()=>{this.excludeGuard.doExcludedNodesResultInEmptyMap$.pipe(Qe(1),Ze(({resultsInEmptyMap:n})=>!n),Je(()=>{this.store.dispatch($e({value:""}))})).subscribe()}),_t(({rules:n})=>ao({items:n}))))}static{this.\u0275fac=function(r){return new(r||e)(ce(Ur),ce(G),ce(To))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();var qi=Vn(Wn());var $i=e=>/[*?]/.test(e);var Aa={gt:">",gte:"\u2265",lt:"<",lte:"\u2264",eq:"="};function Hi(e){if(e.operator==="between"){let t=Math.min(e.value,e.upperValue??e.value),o=Math.max(e.value,e.upperValue??e.value);return`${e.metric} ${t}\u2026${o}`}return`${e.metric} ${Aa[e.operator]} ${e.value}`}var zi=W(mo,e=>e?.map?Gr(e.map).descendants().map(({data:t})=>t).filter(t=>qr(t)):[]);var wt=W(zi,e=>{let t=new Map;for(let o of ka(e))t.set(o,e.map(r=>r.attributes?.[o]??0).filter(r=>typeof r=="number"&&!Number.isNaN(r)));return t});function ka(e){let t=new Set;for(let o of e)for(let r of Object.keys(o.attributes??{}))r!==Xr&&t.add(r);return t}var La=(e,t)=>(t.get(e.metric)??[]).filter(o=>Kr(e,o)).length,Ui=(e,t,o)=>e.filter(r=>r.type===o).map(r=>({id:r.id,label:Hi(r),affectedCount:La(r,t),kind:"METRIC",metricRule:r})),ji=W(Nt,wt,(e,t)=>Ui(e,t,"flatten")),Gi=W(Nt,wt,(e,t)=>Ui(e,t,"exclude"));var Xi=(e,t,o)=>{if(e.length===0)return[];let r=t.map(a=>Zr(a.path)),{rules:i,combinedPositivePrefilter:n}=Oa(e);return Fa(i,n,r),i.map(({item:a,affectedCount:s})=>({id:`${o}/${a.path}`,label:a.path,item:a,effect:o,affectedCount:s,kind:$i(a.path)?"RULE":"MANUAL"})).sort((a,s)=>a.label.localeCompare(s.label))};function Oa(e){let t=(0,qi.default)();return{rules:e.map(r=>{let{ignoredNodePaths:i,condition:n}=Qr(r.path);return n&&Jr(t,r.path),{item:r,ignoredNodePaths:i,condition:n,affectedCount:0}}),combinedPositivePrefilter:t}}function Fa(e,t,o){let r=e.filter(n=>n.condition),i=e.filter(n=>!n.condition);for(let n of o)r.length>0&&t.ignores(n)&&Yi(r,n,!0),Yi(i,n,!1)}function Yi(e,t,o){for(let r of e)r.ignoredNodePaths.ignores(t)===o&&r.affectedCount++}var Ki=W(ct,At,ji,(e,t,o)=>[...o,...Xi(e,t,"flatten")]),Zi=W(st,At,Gi,(e,t,o)=>[...o,...Xi(e,t,"exclude")]);var Qi=(e,t)=>{let o=t.trim().split(",");return t.trim().startsWith("!")?(o[0]=o[0].slice(1),o.some(r=>e.some(i=>`!${Fe(r)}`===i.path))):o.some(r=>e.some(i=>Fe(r)===i.path))};var Ji=e=>W(me,bt,e,(t,o,r)=>o||Qi(r,t)),en=Ji(ct),tn=Ji(st);var Ba=(()=>{class e{constructor(){this.store=y(G),this.flattenRules$=this.store.select(Ki),this.excludeRules$=this.store.select(Zi),this.isFlattenPatternDisabled$=this.store.select(en),this.isExcludePatternDisabled$=this.store.select(tn)}removeRule(o){if(o.kind==="METRIC"){He(this.store,o.metricRule.type,po({id:o.metricRule.id}));return}let r=o.effect==="flatten"?co({items:[o.item]}):no({items:[o.item]});He(this.store,o.effect,r)}clearRules(o){He(this.store,o,io({ruleEffect:o}))}ruleFromSearchPattern(o){He(this.store,o,Ii(o))}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();var rn=W(dt,ho,lt,({unifiedMapNode:e},t,o)=>o&&t.get(o)||e),on=(e,t)=>e!==nt.AREA_SIZE?W(rn,o=>kt(Lt(o),e,t)):W(rn,to,(o,r)=>kt(Lt(o),e,t,r));var Va=(()=>{class e{constructor(){this.store=y(G)}rootNodeFor(o,r){return this.store.select(on(o,r))}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();var Wa=(()=>{class e{constructor(){this.store=y(G),this.focusedNodePath=M(this.store.select(lt),{requireSync:!0})}receive(o){let r=this.focusedNodePath();r&&o!==r&&!o.startsWith(`${r}/`)&&this.store.dispatch(lo())}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();var Zt={color:"fill",borderColor:"stroke"},nn={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},te=Le(),Ia=(function(e){Te(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.type=t.type,o}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(o,r){return li(null,this)},t.prototype.getDataParams=function(o,r,i){var n=e.prototype.getDataParams.call(this,o,r);return i&&(n.info=te(i).info),n},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t})(pi),an=Ia;function Qt(e,t){var o=e.mapDimensionsAll("defaultedLabel"),r=o.length;if(r===1){var i=zt(e,t,o[0]);return i!=null?i+"":null}else if(r){for(var n=[],a=0;a<o.length;a++)n.push(zt(e,t,o[a]));return n.join(" ")}}var Km=Qo(),sn="__ec_stack_";function cn(e){if(mi(e.axis.scale)){for(var t=ue(e.axis),o=[],r=0;r<e.count;r++)o.push(Ne({stackId:sn+r},e));for(var i=$a({bandWidthResult:t,seriesInfo:o}),n=[],r=0;r<e.count;r++){var a=i[sn+r];a.offsetCenter=a.offset+a.width/2,n.push(a)}return n}}function $a(e){var t=e.bandWidthResult.w,o=t,r=0,i,n,a=[],s={};z(e.seriesInfo,function(B,D){D||(n=B.defaultBarGap||0);var $=B.stackId;m(s,$)||r++;var F=s[$];F||(F=s[$]={width:0,maxWidth:0},a.push($));var k=B.barWidth;k&&!F.width&&(F.width=k,k=vt(o,k),o-=k);var We=B.barMaxWidth;We&&(F.maxWidth=We);var qe=B.barMinWidth;qe&&(F.minWidth=qe);var Xe=B.barGap;Xe!=null&&(n=Xe);var Ke=B.barCategoryGap;Ke!=null&&(i=Ke)}),i==null&&(i=je(35-a.length*4,15)+"%");var l=Bt(i,t),p=Bt(n,1),c=(o-l)/(r+(r-1)*p);c=je(c,0),z(a,function(B){var D=s[B],$=D.maxWidth,F=D.minWidth;if(D.width){var k=D.width;$&&(k=vt(k,$)),F&&(k=je(k,F)),D.width=k,o-=k+p*k,r--}else{var k=c;$&&$<k&&(k=vt($,o)),F&&F>k&&(k=F),k!==c&&(D.width=k,o-=k+p*k,r--)}}),c=(o-l)/(r+(r-1)*p),c=je(c,0);var d=0,h;z(a,function(B){var D=s[B];D.width||(D.width=c),h=D,d+=D.width*(1+p)}),h&&(d-=h.width*p);var C={},L=-d/2;return z(a,function(B){var D=s[B];C[B]=C[B]||{bandWidth:t,offset:L,width:D.width},L+=D.width*(1+p)}),C}function za(e,t,o,r,i){var n=e.getArea(),a=n.x,s=n.y,l=n.width,p=n.height,c=o.get(["lineStyle","width"])||0;a-=c/2,s-=c/2,l+=c,p+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var d=new Ko({shape:{x:a,y:s,width:l,height:p}});if(t){var h=e.getBaseAxis(),C=h.isHorizontal(),L=h.inverse;C?(L&&(d.shape.x+=l),d.shape.width=0):(L||(d.shape.y+=p),d.shape.height=0);var B=Io(i)?function(D){i(D,d)}:null;Vt(d,{shape:{width:l,height:p,x:a,y:s}},o,null,r,B)}return d}function Ua(e,t,o){var r=e.getArea(),i=Ge(r.r0,1),n=Ge(r.r,1),a=new oi({shape:{cx:Ge(e.cx,1),cy:Ge(e.cy,1),r0:i,r:n,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});if(t){var s=e.getBaseAxis().dim==="angle";s?a.shape.endAngle=r.startAngle:a.shape.r=i,Vt(a,{shape:{endAngle:r.endAngle,r:n}},o)}return a}function ln(e,t,o,r,i){if(e){if(e.type==="polar")return Ua(e,t,o);if(e.type==="cartesian2d")return za(e,t,o,r,i)}else return null;return null}function ja(e,t){return t=t||[0,0],fe(["x","y"],function(o,r){var i=this.getAxis(o),n=t[r],a=e[r]/2;return i.type==="category"?ue(i).w:Math.abs(i.dataToCoord(n-a)-i.dataToCoord(n+a))},this)}function Jt(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(o){return e.dataToPoint(o)},size:ee(ja,e)}}}var Ga=0,dn=1,Ya=2;var qa="view",gf=(function(e){Te(t,e);function t(o,r,i){var n=e.call(this)||this;n.type=qa,n.dimensions=["x","y"];var a=n;a.invertY=o,a.lgCt=r,a.lgGeo=i;var s=a.trans=[];return s[Ga]=Ae(),s[dn]=Ae(),s[Ya]=Ae(),a.mtRaw=ne(),a.mtRawInv=ne(),a.mtOverall=ne(),a.mtOverallInv=ne(),a.zoom=1,n}return t.prototype.getBoundingRect=function(){return Xa(null,this)},t.prototype.getViewRect=function(){return Ka(null,this)},t.prototype.getRoamTransform=function(){return Go(this.trans[dn])},t.prototype.dataToPoint=function(o,r,i){var n=r?this.mtRaw:this.mtOverall;return i=i||[],n?Ft(i,o,n):Ot(i,o)},t.prototype.pointToData=function(o,r,i){i=i||[];var n=this.mtOverallInv;return n?Ft(i,o,n):Ot(i,o)},t.prototype.convertToPixel=function(o,r,i){var n=mn(r);return n===this?n.dataToPoint(i):null},t.prototype.convertFromPixel=function(o,r,i){var n=mn(r);return n===this?n.pointToData(i):null},t.prototype.containPoint=function(o){var r=this;return mt(Et,r.dataRect),Uo(Et,Et,r.mtOverall),jo(Et,o[0],o[1])},t.dimensions=["x","y"],t})(Yo),Et=Ue();function fn(e){return e.zoom}function Xa(e,t){return mt(e||Ue(),t.dataRect)}function Ka(e,t){return mt(e||Ue(),t.viewRect)}var Cf=ne();var yf=ne(),xf=Ue();var Sf=ne(),bf=ne();function mn(e){var t=e.seriesModel;return t?t.coordinateSystem:null}var wf=Ae(),Ef=Ae();function Za(e,t){return t=t||[0,0],fe([0,1],function(o){var r=t[o],i=e[o]/2,n=[],a=[];return n[o]=r-i,a[o]=r+i,n[1-o]=a[1-o]=t[1-o],Math.abs(this.dataToPoint(n)[o]-this.dataToPoint(a)[o])},this)}function er(e){var t=e.view,o=t.getBoundingRect();return{coordSys:{type:"geo",x:o.x,y:o.y,width:o.width,height:o.height,zoom:fn(t)},api:{coord:function(r){return e.dataToPoint(r)},size:ee(Za,e)}}}function Qa(e,t){var o=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return o.type==="category"?ue(o).w:Math.abs(o.dataToCoord(r-i)-o.dataToCoord(r+i))}function tr(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(o){return e.dataToPoint(o)},size:ee(Qa,e)}}}function Ja(e,t){return t=t||[0,0],fe(["Radius","Angle"],function(o,r){var i="get"+o+"Axis",n=this[i](),a=t[r],s=e[r]/2,l=n.type==="category"?ue(n).w:Math.abs(n.dataToCoord(a-s)-n.dataToCoord(a+s));return o==="Angle"&&(l=l*Math.PI/180),l},this)}function rr(e){var t=e.getRadiusAxis(),o=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(i){var n=t.dataToRadius(i[0]),a=o.dataToAngle(i[1]),s=e.coordToPoint([n,a]);return s.push(n,a*Math.PI/180),s},size:ee(Ja,e)}}}function or(e){var t=e.getRect(),o=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:o.start,end:o.end,weeks:o.weeks,dayCount:o.allDay}},api:{coord:function(r,i){return e.dataToPoint(r,i)},layout:function(r,i){return e.dataToLayout(r,i)}}}}function ir(e){var t=e.getRect();return{coordSys:{type:"matrix",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(o,r){return e.dataToPoint(o,r)},layout:function(o,r){return e.dataToLayout(o,r)}}}}function hn(e,t,o,r){return e&&(e.legacy||e.legacy!==!1&&!o&&!r&&t!=="tspan"&&(t==="text"||m(e,"text")))}function gn(e,t,o){var r=e,i,n,a;if(t==="text")a=r;else{a={},m(r,"text")&&(a.text=r.text),m(r,"rich")&&(a.rich=r.rich),m(r,"textFill")&&(a.fill=r.textFill),m(r,"textStroke")&&(a.stroke=r.textStroke),m(r,"fontFamily")&&(a.fontFamily=r.fontFamily),m(r,"fontSize")&&(a.fontSize=r.fontSize),m(r,"fontStyle")&&(a.fontStyle=r.fontStyle),m(r,"fontWeight")&&(a.fontWeight=r.fontWeight),n={type:"text",style:a,silent:!0},i={};var s=m(r,"textPosition");o?i.position=s?r.textPosition:"inside":s&&(i.position=r.textPosition),m(r,"textPosition")&&(i.position=r.textPosition),m(r,"textOffset")&&(i.offset=r.textOffset),m(r,"textRotation")&&(i.rotation=r.textRotation),m(r,"textDistance")&&(i.distance=r.textDistance)}return un(a,e),z(a.rich,function(l){un(l,l)}),{textConfig:i,textContent:n}}function un(e,t){t&&(t.font=t.textFont||t.font,m(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),m(t,"textAlign")&&(e.align=t.textAlign),m(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),m(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),m(t,"textWidth")&&(e.width=t.textWidth),m(t,"textHeight")&&(e.height=t.textHeight),m(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),m(t,"textPadding")&&(e.padding=t.textPadding),m(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),m(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),m(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),m(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),m(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),m(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),m(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function nr(e,t,o){var r=e;r.textPosition=r.textPosition||o.position||"inside",o.offset!=null&&(r.textOffset=o.offset),o.rotation!=null&&(r.textRotation=o.rotation),o.distance!=null&&(r.textDistance=o.distance);var i=r.textPosition.indexOf("inside")>=0,n=e.fill||Oe.color.neutral99;vn(r,t);var a=r.textFill==null;return i?a&&(r.textFill=o.insideFill||Oe.color.neutral00,!r.textStroke&&o.insideStroke&&(r.textStroke=o.insideStroke),!r.textStroke&&(r.textStroke=n),r.textStrokeWidth==null&&(r.textStrokeWidth=2)):(a&&(r.textFill=e.fill||o.outsideFill||Oe.color.neutral00),!r.textStroke&&o.outsideStroke&&(r.textStroke=o.outsideStroke)),r.text=t.text,r.rich=t.rich,z(t.rich,function(s){vn(s,s)}),r}function vn(e,t){t&&(m(t,"fill")&&(e.textFill=t.fill),m(t,"stroke")&&(e.textStroke=t.fill),m(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),m(t,"font")&&(e.font=t.font),m(t,"fontStyle")&&(e.fontStyle=t.fontStyle),m(t,"fontWeight")&&(e.fontWeight=t.fontWeight),m(t,"fontSize")&&(e.fontSize=t.fontSize),m(t,"fontFamily")&&(e.fontFamily=t.fontFamily),m(t,"align")&&(e.textAlign=t.align),m(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),m(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),m(t,"width")&&(e.textWidth=t.width),m(t,"height")&&(e.textHeight=t.height),m(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),m(t,"padding")&&(e.textPadding=t.padding),m(t,"borderColor")&&(e.textBorderColor=t.borderColor),m(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),m(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),m(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),m(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),m(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),m(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),m(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),m(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),m(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),m(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var xn={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Cn=Se(xn),Yf=Bo(ke,function(e,t){return e[t]=1,e},{}),qf=ke.join(", "),Ye=["","style","shape","extra"],Ve=Le();function sr(e,t,o,r,i){var n=e+"Animation",a=Ct(e,r,i)||{},s=Ve(t).userDuring;return a.duration>0&&(a.during=s?ee(ns,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),ze(a,o[n]),a}function Sn(e,t,o,r){r=r||{};var i=r.dataIndex,n=r.isInit,a=r.clearStyle,s=o.isAnimationEnabled(),l=Ve(e),p=t.style;l.userDuring=t.during;var c={},d={};if(ss(e,t,d),e.type==="compound")for(var h=e.shape.paths,C=t.shape.paths,L=0;L<C.length;L++){var B=C[L];ar("shape",B,h[L])}else ar("shape",t,d),ar("extra",t,d);if(!n&&s&&(as(e,t,c),yn("shape",e,t,c),yn("extra",e,t,c),cs(e,t,p,c)),d.style=p,ts(e,d,a),os(e,t),s)if(n){var D={};z(Ye,function(F){var k=F?t[F]:t;k&&k.enterFrom&&(F&&(D[F]=D[F]||{}),ze(F?D[F]:D,k.enterFrom))});var $=sr("enter",e,t,o,i);$.duration>0&&e.animateFrom(D,$)}else rs(e,t,i||0,o,c);es(e,t),p?e.dirty():e.markRedraw()}function es(e,t){for(var o=Ve(e).leaveToProps,r=0;r<Ye.length;r++){var i=Ye[r],n=i?t[i]:t;n&&n.leaveTo&&(o||(o=Ve(e).leaveToProps={}),i&&(o[i]=o[i]||{}),ze(i?o[i]:o,n.leaveTo))}}function Dt(e,t,o,r){if(e){var i=e.parent,n=Ve(e).leaveToProps;if(n){var a=sr("update",e,t,o,0);a.done=function(){i&&i.remove(e),r&&r()},e.animateTo(n,a)}else i&&i.remove(e),r&&r()}}function Be(e){return e==="all"}function ts(e,t,o){var r=t.style;if(!e.isGroup&&r){if(o){e.useStyle({});for(var i=e.animators,n=0;n<i.length;n++){var a=i[n];a.targetName==="style"&&a.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}function rs(e,t,o,r,i){if(i){var n=sr("update",e,t,r,o);n.duration>0&&e.animateFrom(i,n)}}function os(e,t){m(t,"silent")&&(e.silent=t.silent),m(t,"ignore")&&(e.ignore=t.ignore),e instanceof ft&&m(t,"invisible")&&(e.invisible=t.invisible),e instanceof ut&&m(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var re={},is={setTransform:function(e,t){return re.el[e]=t,this},getTransform:function(e){return re.el[e]},setShape:function(e,t){var o=re.el,r=o.shape||(o.shape={});return r[e]=t,o.dirtyShape&&o.dirtyShape(),this},getShape:function(e){var t=re.el.shape;if(t)return t[e]},setStyle:function(e,t){var o=re.el,r=o.style;return r&&(r[e]=t,o.dirtyStyle&&o.dirtyStyle()),this},getStyle:function(e){var t=re.el.style;if(t)return t[e]},setExtra:function(e,t){var o=re.el.extra||(re.el.extra={});return o[e]=t,this},getExtra:function(e){var t=re.el.extra;if(t)return t[e]}};function ns(){var e=this,t=e.el;if(t){var o=Ve(t).userDuring,r=e.userDuring;if(o!==r){e.el=e.userDuring=null;return}re.el=t,r(is)}}function yn(e,t,o,r){var i=o[e];if(i){var n=t[e],a;if(n){var s=o.transition,l=i.transition;if(l)if(!a&&(a=r[e]={}),Be(l))ze(a,n);else for(var p=gt(l),c=0;c<p.length;c++){var d=p[c],h=n[d];a[d]=h}else if(Be(s)||xe(s,e)>=0){!a&&(a=r[e]={});for(var C=Se(n),c=0;c<C.length;c++){var d=C[c],h=n[d];ls(i[d],h)&&(a[d]=h)}}}}}function ar(e,t,o){var r=t[e];if(r)for(var i=o[e]={},n=Se(r),a=0;a<n.length;a++){var s=n[a];i[s]=qo(r[s])}}function as(e,t,o){for(var r=t.transition,i=Be(r)?ke:gt(r||[]),n=0;n<i.length;n++){var a=i[n];if(!(a==="style"||a==="shape"||a==="extra")){var s=e[a];o[a]=s}}}function ss(e,t,o){for(var r=0;r<Cn.length;r++){var i=Cn[r],n=xn[i],a=t[i];a&&(o[n[0]]=a[0],o[n[1]]=a[1])}for(var r=0;r<ke.length;r++){var s=ke[r];t[s]!=null&&(o[s]=t[s])}}function cs(e,t,o,r){if(o){var i=e.style,n;if(i){var a=o.transition,s=t.transition;if(a&&!Be(a)){var l=gt(a);!n&&(n=r.style={});for(var p=0;p<l.length;p++){var c=l[p],d=i[c];n[c]=d}}else if(e.getAnimationStyleProps&&(Be(s)||Be(a)||xe(s,"style")>=0)){var h=e.getAnimationStyleProps(),C=h?h.style:null;if(C){!n&&(n=r.style={});for(var L=Se(o),p=0;p<L.length;p++){var c=L[p];if(C[c]){var d=i[c];n[c]=d}}}}}}}function ls(e,t){return Fo(e)?e!==t:e!=null&&isFinite(e)}var bn=Le(),ps=["percent","easing","shape","style","extra"];function wn(e){e.stopAnimation("keyframe"),e.attr(bn(e))}function cr(e,t,o){if(!(!o.isAnimationEnabled()||!t)){if(Wo(t)){z(t,function(s){cr(e,s,o)});return}var r=t.keyframes,i=t.duration;if(o&&i==null){var n=Ct("enter",o,0);i=n&&n.duration}if(!(!r||!i)){var a=bn(e);z(Ye,function(s){if(!(s&&!e[s])){var l,p=!1;r.sort(function(c,d){return c.percent-d.percent}),z(r,function(c){var d=e.animators,h=s?c[s]:c;if(h){var C=Se(h);if(s||(C=Vo(C,function(D){return xe(ps,D)<0})),!!C.length){l||(l=e.animate(s,t.loop,!0),l.scope="keyframe");for(var L=0;L<d.length;L++)d[L]!==l&&d[L].targetName===l.targetName&&d[L].stopTracks(C);s&&(a[s]=a[s]||{});var B=s?a[s]:a;z(C,function(D){B[D]=((s?e[s]:e)||{})[D]}),l.whenWithKeys(i*c.percent,h,C,c.easing)}}}),l&&l.delay(t.delay||0).duration(i).start(t.easing)}})}}}var ae="emphasis",ge="normal",ur="blur",vr="select",Ce=[ge,ae,ur,vr],lr={normal:["itemStyle"],emphasis:[ae,"itemStyle"],blur:[ur,"itemStyle"],select:[vr,"itemStyle"]},pr={normal:["label"],emphasis:[ae,"label"],blur:[ur,"label"],select:[vr,"label"]},ds=["x","y"],ms="e\0\0",K={normal:{},emphasis:{},blur:{},select:{}},fs={cartesian2d:Jt,geo:er,single:tr,polar:rr,calendar:or,matrix:ir};function mr(e){return e instanceof ut}function fr(e){return e instanceof ft}function us(e,t){t.copyTransform(e),fr(t)&&fr(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,mr(t)&&mr(e)&&t.setShape(e.shape))}var vs=(function(e){Te(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.type=t.type,o}return t.prototype.render=function(o,r,i,n){this._progressiveEls=null;var a=this._data,s=o.getData(),l=this.group,p=En(o,s,r,i);a||l.removeAll(),s.diff(a).add(function(d){dr(i,null,d,p(d,n),o,l,s)}).remove(function(d){var h=a.getItemGraphicEl(d);h&&Dt(h,te(h).option,o)}).update(function(d,h){var C=a.getItemGraphicEl(h);dr(i,C,d,p(d,n),o,l,s)}).execute();var c=o.get("clip",!0)?ln(o.coordinateSystem,!1,o):null;c?l.setClipPath(c):l.removeClipPath(),this._data=s},t.prototype.incrementalPrepareRender=function(o,r,i){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(o,r,i,n,a){var s=r.getData(),l=En(r,s,i,n),p=this._progressiveEls=[];function c(C){C.isGroup||(C.incremental=Jo(r),C.ensureState("emphasis").hoverLayer=ni)}for(var d=o.start;d<o.end;d++){var h=dr(null,null,d,l(d,a),r,this.group,s);h&&(h.traverse(c),p.push(h))}},t.prototype.eachRendered=function(o){ai(this._progressiveEls||this.group,o)},t.prototype.filterForExposedEvent=function(o,r,i,n){var a=r.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})(di),_n=vs;function hr(e){var t=e.type,o;if(t==="path"){var r=e.shape,i=r.width!=null&&r.height!=null?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,n=Nn(r);o=It(n,null,i,r.layout||"center"),te(o).customPathData=n}else if(t==="image")o=new Xo({}),te(o).customImagePath=e.style.image;else if(t==="text")o=new Zo({});else if(t==="group")o=new ri;else if(t==="compoundPath"){var r=e.shape;if(!r||!r.paths){var a="";ht(a)}var s=fe(r.paths,function(c){if(c.type==="path")return It(c.shape.pathData,c,null);var d=Wt(c.type);if(!d){var h="";ht(h)}return new d});o=new ii({shape:{paths:s}})}else{var l=Wt(t);if(!l){var a="";ht(a)}o=new l}return te(o).customGraphicType=t,o.name=e.name,o.z2EmphasisLift=1,o.z2SelectLift=1,o}function gr(e,t,o,r,i,n,a){wn(t);var s=i&&i.normal.cfg;s&&t.setTextConfig(s),r&&r.transition==null&&(r.transition=ds);var l=r&&r.style;if(l){if(t.type==="text"){var p=l;m(p,"textFill")&&(p.fill=p.textFill),m(p,"textStroke")&&(p.stroke=p.textStroke)}var c=void 0,d=mr(t)?l.decal:null;e&&d&&(d.dirty=!0,c=ui(d,e)),l.__decalPattern=c}if(fr(t)&&l){var c=l.__decalPattern;c&&(l.decal=c)}Sn(t,r,n,{dataIndex:o,isInit:a,clearStyle:!0}),cr(t,r.keyframeAnimation,n)}function Pn(e,t,o,r,i){var n=t.isGroup?null:t,a=i&&i[e].cfg;if(n){var s=n.ensureState(e);if(r===!1){var l=n.getState(e);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),ei(n)}}function hs(e,t,o){if(!e.isGroup){var r=e,i=o.currentZ,n=o.currentZLevel;r.z=i,r.zlevel=n;var a=t.z2;a!=null&&(r.z2=a||0);for(var s=0;s<Ce.length;s++)gs(r,t,Ce[s])}}function gs(e,t,o){var r=o===ge,i=r?t:Mt(t,o),n=i?i.z2:null,a;n!=null&&(a=r?e:e.ensureState(o),a.z2=n||0)}function En(e,t,o,r){var i=e.get("renderItem");if(typeof i=="string"){var n=fi(i);n&&(i=n)}var a=e.coordinateSystem,s={};a&&(s=a.prepareCustoms?a.prepareCustoms(a):fs[a.type](a));for(var l=Ne({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:qe,style:Ke,ordinalRawValue:Xe,styleEmphasis:An,visual:kn,barLayout:Ln,currentSeriesIndices:On,font:Fn},s.api||{}),p={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:s.coordSys,dataInsideLength:t.count(),encode:Cs(e.getData()),itemPayload:e.get("itemPayload")||{}},c,d,h={},C={},L={},B={},D=0;D<Ce.length;D++){var $=Ce[D];L[$]=e.getModel(lr[$]),B[$]=e.getModel(pr[$])}function F(v){return v===c?d||(d=t.getItemModel(v)):t.getItemModel(v)}function k(v,u){return t.hasItemOption?v===c?h[u]||(h[u]=F(v).getModel(lr[u])):F(v).getModel(lr[u]):L[u]}function We(v,u){return t.hasItemOption?v===c?C[u]||(C[u]=F(v).getModel(pr[u])):F(v).getModel(pr[u]):B[u]}return function(v,u){return c=v,d=null,h={},C={},i&&i(Ne({dataIndexInside:v,dataIndex:t.getRawIndex(v),actionType:u?u.type:null},p),l)};function qe(v,u){return u==null&&(u=c),t.getStore().get(t.getDimensionIndex(v||0),u)}function Xe(v,u){u==null&&(u=c),v=v||0;var V=t.getDimensionInfo(v);if(!V){var Z=t.getDimensionIndex(v);return Z>=0?t.getStore().get(Z,u):void 0}var se=t.get(V.name,u),Y=V&&V.ordinalMeta;return Y?Y.categories[se]:se}function Ke(v,u){u==null&&(u=c);var V=t.getItemVisual(u,"style"),Z=V&&V.fill,se=V&&V.opacity,Y=k(u,ge).getItemStyle();Z!=null&&(Y.fill=Z),se!=null&&(Y.opacity=se);var br={inheritColor:$o(Z)?Z:Oe.color.neutral99},Rt=We(u,ge),wr=$t(Rt,null,br,!1,!0);wr.text=Rt.getShallow("show")?Ho(e.getFormattedLabel(u,ge),Qt(t,u)):null;var Bn=Ht(Rt,br,!1);return Sr(v,Y),Y=nr(Y,wr,Bn),v&&xr(Y,v),Y.legacy=!0,Y}function An(v,u){u==null&&(u=c);var V=k(u,ae).getItemStyle(),Z=We(u,ae),se=$t(Z,null,null,!0,!0);se.text=Z.getShallow("show")?zo(e.getFormattedLabel(u,ae),e.getFormattedLabel(u,ge),Qt(t,u)):null;var Y=Ht(Z,null,!0);return Sr(v,V),V=nr(V,se,Y),v&&xr(V,v),V.legacy=!0,V}function xr(v,u){for(var V in u)m(u,V)&&(v[V]=u[V])}function Sr(v,u){v&&(v.textFill&&(u.textFill=v.textFill),v.textPosition&&(u.textPosition=v.textPosition))}function kn(v,u){if(u==null&&(u=c),m(Zt,v)){var V=t.getItemVisual(u,"style");return V?V[Zt[v]]:null}if(m(nn,v))return t.getItemVisual(u,v)}function Ln(v){if(a.type==="cartesian2d"){var u=a.getBaseAxis();return cn(Ne({axis:u},v))}}function On(){return o.getCurrentSeriesIndices()}function Fn(v){return si(v,o)}}function Cs(e){var t={};return z(e.dimensions,function(o){var r=e.getDimensionInfo(o);if(!r.isExtraCoord){var i=r.coordDim,n=t[i]=t[i]||[];n[r.coordDimIndex]=e.getDimensionIndex(o)}}),t}function dr(e,t,o,r,i,n,a){if(!r){n.remove(t);return}var s=Cr(e,t,o,r,i,n);return s&&a.setItemGraphicEl(o,s),s&&ti(s,r.focus,r.blurScope,r.emphasisDisabled),s}function Cr(e,t,o,r,i,n){var a=-1,s=t;t&&Tn(t,r,i)&&(a=xe(n.childrenRef(),t),t=null);var l=!t,p=t;p?p.clearStates():(p=hr(r),s&&us(s,p)),r.morph===!1?p.disableMorphing=!0:p.disableMorphing&&(p.disableMorphing=!1),r.tooltipDisabled&&(p.tooltipDisabled=!0),K.normal.cfg=K.normal.conOpt=K.emphasis.cfg=K.emphasis.conOpt=K.blur.cfg=K.blur.conOpt=K.select.cfg=K.select.conOpt=null,K.isLegacy=!1,xs(p,o,r,i,l,K),ys(p,o,r,i,l),gr(e,p,o,r,K,i,l),m(r,"info")&&(te(p).info=r.info);for(var c=0;c<Ce.length;c++){var d=Ce[c];if(d!==ge){var h=Mt(r,d),C=yr(r,h,d);Pn(d,p,h,C,K)}}return hs(p,r,i),r.type==="group"&&Ss(e,p,o,r,i),a>=0?n.replaceAt(p,a):n.add(p),p}function Tn(e,t,o){var r=te(e),i=t.type,n=t.shape,a=t.style;return o.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i==="path"&&Ds(n)&&Nn(n)!==r.customPathData||i==="image"&&m(a,"image")&&a.image!==r.customImagePath}function ys(e,t,o,r,i){var n=o.clipPath;if(n===!1)e&&e.getClipPath()&&e.removeClipPath();else if(n){var a=e.getClipPath();a&&Tn(a,n,r)&&(a=null),a||(a=hr(n),e.setClipPath(a)),gr(null,a,t,n,null,r,i)}}function xs(e,t,o,r,i,n){if(!(e.isGroup||e.type==="compoundPath")){Dn(o,null,n),Dn(o,ae,n);var a=n.normal.conOpt,s=n.emphasis.conOpt,l=n.blur.conOpt,p=n.select.conOpt;if(a!=null||s!=null||p!=null||l!=null){var c=e.getTextContent();if(a===!1)c&&e.removeTextContent();else{a=n.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=hr(a),e.setTextContent(c)),gr(null,c,t,a,null,r,i);for(var d=a&&a.style,h=0;h<Ce.length;h++){var C=Ce[h];if(C!==ge){var L=n[C].conOpt;Pn(C,c,L,yr(a,L,C),null)}}d?c.dirty():c.markRedraw()}}}}function Dn(e,t,o){var r=t?Mt(e,t):e,i=t?yr(e,r,ae):e.style,n=e.type,a=r?r.textConfig:null,s=e.textContent,l=s?t?Mt(s,t):s:null;if(i&&(o.isLegacy||hn(i,n,!!a,!!l))){o.isLegacy=!0;var p=gn(i,n,!t);!a&&p.textConfig&&(a=p.textConfig),!l&&p.textContent&&(l=p.textContent)}if(!t&&l){var c=l;!c.type&&(c.type="text")}var d=t?o[t]:o.normal;d.cfg=a,d.conOpt=l}function Mt(e,t){return t?e?e[t]:null:e}function yr(e,t,o){var r=t&&t.style;return r==null&&o===ae&&e&&(r=e.styleEmphasis),r}function Ss(e,t,o,r,i){var n=r.children,a=n?n.length:0,s=r.$mergeChildren,l=s==="byName"||r.diffChildrenByName,p=s===!1;if(!(!a&&!l&&!p)){if(l){ws({api:e,oldChildren:t.children()||[],newChildren:n||[],dataIndex:o,seriesModel:i,group:t});return}p&&t.removeAll();for(var c=0;c<a;c++){var d=n[c],h=t.childAt(c);d?(d.ignore==null&&(d.ignore=!1),Cr(e,h,o,d,i,t)):h.ignore=!0}for(var C=t.childCount()-1;C>=c;C--){var L=t.childAt(C);bs(t,L,i)}}}function bs(e,t,o){t&&Dt(t,te(e).option,o)}function ws(e){new ci(e.oldChildren,e.newChildren,Mn,Mn,e).add(Rn).update(Rn).remove(Es).execute()}function Mn(e,t){var o=e&&e.name;return o??ms+t}function Rn(e,t){var o=this.context,r=e!=null?o.newChildren[e]:null,i=t!=null?o.oldChildren[t]:null;Cr(o.api,i,o.dataIndex,r,o.seriesModel,o.group)}function Es(e){var t=this.context,o=t.oldChildren[e];o&&Dt(o,te(o).option,t.seriesModel)}function Nn(e){return e&&(e.pathData||e.d)}function Ds(e){return e&&(m(e,"pathData")||m(e,"d"))}function Ms(e){e.registerChartView(_n),e.registerSeriesModel(an)}export{Wi as a,Cd as b,be as c,xa as d,Ut as e,Pi as f,_a as g,Xt as h,Kt as i,Pa as j,Ta as k,Na as l,wt as m,Wa as n,Ba as o,Va as p,Ms as q};
@@ -2,7 +2,7 @@
2
2
  "meta": {
3
3
  "projectName": "Sample Project with Edges",
4
4
  "apiVersion": "2.0",
5
- "checksum": "06a21f72c5b644784f7c2b0fa6abca21"
5
+ "checksum": "92f2cc60df5649e426712fed3a92f881"
6
6
  },
7
7
  "files": [
8
8
  {
@@ -83,13 +83,31 @@
83
83
  }
84
84
  },
85
85
  "dependency": {
86
+ "nodes": {
87
+ "1ae98c1a93690d75": {
88
+ "level": 0
89
+ },
90
+ "ea70504d5daa3547": {
91
+ "level": 0
92
+ },
93
+ "120a1569e3556450": {
94
+ "level": 0
95
+ },
96
+ "7de6343f370ff7cf": {
97
+ "level": 1
98
+ },
99
+ "3d6521b0884ce9f4": {
100
+ "level": 2
101
+ }
102
+ },
86
103
  "edges": [
87
104
  {
88
105
  "fromId": "7de6343f370ff7cf",
89
106
  "toId": "120a1569e3556450",
90
107
  "attributes": {
91
108
  "pairingRate": 89,
92
- "avgCommits": 34
109
+ "avgCommits": 34,
110
+ "dependencies": 3
93
111
  }
94
112
  },
95
113
  {
@@ -97,7 +115,8 @@
97
115
  "toId": "120a1569e3556450",
98
116
  "attributes": {
99
117
  "pairingRate": 32,
100
- "avgCommits": 17
118
+ "avgCommits": 17,
119
+ "dependencies": 1
101
120
  }
102
121
  },
103
122
  {
@@ -105,15 +124,51 @@
105
124
  "toId": "7de6343f370ff7cf",
106
125
  "attributes": {
107
126
  "pairingRate": 65,
108
- "avgCommits": 22
109
- }
127
+ "avgCommits": 22,
128
+ "dependencies": 2
129
+ },
130
+ "isPointingUpwards": true
131
+ },
132
+ {
133
+ "fromId": "3d6521b0884ce9f4",
134
+ "toId": "7de6343f370ff7cf",
135
+ "attributes": {
136
+ "pairingRate": 48,
137
+ "avgCommits": 25,
138
+ "dependencies": 4
139
+ },
140
+ "isCyclic": true
141
+ },
142
+ {
143
+ "fromId": "7de6343f370ff7cf",
144
+ "toId": "3d6521b0884ce9f4",
145
+ "attributes": {
146
+ "pairingRate": 41,
147
+ "avgCommits": 19,
148
+ "dependencies": 1
149
+ },
150
+ "isCyclic": true,
151
+ "isPointingUpwards": true
110
152
  }
111
153
  ],
112
154
  "attributeTypes": {
113
155
  "pairingRate": "relative",
114
- "avgCommits": "absolute"
156
+ "avgCommits": "absolute",
157
+ "dependencies": "absolute"
115
158
  },
116
- "attributeDescriptors": {}
159
+ "attributeDescriptors": {
160
+ "dependencies": {
161
+ "title": "Dependencies",
162
+ "description": "Number of declaration-level dependencies between two files",
163
+ "hintLowValue": "Few dependencies between the files",
164
+ "hintHighValue": "Many dependencies between the files",
165
+ "link": "",
166
+ "direction": -1,
167
+ "analyzers": [
168
+ "dependencyParser"
169
+ ]
170
+ }
171
+ }
117
172
  },
118
173
  "domain": {
119
174
  "nodes": {