@arcgis/map-components 5.1.0-next.46 → 5.1.0-next.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{IULGMTSK.js → 3GY55TR6.js} +1 -1
- package/dist/cdn/{JJTM5KZ2.js → 5EGS3PEJ.js} +1 -1
- package/dist/cdn/{GO5BD6QL.js → 5FJIKNID.js} +1 -1
- package/dist/cdn/{UVHZXCAN.js → 6E7H5LPA.js} +2 -2
- package/dist/cdn/{HKNVYHER.js → 6XPVHLWQ.js} +1 -1
- package/dist/cdn/{G7SRL7WF.js → 76RS6RKB.js} +1 -1
- package/dist/cdn/{5C33IP7B.js → A2QPYUE5.js} +1 -1
- package/dist/cdn/{FHVFIK44.js → CC77IOI3.js} +1 -1
- package/dist/cdn/CYSDIJ4L.js +2 -0
- package/dist/cdn/EHPHVZAX.js +2 -0
- package/dist/cdn/{PFQ5U7SF.js → ET2U2ZGP.js} +1 -1
- package/dist/cdn/{DCRCFVBU.js → F2SNWNAZ.js} +1 -1
- package/dist/cdn/FF5VMKLK.js +2 -0
- package/dist/cdn/{IPIYZVAJ.js → FWXI6DGS.js} +1 -1
- package/dist/cdn/I6PZUSTS.js +2 -0
- package/dist/cdn/{2IFKJHFD.js → JFNCIZRD.js} +1 -1
- package/dist/cdn/{QEDQOBD7.js → JVFREF7G.js} +2 -2
- package/dist/cdn/{SZSOX5MA.js → KWZTLNUH.js} +1 -1
- package/dist/cdn/{YQWTCTTH.js → LY77GAJT.js} +1 -1
- package/dist/cdn/ODQ4JQEF.js +2 -0
- package/dist/cdn/{NBBZRGXH.js → OH3I63ZU.js} +1 -1
- package/dist/cdn/{JWJHIBYW.js → P2ABZVPJ.js} +1 -1
- package/dist/cdn/PNGKWZJQ.js +2 -0
- package/dist/cdn/{XSEIJTVD.js → R42WEZRB.js} +1 -1
- package/dist/cdn/{KFG6ZJAZ.js → REQFNQZY.js} +1 -1
- package/dist/cdn/{WG4E5DBM.js → RH62B2NE.js} +1 -1
- package/dist/cdn/{L3AVJM22.js → T5MRUYOH.js} +1 -1
- package/dist/cdn/TBWM3VXL.js +2 -0
- package/dist/cdn/{ANRWXBWL.js → VEYOGGAN.js} +1 -1
- package/dist/cdn/{Q5Y3DHAC.js → W27U4A3P.js} +1 -1
- package/dist/cdn/XPZYTUFI.js +2 -0
- package/dist/cdn/{DLB6EEQE.js → YET5HTLQ.js} +1 -1
- package/dist/cdn/YXUK3MCB.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/layer-utils.js +17 -13
- package/dist/components/arcgis-feature-utility-network-association-list/customElement.js +14 -13
- package/dist/components/arcgis-feature-utility-network-associations/customElement.js +80 -86
- package/dist/components/arcgis-utility-network-aggregated-geometry/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +35 -35
- package/dist/components/arcgis-utility-network-trace-location/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +26 -25
- package/dist/components/arcgis-version-management-version-list/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/6JYHNX2S.js +0 -2
- package/dist/cdn/BE4GRNQV.js +0 -2
- package/dist/cdn/CAXI6CJY.js +0 -2
- package/dist/cdn/ELTHY6FL.js +0 -2
- package/dist/cdn/MFIMBD2E.js +0 -2
- package/dist/cdn/NXQA6DOA.js +0 -2
- package/dist/cdn/OGE4JCW6.js +0 -2
- package/dist/cdn/T34SPRV3.js +0 -2
- package/dist/cdn/UKU22VTN.js +0 -2
- /package/dist/cdn/{BILSW27K.js → 2HXYJZSB.js} +0 -0
- /package/dist/cdn/{5VWD7SPW.js → 37GJW6KT.js} +0 -0
- /package/dist/cdn/{VIEEGP7G.js → 4IM2FY5W.js} +0 -0
- /package/dist/cdn/{OIJPQ63Z.js → 4MDRPZTG.js} +0 -0
- /package/dist/cdn/{ZYZA5VUV.js → 4STAROOM.js} +0 -0
- /package/dist/cdn/{YJPCWIX2.js → 5IMWXYL2.js} +0 -0
- /package/dist/cdn/{O5S54F3U.js → 5TXE67XV.js} +0 -0
- /package/dist/cdn/{E6GYGJ2B.js → BBQPUWRO.js} +0 -0
- /package/dist/cdn/{EG3W3ADI.js → BND2TJBO.js} +0 -0
- /package/dist/cdn/{WRS3F55Q.js → CJOHGWK6.js} +0 -0
- /package/dist/cdn/{6TB2XH3T.js → D5WXOOS3.js} +0 -0
- /package/dist/cdn/{UX5YG5TO.js → DMDCKD5U.js} +0 -0
- /package/dist/cdn/{PILEMW25.js → DQH27QCF.js} +0 -0
- /package/dist/cdn/{HX6XVMJE.js → EP252O27.js} +0 -0
- /package/dist/cdn/{H4WIQKA4.js → EVHNFE5I.js} +0 -0
- /package/dist/cdn/{T3ZFKRCS.js → EW6V3NZI.js} +0 -0
- /package/dist/cdn/{6PWTVRJ6.js → F6BQWE5I.js} +0 -0
- /package/dist/cdn/{ULYGZ4D2.js → FLLSBLLE.js} +0 -0
- /package/dist/cdn/{PWPTFBHS.js → FQZXILRT.js} +0 -0
- /package/dist/cdn/{6ZCH5OTT.js → GHY23IXW.js} +0 -0
- /package/dist/cdn/{QY7A4VMP.js → GIGQIUF5.js} +0 -0
- /package/dist/cdn/{GPESYF4D.js → GS75FRUR.js} +0 -0
- /package/dist/cdn/{6W3OENEK.js → HGAJ2IEN.js} +0 -0
- /package/dist/cdn/{YGVSJT3E.js → JKVKP7AW.js} +0 -0
- /package/dist/cdn/{7C22TPME.js → JU3BLGXG.js} +0 -0
- /package/dist/cdn/{MR5AEEII.js → L4TA63M6.js} +0 -0
- /package/dist/cdn/{BUILQQ6S.js → LQVZVGY4.js} +0 -0
- /package/dist/cdn/{SPSJMCAO.js → MM4KQLRF.js} +0 -0
- /package/dist/cdn/{4S2JKX63.js → Q3GALNWS.js} +0 -0
- /package/dist/cdn/{BLSJEYOH.js → QM34BSKE.js} +0 -0
- /package/dist/cdn/{QSOU6NQA.js → QTWRDNXX.js} +0 -0
- /package/dist/cdn/{FVTX4GNH.js → TC3Q2QUA.js} +0 -0
- /package/dist/cdn/{WTUUS552.js → TEFALOII.js} +0 -0
- /package/dist/cdn/{2HJ7EGEB.js → TP5VEU3D.js} +0 -0
- /package/dist/cdn/{3LKCMCHN.js → U35ISUWJ.js} +0 -0
- /package/dist/cdn/{FWV2SQE2.js → UUC3DBCQ.js} +0 -0
- /package/dist/cdn/{ZLOQIB7A.js → UVMLKDJA.js} +0 -0
- /package/dist/cdn/{BEDLAEXK.js → V7DG2KF6.js} +0 -0
- /package/dist/cdn/{TKVE7ETK.js → WHDMC5HB.js} +0 -0
- /package/dist/cdn/{GPGC63RW.js → XEXCDGSR.js} +0 -0
- /package/dist/cdn/{BVFH7ZG4.js → XJXQC6HM.js} +0 -0
- /package/dist/cdn/{GT5SWKXT.js → YZSLMAVX.js} +0 -0
- /package/dist/cdn/{ZX5YTFYB.js → ZUPEVR3P.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as vt}from"./5C33IP7B.js";import{D as ft,E as q,M as at,O as _t,P as xt,c as M,da as ct,ga as bt,i as T,j as v,k as D,l as mt,m as ht,n as dt,na as ut,o as et,oa as lt,pa as kt}from"./IPIYZVAJ.js";import{N as R,a as z,u as w}from"./JWJHIBYW.js";import{a as gt,b as tt,d as A,e as _}from"./GPGC63RW.js";import{V as W,W as yt,g as Y,o as k}from"./PILEMW25.js";import"./3TTFCHAA.js";var st=class extends yt{setupDefaultRules(){super.setupDefaultRules();let e=this._root.interfaceColors,t=this.rule.bind(this);t("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:kt.new(this._root,{}),width:A,height:A}),t("PieChart").setAll({radius:tt(80),startAngle:-90,endAngle:270}),t("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),t("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),t("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),t("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),t("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),t("Slice",["pie"]).states.create("hover",{scale:1.04}),t("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),t("Tick",["pie"]).setAll({location:1}),t("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),t("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),t("FunnelSlice").setAll({interactive:!0,expandDistance:0}),t("FunnelSlice").states.create("hover",{expandDistance:.15}),t("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["funnel","vertical"]).setAll({centerY:_,centerX:0}),t("Tick",["funnel"]).setAll({location:1}),t("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),t("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),t("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),t("PyramidSeries").setAll({valueIs:"area"}),t("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),t("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),t("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),t("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),t("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),t("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["pyramid","vertical"]).setAll({centerY:_,centerX:0}),t("Tick",["pyramid"]).setAll({location:1}),t("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),t("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["pictorial","vertical"]).setAll({centerY:_,centerX:0}),t("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),t("Tick",["pictorial"]).setAll({location:.5});{let s=t("Graphics",["pictorial","background"]);s.setAll({fillOpacity:.2}),xt(s,"fill",e,"alternativeBackground")}}};var C=class extends ut{_afterNew(){this._defaultThemes.push(st.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(e){super._processSeries(e),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}};C.className="PercentChart";C.classNames=ut.classNames.concat([C.className]);var L=class extends ct{constructor(){super(...arguments),this.slicesContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this.labelsContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this.ticksContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this._lLabels=[],this._rLabels=[],this._hLabels=[],this.slices=this.addDisposer(this._makeSlices()),this.labels=this.addDisposer(this._makeLabels()),this.ticks=this.addDisposer(this._makeTicks())}_applyThemes(e=!1){let t=this.get("colors");return t&&t.reset(),super._applyThemes(e)}makeSlice(e){let t=this.slicesContainer.children.push(this.slices.make());return t.on("fill",()=>{this.updateLegendMarker(e)}),t.on("fillPattern",()=>{this.updateLegendMarker(e)}),t.on("stroke",()=>{this.updateLegendMarker(e)}),t._setDataItem(e),e.set("slice",t),this.slices.push(t),t}makeLabel(e){let t=this.labelsContainer.children.push(this.labels.make());return t._setDataItem(e),e.set("label",t),this.labels.push(t),t}_shouldMakeBullet(e){return e.get("value")!=null}makeTick(e){let t=this.ticksContainer.children.push(this.ticks.make());return t._setDataItem(e),e.set("tick",t),this.ticks.push(t),t}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){let e=this.get("colors");e&&e.reset();let t=this.get("patterns");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let e=0,t=0,s=0,i=1/0,a=0;k(this._dataItems,l=>{let r=l.get("valueWorking",0);e+=r,t+=Math.abs(r)}),k(this._dataItems,l=>{let r=l.get("valueWorking",0);r>s&&(s=r),r<i&&(i=r),a++;let n=r/t;t==0&&(n=0),l.setRaw("valuePercentTotal",n*100)}),this.setPrivateRaw("valueLow",i),this.setPrivateRaw("valueHigh",s),this.setPrivateRaw("valueSum",e),this.setPrivateRaw("valueAverage",e/a),this.setPrivateRaw("valueAbsoluteSum",t)}}show(e){let t=Object.create(null,{show:{get:()=>super.show}});return z(this,void 0,void 0,function*(){let s=[];s.push(t.show.call(this,e)),s.push(this._sequencedShowHide(!0,e)),yield Promise.all(s)})}hide(e){let t=Object.create(null,{hide:{get:()=>super.hide}});return z(this,void 0,void 0,function*(){let s=[];s.push(t.hide.call(this,e)),s.push(this._sequencedShowHide(!1,e)),yield Promise.all(s)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&k(this._dataItems,e=>{e.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&k(this._dataItems,e=>{this.updateLegendValue(e)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),k(this.dataItems,e=>{this._updateTick(e)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(e){if(super.processDataItem(e),e.get("fill")==null){let t=this.get("colors");t&&e.setRaw("fill",t.next())}if(e.get("fillPattern")==null){let t=this.get("patterns");t&&e.setRaw("fillPattern",t.next())}}showDataItem(e,t){let s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return z(this,void 0,void 0,function*(){let i=[s.showDataItem.call(this,e,t)];Y(t)||(t=this.get("stateAnimationDuration",0));let a=this.get("stateAnimationEasing"),l=e.get("value"),r=e.animate({key:"valueWorking",to:l,duration:t,easing:a});r&&i.push(r.waitForStop());let n=e.get("tick");n&&i.push(n.show(t));let c=e.get("label");c&&i.push(c.show(t));let o=e.get("slice");o&&i.push(o.show(t)),o.get("active")&&o.states.applyAnimate("active"),yield Promise.all(i)})}hideDataItem(e,t){let s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return z(this,void 0,void 0,function*(){let i=[s.hideDataItem.call(this,e,t)],a=this.states.create("hidden",{});Y(t)||(t=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));let l=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=e.animate({key:"valueWorking",to:0,duration:t,easing:l});r&&i.push(r.waitForStop());let n=e.get("tick");n&&i.push(n.hide(t));let c=e.get("label");c&&i.push(c.hide(t));let o=e.get("slice");o.hideTooltip(),o&&i.push(o.hide(t)),yield Promise.all(i)})}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("label");t&&(this.labels.removeValue(t),t.dispose());let s=e.get("tick");s&&(this.ticks.removeValue(s),s.dispose());let i=e.get("slice");i&&(this.slices.removeValue(i),i.dispose())}hoverDataItem(e){let t=e.get("slice");t&&!t.isHidden()&&t.hover()}unhoverDataItem(e){let t=e.get("slice");t&&t.unhover()}updateLegendMarker(e){if(e){let t=e.get("slice");if(t){let s=e.get("legendDataItem");if(s){let i=s.get("markerRectangle");k(ft,a=>{t.get(a)!=null&&i.set(a,t.get(a))})}}}}_arrangeDown(e){if(e){let t=this._getNextDown();e.sort((s,i)=>s.y>i.y?1:s.y<i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.top;s.y+a<t&&(s.y=t-a),s.label.set("y",s.y),t=s.y+i.bottom})}}_getNextUp(){return this.labelsContainer.maxHeight()}_getNextDown(){return 0}_arrangeUp(e){if(e){let t=this._getNextUp();e.sort((s,i)=>s.y<i.y?1:s.y>i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.bottom;s.y+a>t&&(s.y=t-a),s.label.set("y",s.y),t=s.y+i.top})}}_arrangeRight(e){if(e){let t=0;e.sort((s,i)=>s.y>i.y?1:s.y<i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.left;s.y+a<t&&(s.y=t-a),s.label.set("x",s.y),t=s.y+i.right})}}_arrangeLeft(e){if(e){let t=this.labelsContainer.maxWidth();e.sort((s,i)=>s.y<i.y?1:s.y>i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.right;s.y+a>t&&(s.y=t-a),s.label.set("x",s.y),t=s.y+i.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(e){}_dispose(){super._dispose();let e=this.chart;e&&e.series.removeValue(this)}};L.className="PercentSeries";L.classNames=ct.classNames.concat([L.className]);var G=class extends C{constructor(){super(...arguments),this._maxRadius=1}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:_,y:_})}_prepareChildren(){super._prepareChildren();let e=this.chartContainer,t=e.innerWidth(),s=e.innerHeight(),i=this.get("startAngle",0),a=this.get("endAngle",0),l=this.get("innerRadius"),r=ht(0,0,i,a,1),n=t/(r.right-r.left),c=s/(r.bottom-r.top),o={left:0,right:0,top:0,bottom:0};if(l instanceof gt){let p=l.value,g=Math.min(n,c);p=Math.max(g*p,g-Math.min(s,t))/g,o=ht(0,0,i,a,p),this.setPrivateRaw("irModifyer",p/l.value)}r=dt([r,o]);let m=this._maxRadius;this._maxRadius=Math.min(n,c);let h=w(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(r.bottom+r.top)/2,dx:-h*(r.right+r.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||m!=this._maxRadius)&&this.series.each(p=>{p._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(p=>{p._markDirtyKey("innerRadius")})}radius(e){let t=w(this.get("radius",0),this._maxRadius),s=w(this.get("innerRadius",0),t);if(e){let i=this.series.indexOf(e),a=this.series.length,l=e.get("radius");return l!=null?s+w(l,t-s):s+(t-s)/a*(i+1)}return t}innerRadius(e){let t=this.radius(),s=w(this.get("innerRadius",0),t);if(s<0&&(s=t+s),e){let i=this.series.indexOf(e),a=this.series.length,l=e.get("innerRadius");return l!=null?s+w(l,t-s):s+(t-s)/a*i}return s}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}};G.className="PieChart";G.classNames=C.classNames.concat([G.className]);var U=class extends L{_makeSlices(){return new M(W.new({}),()=>vt._new(this._root,{themeTags:R(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new M(W.new({}),()=>bt._new(this._root,{themeTags:R(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new M(W.new({}),()=>lt._new(this._root,{themeTags:R(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(e){super.processDataItem(e);let t=this.makeSlice(e);t.on("scale",()=>{this._updateTick(e)}),t.on("shiftRadius",()=>{this._updateTick(e)}),t.events.on("positionchanged",()=>{this._updateTick(e)});let s=this.makeLabel(e);s.events.on("positionchanged",()=>{this._updateTick(e)}),this.makeTick(e),t.events.on("positionchanged",()=>{s.markDirty()})}_getNextUp(){let e=this.chart;return e?e._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){let e=this.chart;return e?-e._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();let e=this.chart;if(e){if(this.isDirty("alignLabels")){let t=this.labels.template;if(this.get("alignLabels"))t.set("textType","aligned");else{let s=t.get("textType");(s==null||s=="aligned")&&t.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();let t=this.get("startAngle",e.get("startAngle",-90)),i=this.get("endAngle",e.get("endAngle",270))-t,a=t,l=e.radius(this);this.setPrivateRaw("radius",l);let r=e.innerRadius(this)*e.getPrivate("irModifyer",1);r<0&&(r=l+r),k(this._dataItems,n=>{this.updateLegendValue(n);let c=i*n.get("valuePercentTotal")/100,o=n.get("slice");if(o){o.set("radius",l),o.set("innerRadius",r),o.set("startAngle",a),o.set("arc",c);let p=n.get("fill");o._setDefault("fill",p),o._setDefault("stroke",p);let g=n.get("fillPattern");o._setDefault("fillPattern",g)}let m=mt(a+c/2),h=n.get("label");if(h&&(h.setPrivate("radius",l),h.setPrivate("innerRadius",r),h.set("labelAngle",m),h.get("textType")=="aligned")){let p=l+h.get("radius",0),g=l*T(m);m>90&&m<=270?(!h.isHidden()&&!h.isHiding()&&this._lLabels.push({label:h,y:g}),p*=-1,p-=this.labelsContainer.get("paddingLeft",0),h.set("centerX",A),h.setPrivateRaw("left",!0)):(!h.isHidden()&&!h.isHiding()&&this._rLabels.push({label:h,y:g}),p+=this.labelsContainer.get("paddingRight",0),h.set("centerX",0),h.setPrivateRaw("left",!1)),h.set("x",p),h.set("y",l*T(m))}a+=c,this._updateTick(n)})}}}_updateTick(e){let t=e.get("tick"),s=e.get("label"),i=e.get("slice"),a=t.get("location",1);if(t&&s&&i){let l=(i.get("shiftRadius",0)+i.get("radius",0))*i.get("scale",1)*a,r=s.get("labelAngle",0),n=D(r),c=T(r),o=this.labelsContainer,m=o.get("paddingLeft",0),h=o.get("paddingRight",0),p=0,g=0;p=s.x(),g=s.y();let u=[];if(p!=0||g!=0){if(s.get("textType")=="circular"){let y=s.radius()-s.get("paddingBottom",0),x=s.get("labelAngle",0);p=y*D(x),g=y*T(x)}let d=-h;s.getPrivate("left")&&(d=m),u=[{x:i.x()+l*n,y:i.y()+l*c},{x:p+d,y:g},{x:p,y:g}]}t.set("points",u)}}_positionBullet(e){let t=e.get("sprite");if(t){let i=t.dataItem.get("slice");if(i){let a=i.get("innerRadius",0),l=i.get("radius",0),r=i.get("startAngle",0),n=i.get("arc",0),c=e.get("locationX",.5),o=e.get("locationY",.5),m=r+n*c,h=a+(l-a)*o;t.setAll({x:D(m)*h,y:T(m)*h})}}}};U.className="PieSeries";U.classNames=L.classNames.concat([U.className]);var V=class extends q{constructor(){super(...arguments),this._projectionDirty=!1,this._tlx=0,this._tly=0,this._trx=0,this._try=0,this._blx=0,this._bly=0,this._brx=0,this._bry=0,this._cprx=0,this._cplx=0,this._cpry=0,this._cply=0}_afterNew(){super._afterNew(),this.set("draw",e=>{let t=this.width(),s=this.height(),i=Math.min(t,s)/2,a=w(this.get("cornerRadiusTL",0),i),l=w(this.get("cornerRadiusTR",0),i),r=w(this.get("cornerRadiusBR",0),i),n=w(this.get("cornerRadiusBL",0),i),c=this._trx,o=this._try,m=this._tlx,h=this._tly,p=this._brx,g=this._bry,u=this._blx,d=this._bly;o==h&&(o=o-.01),g==d&&(g=g-.01);let y=et({x:m,y:h},{x:c,y:o}),x=et({x:c,y:o},{x:p,y:g}),b=et({x:p,y:g},{x:u,y:d}),f=et({x:u,y:d},{x:m,y:h});this.get("orientation")=="horizontal"?(a=Math.min(a,Math.abs(h-o)/2),l=Math.min(l,Math.abs(h-o)/2),r=Math.min(r,Math.abs(d-g)/2),n=Math.min(n,Math.abs(d-g)/2)):(a=Math.min(a,Math.abs(m-c)/2),l=Math.min(l,Math.abs(m-c)/2),r=Math.min(r,Math.abs(u-p)/2),n=Math.min(n,Math.abs(u-p)/2));let $=m-a*v((y-f)/2)*D(f),P=h-a*v((y-f)/2)*T(f),F=m-a*v((f-y)/2)*D(y),Z=h-a*v((f-y)/2)*T(y),N=c-l*v((x-y)/2)*D(y),nt=o-l*v((x-y)/2)*T(y),B=c-l*v((y-x)/2)*D(x),O=o-l*v((y-x)/2)*T(x),J=p-r*v((b-x)/2)*D(x),j=g-r*v((b-x)/2)*T(x),Q=p-r*v((x-b)/2)*D(b),I=g-r*v((x-b)/2)*T(b),pt=u-n*v((f-b)/2)*D(b),it=d-n*v((f-b)/2)*T(b),ot=u-n*v((b-f)/2)*D(f),Dt=d-n*v((b-f)/2)*T(f);e.moveTo(F,Z),e.lineTo(N,nt),e.arcTo(c,o,B,O,l),e.quadraticCurveTo(this._cprx,this._cpry,J,j),e.arcTo(p,g,Q,I,r),e.lineTo(pt,it),e.arcTo(u,d,ot,Dt,n),e.quadraticCurveTo(this._cplx,this._cply,$,P),e.arcTo(m,h,F,Z,a)})}getPoint(e,t){let s=this.width(),i=this.height(),a=this.get("topWidth",0),l=this.get("bottomWidth",0);if(this.get("orientation")=="vertical"){let r=-a/2,n=a/2,c=l/2,o=-l/2,m=r+(o-r)*t,h=n+(c-n)*t;return{x:m+(h-m)*e,y:i*t}}else{let r=-a/2,n=a/2,c=l/2,o=-l/2,m=r+(o-r)*e,h=n+(c-n)*e;return{x:s*e,y:m+(h-m)*t}}}_changed(){if(this.isDirty("topWidth")||this.isDirty("bottomWidth")||this.isDirty("expandDistance")||this.isDirty("orientation")||this.isDirty("width")||this.isDirty("height")){let e=this.width(),t=this.height(),s=this.get("topWidth",0),i=this.get("bottomWidth",0);this._clear=!0;let a=this.get("expandDistance",0);this.get("orientation")=="vertical"?(this._tlx=-s/2,this._tly=0,this._trx=s/2,this._try=0,this._brx=i/2,this._bry=t,this._blx=-i/2,this._bly=t,this._cprx=this._trx+(this._brx-this._trx)/2+a*t,this._cpry=this._try+.5*t,this._cplx=this._tlx+(this._blx-this._tlx)/2-a*t,this._cply=this._tly+.5*t):(this._tly=s/2,this._tlx=0,this._try=-s/2,this._trx=0,this._bry=-i/2,this._brx=e,this._bly=i/2,this._blx=e,this._cpry=this._try+(this._bry-this._try)/2-a*e,this._cprx=this._trx+.5*e,this._cply=this._tly+(this._bly-this._tly)/2+a*e,this._cplx=this._tlx+.5*e)}super._changed()}};V.className="FunnelSlice";V.classNames=q.classNames.concat([V.className]);var H=class extends L{constructor(){super(...arguments),this._tag="funnel",this.links=this.addDisposer(this._makeLinks()),this._total=0,this._count=0,this._nextCoord=0,this._opposite=!1}_makeSlices(){return new M(W.new({}),()=>V._new(this._root,{themeTags:R(this.slices.template.get("themeTags",[]),[this._tag,"series","slice",this.get("orientation")])},[this.slices.template]))}_makeLabels(){return new M(W.new({}),()=>_t._new(this._root,{themeTags:R(this.labels.template.get("themeTags",[]),[this._tag,"series","label",this.get("orientation")])},[this.labels.template]))}_makeTicks(){return new M(W.new({}),()=>lt._new(this._root,{themeTags:R(this.ticks.template.get("themeTags",[]),[this._tag,"series","tick",this.get("orientation")])},[this.ticks.template]))}_makeLinks(){return new M(W.new({}),()=>V._new(this._root,{themeTags:R(this.links.template.get("themeTags",[]),[this._tag,"series","link",this.get("orientation")])},[this.links.template]))}makeLink(e){let t=this.slicesContainer.children.push(this.links.make());return t._setDataItem(e),e.set("link",t),this.links.push(t),t}_afterNew(){super._afterNew();let e=this.slicesContainer;e.setAll({isMeasured:!0,position:"relative",width:tt(100),height:tt(100)}),e.onPrivate("width",()=>{this.markDirtySize()}),e.onPrivate("height",()=>{this.markDirtySize()}),this.get("orientation")=="vertical"?this.set("layout",this._root.horizontalLayout):this.set("layout",this._root.verticalLayout)}processDataItem(e){super.processDataItem(e);let t=this.makeSlice(e);t._setDataItem(e),e.set("slice",t),this.makeLink(e);let s=this.makeLabel(e);s.on("x",()=>{this._updateTick(e)}),s.on("y",()=>{this._updateTick(e)}),this.makeTick(e),t.events.on("positionchanged",()=>{s.markDirty()}),t.events.on("boundschanged",()=>{let i=t.dataItem;i&&this._updateTick(i)})}_updateChildren(){this._opposite=!1,this.children.indexOf(this.labelsContainer)==0&&(this._opposite=!0);let e=0,t=0;if(k(this.dataItems,s=>{let i=s.get("value");Y(i)&&(t++,i>0?e+=Math.abs(s.get("valueWorking",i)/i):this.get("ignoreZeroValues",!1)||s.isHidden()?t--:e+=1)}),this._total=1/t*e,this._count=t,this.isDirty("alignLabels")&&this._fixLayout(),this._total>0&&(this._valuesDirty||this._sizeDirty)){let s=this.slicesContainer,i;this.get("orientation")=="vertical"?i=s.innerHeight():i=s.innerWidth(),this._nextCoord=this.get("startLocation",0)*i,this.markDirtyBounds();let a=0;k(this._dataItems,l=>{this.updateLegendValue(l),l.set("index",a),a++;let r=l.get("slice"),n=l.get("tick"),c=l.get("label"),o=l.get("link"),m=l.get("fill"),h=l.get("fillPattern");r._setDefault("fill",m),r._setDefault("stroke",m),r._setDefault("fillPattern",h),o._setDefault("fill",m),o._setDefault("stroke",m);let p=l.get("value");Y(p)&&(p==0&&this.get("ignoreZeroValues")?(r.setPrivate("visible",!1),n.setPrivate("visible",!1),c.setPrivate("visible",!1)):(r.setPrivate("visible",!0),n.setPrivate("visible",!0),c.setPrivate("visible",!0),this.decorateSlice(l),this.isLast(l)?o.setPrivate("visible",!1):l.isHidden()||o.setPrivate("visible",!0)))})}super._updateChildren()}_fixLayout(){let e=this.get("orientation"),t=this.labelsContainer,s=this.labels.template;this.get("alignLabels")?(t.set("position","relative"),t.setAll({isMeasured:!0}),e=="vertical"?(this.set("layout",this._root.horizontalLayout),s.setAll({centerX:A,x:A})):(this.set("layout",this._root.verticalLayout),s.setAll({centerX:0,x:0}))):(t.setAll({isMeasured:!1,position:"absolute"}),e=="vertical"?(t.setAll({x:_}),s.setAll({centerX:_,x:0})):(t.setAll({y:_}),s.setAll({centerX:_,y:0}))),this.markDirtySize()}getNextValue(e){let t=e.get("index"),s=e.get("valueWorking",0);if(t<this.dataItems.length-1){let i=this.dataItems[t+1];if(s=i.get("valueWorking",0),i.isHidden()||i.get("value")==0&&this.get("ignoreZeroValues"))return this.getNextValue(i)}return s}isLast(e){let t=e.get("index");if(t==this.dataItems.length-1)return!0;for(let s=t+1;s<this.dataItems.length;s++)if(!this.dataItems[s].isHidden())return!1;return!0}decorateSlice(e){let t=this.get("orientation"),s=e.get("slice"),i=e.get("label"),a=e.get("link"),l=this.slicesContainer,r=l.innerWidth(),n=l.innerHeight(),c=r;t=="horizontal"&&(c=n);let o=this.getNextValue(e),m=e.get("value",0),h=Math.abs(e.get("valueWorking",m)),p=this.get("bottomRatio",0),g=this.getPrivate("valueHigh",0),u=1;m!=0?u=h/Math.abs(m):e.isHidden()&&(u=1e-6),this._nextCoord==1/0&&(this._nextCoord=0);let d=h/g*c,y=(h-(h-o)*p)/g*c;s.setAll({topWidth:d,bottomWidth:y,orientation:t}),a.setAll({topWidth:y,bottomWidth:(h-(h-o))/g*c,orientation:t});let x=this.get("startLocation",0),b=this.get("endLocation",1);if(t=="vertical"){let f=a.height()*u;n=n*(b-x)+f,s.set("y",this._nextCoord);let $=Math.min(1e5,Math.max(0,n/this._count*u/this._total-f));s.setAll({height:$,x:r/2});let P=this._nextCoord+$/2;i.set("y",P),this._nextCoord+=$+f,a.setAll({y:this._nextCoord-f,x:r/2})}else{let f=a.width()*u;r=r*(b-x)+f,s.set("x",this._nextCoord);let $=Math.min(1e5,Math.max(0,r/this._count*u/this._total-f));s.setAll({width:$,y:n/2});let P=this._nextCoord+$/2;i.set("x",P),this._nextCoord+=$+f,a.setAll({x:this._nextCoord-f,y:n/2})}}hideDataItem(e,t){let s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return z(this,void 0,void 0,function*(){return e.get("link").hide(t),s.hideDataItem.call(this,e,t)})}showDataItem(e,t){let s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return z(this,void 0,void 0,function*(){return e.get("link").show(t),s.showDataItem.call(this,e,t)})}_updateTick(e){if(this.get("alignLabels")){let t=e.get("tick"),s=e.get("label"),i=e.get("slice");if(t&&i&&s){let a=this.labelsContainer,l=this.slicesContainer,r=t.get("location",.5),n=a.width(),c=a.height(),o=a.get("paddingLeft",0),m=a.get("paddingRight",0),h=a.get("paddingTop",0),p=a.get("paddingBottom",0),g={x:0,y:0},u={x:0,y:0},d={x:0,y:0};this._opposite&&(r=1-r),this.get("orientation")=="vertical"?(g=i.getPoint(r,.5),g.x+=i.x()+l.x(),g.y+=i.y()+l.y(),this._opposite?(u.x=n,u.y=s.y(),d.x=n-o,d.y=u.y):(u.x=l.x()+l.width(),u.y=s.y(),d.x=u.x+n-s.width()-m,d.y=u.y)):(g=i.getPoint(.5,r),g.x+=i.x()+l.x(),g.y+=i.y()+l.y(),this._opposite?(u.y=c,u.x=s.x(),d.y=c-h,d.x=u.x):(u.y=l.y()+l.height(),u.x=s.x(),d.y=u.y+c-s.height()-p,d.x=u.x)),t.set("points",[g,u,d])}}}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("link");t&&(this.links.removeValue(t),t.dispose())}_positionBullet(e){let t=e.get("sprite");if(t){let i=t.dataItem.get("slice");if(i){let a=i.width(),l=i.height(),r=e.get("locationX",.5),n=e.get("locationY",.5),c=0,o=0;this.get("orientation")=="horizontal"?o=l/2:c=a/2,t.setAll({x:i.x()+a*r-c,y:i.y()-o+l*n})}}}};H.className="FunnelSeries";H.classNames=L.classNames.concat([H.className]);var X=class extends H{constructor(){super(...arguments),this._tag="pyramid"}_prepareChildren(){super._prepareChildren(),this._nextSize=void 0}decorateSlice(e){let t=this.get("orientation"),s=this.slicesContainer,i=e.get("slice"),a=e.get("label"),l=e.get("link"),r=this.get("valueIs","area"),n=this.getPrivate("valueAbsoluteSum",0);if(n==0)return;let c=this.get("startLocation",0),o=this.get("endLocation",1),m=this.get("topWidth",0),h=this.get("bottomWidth",A),p=Math.abs(e.get("valueWorking",0)),g=e.get("value",0),u,d,y=s.innerHeight(),x=s.innerWidth(),b=l.width(),f=l.height();t=="horizontal"&&([x,y]=[y,x],[b,f]=[f,b]);let $=x/2,P=1;g!=0?P=p/Math.abs(g):e.isHidden()&&(P=1e-6),f*=P,y=y*(o-c)-f*(this._count*this._total-1);let F=w(m,x);Y(this._nextSize)||(this._nextSize=F);let Z=w(h,x),N=this._nextSize,nt=Math.atan2(y,F-Z),B=Math.tan(Math.PI/2-nt);if(B==0&&(B=1e-8),r=="area"){let it=(F+Z)/2*y*p/n,ot=Math.abs(N*N-2*it*B);u=(N-Math.sqrt(ot))/B,u>0?d=(2*it-u*N)/u:d=N}else u=y*p/n,d=N-u*B;let O=this._nextCoord+u/2,J=$,j=this._nextCoord,Q=$,I=j+u;t=="vertical"?(a.set("y",O),a.get("opacity")>0&&this._rLabels.push({label:a,y:O}),i.set("height",u)):(a.set("x",O),a.get("opacity")>0&&this._hLabels.push({label:a,y:O}),[J,j]=[j,J],[Q,I]=[I,Q],i.set("width",u)),i.setAll({orientation:t,bottomWidth:d,topWidth:N,x:J,y:j}),l.setAll({orientation:t,x:Q,y:I,topWidth:d,bottomWidth:d}),this._nextSize=d,this._nextCoord+=u+f}};X.className="PyramidSeries";X.classNames=H.classNames.concat([X.className]);var K=class extends X{constructor(){super(...arguments),this._tag="pictorial",this.seriesMask=q.new(this._root,{position:"absolute",x:_,y:_,centerX:_,centerY:_}),this.seriesGraphics=this.slicesContainer.children.push(q.new(this._root,{themeTags:["pictorial","background"],position:"absolute",x:_,y:_,centerX:_,centerY:_}))}_afterNew(){super._afterNew(),this.set("topWidth",A),this.set("bottomWidth",A),this.set("valueIs","height"),this.slicesContainer.set("mask",this.seriesMask)}_updateScale(){let e=this.slicesContainer,t=e.innerWidth(),s=e.innerHeight(),i=this.seriesMask,a=this.seriesGraphics,l=i.get("scale",1),r=i.localBounds(),n=r.right-r.left,c=r.bottom-r.top;this.get("orientation")=="horizontal"?l=t/n:l=s/c,l!=1/0&&l!=NaN&&(i.set("scale",l),i.set("x",t/2),i.set("y",s/2),a.set("scale",l),a.set("x",t/2),a.set("y",s/2))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("svgPath")){let e=this.get("svgPath");this.seriesMask.set("svgPath",e),this.seriesGraphics.set("svgPath",e)}this._updateScale()}};K.className="PictorialStackedSeries";K.classNames=X.classNames.concat([K.className]);var E=class extends C{_afterNew(){super._afterNew(),this.seriesContainer.setAll({isMeasured:!0,layout:this._root.horizontalLayout})}};E.className="SlicedChart";E.classNames=C.classNames.concat([E.className]);export{st as DefaultTheme,H as FunnelSeries,V as FunnelSlice,C as PercentChart,L as PercentSeries,K as PictorialStackedSeries,G as PieChart,U as PieSeries,X as PyramidSeries,E as SlicedChart};
|
|
2
|
+
import{a as vt}from"./A2QPYUE5.js";import{D as ft,E as q,P as at,R as _t,S as xt,c as M,ga as ct,i as T,j as v,ja as bt,k as D,l as mt,m as ht,n as dt,o as et,qa as ut,ra as lt,sa as kt}from"./FWXI6DGS.js";import{N as R,a as z,u as w}from"./P2ABZVPJ.js";import{a as gt,b as tt,d as A,e as _}from"./XEXCDGSR.js";import{V as W,W as yt,g as Y,o as k}from"./DQH27QCF.js";import"./3TTFCHAA.js";var st=class extends yt{setupDefaultRules(){super.setupDefaultRules();let e=this._root.interfaceColors,t=this.rule.bind(this);t("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:kt.new(this._root,{}),width:A,height:A}),t("PieChart").setAll({radius:tt(80),startAngle:-90,endAngle:270}),t("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),t("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),t("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),t("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),t("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),t("Slice",["pie"]).states.create("hover",{scale:1.04}),t("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),t("Tick",["pie"]).setAll({location:1}),t("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),t("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),t("FunnelSlice").setAll({interactive:!0,expandDistance:0}),t("FunnelSlice").states.create("hover",{expandDistance:.15}),t("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["funnel","vertical"]).setAll({centerY:_,centerX:0}),t("Tick",["funnel"]).setAll({location:1}),t("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),t("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),t("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),t("PyramidSeries").setAll({valueIs:"area"}),t("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),t("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),t("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),t("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),t("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),t("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["pyramid","vertical"]).setAll({centerY:_,centerX:0}),t("Tick",["pyramid"]).setAll({location:1}),t("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),t("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:_}),t("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:_,rotation:-90}),t("Label",["pictorial","vertical"]).setAll({centerY:_,centerX:0}),t("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),t("Tick",["pictorial"]).setAll({location:.5});{let s=t("Graphics",["pictorial","background"]);s.setAll({fillOpacity:.2}),xt(s,"fill",e,"alternativeBackground")}}};var C=class extends ut{_afterNew(){this._defaultThemes.push(st.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(e){super._processSeries(e),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}};C.className="PercentChart";C.classNames=ut.classNames.concat([C.className]);var L=class extends ct{constructor(){super(...arguments),this.slicesContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this.labelsContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this.ticksContainer=this.children.push(at.new(this._root,{position:"absolute",isMeasured:!1})),this._lLabels=[],this._rLabels=[],this._hLabels=[],this.slices=this.addDisposer(this._makeSlices()),this.labels=this.addDisposer(this._makeLabels()),this.ticks=this.addDisposer(this._makeTicks())}_applyThemes(e=!1){let t=this.get("colors");return t&&t.reset(),super._applyThemes(e)}makeSlice(e){let t=this.slicesContainer.children.push(this.slices.make());return t.on("fill",()=>{this.updateLegendMarker(e)}),t.on("fillPattern",()=>{this.updateLegendMarker(e)}),t.on("stroke",()=>{this.updateLegendMarker(e)}),t._setDataItem(e),e.set("slice",t),this.slices.push(t),t}makeLabel(e){let t=this.labelsContainer.children.push(this.labels.make());return t._setDataItem(e),e.set("label",t),this.labels.push(t),t}_shouldMakeBullet(e){return e.get("value")!=null}makeTick(e){let t=this.ticksContainer.children.push(this.ticks.make());return t._setDataItem(e),e.set("tick",t),this.ticks.push(t),t}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){let e=this.get("colors");e&&e.reset();let t=this.get("patterns");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let e=0,t=0,s=0,i=1/0,a=0;k(this._dataItems,l=>{let r=l.get("valueWorking",0);e+=r,t+=Math.abs(r)}),k(this._dataItems,l=>{let r=l.get("valueWorking",0);r>s&&(s=r),r<i&&(i=r),a++;let n=r/t;t==0&&(n=0),l.setRaw("valuePercentTotal",n*100)}),this.setPrivateRaw("valueLow",i),this.setPrivateRaw("valueHigh",s),this.setPrivateRaw("valueSum",e),this.setPrivateRaw("valueAverage",e/a),this.setPrivateRaw("valueAbsoluteSum",t)}}show(e){let t=Object.create(null,{show:{get:()=>super.show}});return z(this,void 0,void 0,function*(){let s=[];s.push(t.show.call(this,e)),s.push(this._sequencedShowHide(!0,e)),yield Promise.all(s)})}hide(e){let t=Object.create(null,{hide:{get:()=>super.hide}});return z(this,void 0,void 0,function*(){let s=[];s.push(t.hide.call(this,e)),s.push(this._sequencedShowHide(!1,e)),yield Promise.all(s)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&k(this._dataItems,e=>{e.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&k(this._dataItems,e=>{this.updateLegendValue(e)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),k(this.dataItems,e=>{this._updateTick(e)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(e){if(super.processDataItem(e),e.get("fill")==null){let t=this.get("colors");t&&e.setRaw("fill",t.next())}if(e.get("fillPattern")==null){let t=this.get("patterns");t&&e.setRaw("fillPattern",t.next())}}showDataItem(e,t){let s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return z(this,void 0,void 0,function*(){let i=[s.showDataItem.call(this,e,t)];Y(t)||(t=this.get("stateAnimationDuration",0));let a=this.get("stateAnimationEasing"),l=e.get("value"),r=e.animate({key:"valueWorking",to:l,duration:t,easing:a});r&&i.push(r.waitForStop());let n=e.get("tick");n&&i.push(n.show(t));let c=e.get("label");c&&i.push(c.show(t));let o=e.get("slice");o&&i.push(o.show(t)),o.get("active")&&o.states.applyAnimate("active"),yield Promise.all(i)})}hideDataItem(e,t){let s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return z(this,void 0,void 0,function*(){let i=[s.hideDataItem.call(this,e,t)],a=this.states.create("hidden",{});Y(t)||(t=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));let l=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=e.animate({key:"valueWorking",to:0,duration:t,easing:l});r&&i.push(r.waitForStop());let n=e.get("tick");n&&i.push(n.hide(t));let c=e.get("label");c&&i.push(c.hide(t));let o=e.get("slice");o.hideTooltip(),o&&i.push(o.hide(t)),yield Promise.all(i)})}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("label");t&&(this.labels.removeValue(t),t.dispose());let s=e.get("tick");s&&(this.ticks.removeValue(s),s.dispose());let i=e.get("slice");i&&(this.slices.removeValue(i),i.dispose())}hoverDataItem(e){let t=e.get("slice");t&&!t.isHidden()&&t.hover()}unhoverDataItem(e){let t=e.get("slice");t&&t.unhover()}updateLegendMarker(e){if(e){let t=e.get("slice");if(t){let s=e.get("legendDataItem");if(s){let i=s.get("markerRectangle");k(ft,a=>{t.get(a)!=null&&i.set(a,t.get(a))})}}}}_arrangeDown(e){if(e){let t=this._getNextDown();e.sort((s,i)=>s.y>i.y?1:s.y<i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.top;s.y+a<t&&(s.y=t-a),s.label.set("y",s.y),t=s.y+i.bottom})}}_getNextUp(){return this.labelsContainer.maxHeight()}_getNextDown(){return 0}_arrangeUp(e){if(e){let t=this._getNextUp();e.sort((s,i)=>s.y<i.y?1:s.y>i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.bottom;s.y+a>t&&(s.y=t-a),s.label.set("y",s.y),t=s.y+i.top})}}_arrangeRight(e){if(e){let t=0;e.sort((s,i)=>s.y>i.y?1:s.y<i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.left;s.y+a<t&&(s.y=t-a),s.label.set("x",s.y),t=s.y+i.right})}}_arrangeLeft(e){if(e){let t=this.labelsContainer.maxWidth();e.sort((s,i)=>s.y<i.y?1:s.y>i.y?-1:0),k(e,s=>{let i=s.label.adjustedLocalBounds(),a=i.right;s.y+a>t&&(s.y=t-a),s.label.set("x",s.y),t=s.y+i.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(e){}_dispose(){super._dispose();let e=this.chart;e&&e.series.removeValue(this)}};L.className="PercentSeries";L.classNames=ct.classNames.concat([L.className]);var G=class extends C{constructor(){super(...arguments),this._maxRadius=1}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:_,y:_})}_prepareChildren(){super._prepareChildren();let e=this.chartContainer,t=e.innerWidth(),s=e.innerHeight(),i=this.get("startAngle",0),a=this.get("endAngle",0),l=this.get("innerRadius"),r=ht(0,0,i,a,1),n=t/(r.right-r.left),c=s/(r.bottom-r.top),o={left:0,right:0,top:0,bottom:0};if(l instanceof gt){let p=l.value,g=Math.min(n,c);p=Math.max(g*p,g-Math.min(s,t))/g,o=ht(0,0,i,a,p),this.setPrivateRaw("irModifyer",p/l.value)}r=dt([r,o]);let m=this._maxRadius;this._maxRadius=Math.min(n,c);let h=w(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(r.bottom+r.top)/2,dx:-h*(r.right+r.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||m!=this._maxRadius)&&this.series.each(p=>{p._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(p=>{p._markDirtyKey("innerRadius")})}radius(e){let t=w(this.get("radius",0),this._maxRadius),s=w(this.get("innerRadius",0),t);if(e){let i=this.series.indexOf(e),a=this.series.length,l=e.get("radius");return l!=null?s+w(l,t-s):s+(t-s)/a*(i+1)}return t}innerRadius(e){let t=this.radius(),s=w(this.get("innerRadius",0),t);if(s<0&&(s=t+s),e){let i=this.series.indexOf(e),a=this.series.length,l=e.get("innerRadius");return l!=null?s+w(l,t-s):s+(t-s)/a*i}return s}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}};G.className="PieChart";G.classNames=C.classNames.concat([G.className]);var U=class extends L{_makeSlices(){return new M(W.new({}),()=>vt._new(this._root,{themeTags:R(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new M(W.new({}),()=>bt._new(this._root,{themeTags:R(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new M(W.new({}),()=>lt._new(this._root,{themeTags:R(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(e){super.processDataItem(e);let t=this.makeSlice(e);t.on("scale",()=>{this._updateTick(e)}),t.on("shiftRadius",()=>{this._updateTick(e)}),t.events.on("positionchanged",()=>{this._updateTick(e)});let s=this.makeLabel(e);s.events.on("positionchanged",()=>{this._updateTick(e)}),this.makeTick(e),t.events.on("positionchanged",()=>{s.markDirty()})}_getNextUp(){let e=this.chart;return e?e._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){let e=this.chart;return e?-e._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();let e=this.chart;if(e){if(this.isDirty("alignLabels")){let t=this.labels.template;if(this.get("alignLabels"))t.set("textType","aligned");else{let s=t.get("textType");(s==null||s=="aligned")&&t.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();let t=this.get("startAngle",e.get("startAngle",-90)),i=this.get("endAngle",e.get("endAngle",270))-t,a=t,l=e.radius(this);this.setPrivateRaw("radius",l);let r=e.innerRadius(this)*e.getPrivate("irModifyer",1);r<0&&(r=l+r),k(this._dataItems,n=>{this.updateLegendValue(n);let c=i*n.get("valuePercentTotal")/100,o=n.get("slice");if(o){o.set("radius",l),o.set("innerRadius",r),o.set("startAngle",a),o.set("arc",c);let p=n.get("fill");o._setDefault("fill",p),o._setDefault("stroke",p);let g=n.get("fillPattern");o._setDefault("fillPattern",g)}let m=mt(a+c/2),h=n.get("label");if(h&&(h.setPrivate("radius",l),h.setPrivate("innerRadius",r),h.set("labelAngle",m),h.get("textType")=="aligned")){let p=l+h.get("radius",0),g=l*T(m);m>90&&m<=270?(!h.isHidden()&&!h.isHiding()&&this._lLabels.push({label:h,y:g}),p*=-1,p-=this.labelsContainer.get("paddingLeft",0),h.set("centerX",A),h.setPrivateRaw("left",!0)):(!h.isHidden()&&!h.isHiding()&&this._rLabels.push({label:h,y:g}),p+=this.labelsContainer.get("paddingRight",0),h.set("centerX",0),h.setPrivateRaw("left",!1)),h.set("x",p),h.set("y",l*T(m))}a+=c,this._updateTick(n)})}}}_updateTick(e){let t=e.get("tick"),s=e.get("label"),i=e.get("slice"),a=t.get("location",1);if(t&&s&&i){let l=(i.get("shiftRadius",0)+i.get("radius",0))*i.get("scale",1)*a,r=s.get("labelAngle",0),n=D(r),c=T(r),o=this.labelsContainer,m=o.get("paddingLeft",0),h=o.get("paddingRight",0),p=0,g=0;p=s.x(),g=s.y();let u=[];if(p!=0||g!=0){if(s.get("textType")=="circular"){let y=s.radius()-s.get("paddingBottom",0),x=s.get("labelAngle",0);p=y*D(x),g=y*T(x)}let d=-h;s.getPrivate("left")&&(d=m),u=[{x:i.x()+l*n,y:i.y()+l*c},{x:p+d,y:g},{x:p,y:g}]}t.set("points",u)}}_positionBullet(e){let t=e.get("sprite");if(t){let i=t.dataItem.get("slice");if(i){let a=i.get("innerRadius",0),l=i.get("radius",0),r=i.get("startAngle",0),n=i.get("arc",0),c=e.get("locationX",.5),o=e.get("locationY",.5),m=r+n*c,h=a+(l-a)*o;t.setAll({x:D(m)*h,y:T(m)*h})}}}};U.className="PieSeries";U.classNames=L.classNames.concat([U.className]);var V=class extends q{constructor(){super(...arguments),this._projectionDirty=!1,this._tlx=0,this._tly=0,this._trx=0,this._try=0,this._blx=0,this._bly=0,this._brx=0,this._bry=0,this._cprx=0,this._cplx=0,this._cpry=0,this._cply=0}_afterNew(){super._afterNew(),this.set("draw",e=>{let t=this.width(),s=this.height(),i=Math.min(t,s)/2,a=w(this.get("cornerRadiusTL",0),i),l=w(this.get("cornerRadiusTR",0),i),r=w(this.get("cornerRadiusBR",0),i),n=w(this.get("cornerRadiusBL",0),i),c=this._trx,o=this._try,m=this._tlx,h=this._tly,p=this._brx,g=this._bry,u=this._blx,d=this._bly;o==h&&(o=o-.01),g==d&&(g=g-.01);let y=et({x:m,y:h},{x:c,y:o}),x=et({x:c,y:o},{x:p,y:g}),b=et({x:p,y:g},{x:u,y:d}),f=et({x:u,y:d},{x:m,y:h});this.get("orientation")=="horizontal"?(a=Math.min(a,Math.abs(h-o)/2),l=Math.min(l,Math.abs(h-o)/2),r=Math.min(r,Math.abs(d-g)/2),n=Math.min(n,Math.abs(d-g)/2)):(a=Math.min(a,Math.abs(m-c)/2),l=Math.min(l,Math.abs(m-c)/2),r=Math.min(r,Math.abs(u-p)/2),n=Math.min(n,Math.abs(u-p)/2));let $=m-a*v((y-f)/2)*D(f),P=h-a*v((y-f)/2)*T(f),F=m-a*v((f-y)/2)*D(y),Z=h-a*v((f-y)/2)*T(y),N=c-l*v((x-y)/2)*D(y),nt=o-l*v((x-y)/2)*T(y),B=c-l*v((y-x)/2)*D(x),O=o-l*v((y-x)/2)*T(x),J=p-r*v((b-x)/2)*D(x),j=g-r*v((b-x)/2)*T(x),Q=p-r*v((x-b)/2)*D(b),I=g-r*v((x-b)/2)*T(b),pt=u-n*v((f-b)/2)*D(b),it=d-n*v((f-b)/2)*T(b),ot=u-n*v((b-f)/2)*D(f),Dt=d-n*v((b-f)/2)*T(f);e.moveTo(F,Z),e.lineTo(N,nt),e.arcTo(c,o,B,O,l),e.quadraticCurveTo(this._cprx,this._cpry,J,j),e.arcTo(p,g,Q,I,r),e.lineTo(pt,it),e.arcTo(u,d,ot,Dt,n),e.quadraticCurveTo(this._cplx,this._cply,$,P),e.arcTo(m,h,F,Z,a)})}getPoint(e,t){let s=this.width(),i=this.height(),a=this.get("topWidth",0),l=this.get("bottomWidth",0);if(this.get("orientation")=="vertical"){let r=-a/2,n=a/2,c=l/2,o=-l/2,m=r+(o-r)*t,h=n+(c-n)*t;return{x:m+(h-m)*e,y:i*t}}else{let r=-a/2,n=a/2,c=l/2,o=-l/2,m=r+(o-r)*e,h=n+(c-n)*e;return{x:s*e,y:m+(h-m)*t}}}_changed(){if(this.isDirty("topWidth")||this.isDirty("bottomWidth")||this.isDirty("expandDistance")||this.isDirty("orientation")||this.isDirty("width")||this.isDirty("height")){let e=this.width(),t=this.height(),s=this.get("topWidth",0),i=this.get("bottomWidth",0);this._clear=!0;let a=this.get("expandDistance",0);this.get("orientation")=="vertical"?(this._tlx=-s/2,this._tly=0,this._trx=s/2,this._try=0,this._brx=i/2,this._bry=t,this._blx=-i/2,this._bly=t,this._cprx=this._trx+(this._brx-this._trx)/2+a*t,this._cpry=this._try+.5*t,this._cplx=this._tlx+(this._blx-this._tlx)/2-a*t,this._cply=this._tly+.5*t):(this._tly=s/2,this._tlx=0,this._try=-s/2,this._trx=0,this._bry=-i/2,this._brx=e,this._bly=i/2,this._blx=e,this._cpry=this._try+(this._bry-this._try)/2-a*e,this._cprx=this._trx+.5*e,this._cply=this._tly+(this._bly-this._tly)/2+a*e,this._cplx=this._tlx+.5*e)}super._changed()}};V.className="FunnelSlice";V.classNames=q.classNames.concat([V.className]);var H=class extends L{constructor(){super(...arguments),this._tag="funnel",this.links=this.addDisposer(this._makeLinks()),this._total=0,this._count=0,this._nextCoord=0,this._opposite=!1}_makeSlices(){return new M(W.new({}),()=>V._new(this._root,{themeTags:R(this.slices.template.get("themeTags",[]),[this._tag,"series","slice",this.get("orientation")])},[this.slices.template]))}_makeLabels(){return new M(W.new({}),()=>_t._new(this._root,{themeTags:R(this.labels.template.get("themeTags",[]),[this._tag,"series","label",this.get("orientation")])},[this.labels.template]))}_makeTicks(){return new M(W.new({}),()=>lt._new(this._root,{themeTags:R(this.ticks.template.get("themeTags",[]),[this._tag,"series","tick",this.get("orientation")])},[this.ticks.template]))}_makeLinks(){return new M(W.new({}),()=>V._new(this._root,{themeTags:R(this.links.template.get("themeTags",[]),[this._tag,"series","link",this.get("orientation")])},[this.links.template]))}makeLink(e){let t=this.slicesContainer.children.push(this.links.make());return t._setDataItem(e),e.set("link",t),this.links.push(t),t}_afterNew(){super._afterNew();let e=this.slicesContainer;e.setAll({isMeasured:!0,position:"relative",width:tt(100),height:tt(100)}),e.onPrivate("width",()=>{this.markDirtySize()}),e.onPrivate("height",()=>{this.markDirtySize()}),this.get("orientation")=="vertical"?this.set("layout",this._root.horizontalLayout):this.set("layout",this._root.verticalLayout)}processDataItem(e){super.processDataItem(e);let t=this.makeSlice(e);t._setDataItem(e),e.set("slice",t),this.makeLink(e);let s=this.makeLabel(e);s.on("x",()=>{this._updateTick(e)}),s.on("y",()=>{this._updateTick(e)}),this.makeTick(e),t.events.on("positionchanged",()=>{s.markDirty()}),t.events.on("boundschanged",()=>{let i=t.dataItem;i&&this._updateTick(i)})}_updateChildren(){this._opposite=!1,this.children.indexOf(this.labelsContainer)==0&&(this._opposite=!0);let e=0,t=0;if(k(this.dataItems,s=>{let i=s.get("value");Y(i)&&(t++,i>0?e+=Math.abs(s.get("valueWorking",i)/i):this.get("ignoreZeroValues",!1)||s.isHidden()?t--:e+=1)}),this._total=1/t*e,this._count=t,this.isDirty("alignLabels")&&this._fixLayout(),this._total>0&&(this._valuesDirty||this._sizeDirty)){let s=this.slicesContainer,i;this.get("orientation")=="vertical"?i=s.innerHeight():i=s.innerWidth(),this._nextCoord=this.get("startLocation",0)*i,this.markDirtyBounds();let a=0;k(this._dataItems,l=>{this.updateLegendValue(l),l.set("index",a),a++;let r=l.get("slice"),n=l.get("tick"),c=l.get("label"),o=l.get("link"),m=l.get("fill"),h=l.get("fillPattern");r._setDefault("fill",m),r._setDefault("stroke",m),r._setDefault("fillPattern",h),o._setDefault("fill",m),o._setDefault("stroke",m);let p=l.get("value");Y(p)&&(p==0&&this.get("ignoreZeroValues")?(r.setPrivate("visible",!1),n.setPrivate("visible",!1),c.setPrivate("visible",!1)):(r.setPrivate("visible",!0),n.setPrivate("visible",!0),c.setPrivate("visible",!0),this.decorateSlice(l),this.isLast(l)?o.setPrivate("visible",!1):l.isHidden()||o.setPrivate("visible",!0)))})}super._updateChildren()}_fixLayout(){let e=this.get("orientation"),t=this.labelsContainer,s=this.labels.template;this.get("alignLabels")?(t.set("position","relative"),t.setAll({isMeasured:!0}),e=="vertical"?(this.set("layout",this._root.horizontalLayout),s.setAll({centerX:A,x:A})):(this.set("layout",this._root.verticalLayout),s.setAll({centerX:0,x:0}))):(t.setAll({isMeasured:!1,position:"absolute"}),e=="vertical"?(t.setAll({x:_}),s.setAll({centerX:_,x:0})):(t.setAll({y:_}),s.setAll({centerX:_,y:0}))),this.markDirtySize()}getNextValue(e){let t=e.get("index"),s=e.get("valueWorking",0);if(t<this.dataItems.length-1){let i=this.dataItems[t+1];if(s=i.get("valueWorking",0),i.isHidden()||i.get("value")==0&&this.get("ignoreZeroValues"))return this.getNextValue(i)}return s}isLast(e){let t=e.get("index");if(t==this.dataItems.length-1)return!0;for(let s=t+1;s<this.dataItems.length;s++)if(!this.dataItems[s].isHidden())return!1;return!0}decorateSlice(e){let t=this.get("orientation"),s=e.get("slice"),i=e.get("label"),a=e.get("link"),l=this.slicesContainer,r=l.innerWidth(),n=l.innerHeight(),c=r;t=="horizontal"&&(c=n);let o=this.getNextValue(e),m=e.get("value",0),h=Math.abs(e.get("valueWorking",m)),p=this.get("bottomRatio",0),g=this.getPrivate("valueHigh",0),u=1;m!=0?u=h/Math.abs(m):e.isHidden()&&(u=1e-6),this._nextCoord==1/0&&(this._nextCoord=0);let d=h/g*c,y=(h-(h-o)*p)/g*c;s.setAll({topWidth:d,bottomWidth:y,orientation:t}),a.setAll({topWidth:y,bottomWidth:(h-(h-o))/g*c,orientation:t});let x=this.get("startLocation",0),b=this.get("endLocation",1);if(t=="vertical"){let f=a.height()*u;n=n*(b-x)+f,s.set("y",this._nextCoord);let $=Math.min(1e5,Math.max(0,n/this._count*u/this._total-f));s.setAll({height:$,x:r/2});let P=this._nextCoord+$/2;i.set("y",P),this._nextCoord+=$+f,a.setAll({y:this._nextCoord-f,x:r/2})}else{let f=a.width()*u;r=r*(b-x)+f,s.set("x",this._nextCoord);let $=Math.min(1e5,Math.max(0,r/this._count*u/this._total-f));s.setAll({width:$,y:n/2});let P=this._nextCoord+$/2;i.set("x",P),this._nextCoord+=$+f,a.setAll({x:this._nextCoord-f,y:n/2})}}hideDataItem(e,t){let s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return z(this,void 0,void 0,function*(){return e.get("link").hide(t),s.hideDataItem.call(this,e,t)})}showDataItem(e,t){let s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return z(this,void 0,void 0,function*(){return e.get("link").show(t),s.showDataItem.call(this,e,t)})}_updateTick(e){if(this.get("alignLabels")){let t=e.get("tick"),s=e.get("label"),i=e.get("slice");if(t&&i&&s){let a=this.labelsContainer,l=this.slicesContainer,r=t.get("location",.5),n=a.width(),c=a.height(),o=a.get("paddingLeft",0),m=a.get("paddingRight",0),h=a.get("paddingTop",0),p=a.get("paddingBottom",0),g={x:0,y:0},u={x:0,y:0},d={x:0,y:0};this._opposite&&(r=1-r),this.get("orientation")=="vertical"?(g=i.getPoint(r,.5),g.x+=i.x()+l.x(),g.y+=i.y()+l.y(),this._opposite?(u.x=n,u.y=s.y(),d.x=n-o,d.y=u.y):(u.x=l.x()+l.width(),u.y=s.y(),d.x=u.x+n-s.width()-m,d.y=u.y)):(g=i.getPoint(.5,r),g.x+=i.x()+l.x(),g.y+=i.y()+l.y(),this._opposite?(u.y=c,u.x=s.x(),d.y=c-h,d.x=u.x):(u.y=l.y()+l.height(),u.x=s.x(),d.y=u.y+c-s.height()-p,d.x=u.x)),t.set("points",[g,u,d])}}}disposeDataItem(e){super.disposeDataItem(e);let t=e.get("link");t&&(this.links.removeValue(t),t.dispose())}_positionBullet(e){let t=e.get("sprite");if(t){let i=t.dataItem.get("slice");if(i){let a=i.width(),l=i.height(),r=e.get("locationX",.5),n=e.get("locationY",.5),c=0,o=0;this.get("orientation")=="horizontal"?o=l/2:c=a/2,t.setAll({x:i.x()+a*r-c,y:i.y()-o+l*n})}}}};H.className="FunnelSeries";H.classNames=L.classNames.concat([H.className]);var X=class extends H{constructor(){super(...arguments),this._tag="pyramid"}_prepareChildren(){super._prepareChildren(),this._nextSize=void 0}decorateSlice(e){let t=this.get("orientation"),s=this.slicesContainer,i=e.get("slice"),a=e.get("label"),l=e.get("link"),r=this.get("valueIs","area"),n=this.getPrivate("valueAbsoluteSum",0);if(n==0)return;let c=this.get("startLocation",0),o=this.get("endLocation",1),m=this.get("topWidth",0),h=this.get("bottomWidth",A),p=Math.abs(e.get("valueWorking",0)),g=e.get("value",0),u,d,y=s.innerHeight(),x=s.innerWidth(),b=l.width(),f=l.height();t=="horizontal"&&([x,y]=[y,x],[b,f]=[f,b]);let $=x/2,P=1;g!=0?P=p/Math.abs(g):e.isHidden()&&(P=1e-6),f*=P,y=y*(o-c)-f*(this._count*this._total-1);let F=w(m,x);Y(this._nextSize)||(this._nextSize=F);let Z=w(h,x),N=this._nextSize,nt=Math.atan2(y,F-Z),B=Math.tan(Math.PI/2-nt);if(B==0&&(B=1e-8),r=="area"){let it=(F+Z)/2*y*p/n,ot=Math.abs(N*N-2*it*B);u=(N-Math.sqrt(ot))/B,u>0?d=(2*it-u*N)/u:d=N}else u=y*p/n,d=N-u*B;let O=this._nextCoord+u/2,J=$,j=this._nextCoord,Q=$,I=j+u;t=="vertical"?(a.set("y",O),a.get("opacity")>0&&this._rLabels.push({label:a,y:O}),i.set("height",u)):(a.set("x",O),a.get("opacity")>0&&this._hLabels.push({label:a,y:O}),[J,j]=[j,J],[Q,I]=[I,Q],i.set("width",u)),i.setAll({orientation:t,bottomWidth:d,topWidth:N,x:J,y:j}),l.setAll({orientation:t,x:Q,y:I,topWidth:d,bottomWidth:d}),this._nextSize=d,this._nextCoord+=u+f}};X.className="PyramidSeries";X.classNames=H.classNames.concat([X.className]);var K=class extends X{constructor(){super(...arguments),this._tag="pictorial",this.seriesMask=q.new(this._root,{position:"absolute",x:_,y:_,centerX:_,centerY:_}),this.seriesGraphics=this.slicesContainer.children.push(q.new(this._root,{themeTags:["pictorial","background"],position:"absolute",x:_,y:_,centerX:_,centerY:_}))}_afterNew(){super._afterNew(),this.set("topWidth",A),this.set("bottomWidth",A),this.set("valueIs","height"),this.slicesContainer.set("mask",this.seriesMask)}_updateScale(){let e=this.slicesContainer,t=e.innerWidth(),s=e.innerHeight(),i=this.seriesMask,a=this.seriesGraphics,l=i.get("scale",1),r=i.localBounds(),n=r.right-r.left,c=r.bottom-r.top;this.get("orientation")=="horizontal"?l=t/n:l=s/c,l!=1/0&&l!=NaN&&(i.set("scale",l),i.set("x",t/2),i.set("y",s/2),a.set("scale",l),a.set("x",t/2),a.set("y",s/2))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("svgPath")){let e=this.get("svgPath");this.seriesMask.set("svgPath",e),this.seriesGraphics.set("svgPath",e)}this._updateScale()}};K.className="PictorialStackedSeries";K.classNames=X.classNames.concat([K.className]);var E=class extends C{_afterNew(){super._afterNew(),this.seriesContainer.setAll({isMeasured:!0,layout:this._root.horizontalLayout})}};E.className="SlicedChart";E.classNames=C.classNames.concat([E.className]);export{st as DefaultTheme,H as FunnelSeries,V as FunnelSlice,C as PercentChart,L as PercentSeries,K as PictorialStackedSeries,G as PieChart,U as PieSeries,X as PyramidSeries,E as SlicedChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as b}from"./MP6Z45SA.js";import a from"./DLB6EEQE.js";import"./CAXI6CJY.js";import{a as R}from"./J6UG5EF7.js";import{b as P}from"./EHZW6UXL.js";import{M as O,N as S,O as j,P as q,S as L,U as Q,a as x,b as o}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:k},{isRelatableFeatureSupportedLayer:G,findRelatedLayer:J},{substitute:U,formatNumber:H},{watch:_,on:X},K,T,{ignoreAbortErrors:D},Y,{g:B}])=>{var ee=x`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,te=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},E=100,M=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=b(this._queryController,E),this._queryFeatureCountDebounced=b(this._queryFeatureCountController,E),this._queryPageDebounced=b(this._queryPageController,E),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=ee}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&G(e.parent)?e.parent:e;return J(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return U(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[_(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),_(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),X(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:g,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&g!=null){let{default:w}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:v}=await w({layer:t,sqlWhere:`${n} = '${g}'`,field:t.subtypeField??void 0,signal:r?.signal}),I=v.map(({count:u,value:c})=>{let m=t.subtypes?.find(A=>A.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=I}return}let{historicMoment:p,gdbVersion:f}=e,F=new T({cacheHint:C,gdbVersion:f,historicMoment:p,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(F,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:g,relationshipId:C,showAllEnabled:p,supportsCacheHint:f}=this,{canQuery:F,objectId:h}=this;if(!F||!a||!l||h==null)return[];let w=p?((i-1)*s+r)%r:0,v=p?s:t,I=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...te(l),...g,I,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:A,gdbVersion:Z}=a,W=new T({orderByFields:m,start:w,num:v,outFields:c,cacheHint:f,historicMoment:A,gdbVersion:Z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),$=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?$.forEach(d=>{let z=d.attributes[u],N=l.findSublayerForSubtypeCode?.(z);d.sourceLayer=N,d.layer=N}):$.forEach(d=>{d.sourceLayer=l,d.layer=l}),$}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;t&&this._addFlowItem(L(R(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(L(R(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new Y({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,title:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${q(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${k(l.toString())} .label=${k(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${q(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",M);return M},"applications/Components/stringUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","widgets/Feature/FeatureViewModel",a)
|
|
2
|
+
import{a as b}from"./MP6Z45SA.js";import a from"./YET5HTLQ.js";import"./FF5VMKLK.js";import{a as R}from"./J6UG5EF7.js";import{b as P}from"./EHZW6UXL.js";import{M as O,N as S,O as j,P as q,S as L,U as Q,a as x,b as o}from"./MDRC374Z.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:k},{isRelatableFeatureSupportedLayer:G,findRelatedLayer:J},{substitute:U,formatNumber:H},{watch:_,on:X},K,T,{ignoreAbortErrors:D},Y,{g:B}])=>{var ee=x`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,te=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},E=100,M=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=b(this._queryController,E),this._queryFeatureCountDebounced=b(this._queryFeatureCountController,E),this._queryPageDebounced=b(this._queryPageController,E),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=ee}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&G(e.parent)?e.parent:e;return J(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return U(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[_(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),_(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),X(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:g,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&g!=null){let{default:w}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:v}=await w({layer:t,sqlWhere:`${n} = '${g}'`,field:t.subtypeField??void 0,signal:r?.signal}),I=v.map(({count:u,value:c})=>{let m=t.subtypes?.find(A=>A.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=I}return}let{historicMoment:p,gdbVersion:f}=e,F=new T({cacheHint:C,gdbVersion:f,historicMoment:p,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(F,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:g,relationshipId:C,showAllEnabled:p,supportsCacheHint:f}=this,{canQuery:F,objectId:h}=this;if(!F||!a||!l||h==null)return[];let w=p?((i-1)*s+r)%r:0,v=p?s:t,I=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...te(l),...g,I,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:A,gdbVersion:Z}=a,W=new T({orderByFields:m,start:w,num:v,outFields:c,cacheHint:f,historicMoment:A,gdbVersion:Z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),$=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?$.forEach(d=>{let z=d.attributes[u],N=l.findSublayerForSubtypeCode?.(z);d.sourceLayer=N,d.layer=N}):$.forEach(d=>{d.sourceLayer=l,d.layer=l}),$}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;t&&this._addFlowItem(L(R(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(L(R(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new Y({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,title:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${q(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${k(l.toString())} .label=${k(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${q(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",M);return M},"applications/Components/stringUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","widgets/Feature/FeatureViewModel",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{A as Ea,B as Ja,C as Ka,D as La,E as Ma,F as Na,G as Oa,H as Pa,I as Qa,J as Sa,K as Ta,L as Ua,M as Va,N as Wa,O as Xa,P as Ya,a as R,b as T,c as U,d as V,e as W,f as X,g as Y,h as _,i as $,j as aa,k as ba,l as ca,m as fa,n as ga,o as ha,p as ia,q as ja,r as oa,s as pa,t as qa,u as ra,v as va,w as xa,x as ya,y as za,z as Aa}from"./JVFREF7G.js";import{a as da,b as ea,c as sa,d as Da}from"./RH62B2NE.js";import{a as Fa}from"./A2QPYUE5.js";import{A as B,B as C,C as D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R as S,U as ka,V as la,W as ma,X as na,c as r,fa as ta,ga as ua,ha as wa,ia as Ba,ja as Ca,pa as Ga,q as s,qa as Ha,ra as Ia,sa as Ra,t,u,v,w,x,y,z as A}from"./FWXI6DGS.js";import{P as o,Q as p,R as q,b as n}from"./P2ABZVPJ.js";import{a,b,c,d,e}from"./XEXCDGSR.js";import{D as g,K as h,M as i,N as j,O as k,P as l,Q as m,V as z,W as Z,l as f}from"./DQH27QCF.js";import"./3TTFCHAA.js";export{j as ArrayDisposer,D as BlendMode,ca as Bullet,ea as Button,Ta as CSVParser,$ as CanvasLayer,_ as CanvasRenderer,Ga as Chart,ga as Circle,Ma as CirclePattern,q as Color,Ra as ColorSet,na as Component,fa as ConfirmButton,P as Container,m as CounterDisposer,ma as DataItem,Ua as DataProcessor,X as DateFormatter,i as Disposer,Y as DurationFormatter,sa as EditableLabel,ia as Ellipse,y as Entity,pa as Gradient,Ka as GrainPattern,E as Graphics,J as GridLayout,ra as HeatLegend,H as HorizontalLayout,R as InterfaceColors,Sa as JSONParser,la as JsonData,S as Label,G as Layout,va as Legend,wa as Line,Na as LinePattern,qa as LinearGradient,za as Link,ka as ListData,r as ListTemplate,ba as Modal,k as MultiDisposer,l as MutableValueDisposer,V as NumberFormatter,Wa as NumericStepper,ya as OrthogonalLine,Pa as PathPattern,B as Pattern,Qa as PatternSet,a as Percent,Aa as Picture,C as PicturePattern,T as PointedRectangle,ha as Polygon,Xa as ProgressPie,La as RadialGradient,Ca as RadialLabel,Ba as RadialText,F as Rectangle,Oa as RectanglePattern,aa as Root,da as RoundedRectangle,Da as Scrollbar,Ha as SerialChart,ua as Series,Fa as Slice,Ea as Slider,A as Sprite,Va as SpriteResizer,ja as Star,z as Template,Q as Text,K as TextFormatter,Z as Theme,Ia as Tick,W as Timezone,U as Tooltip,xa as Triangle,I as VerticalLayout,Ja as ZoomTools,oa as ZoomableContainer,v as addLicense,g as array,p as color,w as disposeAllRootElements,t as ease,N as getCustomDataValue,x as getRootById,M as getTagValue,O as getTagValueFromObject,s as math,Ya as net,h as object,c as p0,d as p100,e as p50,b as percent,L as populateString,n as ready,u as registry,ta as time,f as type,o as utils};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{f as s}from"./FF5VMKLK.js";import{p as u}from"./MDRC374Z.js";export default $arcgis.t(([{replace:f},{fieldFormatFromFieldInfo:h}])=>{var c=/^\s*expression\//iu,y=/href=(""|'')/giu,I=/(\{([^{\r\n]+)\})/gu,N=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/giu,F=/'/gu,C="relationships/",w=/^(?:mailto:|tel:)/u;function P(n,e){let r=new Map;if(!n)return r;for(let t of n){if(!t.fieldName)continue;let i=d(t.fieldName,e);t.fieldName=i,r.set(i.toLowerCase(),t)}return r}function R(n){let e=[];if(!n)return e;let{fieldInfos:r,content:t}=n;return r&&e.push(...r),!t||!Array.isArray(t)||t.forEach(i=>{if(i.type==="fields"){let o=i?.fieldInfos;o&&e.push(...o)}}),e}function W(n,e){return n?.getEffectivePopupTemplate(e)??void 0}function B(n){if(n!=null)return"sourceLayer"in n&&n.sourceLayer?n.sourceLayer:n.layer??void 0}function L(n=""){return n?n.includes(C):!1}function D(n=""){if(n)return!w.test(n.trim().toLowerCase())}function d(n,e){let r=g(e,n);return r?r.name:n}function G(n,e){return n?.map(r=>d(r,e))}function p(n){return n?c.test(n):!1}function b(n,e){if(!e||!p(e)||!n)return;let r=e.replace(c,"").toLowerCase();return n.find(({name:t})=>t.toLowerCase()===r)}function J(n,e){if(!(!n?.length||!e))return n.find(r=>r.fieldName?.toLowerCase()===e.toLowerCase())}function A(n){let{fieldInfo:e,graphic:r,layer:t}=n;return v({fieldInfo:e,graphic:r})?s(t,{graphic:r}):null}function v({fieldInfo:n,graphic:e}){return!!n?.fieldName&&!p(n.fieldName)&&!L(n.fieldName)&&!e?.popupTemplate}function K({expressionInfos:n,fieldInfo:e,graphic:r,isContentFieldInfos:t,layer:i}){if(!e?.fieldName)return null;let o=b(n,e?.fieldName);if(o)return o.title||null;let a=A({fieldInfo:e,graphic:r,layer:i});if(a){let l=a.getFieldAlias(e.fieldName);return t?e.label||l||e.fieldName:l||e.fieldName}return e.label||e.fieldName}function Q(n){let{configurableFieldsContainer:e,fieldInfo:r,isContentFieldInfos:t}=n;if(!r?.fieldName)return null;let i=!e.popupTemplate&&!e.fieldConfigurations?h(r,e.getField(r.fieldName)):e.getFieldConfiguration(r.fieldName)?.fieldFormat;return t&&r.fieldFormat||i}function m(n){return n.trim()}function x(n){return n.replaceAll(y,"")}function j(n,e){return`{${e.get(n.toLowerCase())?.fieldName||n}}`}function k({formattedValues:n,template:e,fieldInfoMap:r}){return m(x(f(f(e,t=>j(t,r)),n)))}function g(n,e){return!(n&&"getField"in n&&typeof n.getField=="function")||!e?null:n.getField(e)??null}function E(n,e){return n.replaceAll(I,(r,t,i)=>{let o=g(e,i);return o?`{${o.name}}`:t})}function M(n,e,r=!1){let t=e[n];if(typeof t=="string"){let i=(r?encodeURIComponent(t):t).replaceAll(F,"%27");e[n]=i}}function T(n,e=!1){let r={...n};return Object.keys(r).forEach(t=>M(t,r,e)),r}function V(n,e,r){e=m(e);let t=e&&!e.startsWith("{");return f(n,T(r,t||!1))}function $(n,e,r){let t=E(n,r);return t&&t.replaceAll(N,(i,o,a)=>V(i,o||a,e))}function _({values:n,globalValues:e,layer:r,text:t,fieldInfoMap:i}){return t?k({formattedValues:e,template:$(t,{...e,...n},r),fieldInfoMap:i}):""}async function z({type:n,value:e,event:r}){try{return typeof e=="function"?e(r):await e}catch(t){u("error","arcgis-feature",`An error occurred when calling the "${n}" function`,{detail:{error:t,graphic:r.graphic,value:e}});return}}function H(n){let e=n.attributes,r=n.layer;if(!e||!r)return"";let t="displayField"in r?r.displayField:null,i=t!=null?e[t]:null,o=n.getObjectId()?.toString();return i?.toString()||o||"Unknown"}return{a:P,b:R,c:W,d:B,e:L,f:D,g:d,h:G,i:p,j:J,k:A,l:K,m:Q,n:k,o:E,p:_,q:z,r:H}},"applications/Components/stringUtils","applications/Components/fieldFormatUtils")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{M as x,N as w,O as P,U as F,a as C,b as t,f as U,x as f}from"./MDRC374Z.js";import"./3TTFCHAA.js";var N=C`:host{display:none;background:#bdf2c4}:host([selected]){display:flex}calcite-block{margin-block:0}calcite-fab{margin-top:var(--calcite-spacing-md);margin-bottom:var(--calcite-spacing-md)}calcite-pagination{justify-content:center}`,k=class extends P{constructor(){super(...arguments),this._filterInputElement=x(),this._flowItemElement=x(),this.currentPage=1,this.selected=!1,this.showBackButton=!1,this.arcgisFlowItemBack=f(),this.arcgisFlowItemClose=f(),this.arcgisGetVersions=f(),this.arcgisManageVersion=f(),this.arcgisNewVersion=f()}static{this.properties={_filteredVersionInfos:16,currentPage:11,selected:7,showBackButton:7,versionListElementProps:0}}static{this.styles=N}load(){this._filteredVersionInfos=this.versionListElementProps.versionInfos}willUpdate(e){if(e.has("versionListElementProps")){let i=e.get("versionListElementProps"),s=this.versionListElementProps;i?.versionInfos!==s.versionInfos&&(this._filteredVersionInfos=s.versionInfos,this._filterInputElement.value&&this._handleFilterChange())}}updated(){this._filterInputElement.value?.setFocus()}async setFocus(){this._flowItemElement.value?.setFocus()}goBack(){}_handleFilterChange(){let{versionListElementProps:{versionInfos:e}}=this,i=this._filterInputElement.value.value.toUpperCase();this._filteredVersionInfos=i===""?e:e.filter(s=>s.versionIdentifier.name.toUpperCase().includes(i)||s.versionIdentifier.guid.toUpperCase().includes(i)),this._filteredVersionInfos.length&&(this.currentPage=1)}_handleNoticeClosed(){this.versionListElementProps={...this.versionListElementProps,executionError:void 0}}_handlePaginationChange(e){this.currentPage=e.target.startItem}_getExecutionError(e){let{versionListElementProps:{strings:{executionErrors:i}}}=this;switch(e){case"no-feature-service-found":return i.noFeatureServiceFound;case"no-valid-enterprise-version":return i.notValidEnterpriseVersion;case"no-valid-version-name":return i.invalidVersionName;default:return e}}_paginate(e,i,s){return e.slice((s-1)*i,s*i)}render(){let{currentPage:e,selected:i,showBackButton:s,versionListElementProps:{closable:v,currentUser:$,currentVersionIdentifier:d,executionError:h,heading:r,isVersionAdministrator:g,isVersioningApiAvailable:m,pageSize:o,serviceName:n,serviceUrl:c,state:p,strings:{headers:l},strings:a,versionInfos:u}}=this,I=t`<calcite-block .heading=${l.currentVersion} .description=${d.name} overlay-positioning=fixed></calcite-block>`,V=t`<calcite-action icon=refresh .id=${`action-refresh-versions-${n}`} .label=${`action-refresh-versions-${n}`} slot=header-actions-end text @click=${()=>this.arcgisGetVersions.emit({serviceUrl:c})}><calcite-tooltip overlay-positioning=fixed .referenceElement=${`action-refresh-versions-${n}`}><span>${a.actions.refreshVersions}</span></calcite-tooltip></calcite-action>`;this._paginatedVersionInfos=this._filteredVersionInfos.length>o?this._paginate(this._filteredVersionInfos,o,e):this._filteredVersionInfos;let b=this._filteredVersionInfos.length>o?t`<calcite-pagination @calcitePaginationChange=${this._handlePaginationChange} page-size=1 .startItem=${e} .totalItems=${Math.ceil(this._filteredVersionInfos.length/o)}></calcite-pagination>`:void 0,_=this._paginate(this._paginatedVersionInfos,o,1).map(A=>{let M={currentUser:$,currentVersionIdentifier:d,isCurrentVersionCard:!1,isVersionAdministrator:g,isVersioningApiAvailable:m,serviceUrl:c,strings:a,versionInfo:A};return this._renderListItem(M)}),E=u.length>o?t`<calcite-block expanded .label=${l.filterVersions}><calcite-input-text clearable icon=search @calciteInputTextInput=${this._handleFilterChange} .placeholder=${a.actions.searchVersions} ${w(this._filterInputElement)}></calcite-input-text></calcite-block>`:void 0,L=t`<calcite-list .label=${a.labels.versionList}>${_}</calcite-list>`,y=m?t`<calcite-fab appearance=outline-fill slot=fab text-enabled .text=${a.actions.newVersion} @click=${()=>this.arcgisNewVersion.emit({serviceUrl:c})}></calcite-fab>`:void 0,B=h?t`<calcite-notice @calciteNoticeClose=${this._handleNoticeClosed} class="notice" closable kind=warning open scale=s slot=footer width=full><div slot=message>${this._getExecutionError(h)}</div></calcite-notice>`:void 0;return t`<calcite-flow-item .closable=${v} .description=${n} .heading=${r} .selected=${i} .showBackButton=${s} @calciteFlowItemBack=${()=>this.arcgisFlowItemBack.emit()} @calciteFlowItemClose=${()=>this.arcgisFlowItemClose.emit()} ${w(this._flowItemElement)}><calcite-panel .loading=${p==="executing"}>${I}<calcite-panel .heading=${this._filteredVersionInfos.length?`${a.headers.manageVersions} (${this._filteredVersionInfos.length})`:a.headers.manageVersions}>${V}${E}${L}${y}</calcite-panel>${b}${B}</calcite-panel></calcite-flow-item>`}_renderListItem(e){let{currentUser:i,currentVersionIdentifier:s,isVersionAdministrator:v,isVersioningApiAvailable:$,serviceUrl:d,strings:{actions:h},versionInfo:r}=e,g=r.versionIdentifier.name,m=g.substring(g.lastIndexOf(".")+1),o=g.substring(0,g.lastIndexOf(".")),n=r.versionIdentifier.guid,c=`action-start-switch-to-version-${n}`,p=o.toUpperCase()===i.toUpperCase()&&$||v,l=s.guid===r.versionIdentifier.guid,a=g.toUpperCase()==="SDE.DEFAULT",u=t`<calcite-action .disabled=${l} icon=code-branch .label=${`action-switch-to-version-${n}`} scale=s .text=${h.switchToVersion} text-enabled @click=${()=>{this.arcgisManageVersion.emit({actionType:"changeVersion",serviceUrl:d,versionInfo:r})}}></calcite-action>`,I=a?void 0:t`<calcite-action .disabled=${!p||p&&l} icon=trash .label=${`action-delete-version-${n}`} scale=s .text=${h.deleteVersion} text-enabled @click=${()=>{this.arcgisManageVersion.emit({actionType:"deleteVersion",serviceUrl:d,versionInfo:r})}}></calcite-action>`,V=t`<calcite-action .disabled=${!p||l} icon=code-branch-edit .label=${`action-edit-version-${n}`} scale=s .text=${h.editVersion} text-enabled @click=${()=>{this.arcgisManageVersion.emit({actionType:"editVersion",serviceUrl:d,versionInfo:r})}}></calcite-action>`,b=t`<calcite-action-menu .label=${`action-version-menu-${n}`} overlay-positioning=fixed slot=actions-end>${u}${V}${I}</calcite-action-menu>`,_=l?void 0:t`<calcite-tooltip overlay-positioning=fixed .referenceElement=${c}><span>${h.switchToVersion}</span></calcite-tooltip>`,E=t`<div slot=actions-start><calcite-action .disabled=${l} icon=code-branch id=${c??U} .label=${c} .text=${c} @click=${()=>{this.arcgisManageVersion.emit({actionType:"changeVersion",serviceUrl:d,versionInfo:r})}}></calcite-action>${_}</div>`;return t`<calcite-list-item .description=${o} .label=${m} .value=${n}>${E}${b}</calcite-list-item>`}};F("arcgis-version-management-version-list",k);export{k as ArcgisVersionManagementVersionList};
|