@arcgis/core 4.28.0-next.20230708 → 4.28.0-next.20230711
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9e5f59a8e8f12cd9e5e0.js → 8faf88599f86ee276185.js} +1 -1
- package/assets/esri/core/workers/chunks/ddea45acae89759e57fa.js +1 -0
- package/assets/esri/core/workers/chunks/{2c2cab197c47f080772a.js → f5f0a5318337439d464e.js} +1 -1
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +0 -12
- package/assets/esri/themes/base/widgets/_Weather.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Button.js +1 -1
- package/chunks/LineSeries.js +5 -0
- package/chunks/Responsive.js +5 -0
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/chunks/ar.js +1 -1
- package/chunks/ar2.js +1 -1
- package/chunks/bg_BG.js +1 -1
- package/chunks/bg_BG2.js +1 -1
- package/chunks/bs_BA.js +1 -1
- package/chunks/bs_BA2.js +1 -1
- package/chunks/ca_ES.js +1 -1
- package/chunks/ca_ES2.js +1 -1
- package/chunks/chartUtilsAm5.js +5 -0
- package/chunks/cs_CZ.js +1 -1
- package/chunks/cs_CZ2.js +1 -1
- package/chunks/da_DK.js +1 -1
- package/chunks/da_DK2.js +1 -1
- package/chunks/de_CH.js +1 -1
- package/chunks/de_CH2.js +1 -1
- package/chunks/de_DE.js +1 -1
- package/chunks/de_DE2.js +1 -1
- package/chunks/el_GR.js +1 -1
- package/chunks/el_GR2.js +1 -1
- package/chunks/en_CA.js +1 -1
- package/chunks/en_CA2.js +1 -1
- package/chunks/en_US.js +1 -1
- package/chunks/en_US2.js +1 -1
- package/chunks/es_ES.js +1 -1
- package/chunks/es_ES2.js +1 -1
- package/chunks/et_EE.js +1 -1
- package/chunks/et_EE2.js +1 -1
- package/chunks/fi_FI.js +1 -1
- package/chunks/fi_FI2.js +1 -1
- package/chunks/fr_FR.js +1 -1
- package/chunks/fr_FR2.js +1 -1
- package/chunks/he_IL.js +1 -1
- package/chunks/he_IL2.js +1 -1
- package/chunks/hr_HR.js +1 -1
- package/chunks/hr_HR2.js +1 -1
- package/chunks/hu_HU.js +1 -1
- package/chunks/hu_HU2.js +1 -1
- package/chunks/id_ID.js +1 -1
- package/chunks/id_ID2.js +1 -1
- package/chunks/it_IT.js +1 -1
- package/chunks/it_IT2.js +1 -1
- package/chunks/ja_JP.js +1 -1
- package/chunks/ja_JP2.js +1 -1
- package/chunks/ko_KR.js +1 -1
- package/chunks/ko_KR2.js +1 -1
- package/chunks/lt_LT.js +1 -1
- package/chunks/lt_LT2.js +1 -1
- package/chunks/lv_LV.js +1 -1
- package/chunks/lv_LV2.js +1 -1
- package/chunks/nb_NO.js +1 -1
- package/chunks/nb_NO2.js +1 -1
- package/chunks/nl_NL.js +1 -1
- package/chunks/nl_NL2.js +1 -1
- package/chunks/pl_PL.js +1 -1
- package/chunks/pl_PL2.js +1 -1
- package/chunks/pt_BR.js +1 -1
- package/chunks/pt_BR2.js +1 -1
- package/chunks/pt_PT.js +1 -1
- package/chunks/pt_PT2.js +1 -1
- package/chunks/ro_RO.js +1 -1
- package/chunks/ro_RO2.js +1 -1
- package/chunks/ru_RU.js +1 -1
- package/chunks/ru_RU2.js +1 -1
- package/chunks/sk_SK.js +1 -1
- package/chunks/sk_SK2.js +1 -1
- package/chunks/sl_SL.js +1 -1
- package/chunks/sl_SL2.js +1 -1
- package/chunks/sr_RS.js +1 -1
- package/chunks/sr_RS2.js +1 -1
- package/chunks/sv_SE.js +1 -1
- package/chunks/sv_SE2.js +1 -1
- package/chunks/th_TH.js +1 -1
- package/chunks/th_TH2.js +1 -1
- package/chunks/tr_TR.js +1 -1
- package/chunks/tr_TR2.js +1 -1
- package/chunks/uk_UA.js +1 -1
- package/chunks/uk_UA2.js +1 -1
- package/chunks/vi_VN.js +1 -1
- package/chunks/vi_VN2.js +1 -1
- package/chunks/zh_Hans.js +1 -1
- package/chunks/zh_Hans2.js +1 -1
- package/chunks/zh_Hant.js +1 -1
- package/chunks/zh_Hant2.js +1 -1
- package/interfaces.d.ts +12 -0
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
- package/networks/Network.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +1 -1
- package/rest/networks/queryAssociations.js +1 -1
- package/rest/networks/queryNamedTraceConfigurations.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.js +1 -1
- package/rest/networks/support/QueryNamedTraceConfigurationsParameters.js +1 -1
- package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
- package/rest/networks/synthesizeAssociationGeometries.js +1 -1
- package/rest/support/meshFeatureSet.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/3d/environment/CloudsData.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsParameters.js +5 -0
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/css.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
- package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
- package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/chartUtils.js +1 -1
- package/widgets/support/chartUtilsAm5.js +1 -1
- package/assets/esri/core/workers/chunks/0f57b8d4fa3afb296392.js +0 -1
- package/views/3d/environment/CloudsCompositionParameters.js +0 -5
- package/views/3d/environment/weatherUtils.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{deprecatedProperty as n}from"../../core/deprecate.js";import s from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{EsriPromiseMixin as r}from"../../core/Promise.js";import{watch as a}from"../../core/reactiveUtils.js";import{templateHasKey as l}from"../../core/string.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../core/support/UpdatingHandles.js";import d from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as f}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{flattenFieldInputs as g,flattenRelationshipInputs as y,parseFormTemplateString as _,isGroupInput as v,isGroupElement as C,isFieldElement as I,isRelationshipElement as E,isRelationshipInput as F,isFieldInput as x,getNormalizedFeatureTypeInfo as b}from"./featureFormUtils.js";import V from"./FieldInput.js";import{createFormExpressionArcadeExecutor as w}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as j}from"./FormExpressionsManager.js";import A from"./GroupInput.js";import T from"./RelationshipInput.js";const M=new t({attributes:{}}),R=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],N=["visibilityExpression"],L=["editableExpression","visibilityExpression"],S="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",k="#JSAPI_CONTINGENT_VALUE_ANY_HASH",H="#JSAPI_CONTINGENT_VALUE_NULL_HASH",P="esri.widgets.FeatureForm.FeatureFormViewModel",U=i.getLogger(P);let G=class extends(r(s.EventedAccessor)){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=M.clone(),this._initialFeature=M.clone(),this._updatingHandles=new c,this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.inputs=[],this.map=null,this.relatedRecordCallbacks=null,this.strict=!1}initialize(){const e=a((()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this.feature,this.arcadeEditType]),(([e,t])=>{null!=e&&(t?this._updateInputs():e.load().catch((()=>{})))}),{equals:([e,t,n,s,i],[o,r,a,l,u])=>e===o&&t===r&&n===a&&s===l&&i===u,initial:!0}),t=a((()=>this._arcadeContextInfo),(e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e)})),n=a((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map((e=>[e.name,e])))}get activeRelationshipInput(){return this.allRelationshipInputs.find((e=>e.relationshipId===this.relationshipId))}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:n,map:s,spatialReference:i}=this;return{layer:f(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i}}get allFieldInputs(){return g(this.inputs)}get allRelationshipInputs(){return y(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():M.clone(),this._initialFeature=this._featureClone.clone(),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach((t=>t.feature=e))):(this.inputs.forEach((e=>e.destroy())),this.inputs.length=0),this.contingencyConstraintViolations.clear(),null!=this._expressionsManager&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this._updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return null!=e&&e.description&&t?_(e.description,this.getValues(),t.fieldsIndex):null}get formTitle(){const{formTemplate:e,layer:t}=this;return null!=e&&e.title&&t?_(e.title,this.getValues(),t.fieldsIndex):null}formHeaderVisible(){const{activeRelationshipInput:e,formDescription:t,formTitle:n}=this;return!(e||!t&&!n)}set inputFields(e){n(U,"inputFields",{replacement:"FeatureFormViewModel.inputs",version:"4.27"}),this.inputs=e}get inputFields(){return n(U,"inputFields",{replacement:"FeatureFormViewModel.inputs",version:"4.27"}),this.inputs}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach((e=>e.showAllEnabled=!1)),null!=e){const n=t.find((t=>t.relationshipId===e));n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter((e=>!e.valid)).every((({submittable:e})=>e))}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every((({valid:e})=>e))}get view(){return n(U,"view",{replacement:"FeatureForm.map",version:"4.27"}),this._get("view")}set view(e){n(U,"view",{replacement:"FeatureForm.map",version:"4.27"}),this._set("view",e),e?.map&&(this.map=e.map)}findField(e){return this.allFieldInputs.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:n}=this,s=!!n?.getField(e);return t.getAttribute(e)??(s?null:void 0)}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),null!=this._expressionsManager&&this._updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allFieldInputs,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),n=e.filter((e=>!e.valid)).map((({name:e})=>e)),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:n}=this;n.geometry=t.geometry,null!=e&&this._updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_updateInputs(){const{_featureClone:e,_initialFeature:t,arcadeEditType:n,formTemplate:s,inputs:i,layer:o}=this;if(!o)return;const r={arcadeEditType:n,feature:e,initialFeature:t,layer:o},a=i.slice(),l=null!=s&&s.elements&&s.elements.length>0?this._updateInputsUsingFormElements(a,s.elements,r):this._updateInputsUsingLayerFields(a,o?.fields,r);this.inputs=l}_updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(v(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(O),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});this._updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=g(o);return this._createExpressionsManager(e,t),this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))})));for(const[r,a]of s.entries())s.delete(r),a.destroy();return o}_updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):C(a)?this._makeGroupInputFromElement(a,s):I(a)?this._makeFieldInputFromElement(a,s,i):E(a)?this._makeRelationshipInputFromElement(a,s,i):null;if(n){if(r.push(n),e)if(t.delete(a),v(n)){const{feature:e}=s;n.set({feature:e})}else if(F(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else n.set(s);else this._assignExpressionExecutors(n,a,o);if(C(a)){const e=a.elements.filter((e=>O(e)));n.inputs=this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return i.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const i of e)if(v(i)){for(const e of i.inputs)e.destroy();i.inputs.length=0,i.destroy()}else F(i)?i.destroy():x(i)&&(null!==i.element?i.destroy():s.set(i.field,i));const o=[],{arcadeEditType:r,feature:a,initialFeature:l,layer:u}=n;for(const i of t){const e=s.get(i)??new V({arcadeEditType:r,field:i,feature:a,initialFeature:l,layer:u,value:a?.getAttribute(i.name)??null});o.push(e),s.delete(i)}for(const[i,p]of s.entries())s.delete(i),p.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)}_makeFieldInputFromElement(e,t,n){const{arcadeEditType:s,feature:i,initialFeature:o,layer:r}=t,{fieldName:a}=e,l=a&&this._layerFieldsByName.get(a);return l?new V({arcadeEditType:s,element:e,field:l,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n}):null}_makeGroupInputFromElement(e,t){const{feature:n,layer:s}=t;return new A({element:e,inputs:[],feature:n,layer:s})}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o}=t;return new T({element:e,feature:i,group:n,layer:o,map:s})}_assignExpressionExecutors(e,t,n){const s=C(t)?N:E(t)?L:R,i=[];for(const o of s){const s=t[o],{_expressionExecutorLookup:i}=this;if(null!=s&&""!==s){const t=`${o}Executor`,r=this._expressionInfosLookup.get(s)?.expression??s;if(i.has(r))e[t]=i.get(r);else if(n.has(r)){const s=n.get(r).then((n=>(e[t]=n,n)));n.set(r,s)}else{const s=w(r,this.layer).then((n=>(e[t]=n,i.set(r,n),n)));n.set(r,s)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:n,_featureClone:s}=this;this._expressionsManager=new j({executors:e,feature:s,arcadeContextInfo:n,fieldInputs:t})}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:u}=b(o);if(t===a&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);s.sourceLayer=this.feature.sourceLayer=e}const e=new Set;for(const t of u)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}}if(null!=i){const{description:e,title:n}=i;n&&l(n,t)&&this.notifyChange("formTitle"),e&&l(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=b(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(k)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(k),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(k)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(k),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:d,rightIsRange:f}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new h({objectType:"null"});continue}if(r&&f||a&&d)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(n.minValue,o.minValue),g=Math.min(n.maxValue,o.maxValue);if(m>g)return null;s.values[i]=new h({objectType:"range",minValue:m,maxValue:g})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter((t=>n.every((n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===k)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,r=new Set,a=new Set;for(const l of i)if(o.has(l)){const e=this.layer?.getFieldDomain(l,{feature:this.feature});if(null==e)continue;switch(e.type){case"coded-value":r.add(l);break;case"range":a.add(l)}}return{codedValueFields:[...r],rangeFields:[...a]}}_hashContingency(e,t,n=!1){if(t.length<1)return[S,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[k,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${H}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};function O(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||(i.getLogger(P).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}e([u()],G.prototype,"_expressionInfosLookup",null),e([u()],G.prototype,"_featureClone",void 0),e([u()],G.prototype,"activeRelationshipInput",null),e([u()],G.prototype,"_arcadeContextInfo",null),e([u({readOnly:!0})],G.prototype,"allFieldInputs",null),e([u()],G.prototype,"allRelationshipInputs",null),e([u()],G.prototype,"_layerFieldsByName",null),e([u()],G.prototype,"arcadeEditType",void 0),e([u()],G.prototype,"contingencyConstraintViolations",void 0),e([u()],G.prototype,"disabled",void 0),e([u()],G.prototype,"feature",null),e([u()],G.prototype,"fieldsWithContingentValues",null),e([u({type:d})],G.prototype,"formTemplate",null),e([u()],G.prototype,"formDescription",null),e([u()],G.prototype,"formTitle",null),e([u()],G.prototype,"formHeaderVisible",null),e([u()],G.prototype,"inputs",void 0),e([u()],G.prototype,"inputFields",null),e([u()],G.prototype,"joinedContingentValues",null),e([u()],G.prototype,"layer",null),e([u()],G.prototype,"map",void 0),e([u()],G.prototype,"relatedRecordCallbacks",void 0),e([u()],G.prototype,"relationshipId",null),e([u()],G.prototype,"spatialReference",null),e([u()],G.prototype,"state",null),e([u()],G.prototype,"strict",void 0),e([u()],G.prototype,"submittable",null),e([u()],G.prototype,"updating",null),e([u()],G.prototype,"valid",null),e([u()],G.prototype,"view",null),e([u()],G.prototype,"getValues",null),e([u()],G.prototype,"submit",null),G=e([p(P)],G);const $=G;export{$ as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{deprecatedProperty as n}from"../../core/deprecate.js";import s from"../../core/Evented.js";import i from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{EsriPromiseMixin as r}from"../../core/Promise.js";import{watch as a}from"../../core/reactiveUtils.js";import{templateHasKey as l}from"../../core/string.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../core/support/UpdatingHandles.js";import d from"../../form/FormTemplate.js";import h from"../../layers/support/ContingentValue.js";import{isEditableLayer as f}from"../../layers/support/editableLayers.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{flattenFieldInputs as g,flattenRelationshipInputs as y,parseFormTemplateString as _,isGroupInput as v,isGroupElement as C,isFieldElement as I,isRelationshipElement as F,isRelationshipInput as E,isFieldInput as x,getNormalizedFeatureTypeInfo as b}from"./featureFormUtils.js";import V from"./FieldInput.js";import{createFormExpressionArcadeExecutor as w}from"./FormExpressionArcadeExecutor.js";import{FormExpressionsManager as j}from"./FormExpressionsManager.js";import A from"./GroupInput.js";import T from"./RelationshipInput.js";const M=new t({attributes:{}}),R=["editableExpression","requiredExpression","valueExpression","visibilityExpression"],N=["visibilityExpression"],L=["editableExpression","visibilityExpression"],S="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",k="#JSAPI_CONTINGENT_VALUE_ANY_HASH",H="#JSAPI_CONTINGENT_VALUE_NULL_HASH",P="esri.widgets.FeatureForm.FeatureFormViewModel",U=i.getLogger(P);let G=class extends(r(s.EventedAccessor)){constructor(e){super(e),this._expressionExecutorLookup=new Map,this._expressionsManager=null,this._contingentValuesCache=null,this._featureClone=M.clone(),this._initialFeature=M.clone(),this._updatingHandles=new c,this.arcadeEditType="NA",this.contingencyConstraintViolations=new Map,this.disabled=!1,this.inputs=[],this.map=null,this.relatedRecordCallbacks=null,this.strict=!1}initialize(){const e=a((()=>[this.layer,!!this.layer?.loaded,this.formTemplate,this.feature,this.arcadeEditType]),(([e,t])=>{null!=e&&(t?this._updateInputs():e.load().catch((()=>{})))}),{equals:([e,t,n,s,i],[o,r,a,l,u])=>e===o&&t===r&&n===a&&s===l&&i===u,initial:!0}),t=a((()=>this._arcadeContextInfo),(e=>{null!=this._expressionsManager&&(this._expressionsManager.arcadeContextInfo=e)})),n=a((()=>this.layer),(e=>{const t="subtype-sublayer"===e?.type?e.parent:"feature"===e?.type?e:null;t&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(t).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.addHandles([e,t,n])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=o(this._contingentValuesCache),this._updatingHandles.destroy()}get _expressionInfosLookup(){return new Map(this.formTemplate?.expressionInfos?.map((e=>[e.name,e])))}get activeRelationshipInput(){return this.allRelationshipInputs.find((e=>e.relationshipId===this.relationshipId))}get _arcadeContextInfo(){const{_initialFeature:e,arcadeEditType:t,layer:n,map:s,spatialReference:i}=this;return{layer:f(n)?n:null,originalFeature:e,editType:t,map:s,spatialReference:i}}get allFieldInputs(){return g(this.inputs)}get allRelationshipInputs(){return y(this.inputs)}get _layerFieldsByName(){return new Map(this.layer?.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():M.clone(),this._initialFeature=this._featureClone.clone(),e?(this._resetFieldInputValues(this._featureClone),this.allRelationshipInputs.forEach((t=>t.feature=e))):(this.inputs.forEach((e=>e.destroy())),this.inputs.length=0),this.contingencyConstraintViolations.clear(),null!=this._expressionsManager&&(this._expressionsManager.resetExecutors(),this._expressionsManager.feature=this._featureClone,this._updatingHandles.addPromise(this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated())))),this._set("feature",e)}get fieldsWithContingentValues(){if(null==this._contingentValuesCache)return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){void 0===e?this._clearOverride("formTemplate"):this._override("formTemplate",e)}get formDescription(){const{formTemplate:e,layer:t}=this;return null!=e&&e.description&&t?_(e.description,this.getValues(),t.fieldsIndex):null}get formTitle(){const{formTemplate:e,layer:t}=this;return null!=e&&e.title&&t?_(e.title,this.getValues(),t.fieldsIndex):null}formHeaderVisible(){const{activeRelationshipInput:e,formDescription:t,formTitle:n}=this;return!(e||!t&&!n)}set inputFields(e){n(U,"inputFields",{replacement:"FeatureFormViewModel.inputs",version:"4.27"}),this.inputs=e}get inputFields(){return n(U,"inputFields",{replacement:"FeatureFormViewModel.inputs",version:"4.27"}),this.inputs}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){this._override("layer",e)}get relationshipId(){return this._get("relationshipId")}set relationshipId(e){const t=this.allRelationshipInputs;if(null!=e&&e===this.relationshipId||t.forEach((e=>e.showAllEnabled=!1)),null!=e){const n=t.find((t=>t.relationshipId===e));n&&(n.showAllEnabled=!0)}this._set("relationshipId",e)}get spatialReference(){return this.layer?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.layer?.loaded?"ready":"disabled"}get submittable(){return!!this.valid||this.allFieldInputs.filter((e=>!e.valid)).every((({submittable:e})=>e))}get updating(){return this._updatingHandles.updating}get valid(){const e=this.allFieldInputs;return e.length>0&&e.every((({valid:e})=>e))}get view(){return n(U,"view",{replacement:"FeatureForm.map",version:"4.27"}),this._get("view")}set view(e){n(U,"view",{replacement:"FeatureForm.map",version:"4.27"}),this._set("view",e),e?.map&&(this.map=e.map)}findField(e){return this.allFieldInputs.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:n}=this,s=!!n?.getField(e);return t.getAttribute(e)??(s?null:void 0)}setValue(e,t){const{_featureClone:n,strict:s}=this,i=this.findField(e);t=""===t?null:t,i&&n.getAttribute(e)!==t&&(i.value=t,s&&!i.valid||(this._afterValueChange(i),null!=this._expressionsManager&&this._updatingHandles.addPromise(this._expressionsManager.evaluateInvalidated([i.name]).finally((()=>this._afterExpressionsEvaluated())))))}getValues(){return{...this._featureClone.attributes}}overrideInitialFeature(e){this._initialFeature=e}submit(){const e=this.allFieldInputs,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),n=e.filter((e=>!e.valid)).map((({name:e})=>e)),s=this.getValues();if(this.validateContingencyConstraints(s,{includeIncompleteViolations:!0}).length>0)for(const[i,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(i),n.push(i));this.emit("submit",{valid:[...t],invalid:n,values:s})}validateContingencyConstraints(e,t){const{_contingentValuesCache:n}=this,s=new Map;if(this.contingencyConstraintViolations=s,null==n)return[];const{invalid:i,incomplete:o}=n.validateContingencyConstraints(e),r=[...i,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)s.set(e,a);return r}notifyFeatureGeometryChanged(){const{_expressionsManager:e,feature:t,_featureClone:n}=this;n.geometry=t.geometry,null!=e&&this._updatingHandles.addPromise(e.evaluateInvalidatedByGeometry().finally((()=>this._afterExpressionsEvaluated())))}_emitChangeEvent({name:e,valid:t,value:n}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:n,valid:t})}_updateInputs(){const{_featureClone:e,_initialFeature:t,arcadeEditType:n,formTemplate:s,inputs:i,layer:o}=this;if(!o)return;const r={arcadeEditType:n,feature:e,initialFeature:t,layer:o},a=i.slice(),l=null!=s&&s.elements&&s.elements.length>0?this._updateInputsUsingFormElements(a,s.elements,r):this._updateInputsUsingLayerFields(a,o?.fields,r);this.inputs=l}_updateInputsUsingFormElements(e,t,n){const s=new Map;for(const r of e)if(v(r)){s.set(r.element,r);for(const e of r.inputs)e.element&&s.set(e.element,e)}else r.element&&s.set(r.element,r);const i=new Map,o=this._updateInputsUsingFormElementsRecursive({existingInputsByElement:s,updatedElements:t.filter(O),sharedInitializationProperties:n,group:null,newExpressionExecutorPromises:i});this._updatingHandles.addPromise(Promise.all(Array.from(i.values())).then((()=>{const e=Array.from(this._expressionExecutorLookup.values()),t=g(o);return this._createExpressionsManager(e,t),this._expressionsManager.evaluateAll().finally((()=>this._afterExpressionsEvaluated()))})));for(const[r,a]of s.entries())s.delete(r),a.destroy();return o}_updateInputsUsingFormElementsRecursive(e){const{existingInputsByElement:t,updatedElements:n,sharedInitializationProperties:s,group:i,newExpressionExecutorPromises:o}=e,r=[];for(const a of n){const e=t.has(a),n=e?t.get(a):C(a)?this._makeGroupInputFromElement(a,s):I(a)?this._makeFieldInputFromElement(a,s,i):F(a)?this._makeRelationshipInputFromElement(a,s,i):null;if(n){if(r.push(n),e)if(t.delete(a),v(n)){const{feature:e}=s;n.set({feature:e})}else if(E(n)){const e=this.relationshipId===a.relationshipId;n.set(s),n.set({map:this.map,showAllEnabled:e})}else n.set(s);else this._assignExpressionExecutors(n,a,o);if(C(a)){const e=a.elements.filter((e=>O(e)));n.inputs=this._updateInputsUsingFormElementsRecursive({existingInputsByElement:t,updatedElements:e,sharedInitializationProperties:s,group:n,newExpressionExecutorPromises:o})}}}return r}_updateInputsUsingLayerFields(e,t,n){if(!Array.isArray(t))return i.getLogger(this).warn(this.declaredClass,"No attribute fields found."),[];const s=new Map;for(const i of e)if(v(i)){for(const e of i.inputs)e.destroy();i.inputs.length=0,i.destroy()}else E(i)?i.destroy():x(i)&&(null!==i.element?i.destroy():s.set(i.field,i));const o=[],{arcadeEditType:r,feature:a,initialFeature:l,layer:u}=n;for(const i of t){const e=s.get(i)??new V({arcadeEditType:r,field:i,feature:a,initialFeature:l,layer:u,value:a?.getAttribute(i.name)??null});o.push(e),s.delete(i)}for(const[i,p]of s.entries())s.delete(i),p.destroy();return o}_resetFieldInputValues(e){for(const t of this.allFieldInputs)t.value=e.getAttribute(t.name)}_makeFieldInputFromElement(e,t,n){const{arcadeEditType:s,feature:i,initialFeature:o,layer:r}=t,{fieldName:a}=e,l=a&&this._layerFieldsByName.get(a);return l?new V({arcadeEditType:s,element:e,field:l,value:i?.getAttribute(e.fieldName)??null,feature:i,initialFeature:o,layer:r,group:n}):null}_makeGroupInputFromElement(e,t){const{feature:n,layer:s}=t;return new A({element:e,inputs:[],feature:n,layer:s})}_makeRelationshipInputFromElement(e,t,n=null){const{map:s}=this,{feature:i,layer:o}=t;return new T({element:e,feature:i,group:n,layer:o,map:s})}_assignExpressionExecutors(e,t,n){const s=C(t)?N:F(t)?L:R,i=[];for(const o of s){const s=t[o],{_expressionExecutorLookup:i}=this;if(null!=s&&""!==s){const t=`${o}Executor`,r=this._expressionInfosLookup.get(s)?.expression??s;if(i.has(r))e[t]=i.get(r);else if(n.has(r)){const s=n.get(r).then((n=>(e[t]=n,n)));n.set(r,s)}else{const s=w(r,this.layer).then((n=>(e[t]=n,i.set(r,n),n)));n.set(r,s)}}}return i}_createExpressionsManager(e,t){const{_arcadeContextInfo:n,_featureClone:s}=this;this._expressionsManager=new j({executors:e,feature:s,arcadeContextInfo:n,fieldInputs:t})}_afterValueChange(e){const{name:t,value:n}=e,{_featureClone:s,formTemplate:i,layer:o}=this;if(!o)return;const r=s.getAttribute(t);s.setAttribute(t,n);const{typeFieldName:a,types:u}=b(o);if(t===a&&n!==r){if("subtype-sublayer"===o.type){const e=o.parent?.findSublayerForFeature(s);s.sourceLayer=this.feature.sourceLayer=e}const e=new Set;for(const t of u)if(t.domains&&"object"==typeof t.domains)for(const n of Object.keys(t.domains))e.add(n);for(const t of e){const e=this.findField(t);e&&e.notifyChange("domain")}}if(null!=i){const{description:e,title:n}=i;n&&l(n,t)&&this.notifyChange("formTitle"),e&&l(e,t)&&this.notifyChange("formDescription")}this._emitChangeEvent(e)}_afterExpressionsEvaluated(){const{_featureClone:e}=this;for(const t of this.allFieldInputs)t.value!==e.getAttribute(t.name)&&this._afterValueChange(t)}_joinContingentValues(){const e=this._contingentValuesCache;if(null==e)return[];const{typeFieldName:t}=b(this.layer),n=t?this.getValue(t):null,s=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:i}=r,o=[];for(const s of e)s.isRetired||null!=s.subtype&&s.subtype.code!==n||o.push({values:s.values});o.length>0&&s.push({name:i,fields:t,contingencies:o})}const[i,o]=this._generateJoinPlan(s);return[...i.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,n=[],s=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const i=t.get(e),o=l,r=[i.name,o.name].sort().join("|");if(s.has(r))continue;n.push([i,o]),s.add(r),t.set(e,o)}else t.set(e,l);const i=new Set(n.flat()),o=new Set(e);for(const l of i)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(n.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of n){const e=a.get(l),t=a.get(u);if(e===t)continue;const n=r.get(e),s=r.get(t);for(const i of s)n.add(i),a.set(i,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),n=t.shift();let s=t.shift(),i=this._generateJoinKey(n.fields,s.fields),o=new Set([...n.fields,...s.fields]),r=new Map;for(const l of n.contingencies){const[e]=this._hashContingency(l,i.codedValueFields,!0);r.has(e)?r.get(e)?.push(l):r.set(e,[l])}for(;t.length>0;){const e=new Map,n=t.shift(),a=this._generateJoinKey(o,n.fields);for(const t of s.contingencies){const[n,s]=this._hashContingency(t,i.codedValueFields),o=s?this._findMatchingContingenciesWithAnyHashMask(r,n):r.get(n);if(r.has(k)&&o?.push(...this._findMatchingContingenciesContainingAny(t,r.get(k),i.codedValueFields)),null!=o)for(const r of o){const n=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,i.rangeFields):this._joinContingencies(r,t);if(null==n)break;const[s]=this._hashContingency(n,a.codedValueFields,!0);e.has(s)?e.get(s)?.push(n):e.set(s,[n])}}r=e,s=n,i=a,o=new Set([...o,...s.fields])}const a=[];for(const l of s.contingencies){const[e,t]=this._hashContingency(l,i.codedValueFields),n=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(k)&&n.push(...this._findMatchingContingenciesContainingAny(l,r.get(k),i.codedValueFields)),null!=n)for(const s of n){const e=i.rangeFields.length>0?this._joinContingenciesWithRangeDomains(s,l,i.rangeFields):this._joinContingencies(s,l);null!=e&&a.push(e)}}return a}_joinContingencies(e,t){const n={values:{...e.values,...t.values}};for(const[s,i]of Object.entries(n.values))"any"===i.objectType&&null!=e.values[s]&&(n.values[s]=e.values[s]);return n}_joinContingenciesWithRangeDomains(e,t,n){const s=this._joinContingencies(e,t);for(const i of n){const n=e.values[i],o=t.values[i],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:p,bothAreAny:c,leftIsRange:d,rightIsRange:f}=this._compareObjectTypes(n.objectType,o.objectType);if(l||c)continue;if(r&&p||a&&u){s.values[i]=new h({objectType:"null"});continue}if(r&&f||a&&d)return null;u?(n.minValue=-1/0,n.maxValue=1/0):p&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(n.minValue,o.minValue),g=Math.min(n.maxValue,o.maxValue);if(m>g)return null;s.values[i]=new h({objectType:"range",minValue:m,maxValue:g})}return s}_findMatchingContingenciesContainingAny(e,t,n){return t.filter((t=>n.every((n=>{const s=t.values[n],i=e.values[n];return"any"===s.objectType||"any"===i.objectType||s.codedValue?.code===i.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const n=RegExp(`${t}$`),s=[];for(const[i,o]of e){if(i===k)break;n.test(i)&&s.push(...o)}return s}_generateJoinKey(e,t){const n=Array.isArray(e)?new Set(e):e,s=Array.isArray(t)?new Set(t):t,i=n.size<s.size?n:s,o=i===n?s:n,r=new Set,a=new Set;for(const l of i)if(o.has(l)){const e=this.layer?.getFieldDomain(l,{feature:this.feature});if(null==e)continue;switch(e.type){case"coded-value":r.add(l);break;case"range":a.add(l)}}return{codedValueFields:[...r],rangeFields:[...a]}}_hashContingency(e,t,n=!1){if(t.length<1)return[S,!1];const s=[];let i=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(n)return[k,!0];i=!0,s.push(`${o}:.*`)}else"null"===t.objectType?s.push(`${o}:${H}`):s.push(`${o}:${t.codedValue?.code}`)}return[s.sort().join("&"),i]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};function O(e){return"field"===e.type||"group"===e.type||"relationship"===e.type||(i.getLogger(P).warn("form-info::unsupported-element-type","Only element types 'field', 'group' and 'relationship' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}e([u()],G.prototype,"_expressionInfosLookup",null),e([u()],G.prototype,"_featureClone",void 0),e([u()],G.prototype,"activeRelationshipInput",null),e([u()],G.prototype,"_arcadeContextInfo",null),e([u({readOnly:!0})],G.prototype,"allFieldInputs",null),e([u()],G.prototype,"allRelationshipInputs",null),e([u()],G.prototype,"_layerFieldsByName",null),e([u()],G.prototype,"arcadeEditType",void 0),e([u()],G.prototype,"contingencyConstraintViolations",void 0),e([u()],G.prototype,"disabled",void 0),e([u()],G.prototype,"feature",null),e([u()],G.prototype,"fieldsWithContingentValues",null),e([u({type:d})],G.prototype,"formTemplate",null),e([u()],G.prototype,"formDescription",null),e([u()],G.prototype,"formTitle",null),e([u()],G.prototype,"formHeaderVisible",null),e([u()],G.prototype,"inputs",void 0),e([u()],G.prototype,"inputFields",null),e([u()],G.prototype,"joinedContingentValues",null),e([u()],G.prototype,"layer",null),e([u()],G.prototype,"map",void 0),e([u()],G.prototype,"relatedRecordCallbacks",void 0),e([u()],G.prototype,"relationshipId",null),e([u()],G.prototype,"spatialReference",null),e([u()],G.prototype,"state",null),e([u()],G.prototype,"strict",void 0),e([u()],G.prototype,"submittable",null),e([u()],G.prototype,"updating",null),e([u()],G.prototype,"valid",null),e([u()],G.prototype,"view",null),e([u()],G.prototype,"getValues",null),e([u()],G.prototype,"submit",null),G=e([p(P)],G);const $=G;export{$ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Logger.js";import{watch as n,syncAndInitial as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../views/3d/environment/CloudyWeather.js";import l from"../../views/3d/environment/FoggyWeather.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Logger.js";import{watch as n,syncAndInitial as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import a from"../../views/3d/environment/CloudyWeather.js";import l from"../../views/3d/environment/FoggyWeather.js";import p from"../../views/3d/environment/RainyWeather.js";import h from"../../views/3d/environment/SnowyWeather.js";import y from"../../views/3d/environment/SunnyWeather.js";import{validateWeatherType as m}from"../../views/3d/environment/weather.js";import{WeatherState as u,WeatherError as w}from"./enums.js";const c="esri.widgets.Weather.WeatherViewModel",d=r.getLogger(c);let v=class extends t{constructor(e){super(e),this.view=null,this._weatherByType={sunny:new y,cloudy:new a,rainy:new p,snowy:new h,foggy:new l},this._settingWeather=!1}initialize(){this.addHandles([n((()=>this.current),(e=>{this._settingWeather||null==e||(this._weatherByType={...this._weatherByType,[e.type]:e})}),o)])}get state(){const e=this.view;return null!=e&&e.ready?null!=this.error?this.error===w.NotVisible?u.Ready:u.Error:u.Ready:u.Disabled}get weatherByType(){return this._weatherByType}get error(){const e=this.view;return null!=e&&e.ready?"3d"!==e.type?w.UnsupportedView:"local"===e.viewingMode?w.LocalScene:e.environment.atmosphereEnabled?e.environmentManager.weatherVisible?null:w.NotVisible:w.NoAtmosphere:null}get current(){return this._environment?.weather??this._weatherByType.sunny}set current(e){const t=this._environment;t&&(t.weather=e)}get _environment(){const e=this.view;return null!=e&&"3d"===e.type?e.environment:null}setWeatherByType(e){if(!m(e,d))return;const t=this._environment;null!=t&&(this._settingWeather=!0,t.weather=this._weatherByType[e],this._settingWeather=!1)}setSnowCoverEnabled(e){const t=this.current;"snowCover"in t&&(t.snowCover=e?"enabled":"disabled")}};e([s()],v.prototype,"view",void 0),e([s()],v.prototype,"state",null),e([s()],v.prototype,"_weatherByType",void 0),e([s()],v.prototype,"weatherByType",null),e([s()],v.prototype,"error",null),e([s()],v.prototype,"current",null),e([s()],v.prototype,"_environment",null),v=e([i(c)],v);const g=v;export{g as default};
|
package/widgets/Weather/css.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e="esri-weather",r={base:e,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",widgetIcon:"esri-icon-partly-cloudy",content:`${e}__content`,hasError:`${e}__content--has-error`,selector:`${e}__selector`,options:`${e}__options`,error:`${e}__error`,warning:`${e}__warning`},i={base:`${`${e}__labeled-slider`}`};export{r as CSS,i as LABELED_SLIDER_CSS};
|
|
5
|
+
const e="esri-weather",r={base:e,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",widgetIcon:"esri-icon-partly-cloudy",content:`${e}__content`,hasError:`${e}__content--has-error`,selector:`${e}__selector`,options:`${e}__options`,optionsHidden:`${e}__options--hidden`,error:`${e}__error`,warning:`${e}__warning`},i={base:`${`${e}__labeled-slider`}`};export{r as CSS,i as LABELED_SLIDER_CSS};
|
package/widgets/Weather.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{memoize as o}from"../core/memoize.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as s}from"../views/3d/environment/weather.js";import i from"./Widget.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{Heading as a}from"./support/Heading.js";import{classes as l}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d,tsxFragment as p}from"./support/jsxFactory.js";import{CSS as u}from"./Weather/css.js";import{WeatherState as h,WeatherError as g}from"./Weather/enums.js";import{LabeledSlider as m}from"./Weather/LabeledSlider.js";import v from"./Weather/VisibleElements.js";import y from"./Weather/WeatherViewModel.js";const b={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let w=class extends i{constructor(e){super(e),this.viewModel=new y,this.headingLevel=4,this.visibleElements=new v,this.iconClass=u.widgetIcon,this.icon=null,this._renderWeatherTypeButton=e=>{const o=this.viewModel,t=this.messages[e].label,r=o.state===h.Disabled,s=!r&&o.current.type===e;return d("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",kind:s?"brand":"neutral",disabled:r,iconStart:b[e],key:`${e}-type-button`,label:t,scale:"l",title:t,onclick:()=>{s||o.setWeatherByType(e)}})},this._memoizedCallbacks=o((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.target.checked)}})))}render(){const e=this.viewModel.state===h.Disabled;return d("div",{class:this.classes(u.base,u.esriWidget,e&&u.esriWidgetDisabled),role:"region","aria-label":this.messages.widgetLabelAccessible},this._renderContent())}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js")})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case g.LocalScene:return e.localScene;case g.NoAtmosphere:return e.noAtmosphere;case g.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===g.NotVisible){return null!=this.view&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{memoize as o}from"../core/memoize.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{weatherTypesArray as s}from"../views/3d/environment/weather.js";import i from"./Widget.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{Heading as a}from"./support/Heading.js";import{classes as l}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d,tsxFragment as p}from"./support/jsxFactory.js";import{CSS as u}from"./Weather/css.js";import{WeatherState as h,WeatherError as g}from"./Weather/enums.js";import{LabeledSlider as m}from"./Weather/LabeledSlider.js";import v from"./Weather/VisibleElements.js";import y from"./Weather/WeatherViewModel.js";const b={sunny:"brightness",cloudy:"partly-cloudy",rainy:"rain",snowy:"snow",foggy:"fog"};let w=class extends i{constructor(e){super(e),this.viewModel=new y,this.headingLevel=4,this.visibleElements=new v,this.iconClass=u.widgetIcon,this.icon=null,this._renderWeatherTypeButton=e=>{const o=this.viewModel,t=this.messages[e].label,r=o.state===h.Disabled,s=!r&&o.current.type===e;return d("calcite-button",{appearance:s?"solid":"outline","aria-checked":s?"true":"false",kind:s?"brand":"neutral",disabled:r,iconStart:b[e],key:`${e}-type-button`,label:t,scale:"l",title:t,onclick:()=>{s||o.setWeatherByType(e)}})},this._memoizedCallbacks=o((e=>({onCloudCoverChange:o=>{"cloudCover"in e&&(e.cloudCover=o)},onPrecipitationChange:o=>{"precipitation"in e&&(e.precipitation=o)},onFogStrengthChange:o=>{"fogStrength"in e&&(e.fogStrength=o)},onSnowCoverChange:e=>{this.viewModel.setSnowCoverEnabled(e.target.checked)}})))}render(){const e=this.viewModel.state===h.Disabled;return d("div",{class:this.classes(u.base,u.esriWidget,e&&u.esriWidgetDisabled),role:"region","aria-label":this.messages.widgetLabelAccessible},this._renderContent())}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js")})}get view(){return this.viewModel?.view}set view(e){this.viewModel&&(this.viewModel.view=e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get _errorMessage(){const e=this.messages.error;switch(this.viewModel.error){case g.LocalScene:return e.localScene;case g.NoAtmosphere:return e.noAtmosphere;case g.UnsupportedView:return e.unsupported;default:return null}}get _warningMessage(){if(this.viewModel.error===g.NotVisible){return null!=this.view&&"3d"===this.view?.type&&this.view.environment.atmosphereEnabled?this.messages.error.notVisible:null}return null}_renderContent(){const{headingLevel:e,messages:o,viewModel:t,visibleElements:r}=this,i=this._warningMessage,n=t.current,c=t.state===h.Error;return d(p,null,r.header?d(a,{level:e},o.widgetLabel):null,c?d("div",{key:"error",class:u.error},this._errorMessage):null,d("div",{key:"content",class:l({[u.content]:!0,[u.hasError]:c})},d("div",{"aria-label":o.weatherType,class:u.selector,key:"type-selector",role:"radiogroup"},s.map(this._renderWeatherTypeButton)),Object.values(t.weatherByType).map((e=>d("div",{key:"options-container",class:l({[u.options]:!0,[u.optionsHidden]:e.type!==n?.type})},this._renderOptions(e)))),null!=i?this._renderWarning(i):null))}_renderOptions(e){const{viewModel:o,messages:t}=this,r=o.state===h.Disabled,s=this._memoizedCallbacks(e);switch(e.type){case"sunny":return d(m,{key:"sunny-cover",disabled:r,label:t.sunny.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"cloudy":return d(m,{key:"cloudy-cover",disabled:r,label:t.cloudy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange});case"rainy":return d(p,null,d(m,{key:"rainy-cover",disabled:r,label:t.rainy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),d(m,{key:"rainy-precipitation",disabled:r,label:t.rainy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}));case"snowy":return d(p,null,d(m,{key:"snowy-cloud-cover",disabled:r,label:t.snowy.cloudCover,value:e.cloudCover,onChange:s.onCloudCoverChange}),d(m,{key:"snowy-precipitation",disabled:r,label:t.snowy.precipitation,value:e.precipitation,onChange:s.onPrecipitationChange}),d("calcite-label",{key:"snow-cover",scale:"s",layout:"inline",title:t.snowy.snowCoverTooltip},d("calcite-checkbox",{checked:"enabled"===e.snowCover,disabled:r,onCalciteCheckboxChange:s.onSnowCoverChange}),t.snowy.snowCover));case"foggy":return d(m,{key:"foggy-cover",disabled:r,label:t.foggy.fogStrength,value:e.fogStrength,onChange:s.onFogStrengthChange})}}_renderWarning(e){return d("div",{key:"warning",class:u.warning},d("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s"}),e)}};e([t()],w.prototype,"viewModel",void 0),e([t()],w.prototype,"view",null),e([t()],w.prototype,"headingLevel",void 0),e([t({type:v,nonNullable:!0})],w.prototype,"visibleElements",void 0),e([t()],w.prototype,"iconClass",void 0),e([t()],w.prototype,"icon",void 0),e([t()],w.prototype,"label",null),e([t(),c("esri/widgets/Weather/t9n/Weather")],w.prototype,"messages",void 0),e([t()],w.prototype,"_errorMessage",null),e([t()],w.prototype,"_warningMessage",null),w=e([r("esri.widgets.Weather")],w);const C=w;export{C as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../intl.js";import"../../core/has.js";import{getLocale as t}from"../../intl/locale.js";const s="en-us",n=new Map([["ar",()=>import("../../chunks/
|
|
5
|
+
import"../../intl.js";import"../../core/has.js";import{getLocale as t}from"../../intl/locale.js";const s="en-us",n=new Map([["ar",()=>import("../../chunks/ar2.js").then((t=>t.a))],["bg-bg",()=>import("../../chunks/bg_BG2.js").then((t=>t.b))],["bs-ba",()=>import("../../chunks/bs_BA2.js").then((t=>t.b))],["ca-es",()=>import("../../chunks/ca_ES2.js").then((t=>t.c))],["cs-cz",()=>import("../../chunks/cs_CZ2.js").then((t=>t.c))],["da-dk",()=>import("../../chunks/da_DK2.js").then((t=>t.d))],["de-de",()=>import("../../chunks/de_DE2.js").then((t=>t.d))],["de-ch",()=>import("../../chunks/de_CH2.js").then((t=>t.d))],["el-gr",()=>import("../../chunks/el_GR2.js").then((t=>t.e))],["en-us",()=>import("../../chunks/en_US2.js").then((t=>t.e))],["en-ca",()=>import("../../chunks/en_CA2.js").then((t=>t.e))],["es-es",()=>import("../../chunks/es_ES2.js").then((t=>t.e))],["et-ee",()=>import("../../chunks/et_EE2.js").then((t=>t.e))],["fi-fi",()=>import("../../chunks/fi_FI2.js").then((t=>t.f))],["fr-fr",()=>import("../../chunks/fr_FR2.js").then((t=>t.f))],["he-il",()=>import("../../chunks/he_IL2.js").then((t=>t.h))],["hr-hr",()=>import("../../chunks/hr_HR2.js").then((t=>t.h))],["hu-hu",()=>import("../../chunks/hu_HU2.js").then((t=>t.h))],["id-id",()=>import("../../chunks/id_ID2.js").then((t=>t.i))],["it-it",()=>import("../../chunks/it_IT2.js").then((t=>t.i))],["ja-jp",()=>import("../../chunks/ja_JP2.js").then((t=>t.j))],["ko-kr",()=>import("../../chunks/ko_KR2.js").then((t=>t.k))],["lt-lt",()=>import("../../chunks/lt_LT2.js").then((t=>t.l))],["lv-lv",()=>import("../../chunks/lv_LV2.js").then((t=>t.l))],["nb-no",()=>import("../../chunks/nb_NO2.js").then((t=>t.n))],["nl-nl",()=>import("../../chunks/nl_NL2.js").then((t=>t.n))],["pl-pl",()=>import("../../chunks/pl_PL2.js").then((t=>t.p))],["pt-br",()=>import("../../chunks/pt_BR2.js").then((t=>t.p))],["pt-pt",()=>import("../../chunks/pt_PT2.js").then((t=>t.p))],["ro-ro",()=>import("../../chunks/ro_RO2.js").then((t=>t.r))],["ru-ru",()=>import("../../chunks/ru_RU2.js").then((t=>t.r))],["sk-sk",()=>import("../../chunks/sk_SK2.js").then((t=>t.s))],["sl-sl",()=>import("../../chunks/sl_SL2.js").then((t=>t.s))],["sr-rs",()=>import("../../chunks/sr_RS2.js").then((t=>t.s))],["sv-se",()=>import("../../chunks/sv_SE2.js").then((t=>t.s))],["th-th",()=>import("../../chunks/th_TH2.js").then((t=>t.t))],["tr-tr",()=>import("../../chunks/tr_TR2.js").then((t=>t.t))],["uk-ua",()=>import("../../chunks/uk_UA2.js").then((t=>t.u))],["vi-vn",()=>import("../../chunks/vi_VN2.js").then((t=>t.v))],["zh-cn",()=>import("../../chunks/zh_Hans2.js").then((t=>t.z))],["zh-hk",()=>import("../../chunks/zh_Hant2.js").then((t=>t.z))],["zh-tw",()=>import("../../chunks/zh_Hant2.js").then((t=>t.z))]]);function h(t){const s=t.split("-")[0].toLowerCase();let h=null;for(const e of n.keys())if(e.startsWith(s)){h=e;break}return h}function e(t){return t?n.has(t.toLowerCase())?t.toLowerCase():h(t)||s:s}let r=null,o=null;async function i(s=t()){if(s=e(s),r&&s===o)return r;r=import("../../chunks/index3.js").then((t=>t.i)),o=s;try{const[t,h]=await Promise.all([r,n.get(o)()]);o===s&&(t.am4core.options.defaultLocale=h.default),t.am4core.options.suppressWarnings=!0,t.am4core.options.autoDispose=!0}catch{return r=null,o=null,null}return r}export{e as getChartLocale,i as loadChartsModule};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../intl.js";import{o as e,e as t,k as i,E as s,i as r,a,c as n,b as o,P as l,d as h,f as u,T as c,n as d,g as b,h as f,p,j as g,l as m,m as _,q as y,r as v,s as w,t as x,u as P,v as k,w as O,x as M,A as j,D as S,y as E,z as T,B,C,F as D,G as A,M as L,H as z,I as F,J as H,K as Y,L as I,N as R,O as U,Q as W,R as V,S as N,U as X,V as G,W as q,X as K,Y as Z,Z as J,_ as $,$ as Q,a0 as ee,a1 as te,a2 as ie,a3 as se,a4 as re,a5 as ae,a6 as ne,a7 as oe,a8 as le,a9 as he,aa as ue,ab as ce,ac as de,ad as be,ae as fe,af as pe,ag as ge,ah as me,ai as _e}from"../../chunks/Theme.js";import{T as ye}from"../../chunks/Tooltip.js";import{D as ve}from"../../chunks/DefaultTheme.js";import{getLocale as we}from"../../intl/locale.js";class xe{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver((e=>{t(e,(e=>{t(this._targets,(t=>{t.target===e.target&&t.callback()}))}))}))}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),i(this._targets,(t=>t.target!==e))}}class Pe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,i){if(null===this._timer){let e=null;const i=()=>{const s=Date.now();(null===e||s>e+Pe.delay)&&(e=s,t(this._targets,(e=>{let t=e.target.getBoundingClientRect();t.width===e.size.width&&t.height===e.size.height||(e.size=t,e.callback())}))),0===this._targets.length?this._timer=null:this._timer=requestAnimationFrame(i)};this._timer=requestAnimationFrame(i)}let s={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:i,size:s})}removeTarget(e){i(this._targets,(t=>t.target!==e)),0===this._targets.length&&null!==this._timer&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(Pe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let ke=null;function Oe(){return null===ke&&(ke="undefined"!=typeof ResizeObserver?new xe:new Pe),ke}class Me{constructor(t,i){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Oe(),this._element=t,this._listener=e(i),this._sensor.addTarget(t,i)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class je extends s{}Object.defineProperty(je,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(je,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:s.classNames.concat([je.className])});class Se extends s{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let s;(null==t||r(t)&&"number"===t.toLowerCase())&&(t=this.get("numberFormat",""));let h=Number(e);if(a(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(h):new Intl.NumberFormat(void 0,t).format(h)}catch(u){return"Invalid"}else{t=n(t);let e,r=this.parseFormat(t,this._root.language);e=h>this.get("negativeBase")?r.positive:h<this.get("negativeBase")?r.negative:r.zero,null==i||e.mod||(e=o(e),e.decimals.active=0==h?0:i),s=e.template.split(l).join(this.applyFormat(h,e))}return!0===this.get("forceLTR")&&(s=""+s),s}parseFormat(e,t){const i=t.translateEmpty("_thousandSeparator"),s=t.translateEmpty("_decimalSeparator");let r={positive:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1},negative:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1},zero:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1}},a=(e=e.replace("||",h)).split("|");return r.positive.source=a[0],void 0===a[2]?r.zero=r.positive:r.zero.source=a[2],void 0===a[1]?r.negative=r.positive:r.negative.source=a[1],u(r,((e,t)=>{if(t.parsed)return;let i=t.source;"number"===i.toLowerCase()&&(i=this.get("numberFormat","#,###.#####"));let s=c.chunk(i,!0);for(let r=0;r<s.length;r++){let e=s[r];if(e.text=e.text.replace(h,"|"),"value"===e.type){let i=e.text.match(/[#0.,]+[ ]?[abespABESP%!]?[abespABESP‰!]?/);if(i)if(null===i||""===i[0])t.template+=e.text;else{let s=i[0].match(/[abespABESP%‰!]{2}|[abespABESP%‰]{1}$/);s&&(t.mod=s[0].toLowerCase(),t.modSpacing=!!i[0].match(/[ ]{1}[abespABESP%‰!]{1}$/));let r=i[0].split(".");if(""===r[0]);else{t.thousands.active=(r[0].match(/0/g)||[]).length,t.thousands.passive=(r[0].match(/\#/g)||[]).length+t.thousands.active;let e=r[0].split(",");1===e.length||(t.thousands.interval=(e.pop()||"").length,0===t.thousands.interval&&(t.thousands.interval=-1))}void 0===r[1]||(t.decimals.active=(r[1].match(/0/g)||[]).length,t.decimals.passive=(r[1].match(/\#/g)||[]).length+t.decimals.active),t.template+=e.text.split(i[0]).join(l)}}else t.template+=e.text}t.parsed=!0})),r}applyFormat(e,t){let i=e<0;e=Math.abs(e);let s="",r="",a=t.mod?t.mod.split(""):[];if(-1!==a.indexOf("b")){let i=this.applyPrefix(e,this.get("bytePrefixes"),-1!==a.indexOf("!"));e=i[0],s=i[1],r=i[2],t.modSpacing&&(r=" "+r)}else if(-1!==a.indexOf("a")){let i=this.applyPrefix(e,e<this.get("smallNumberThreshold")?this.get("smallNumberPrefixes"):this.get("bigNumberPrefixes"),-1!==a.indexOf("!"));e=i[0],s=i[1],r=i[2],t.modSpacing&&(r=" "+r)}else if(-1!==a.indexOf("p")){let t=Math.min(e.toString().length+2,21);e=parseFloat(e.toPrecision(t)),s=this._root.language.translate("_percentPrefix"),r=this._root.language.translate("_percentSuffix"),""==s&&""==r&&(r="%")}else if(-1!==a.indexOf("%")){let t=Math.min(e.toString().length+2,21);e*=100,e=parseFloat(e.toPrecision(t)),r="%"}else if(-1!==a.indexOf("‰")){let t=Math.min(e.toString().length+3,21);e*=1e3,e=parseFloat(e.toPrecision(t)),r="‰"}if(-1!==a.indexOf("e")){let i;i=t.decimals.passive>=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(i[0]),r="e"+i[1],t.modSpacing&&(r=" "+r)}else if(0===t.decimals.passive)e=Math.round(e);else if(t.decimals.passive>0){let i=Math.pow(10,t.decimals.passive);e=Math.round(e*i)/i}let n="",o=d(e).split("."),l=o[0];if(l.length<t.thousands.active&&(l=Array(t.thousands.active-l.length+1).join("0")+l),t.thousands.interval>0){let e=[],i=l.split("").reverse().join("");for(let s=0,r=l.length;s<=r;s+=t.thousands.interval){let r=i.substr(s,t.thousands.interval).split("").reverse().join("");""!==r&&e.unshift(r)}l=e.join(t.thousands.separator)}n+=l,1===o.length&&o.push("");let h=o[1];return h.length<t.decimals.active&&(h+=Array(t.decimals.active-h.length+1).join("0")),""!==h&&(n+=t.decimals.separator+h),""===n&&(n="0"),0!==e&&i&&-1===a.indexOf("s")&&(n="-"+n),s&&(n=s+n),r&&(n+=r),n}applyPrefix(e,t,i=!1){let s=e,r="",a="",n=!1,o=1;for(let l=0,h=t.length;l<h;l++)t[l].number<=e&&(0===t[l].number?s=0:(s=e/t[l].number,o=t[l].number),r=t[l].prefix,a=t[l].suffix,n=!0);return!n&&i&&t.length&&0!=e&&(s=e/t[0].number,r=t[0].prefix,a=t[0].suffix,n=!0),n&&(s=parseFloat(s.toPrecision(Math.min(o.toString().length+Math.floor(s).toString().replace(/[^0-9]*/g,"").length,21)))),[s,r,a]}escape(e){return e.replace("||",h)}unescape(e){return e.replace(h,"|")}}function Ee(e,t){let i=0,s=0,r=1,a=0,n=0,o=0,l=0,h=0;return e.formatToParts(t).forEach((e=>{switch(e.type){case"year":i=+e.value;break;case"month":s=+e.value-1;break;case"day":r=+e.value;break;case"hour":a=+e.value;break;case"minute":n=+e.value;break;case"second":o=+e.value;break;case"fractionalSecond":l=+e.value;break;case"weekday":switch(e.value){case"Sun":h=0;break;case"Mon":h=1;break;case"Tue":h=2;break;case"Wed":h=3;break;case"Thu":h=4;break;case"Fri":h=5;break;case"Sat":h=6}}})),24===a&&(a=0),{year:i,month:s,day:r,hour:a,minute:n,second:o,millisecond:l,weekday:h}}function Te(e,t){const{year:i,month:s,day:r,hour:a,minute:n,second:o,millisecond:l}=Ee(e,t);return Date.UTC(i,s,r,a,n,o,l)}class Be{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),s=new Date(e);s.setUTCMinutes(s.getUTCMinutes()-(t-i));const r=s.getTimezoneOffset();return i!=r&&s.setUTCMinutes(s.getUTCMinutes()+r-i),s}offsetUTC(e){return(Te(this._utc,e)-Te(this._dtf,e))/6e4}parseDate(e){return Ee(this._dtf,e)}}class Ce extends s{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;void 0!==t&&""!==t||(t=this.get("dateFormat","yyyy-MM-dd"));let s=e;if(a(t))try{const e=this.get("intlLocales");return e?new Intl.DateTimeFormat(e,t).format(s):new Intl.DateTimeFormat(void 0,t).format(s)}catch(o){return"Invalid"}let r=this.parseFormat(t);const n=this._root.timezone;return n&&!this._root.utc&&(s=n.convertLocal(s)),b(s.getTime())?(i=this.applyFormat(s,r),this.get("capitalize")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):"Invalid date"}applyFormat(e,t){let i,s,r,a,n,o,h,u,c=t.template,d=e.getTime();this._root.utc?(i=e.getUTCFullYear(),s=e.getUTCMonth(),r=e.getUTCDay(),a=e.getUTCDate(),n=e.getUTCHours(),o=e.getUTCMinutes(),h=e.getUTCSeconds(),u=e.getUTCMilliseconds()):(i=e.getFullYear(),s=e.getMonth(),r=e.getDay(),a=e.getDate(),n=e.getHours(),o=e.getMinutes(),h=e.getSeconds(),u=e.getMilliseconds());for(let b=0,x=t.parts.length;b<x;b++){let x="";switch(t.parts[b]){case"G":x=this._t(i<0?"_era_bc":"_era_ad");break;case"yyyy":x=Math.abs(i).toString(),i<0&&(x+=this._t("_era_bc"));break;case"yyy":case"yy":case"y":x=Math.abs(i).toString().substr(-t.parts[b].length),i<0&&(x+=this._t("_era_bc"));break;case"YYYY":case"YYY":case"YY":case"Y":let l=w(e,this._root.utc);x="YYYY"==t.parts[b]?Math.abs(l).toString():Math.abs(l).toString().substr(-t.parts[b].length),l<0&&(x+=this._t("_era_bc"));break;case"u":case"F":case"g":break;case"q":x=""+Math.ceil((e.getMonth()+1)/3);break;case"MMMMM":x=this._t(this._getMonth(s)).substr(0,1);break;case"MMMM":x=this._t(this._getMonth(s));break;case"MMM":x=this._t(this._getShortMonth(s));break;case"MM":x=p(s+1,2,"0");break;case"M":x=(s+1).toString();break;case"ww":x=p(v(e,this._root.utc),2,"0");break;case"w":x=v(e,this._root.utc).toString();break;case"W":x=y(e,this._root.utc).toString();break;case"dd":x=p(a,2,"0");break;case"d":x=a.toString();break;case"DD":case"DDD":x=p(_(e,this._root.utc).toString(),t.parts[b].length,"0");break;case"D":x=_(e,this._root.utc).toString();break;case"t":x=this._root.language.translateFunc("_dateOrd").call(this,a);break;case"E":x=(r||7).toString();break;case"EE":x=p((r||7).toString(),2,"0");break;case"EEE":case"eee":x=this._t(this._getShortWeekday(r));break;case"EEEE":case"eeee":x=this._t(this._getWeekday(r));break;case"EEEEE":case"eeeee":x=this._t(this._getShortWeekday(r)).substr(0,1);break;case"e":case"ee":x=(r-(this._root.locale.firstDayOfWeek||1)+1).toString(),"ee"==t.parts[b]&&(x=p(x,2,"0"));break;case"a":x=n>=12?this._t("PM"):this._t("AM");break;case"aa":x=n>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":x=n>=12?this._t("P"):this._t("A");break;case"h":x=m(n).toString();break;case"hh":x=p(m(n),2,"0");break;case"H":x=n.toString();break;case"HH":x=p(n,2,"0");break;case"K":x=m(n,0).toString();break;case"KK":x=p(m(n,0),2,"0");break;case"k":x=(n+1).toString();break;case"kk":x=p(n+1,2,"0");break;case"m":x=o.toString();break;case"mm":x=p(o,2,"0");break;case"s":x=h.toString();break;case"ss":x=p(h,2,"0");break;case"S":case"SS":case"SSS":x=Math.round(u/1e3*Math.pow(10,t.parts[b].length)).toString();break;case"x":x=d.toString();break;case"n":case"nn":case"nnn":x=p(u,t.parts[b].length,"0");break;case"z":x=g(e,!1,!1,this._root.utc);break;case"zz":x=g(e,!0,!1,this._root.utc);break;case"zzz":x=g(e,!1,!0,this._root.utc);break;case"zzzz":x=g(e,!0,!0,this._root.utc);break;case"Z":case"ZZ":let c=this._root.utc?"UTC":this._root.timezone;c instanceof Be&&(c=c.name);const P=c?f(c):e.getTimezoneOffset();let k=Math.abs(P)/60,O=Math.floor(k),M=60*k-60*O;this._root.utc&&(O=0,M=0),"Z"==t.parts[b]?(x="GMT",x+=P>0?"-":"+",x+=p(O,2)+":"+p(M,2)):(x=P>0?"-":"+",x+=p(O,2)+p(M,2));break;case"i":x=e.toISOString();break;case"I":x=e.toUTCString()}c=c.replace(l,x)}return c}parseFormat(e){let t={template:"",parts:[]},i=c.chunk(e,!0);for(let s=0;s<i.length;s++){let e=i[s];if("value"===e.type){if(e.text.match(/^date$/i)){let t=this.get("dateFormat","yyyy-MM-dd");r(t)||(t="yyyy-MM-dd"),e.text=t}let i=e.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);if(i)for(let s=0;s<i.length;s++)t.parts.push(i[s]),e.text=e.text.replace(i[s],l)}t.template+=e.text}return t}_months(){return["January","February","March","April","May","June","July","August","September","October","November","December"]}_getMonth(e){return this._months()[e]}_shortMonths(){return["Jan","Feb","Mar","Apr","May(short)","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}_getShortMonth(e){return this._shortMonths()[e]}_weekdays(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}_getWeekday(e){return this._weekdays()[e]}_shortWeekdays(){return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}_getShortWeekday(e){return this._shortWeekdays()[e]}parse(e,t){if(e instanceof Date)return e;if(b(e))return new Date(e);let i;r(e)||(e=e.toString());let s="";t=(t=n(t)).substr(0,e.length);let a=this.parseFormat(t),o={year:-1,year3:-1,year2:-1,year1:-1,month:-1,monthShort:-1,monthLong:-1,weekdayShort:-1,weekdayLong:-1,day:-1,yearDay:-1,week:-1,hourBase0:-1,hour12Base0:-1,hourBase1:-1,hour12Base1:-1,minute:-1,second:-1,millisecond:-1,millisecondDigits:-1,am:-1,zone:-1,timestamp:-1,iso:-1},l={year:1970,month:0,day:1,hour:0,minute:0,second:0,millisecond:0,timestamp:null,offset:0,utc:this._root.utc},h=0,u=0;for(let r=0;r<a.parts.length;r++){switch(u=r+h+1,a.parts[r]){case"yyyy":case"YYYY":s+="([0-9]{4})",o.year=u;break;case"yyy":case"YYY":s+="([0-9]{3})",o.year3=u;break;case"yy":case"YY":s+="([0-9]{2})",o.year2=u;break;case"y":case"Y":s+="([0-9]{1})",o.year1=u;break;case"MMMM":s+="("+this.getStringList(this._months()).join("|")+")",o.monthLong=u;break;case"MMM":s+="("+this.getStringList(this._shortMonths()).join("|")+")",o.monthShort=u;break;case"MM":case"M":s+="([0-9]{2}|[0-9]{1})",o.month=u;break;case"ww":case"w":s+="([0-9]{2}|[0-9]{1})",o.week=u;break;case"dd":case"d":s+="([0-9]{2}|[0-9]{1})",o.day=u;break;case"DDD":case"DD":case"D":s+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.yearDay=u;break;case"dddd":s+="("+this.getStringList(this._weekdays()).join("|")+")",o.weekdayLong=u;break;case"ddd":s+="("+this.getStringList(this._shortWeekdays()).join("|")+")",o.weekdayShort=u;break;case"aaa":case"aa":case"a":s+="("+this.getStringList(["AM","PM","A.M.","P.M.","A","P"]).join("|")+")",o.am=u;break;case"hh":case"h":s+="([0-9]{2}|[0-9]{1})",o.hour12Base1=u;break;case"HH":case"H":s+="([0-9]{2}|[0-9]{1})",o.hourBase0=u;break;case"KK":case"K":s+="([0-9]{2}|[0-9]{1})",o.hour12Base0=u;break;case"kk":case"k":s+="([0-9]{2}|[0-9]{1})",o.hourBase1=u;break;case"mm":case"m":s+="([0-9]{2}|[0-9]{1})",o.minute=u;break;case"ss":case"s":s+="([0-9]{2}|[0-9]{1})",o.second=u;break;case"SSS":case"SS":case"S":s+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.millisecond=u,o.millisecondDigits=a.parts[r].length;break;case"nnn":case"nn":case"n":s+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.millisecond=u;break;case"x":s+="([0-9]{1,})",o.timestamp=u;break;case"Z":s+="GMT([-+]+[0-9]{2}:[0-9]{2})",o.zone=u;break;case"ZZ":s+="([\\-+]+[0-9]{2}[0-9]{2})",o.zone=u;break;case"i":s+="([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)",o.iso=u,h+=7;break;case"G":case"YYYY":case"YYY":case"YY":case"Y":case"MMMMM":case"W":case"EEEEE":case"EEEE":case"EEE":case"EE":case"E":case"eeeee":case"eeee":case"eee":case"ee":case"e":case"zzzz":case"zzz":case"zz":case"z":case"t":h--}s+="[^0-9]*"}let c=new RegExp(s),d=e.match(c);if(d){if(o.year>-1&&(l.year=parseInt(d[o.year])),o.year3>-1){let e=parseInt(d[o.year3]);e+=1e3,l.year=e}if(o.year2>-1){let e=parseInt(d[o.year2]);e+=e>50?1e3:2e3,l.year=e}if(o.year1>-1){let e=parseInt(d[o.year1]);e=10*Math.floor((new Date).getFullYear()/10)+e,l.year=e}if(o.monthLong>-1&&(l.month=this.resolveMonth(d[o.monthLong])),o.monthShort>-1&&(l.month=this.resolveShortMonth(d[o.monthShort])),o.month>-1&&(l.month=parseInt(d[o.month])-1),o.week>-1&&-1===o.day&&(l.month=0,l.day=x(parseInt(d[o.week]),l.year,1,this._root.utc)),o.day>-1&&(l.day=parseInt(d[o.day])),o.yearDay>-1&&(l.month=0,l.day=parseInt(d[o.yearDay])),o.hourBase0>-1&&(l.hour=parseInt(d[o.hourBase0])),o.hourBase1>-1&&(l.hour=parseInt(d[o.hourBase1])-1),o.hour12Base0>-1){let e=parseInt(d[o.hour12Base0]);11==e&&(e=0),o.am>-1&&!this.isAm(d[o.am])&&(e+=12),l.hour=e}if(o.hour12Base1>-1){let e=parseInt(d[o.hour12Base1]);12==e&&(e=0),o.am>-1&&!this.isAm(d[o.am])&&(e+=12),l.hour=e}if(o.minute>-1&&(l.minute=parseInt(d[o.minute])),o.second>-1&&(l.second=parseInt(d[o.second])),o.millisecond>-1){let e=parseInt(d[o.millisecond]);2==o.millisecondDigits?e*=10:1==o.millisecondDigits&&(e*=100),l.millisecond=e}if(o.timestamp>-1){l.timestamp=parseInt(d[o.timestamp]);const e=new Date(l.timestamp);l.year=e.getUTCFullYear(),l.month=e.getUTCMonth(),l.day=e.getUTCDate(),l.hour=e.getUTCHours(),l.minute=e.getUTCMinutes(),l.second=e.getUTCSeconds(),l.millisecond=e.getUTCMilliseconds()}o.zone>-1&&(l.offset=this.resolveTimezoneOffset(new Date(l.year,l.month,l.day),d[o.zone])),o.iso>-1&&(l.year=P(d[o.iso+0]),l.month=P(d[o.iso+1])-1,l.day=P(d[o.iso+2]),l.hour=P(d[o.iso+3]),l.minute=P(d[o.iso+4]),l.second=P(d[o.iso+5]),l.millisecond=P(d[o.iso+6]),"Z"==d[o.iso+7]||"z"==d[o.iso+7]?l.utc=!0:""!=d[o.iso+7]&&(l.offset=this.resolveTimezoneOffset(new Date(l.year,l.month,l.day),d[o.iso+7]))),i=l.utc?new Date(Date.UTC(l.year,l.month,l.day,l.hour,l.minute,l.second,l.millisecond)):new Date(l.year,l.month,l.day,l.hour,l.minute+l.offset,l.second,l.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),s=i[1],r=i[2],a=i[3],n=60*parseInt(r)+parseInt(a);return"+"==s&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;i<e.length;i++)this._root.language?t.push(k(this._t(e[i]))):t.push(k(e[i]));return t}}class De extends s{constructor(){super(...arguments),Object.defineProperty(this,"_unitAliases",{enumerable:!0,configurable:!0,writable:!0,value:{Y:"y",D:"d",H:"h",K:"h",k:"h",n:"S"}})}_setDefaults(){const e="_duration_millisecond",t="_duration_second",i="_duration_minute",s="_duration_hour",r="_duration_day",a="_duration_week",n="_duration_month",o="_duration_year",l="_second",h="_minute",u="_hour",c="_day",d="_week",b="_week",f="_year";this._setDefault("negativeBase",0),this._setDefault("baseUnit","second"),this._setDefault("durationFormats",{millisecond:{millisecond:this._t(e),second:this._t(e+l),minute:this._t(e+h),hour:this._t(e+u),day:this._t(e+c),week:this._t(e+d),month:this._t(e+b),year:this._t(e+f)},second:{second:this._t(t),minute:this._t(t+h),hour:this._t(t+u),day:this._t(t+c),week:this._t(t+d),month:this._t(t+b),year:this._t(t+f)},minute:{minute:this._t(i),hour:this._t(i+u),day:this._t(i+c),week:this._t(i+d),month:this._t(i+b),year:this._t(i+f)},hour:{hour:this._t(s),day:this._t(s+c),week:this._t(s+d),month:this._t(s+b),year:this._t(s+f)},day:{day:this._t(r),week:this._t(r+d),month:this._t(r+b),year:this._t(r+f)},week:{week:this._t(a),month:this._t(a+b),year:this._t(a+f)},month:{month:this._t(n),year:this._t(n+f)},year:{year:this._t(o)}}),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let s=i||this.get("baseUnit");void 0!==t&&""!==t||(t=null!=this.get("durationFormat")?this.get("durationFormat"):this.getFormat(P(e),void 0,s)),t=n(t);let r,a=this.parseFormat(t,s),o=Number(e);r=o>this.get("negativeBase")?a.positive:o<this.get("negativeBase")?a.negative:a.zero;let l=this.applyFormat(o,r);return""!==r.color&&(l="["+r.color+"]"+l+"[/]"),l}parseFormat(e,t){let i=t||this.get("baseUnit"),s={positive:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1},negative:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1},zero:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1}},r=(e=e.replace("||",h)).split("|");return s.positive.source=r[0],void 0===r[2]?s.zero=s.positive:s.zero.source=r[2],void 0===r[1]?s.negative=s.positive:s.negative.source=r[1],u(s,((e,t)=>{if(t.parsed)return;let i=t.source,s=[];s=t.source.match(/^\[([^\]]*)\]/),s&&s.length&&""!==s[0]&&(i=t.source.substr(s[0].length),t.color=s[1]);let r=c.chunk(i,!0);for(let a=0;a<r.length;a++){let e=r[a];if(e.text=e.text.replace(h,"|"),"value"===e.type){e.text.match(/[yYMdDwhHKkmsSn]+a/)&&(t.absolute=!0,e.text=e.text.replace(/([yYMdDwhHKkmsSn]+)a/,"$1"));let i=e.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);if(i)for(let s=0;s<i.length;s++)null==i[s]&&(i[s]=this._unitAliases[i[s]]),t.parts.push(i[s]),e.text=e.text.replace(i[s],l)}t.template+=e.text}t.parsed=!0})),s}applyFormat(e,t){let i=!t.absolute&&e<this.get("negativeBase");e=Math.abs(e);let s=this.toTimeStamp(e,t.baseUnit),r=t.template;for(let a=0,n=t.parts.length;a<n;a++){let e=t.parts[a],i=this._toTimeUnit(e.substr(0,1)),n=e.length,o=Math.floor(s/this._getUnitValue(i));r=r.replace(l,p(o,n,"0")),s-=o*this._getUnitValue(i)}return i&&(r="-"+r),r}toTimeStamp(e,t){return e*this._getUnitValue(t)}_toTimeUnit(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year"}}getFormat(e,t,i){if(null!=this.get("durationFormat"))return this.get("durationFormat");if(i||(i=this.get("baseUnit")),null!=t&&e!=t){e=Math.abs(e),t=Math.abs(t);let s=this.getValueUnit(Math.max(e,t),i);return this.get("durationFormats")[i][s]}{let t=this.getValueUnit(e,i);return this.get("durationFormats")[i][t]}}getValueUnit(e,t){let i;t||(t=this.get("baseUnit"));let s=this.getMilliseconds(e,t);return O(this._getUnitValues(),((e,r)=>{if(e==t||i){if(s/r<=1)return i||(i=e),!1;i=e}return!0})),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const Ae={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(e){let t="th";if(e<11||e>13)switch(e%10){case 1:t="st";break;case 2:t="nd";break;case 3:t="rd"}return t},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Le extends s{_setDefaults(){this.setPrivate("defaultLocale",Ae),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let s=e,r=t[e];if(null===r)s="";else if(null!=r)r&&(s=r);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let a=i.length,n=0;n<a;++n)s=s.split("%"+(n+1)).join(i[n]);return s}translateAny(e,t,...i){return this.translate(e,t,...i)}setTranslationAny(e,t,i){(i||this._root.locale)[e]=t}setTranslationsAny(e,t){u(e,((e,i)=>{this.setTranslationAny(e,i,t)}))}translateEmpty(e,t,...i){let s=this.translate(e,t,...i);return s==e?"":s}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:M(e,(e=>this.translate(e,t)))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class ze{constructor(e=1,t=0,i=0,s=1,r=0,a=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=s,this.tx=r,this.ty=a}setTransform(e,t,i,s,r,a=1){this.a=Math.cos(r)*a,this.b=Math.sin(r)*a,this.c=-Math.sin(r)*a,this.d=Math.cos(r)*a,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,s=this.c,r=this.d;this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*r+this.ty}prepend(e){const t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){const t=this.a,i=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Fe=function(){function e(e,t){var i=[],s=!0,r=!1,a=void 0;try{for(var n,o=e[Symbol.iterator]();!(s=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){r=!0,a=l}finally{try{!s&&o.return&&o.return()}finally{if(r)throw a}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),He=2*Math.PI,Ye=function(e,t,i,s,r,a,n){var o=e.x,l=e.y;return{x:s*(o*=t)-r*(l*=i)+a,y:r*o+s*l+n}},Ie=function(e,t){var i=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),s=Math.cos(e),r=Math.sin(e),a=Math.cos(e+t),n=Math.sin(e+t);return[{x:s-r*i,y:r+s*i},{x:a+n*i,y:n-a*i},{x:a,y:n}]},Re=function(e,t,i,s){var r=e*i+t*s;return r>1&&(r=1),r<-1&&(r=-1),(e*s-t*i<0?-1:1)*Math.acos(r)},Ue=function(e,t,i,s,r,a,n,o,l,h,u,c){var d=Math.pow(r,2),b=Math.pow(a,2),f=Math.pow(u,2),p=Math.pow(c,2),g=d*b-d*p-b*f;g<0&&(g=0),g/=d*p+b*f;var m=(g=Math.sqrt(g)*(n===o?-1:1))*r/a*c,_=g*-a/r*u,y=h*m-l*_+(e+i)/2,v=l*m+h*_+(t+s)/2,w=(u-m)/r,x=(c-_)/a,P=(-u-m)/r,k=(-c-_)/a,O=Re(1,0,w,x),M=Re(w,x,P,k);return 0===o&&M>0&&(M-=He),1===o&&M<0&&(M+=He),[y,v,O,M]},We=function(e){var t=e.px,i=e.py,s=e.cx,r=e.cy,a=e.rx,n=e.ry,o=e.xAxisRotation,l=void 0===o?0:o,h=e.largeArcFlag,u=void 0===h?0:h,c=e.sweepFlag,d=void 0===c?0:c,b=[];if(0===a||0===n)return[];var f=Math.sin(l*He/360),p=Math.cos(l*He/360),g=p*(t-s)/2+f*(i-r)/2,m=-f*(t-s)/2+p*(i-r)/2;if(0===g&&0===m)return[];a=Math.abs(a),n=Math.abs(n);var _=Math.pow(g,2)/Math.pow(a,2)+Math.pow(m,2)/Math.pow(n,2);_>1&&(a*=Math.sqrt(_),n*=Math.sqrt(_));var y=Ue(t,i,s,r,a,n,u,d,f,p,g,m),v=Fe(y,4),w=v[0],x=v[1],P=v[2],k=v[3],O=Math.abs(k)/(He/4);Math.abs(1-O)<1e-7&&(O=1);var M=Math.max(Math.ceil(O),1);k/=M;for(var j=0;j<M;j++)b.push(Ie(P,k)),P+=k;return b.map((function(e){var t=Ye(e[0],a,n,p,f,w,x),i=t.x,s=t.y,r=Ye(e[1],a,n,p,f,w,x),o=r.x,l=r.y,h=Ye(e[2],a,n,p,f,w,x);return{x1:i,y1:s,x2:o,y2:l,x:h.x,y:h.y}}))};function Ve(e,t,i){if(t!==i)throw new Error("Required "+i+" arguments for "+e+" but got "+t)}function Ne(e,t,i){if(t<i)throw new Error("Required at least "+i+" arguments for "+e+" but got "+t)}function Xe(e,t,i){if(Ne(e,t,i),t%i!=0)throw new Error("Arguments for "+e+" must be in pairs of "+i)}function Ge(e){for(let t=0;t<e.length;t+=7){let i=t+3,s=e[i];if(s.length>1){const t=/^([01])([01])(.*)$/.exec(s);null!==t&&(e.splice(i,0,t[1]),++i,e.splice(i,0,t[2]),++i,t[3].length>0?e[i]=t[3]:e.splice(i,1))}if(++i,s=e[i],s.length>1){const t=/^([01])(.+)$/.exec(s);null!==t&&(e.splice(i,0,t[1]),++i,e[i]=t[2])}}}function qe(e){if(0===e||1===e)return e;throw new Error("Flag must be 0 or 1")}function Ke(e){const t=[0,0,0];for(let i=0;i<24;i++)t[i%3]<<=1,t[i%3]|=1&e,e>>=1;return(0|t[2])+(t[1]<<8)+(t[0]<<16)}function Ze(e,t){for(;(!e.interactive||t(e))&&e._parent;)e=e._parent}function Je(e,t,i){return T(e,z(t),(e=>{const t=F(e);let s=e.touches;s?(0==s.length&&(s=e.changedTouches),i(Y(s),t)):i([e],t)}))}function $e(e){const t=document.createElement("canvas");t.width=1,t.height=1;const i=t.getContext("2d",{willReadFrequently:!0});i.drawImage(e,0,0,1,1);try{return i.getImageData(0,0,1,1),!1}catch(s){return console.warn('Image "'+e.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function Qe(e){e.width=0,e.height=0,e.style.width="0px",e.style.height="0px"}class et{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class tt extends G{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new et}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){if(null==e)this._layer=void 0;else{const i=!0;this._layer=this._renderer.getLayer(e,i),this._layer.visible=i,this._layer.margin=t,t&&q(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost()}}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return void 0===this._colorId&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(){return 0==this.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(){return this._isInteractive()}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){if(!this._localBounds){const e=1e7;this._localBounds={left:e,top:e,right:-e,bottom:-e},this._addBounds(this._localBounds)}return this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),s=t.apply({x:e.right,y:e.top}),r=t.apply({x:e.right,y:e.bottom}),a=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,s.x,r.x,a.x),top:Math.min(i.y,s.y,r.y,a.y),right:Math.max(i.x,s.x,r.x,a.x),bottom:Math.max(i.y,s.y,r.y,a.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new S((()=>{}))}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let s=i.tx*t,r=i.ty*t;this.crisp&&(s=Math.floor(s)+.5,r=Math.floor(r)+.5),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,s,r)}_transformMargin(e,t,i){const s=this._matrix;e.setTransform(s.a*t,s.b*t,s.c*t,s.d*t,(s.tx+i.left)*t,(s.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(!1!==this.exportable||!this._renderer._omitTainted)){this._setMatrix();const i=this._renderer.resolution,s=this._renderer.layers,r=this._renderer._ghostLayer,a=r.context,n=this.mask;n&&n._setMatrix(),t(s,(e=>{if(e){const t=e.context;t.save(),n&&(n._transformLayer(t,i,e),n._runPath(t),t.clip()),t.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(t,i,e),this.filter&&(t.filter=this.filter)}})),a.save(),n&&this._isInteractiveMask()&&(n._transformMargin(a,i,r.margin),n._runPath(a),a.clip()),this._transformMargin(a,i,r.margin),this._render(e),a.restore(),t(s,(e=>{e&&e.context.restore()}))}}_render(e){if(!1===this.exportable){(this._layer||e).tainted=!0}}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some((e=>e.value===this))}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class it extends tt{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(){return this.interactiveChildren||super._isInteractiveMask()}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,H(this._children,e)}_render(e){super._render(e);const i=this._renderer;this.interactive&&this.interactiveChildren&&++i._forceInteractive;const s=this._layer||e;t(this._children,(e=>{e.compoundAlpha=this.compoundAlpha*this.alpha,e.render(s)})),this.interactive&&this.interactiveChildren&&--i._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),I(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&t(this._childLayers,(e=>e.dirty=!0))}_dispose(){super._dispose(),this._childLayers&&t(this._childLayers,(e=>{e.dirty=!0}))}}function st(e,t){e.left=Math.min(e.left,t.x),e.top=Math.min(e.top,t.y),e.right=Math.max(e.right,t.x),e.bottom=Math.max(e.bottom,t.y)}class rt{colorize(e,t){}path(e){}addBounds(e){}}class at extends rt{colorize(e,t){e.beginPath()}}class nt extends rt{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=void 0!==t?t:this.color}}class ot extends rt{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class lt extends rt{colorize(e,t){e.stroke()}}class ht extends rt{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=void 0!==t?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ut extends rt{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class ct extends rt{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class dt extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,s=t+this.width,r=i+this.height;st(e,{x:t,y:i}),st(e,{x:s,y:i}),st(e,{x:t,y:r}),st(e,{x:s,y:r})}}class bt extends rt{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){st(e,{x:this.x-this.radius,y:this.y-this.radius}),st(e,{x:this.x+this.radius,y:this.y+this.radius})}}class ft extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){st(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),st(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class pt extends rt{constructor(e,t,i,s,r,a){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=K(this.cx,this.cy,this.startAngle*Z,this.endAngle*Z,this.radius);st(e,{x:t.left,y:t.top}),st(e,{x:t.right,y:t.bottom})}}class gt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class mt extends rt{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){st(e,{x:this.x,y:this.y})}}class _t extends rt{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){st(e,{x:this.x,y:this.y})}}class yt extends rt{path(e){e.closePath()}}class vt extends rt{constructor(e,t,i,s,r,a){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){st(e,{x:this.cpX,y:this.cpY}),st(e,{x:this.cpX2,y:this.cpY2}),st(e,{x:this.toX,y:this.toY})}}class wt extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){st(e,{x:this.cpX,y:this.cpY}),st(e,{x:this.toX,y:this.toY})}}class xt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:r})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class Pt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){st(e,{x:this.x,y:this.y}),st(e,{x:this.width,y:this.height})}}class kt extends tt{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:R.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof C?this._pushOp(new nt(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new nt(e))):this._pushOp(new nt("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new ot(this._hasShadows))}endStroke(){this._pushOp(new lt)}beginPath(){this._pushOp(new at)}lineStyle(e=0,t,i=1,s){this._strokeAlpha=i,t?t instanceof C?this._pushOp(new ht(e,t.toCSS(i),s)):this._pushOp(new ht(e,t,s)):this._pushOp(new ht(e,"rgba(0, 0, 0, "+i+")",s))}setLineDash(e){this._pushOp(new ut(e||[]))}setLineDashOffset(e=0){this._pushOp(new ct(e))}drawRect(e,t,i,s){this._pushOp(new dt(e,t,i,s))}drawCircle(e,t,i){this._pushOp(new bt(e,t,i))}drawEllipse(e,t,i,s){this._pushOp(new ft(e,t,i,s))}arc(e,t,i,s,r,a=!1){this._pushOp(new pt(e,t,i,s,r,a))}arcTo(e,t,i,s,r){this._pushOp(new gt(e,t,i,s,r))}lineTo(e,t){this._pushOp(new mt(e,t))}moveTo(e,t){this._pushOp(new _t(e,t))}bezierCurveTo(e,t,i,s,r,a){this._pushOp(new vt(e,t,i,s,r,a))}quadraticCurveTo(e,t,i,s){this._pushOp(new wt(e,t,i,s))}closePath(){this._pushOp(new yt)}shadow(e,t=0,i=0,s=0,r){this._hasShadows=!0,this._pushOp(new xt(r?e.toCSS(r):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,s))}image(e,t,i,s,r){this._pushOp(new Pt(e,t,i,s,r))}svgPath(e){let i=0,s=0,r=null,a=null,n=null,o=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,h=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let u;for(;null!==(u=l.exec(e));){const e=u[1],l=u[2],c=[];for(;null!==(u=h.exec(l));)c.push(u[1]);switch("S"!==e&&"s"!==e&&"C"!==e&&"c"!==e&&(r=null,a=null),"Q"!==e&&"q"!==e&&"T"!==e&&"t"!==e&&(n=null,o=null),e){case"M":Xe(e,c.length,2),i=+c[0],s=+c[1],this.moveTo(i,s);for(let e=2;e<c.length;e+=2)i=+c[e],s=+c[e+1],this.lineTo(i,s);break;case"m":Xe(e,c.length,2),i+=+c[0],s+=+c[1],this.moveTo(i,s);for(let e=2;e<c.length;e+=2)i+=+c[e],s+=+c[e+1],this.lineTo(i,s);break;case"L":Xe(e,c.length,2);for(let e=0;e<c.length;e+=2)i=+c[e],s=+c[e+1],this.lineTo(i,s);break;case"l":Xe(e,c.length,2);for(let e=0;e<c.length;e+=2)i+=+c[e],s+=+c[e+1],this.lineTo(i,s);break;case"H":Ne(e,c.length,1);for(let e=0;e<c.length;++e)i=+c[e],this.lineTo(i,s);break;case"h":Ne(e,c.length,1);for(let e=0;e<c.length;++e)i+=+c[e],this.lineTo(i,s);break;case"V":Ne(e,c.length,1);for(let e=0;e<c.length;++e)s=+c[e],this.lineTo(i,s);break;case"v":Ne(e,c.length,1);for(let e=0;e<c.length;++e)s+=+c[e],this.lineTo(i,s);break;case"C":Xe(e,c.length,6);for(let e=0;e<c.length;e+=6){const t=+c[e],n=+c[e+1];r=+c[e+2],a=+c[e+3],i=+c[e+4],s=+c[e+5],this.bezierCurveTo(t,n,r,a,i,s)}break;case"c":Xe(e,c.length,6);for(let e=0;e<c.length;e+=6){const t=+c[e]+i,n=+c[e+1]+s;r=+c[e+2]+i,a=+c[e+3]+s,i+=+c[e+4],s+=+c[e+5],this.bezierCurveTo(t,n,r,a,i,s)}break;case"S":Xe(e,c.length,4),null!==r&&null!==a||(r=i,a=s);for(let e=0;e<c.length;e+=4){const t=2*i-r,n=2*s-a;r=+c[e],a=+c[e+1],i=+c[e+2],s=+c[e+3],this.bezierCurveTo(t,n,r,a,i,s)}break;case"s":Xe(e,c.length,4),null!==r&&null!==a||(r=i,a=s);for(let e=0;e<c.length;e+=4){const t=2*i-r,n=2*s-a;r=+c[e]+i,a=+c[e+1]+s,i+=+c[e+2],s+=+c[e+3],this.bezierCurveTo(t,n,r,a,i,s)}break;case"Q":Xe(e,c.length,4);for(let e=0;e<c.length;e+=4)n=+c[e],o=+c[e+1],i=+c[e+2],s=+c[e+3],this.quadraticCurveTo(n,o,i,s);break;case"q":Xe(e,c.length,4);for(let e=0;e<c.length;e+=4)n=+c[e]+i,o=+c[e+1]+s,i+=+c[e+2],s+=+c[e+3],this.quadraticCurveTo(n,o,i,s);break;case"T":Xe(e,c.length,2),null!==n&&null!==o||(n=i,o=s);for(let e=0;e<c.length;e+=2)n=2*i-n,o=2*s-o,i=+c[e],s=+c[e+1],this.quadraticCurveTo(n,o,i,s);break;case"t":Xe(e,c.length,2),null!==n&&null!==o||(n=i,o=s);for(let e=0;e<c.length;e+=2)n=2*i-n,o=2*s-o,i+=+c[e],s+=+c[e+1],this.quadraticCurveTo(n,o,i,s);break;case"A":case"a":const l="a"===e;Ge(c),Xe(e,c.length,7);for(let e=0;e<c.length;e+=7){let r=+c[e+5],a=+c[e+6];l&&(r+=i,a+=s);const n=We({px:i,py:s,rx:+c[e],ry:+c[e+1],xAxisRotation:+c[e+2],largeArcFlag:qe(+c[e+3]),sweepFlag:qe(+c[e+4]),cx:r,cy:a});t(n,(e=>{this.bezierCurveTo(e.x1,e.y1,e.x2,e.y2,e.x,e.y),i=e.x,s=e.y}))}break;case"Z":case"z":Ve(e,c.length,0),this.closePath()}}}_runPath(e){e.beginPath(),t(this._operations,(t=>{t.path(e)}))}_render(e){super._render(e);const i=this._layer||e,s=i.dirty,r=this._isInteractive();if(s||r){const e=i.context,a=this._renderer._ghostLayer.context;let n;s&&(e.globalCompositeOperation=this.blendMode,e.beginPath()),r&&(a.beginPath(),n=this._getColorId()),t(this._operations,(t=>{s&&(t.path(e),t.colorize(e,void 0)),r&&(t.path(a),t.colorize(a,n))}))}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const i=this.mask;i&&(i._setMatrix(),i._transform(e,1),i._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),t(this._operations,(t=>{t.path(e),t.colorize(e,void 0)})),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&t(this._operations,(t=>{t.addBounds(e)}))}}class Ot extends tt{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const s=e.context,r=this._renderer._ghostLayer.context,a=this.style;let n=this._getFontStyle(void 0,i);s.font=n,this._isInteractive()&&!t&&(r.font=n),a.fill&&(a.fill instanceof C?s.fillStyle=a.fill.toCSS(null!=a.fillOpacity?a.fillOpacity:1):s.fillStyle=a.fill),a.shadowColor&&(e.context.shadowColor=a.shadowColor.toCSS(a.shadowOpacity||1)),a.shadowBlur&&(e.context.shadowBlur=a.shadowBlur),a.shadowOffsetX&&(e.context.shadowOffsetX=a.shadowOffsetX),a.shadowOffsetY&&(e.context.shadowOffsetY=a.shadowOffsetY),this._shared(s),this._isInteractive()&&!t&&(r.fillStyle=this._getColorId(),this._shared(r))}_getFontStyle(e,t=!1){const i=this.style;let s=[];return e&&e.fontVariant?s.push(e.fontVariant):i.fontVariant&&s.push(i.fontVariant),t||(e&&e.fontWeight?s.push(e.fontWeight):i.fontWeight&&s.push(i.fontWeight)),e&&e.fontStyle?s.push(e.fontStyle):i.fontStyle&&s.push(i.fontStyle),e&&e.fontSize?(b(e.fontSize)&&(e.fontSize=e.fontSize+"px"),s.push(e.fontSize)):i.fontSize&&(b(i.fontSize)&&(i.fontSize=i.fontSize+"px"),s.push(i.fontSize)),e&&e.fontFamily?s.push(e.fontFamily):i.fontFamily?s.push(i.fontFamily):s.length&&s.push("Arial"),s.join(" ")}_render(e){const i=this._layer||e;if(this._textInfo||this._measure(i),this.textVisible){const e=this._isInteractive(),s=i.context,r=i.dirty,a=this._renderer._ghostLayer.context;s.save(),a.save(),this._prerender(i),t(this._textInfo,((i,n)=>{t(i.textChunks,((t,n)=>{if(t.style&&(s.save(),a.save(),s.font=t.style,this._isInteractive()&&(a.font=t.style)),t.fill&&(s.save(),s.fillStyle=t.fill.toCSS()),r&&s.fillText(t.text,t.offsetX,i.offsetY+t.offsetY),"underline"==t.textDecoration||"line-through"==t.textDecoration){let e,r=1,a=1,n=t.height,o=t.offsetX;switch(this.style.textAlign){case"right":case"end":o-=t.width;break;case"center":o-=t.width/2}if(t.style){switch(c.getTextStyle(t.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":r=2}}n&&(a=n/20),e="line-through"==t.textDecoration?r+i.offsetY+t.offsetY-t.height/2:r+1.5*a+i.offsetY+t.offsetY,s.save(),s.beginPath(),t.fill?s.strokeStyle=t.fill.toCSS():this.style.fill&&this.style.fill instanceof C&&(s.strokeStyle=this.style.fill.toCSS()),s.lineWidth=r*a,s.moveTo(o,e),s.lineTo(o+t.width,e),s.stroke(),s.restore()}e&&this.interactive&&a.fillText(t.text,t.offsetX,i.offsetY+t.offsetY),t.fill&&s.restore(),t.style&&(s.restore(),a.restore())}))})),s.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure(this.getLayer());st(e,{x:t.left,y:t.top}),st(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const i=e.context,s=this._renderer._ghostLayer.context,r="rtl"==this.style.direction;this._textInfo=[];const a=this.style.oversizedBehavior,n=this.style.maxWidth,o=b(n)&&"truncate"==a,l=b(n)&&("wrap"==a||"wrap-no-break"==a);i.save(),s.save(),this._prerender(e,!0,this._ignoreFontWeight());const h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",u=this.text.toString().replace(/\r/g,"").split(/\n/);let d,f=!0,p=0,g=0,m=0;t(u,((e,t)=>{let r;for(r=""==e?[{type:"value",text:""}]:c.chunk(e,!1,this.style.ignoreFormatting);r.length>0;){let e={offsetY:m,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const t=this._measureText(h,i),a=t.actualBoundingBoxAscent+t.actualBoundingBoxDescent;let u;e.height=a,e.ascent=t.actualBoundingBoxAscent;let b,_,y,v=this.style.textDecoration,w=!1,x=!0,k=[];U(r,((t,a)=>{if("format"==t.type)if("[/]"==t.text)f||(i.restore(),s.restore(),f=!0),b=void 0,d=void 0,_=void 0,v=this.style.textDecoration,y=void 0,u=t.text;else{f||(i.restore(),s.restore());let r=c.getTextStyle(t.text);const a=this._getFontStyle(r);i.save(),s.save(),i.font=a,d=a,u=t.text,r.textDecoration&&(v=r.textDecoration),r.fill&&(b=r.fill),r.width&&(_=P(r.width)),r.verticalAlign&&(y=r.verticalAlign),f=!1;const n=this._measureText(h,i),o=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent;o>e.height&&(e.height=o),n.actualBoundingBoxAscent>e.ascent&&(e.ascent=n.actualBoundingBoxAscent)}else if("value"==t.type&&!w){const s=this._measureText(t.text,i);let h=s.actualBoundingBoxLeft+s.actualBoundingBoxRight;if(o){let s=x||this.style.breakWords||!1;const r=this.style.ellipsis||"",a=this._measureText(r,i),o=a.actualBoundingBoxLeft+a.actualBoundingBoxRight;if(e.width+h>n){const a=n-e.width-o;t.text=this._truncateText(i,t.text,a,s),t.text+=r,w=!0}}else if(l&&e.width+h>n){const s=n-e.width,o=this._truncateText(i,t.text,s,!1,x&&"wrap-no-break"!=this.style.oversizedBehavior);if(""==o)return this.textVisible=!0,!1;k=r.slice(a+1),J(o)!=J(t.text)&&(k.unshift({type:"value",text:t.text.substr(o.length)}),u&&k.unshift({type:"format",text:u})),t.text=J(o),r=[],w=!0}let c=1,f=1;if(d&&_&&_>h){const e=h/_;switch(this.style.textAlign){case"right":case"end":c=e;break;case"center":c=e,f=e;break;default:f=e}h=_}const p=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;p>e.height&&(e.height=p),s.actualBoundingBoxAscent>e.ascent&&(e.ascent=s.actualBoundingBoxAscent),e.width+=h,e.left+=s.actualBoundingBoxLeft/c,e.right+=s.actualBoundingBoxRight/f,e.textChunks.push({style:d,fill:b,text:t.text,width:h,height:p,left:s.actualBoundingBoxLeft,right:s.actualBoundingBoxRight,ascent:s.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:v,verticalAlign:y}),x=!1}return!0})),this.style.lineHeight instanceof W?(e.height*=this.style.lineHeight.value,e.ascent*=this.style.lineHeight.value):(e.height*=this.style.lineHeight||1.2,e.ascent*=this.style.lineHeight||1.2),p<e.left&&(p=e.left),g<e.right&&(g=e.right),this._textInfo.push(e),m+=e.height,r=k||[]}})),f||(i.restore(),s.restore()),t(this._textInfo,((e,i)=>{let s=0;t(e.textChunks,(t=>{if(t.offsetX=s+t.left-e.left,t.offsetY+=e.height-e.height*(this.style.baselineRatio||.19),s+=t.width,t.verticalAlign)switch(t.verticalAlign){case"super":t.offsetY-=e.height/2-t.height/2;break;case"sub":t.offsetY+=t.height/2}}))}));const _={left:r?-g:-p,top:0,right:r?p:g,bottom:m};if("none"!==a){const e=this._fitRatio(_);if(e<1)if("fit"==a)b(this.style.minScale)&&e<this.style.minScale?(this.textVisible=!1,_.left=0,_.top=0,_.right=0,_.bottom=0):(this._originalScale&&1!=this._originalScale||(this._originalScale=this.scale),this.scale=e,this.textVisible=!0);else if("hide"==a)this.textVisible=!1,_.left=0,_.top=0,_.right=0,_.bottom=0;else{switch(this.style.textAlign){case"right":case"end":_.left=-n,_.right=0;break;case"center":_.left=-n/2,_.right=n/2;break;default:_.left=0,_.right=n}this.scale=this._originalScale||1,this._originalScale=void 0,this.textVisible=!0}else this.scale=this._originalScale||1,this._originalScale=void 0,this.textVisible=!0}return i.restore(),s.restore(),_}_fitRatio(e){const t=this.style.maxWidth,i=this.style.maxHeight;if(!b(t)&&!b(i))return 1;const s=e.right-e.left,r=e.bottom-e.top;return Math.min(t/s||1,i/r||1)}_truncateText(e,t,i,s=!1,r=!0){let a;do{if(s)t=t.slice(0,-1);else{let e=t.replace(/[^,;:!?\\\/\s]+[,;:!?\\\/\s]*$/g,"");if(""==e&&r)s=!0;else{if(""==e)return t;t=e}}const i=this._measureText(t,e);a=i.actualBoundingBoxLeft+i.actualBoundingBoxRight}while(a>i&&""!=t);return t}_measureText(e,t){let i=t.measureText(e),s={};if(null==i.actualBoundingBoxAscent){const t=document.createElement("div");t.innerText=e,t.style.visibility="hidden",t.style.position="absolute",t.style.top="-1000000px;",t.style.fontFamily=this.style.fontFamily||"",t.style.fontSize=this.style.fontSize+"",document.body.appendChild(t);const r=t.getBoundingClientRect();document.body.removeChild(t);const a=r.height,n=i.width;s={actualBoundingBoxAscent:a,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:n,fontBoundingBoxAscent:a,fontBoundingBoxDescent:0,width:n}}else s={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const r=i.width;switch(this.style.textAlign){case"right":case"end":s.actualBoundingBoxLeft=r,s.actualBoundingBoxRight=0;break;case"center":s.actualBoundingBoxLeft=r/2,s.actualBoundingBoxRight=r/2;break;default:s.actualBoundingBoxLeft=0,s.actualBoundingBoxRight=r}return s}}class Mt{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:V(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class jt extends Ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){if("circular"===this.textType)this._renderCircular(e);else super._render(e)}_renderCircular(e){if(this.textVisible){const i=this._layer||e;this._prerender(i);const s=this._isInteractive(),r=i.context,a=i.dirty,n=this._renderer._ghostLayer.context;r.save(),s&&n.save(),this._textInfo||this._measure(i);let o=this.radius||0,l=this.startAngle||0,h=0,u=this.orientation,c="auto"==u?"auto":"inward"==u;const d=this.inside,b=this.style.textAlign||"left",f=this.kerning||0;let p="left"==b?1:-1;const g=!this._textReversed;if("auto"==c){let e=0,i=0;t(this._textInfo,((t,i)=>{const s=l+t.width/(o-t.height)/2*-p;s>e&&(e=s)})),i="left"==b?(e+h/2)*Z:"right"==b?(e-h/2)*Z:l*Z,i=N(i),c=i>=270||i<=90}1==c&&g&&(this._textInfo.reverse(),this._textReversed=!0),t(this._textInfo,((e,i)=>{const u=e.height;d||(o+=u),(-1==p&&c||1==p&&!c)&&g&&e.textChunks.reverse();let m=l;h=0,"center"==b&&(m+=e.width/(o-u)/2*-p,h=m-l),m+=Math.PI*(c?0:1),r.save(),s&&n.save(),r.rotate(m),s&&n.rotate(m);let _=0;t(e.textChunks,((e,t)=>{const i=e.text,l=e.width;_=l/2/(o-u)*p,r.rotate(_),s&&n.rotate(_),e.style&&(r.save(),n.save(),r.font=e.style,s&&(n.font=e.style)),e.fill&&(r.save(),r.fillStyle=e.fill.toCSS()),r.textBaseline="middle",r.textAlign="center",s&&(n.textBaseline="middle",n.textAlign="center"),a&&r.fillText(i,0,(c?1:-1)*(0-o+u/2)),s&&n.fillText(i,0,(c?1:-1)*(0-o+u/2)),e.fill&&r.restore(),e.style&&(r.restore(),n.restore()),_=(l/2+f)/(o-u)*p,r.rotate(_),s&&n.rotate(_)})),r.restore(),s&&n.restore(),d&&(o-=u)})),r.restore(),s&&n.restore()}}_measure(e){return"circular"===this.textType?this._measureCircular(e):super._measure(e)}_measureCircular(e){const i=e.context,s=this._renderer._ghostLayer.context,r="rtl"==this.style.direction,a=this.style.oversizedBehavior,n=this.style.maxWidth,o=b(n)&&"truncate"==a,l=this.style.ellipsis||"";let h;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,i.save(),s.save(),this._prerender(e,!0);const u=this.text.toString().replace(/\r/g,"").split(/\n/);let d=!0,f=0,p=0;return t(u,((e,a)=>{let u,b,g,m=c.chunk(e,!1,this.style.ignoreFormatting),_={offsetY:p,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};t(m,((e,t)=>{if("format"==e.type){if("[/]"==e.text)d||(i.restore(),s.restore(),d=!0),b=void 0,u=void 0,g=void 0;else{let t=c.getTextStyle(e.text);const r=this._getFontStyle(t);i.save(),s.save(),i.font=r,u=r,t.fill&&(b=t.fill),t.width&&(g=P(t.width)),d=!1}o&&(h=this._measureText(l,i))}else if("value"==e.type){const t=e.text.match(/./gu)||[];r&&t.reverse();for(let e=0;e<t.length;e++){const s=t[e],a=this._measureText(s,i);let c=a.width;u&&g&&g>c&&(c=g);const d=a.actualBoundingBoxAscent+a.actualBoundingBoxDescent;if(d>_.height&&(_.height=d),a.actualBoundingBoxAscent>_.ascent&&(_.ascent=a.actualBoundingBoxAscent),_.width+=c,_.left+=a.actualBoundingBoxLeft,_.right+=a.actualBoundingBoxRight,_.textChunks.push({style:u,fill:b,text:s,width:c,height:d+a.actualBoundingBoxDescent,left:a.actualBoundingBoxLeft,right:a.actualBoundingBoxRight,ascent:a.actualBoundingBoxAscent,offsetX:0,offsetY:d,textDecoration:void 0}),f+=c,o){h||(h=this._measureText(l,i));const e=h.actualBoundingBoxLeft+h.actualBoundingBoxRight;if(f+=e,f+e>n){1==_.textChunks.length?this.textVisible=!1:(_.width+=e,_.left+=h.actualBoundingBoxLeft,_.right+=h.actualBoundingBoxRight,_.textChunks.push({style:u,fill:b,text:l,width:e,height:d+h.actualBoundingBoxDescent,left:h.actualBoundingBoxLeft,right:h.actualBoundingBoxRight,ascent:h.actualBoundingBoxAscent,offsetX:0,offsetY:d,textDecoration:void 0}));break}}if(r)break}}})),this.style.lineHeight instanceof W?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),p+=_.height})),d||(i.restore(),s.restore()),"hide"==a&&f>n&&(this.textVisible=!1),t(this._textInfo,(e=>{t(e.textChunks,(t=>{t.offsetY+=Math.round((e.height-t.height+(e.ascent-t.ascent))/2)}))})),i.restore(),s.restore(),{left:0,top:0,right:0,bottom:0}}}class St extends tt{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&Qe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){const t=this._layer||e;if(void 0===this.tainted&&(this.tainted=$e(this.image),t.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(t.dirty){this.shadowColor&&(t.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.context.shadowOffsetY=this.shadowOffsetY);const e=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;t.context.drawImage(this.image,0,0,e,i)}if(this.interactive&&this._isInteractive()){const e=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(e,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(void 0===this._imageMask){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,s=document.createElement("canvas");s.width=t,s.height=i;const r=s.getContext("2d");r.imageSmoothingEnabled=!1,r.fillStyle=this._getColorId(),r.fillRect(0,0,t,i),$e(e)||(r.globalCompositeOperation="destination-in",r.drawImage(e,0,0,t,i)),this._imageMask=s}return this._imageMask}}class Et{constructor(e,t,i,s){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),E("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Tt extends j{constructor(i){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Bt}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_domWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_domHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_canvasWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_canvasHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=i??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new S((()=>{u(this._events,((e,t)=>{t.disposer.dispose()})),t(this.layers,(e=>{Qe(e.view),e.exportableView&&Qe(e.exportableView)})),Qe(this._ghostLayer.view),Qe(this._patternCanvas)}))),this._disposers.push(e((()=>{null==i&&(this.resolution=window.devicePixelRatio)}))),E("touchevents")){const e=e=>{0!==this._dragging.length&&U(this._dragging,(t=>!t.value.shouldCancelTouch()||(e.preventDefault(),!1))),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(T(window,"touchstart",e,{passive:!1})),this._disposers.push(T(this.view,"touchstart",e,{passive:!1})),this._disposers.push(T(this.view,"touchmove",(()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()}),{passive:!0})),this._disposers.push(T(window,"click",(e=>{this._touchActive=!1}),{passive:!0})),this._disposers.push(T(this.view,"click",(e=>{window.setTimeout((()=>{this._touchActive=!0,this._delayTouchDeactivate()}),100)}),{passive:!0}))}E("wheelevents")&&this._disposers.push(T(this.view,"wheel",(e=>{let t=!1;this._hovering.forEach((e=>{if(e.wheelable)return t=!0,!1})),t&&e.preventDefault()}),{passive:!1}))}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout((()=>{this._touchActive=!1}),this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,s){return this.defaultLayer.context.createLinearGradient(e,t,i,s)}createRadialGradient(e,t,i,s,r,a){return this.defaultLayer.context.createRadialGradient(e,t,i,s,r,a)}createPattern(e,t,i,s,r){return this._patternCanvas.width=s,this._patternCanvas.height=r,this._patternContext.clearRect(0,0,s,r),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new it(this)}makeGraphics(){return new kt(this)}makeText(e,t){return new Ot(this,e,t)}makeTextStyle(){return new Mt}makeRadialText(e,t){return new jt(this,e,t)}makePicture(e){return new St(this,e)}resizeLayer(e){e.resize(this._canvasWidth,this._canvasHeight,this._domWidth,this._domHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._canvasWidth,this._canvasHeight,this._domWidth,this._domHeight,this.resolution)}resize(e,i,s,r){this._canvasWidth=e,this._canvasHeight=i,this._domWidth=s,this._domHeight=r,t(this.layers,(e=>{e&&(e.dirty=!0,this.resizeLayer(e))})),this.resizeGhost(),this.view.style.width=s+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),s=new Ct(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",s}getLayerByOrder(e){const t=this.layers,i=t.length;for(let s=0;s<i;s++){const i=t[s];if(i.order==e)return i}}getLayer(e,t=!0){let i=this.getLayerByOrder(e);if(i)return i;const s=this.createDetachedLayer(99==e);s.order=e,s.visible=t,s.visible&&this.resizeLayer(s);const r=this.layers;r.push(s),r.sort(((e,t)=>e.order>t.order?1:e.order<t.order?-1:0));const a=r.length;let n;for(let o=B(r,s)+1;o<a;o++)if(r[o].visible){n=r[o];break}return s.visible&&(void 0===n?this._layerDom.appendChild(s.view):this._layerDom.insertBefore(s.view,n.view)),s}render(e){if(this._dirtyLayers.length=0,t(this.layers,(e=>{e&&e.dirty&&e.visible&&(this._dirtyLayers.push(e),e.clear())})),this._ghostLayer.clear(),e.render(this.defaultLayer),this._ghostLayer.context.restore(),t(this.layers,(e=>{if(e){const t=e.context;t.beginPath(),t.moveTo(0,0),t.stroke()}})),t(this._dirtyLayers,(e=>{e.context.restore(),e.dirty=!1})),this._hovering.size&&this._lastPointerMoveEvent){const{events:e,target:i,native:s}=this._lastPointerMoveEvent;t(e,(e=>{this._dispatchGlobalMousemove(e,i,s)}))}}paintId(e){const t=Ke(++this._colorId),i=C.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){void 0!==e._colorId&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(e.left-t.left,e.top-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),s={x:e.clientX||0,y:e.clientY||0},r={x:s.x-(t?i.left:0),y:s.y-(t?i.top:0)};return new Et(e,s,r,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(0===t.width||0===t.height||e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom)return;if(!i||!this._layerDom.contains(i))return;const s=this._ghostLayer.getImageData(e,t);if(0===s.data[0]&&0===s.data[1]&&0===s.data[2])return!1;const r=C.fromRGB(s.data[0],s.data[1],s.data[2]).toCSS();return this._colorMap[r]}_withEvents(e,t){const s=this._events[e];if(void 0!==s){s.dispatching=!0;try{t(s)}finally{s.dispatching=!1,s.cleanup&&(s.cleanup=!1,i(s.callbacks,(e=>!e.disposed)),0===s.callbacks.length&&(s.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,i){this.interactionsEnabled&&this._withEvents(e,(e=>{t(e.callbacks,(e=>{e.disposed||e.callback.call(e.context,i)}))}))}_dispatchEvent(e,i,s){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,(e=>{t(e.callbacks,(e=>{e.disposed||e.object!==i||(e.callback.call(e.context,s),r=!0)}))})),r}_dispatchMousedown(e,t){const i=e.button;if(0!=i&&2!=i&&1!=i&&void 0!==i)return;const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox,t);if(r){const e=s.id;let t=!1;Ze(r,(i=>{const r={id:e,value:i};if(this._mousedown.push(r),!t&&this._dispatchEvent("pointerdown",i,s)){t=!0;this._dragging.some((t=>t.value===i&&t.id===e))||this._dragging.push(r)}return!0}))}}_dispatchGlobalMousemove(e,t,i){const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox,t);s.native=i,r?(this._hovering.forEach((e=>{e.contains(r)||(this._hovering.delete(e),e.cursorOverStyle&&D(document.body,"cursor",e._replacedCursorStyle),this._dispatchEvent("pointerout",e,s))})),s.native&&Ze(r,(e=>(this._hovering.has(e)||(this._hovering.add(e),e.cursorOverStyle&&(e._replacedCursorStyle=X(document.body,"cursor"),D(document.body,"cursor",e.cursorOverStyle)),this._dispatchEvent("pointerover",e,s)),!0)))):(this._hovering.forEach((e=>{e.cursorOverStyle&&D(document.body,"cursor",e._replacedCursorStyle),this._dispatchEvent("pointerout",e,s)})),this._hovering.clear()),this._dispatchEventAll("globalpointermove",s)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(0!==this._dragging.length){const t=this.getEvent(e),i=t.id;this._dragging.forEach((e=>{e.id===i&&this._dispatchEvent("pointermove",e.value,t)}))}}_dispatchDragEnd(e,t){const i=e.button;let s;if(0==i||void 0===i)s="click";else if(2==i)s="rightclick";else{if(1!=i)return;s="middleclick"}const r=this.getEvent(e),a=r.id;if(0!==this._mousedown.length){const e=this._getHitTarget(r.originalPoint,r.bbox,t);e&&this._mousedown.forEach((t=>{t.id===a&&t.value.contains(e)&&this._dispatchEvent(s,t.value,r)})),this._mousedown.length=0}0!==this._dragging.length&&(this._dragging.forEach((e=>{e.id===a&&this._dispatchEvent("pointerup",e.value,r)})),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),s=this._getHitTarget(i.originalPoint,i.bbox,t);s&&Ze(s,(e=>!this._dispatchEvent("dblclick",e,i)))}_dispatchWheel(e,t){const i=this.getEvent(e),s=this._getHitTarget(i.originalPoint,i.bbox,t);s&&Ze(s,(e=>!this._dispatchEvent("wheel",e,i)))}_makeSharedEvent(e,t){if(void 0===this._listeners[e]){const i=t();this._listeners[e]=new A((()=>{delete this._listeners[e],i.dispose()}))}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,s=null;function r(){s=null,i=!1}return new L([new S((()=>{null!==s&&clearTimeout(s),r()})),T(this.view,z(e),(e=>{i=!0,null!==s&&clearTimeout(s),s=window.setTimeout(r,0)})),Je(window,e,((e,r)=>{null!==s&&(clearTimeout(s),s=null),t(e,r,i),i=!1}))])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",(()=>{const e=(e,i,s)=>{this._lastPointerMoveEvent={events:e,target:i,native:s},t(e,(e=>{this._dispatchGlobalMousemove(e,i,s)}))};return new L([this._onPointerEvent("pointerdown",e),this._onPointerEvent("pointermove",e)])}));case"globalpointerup":return this._makeSharedEvent("pointerup",(()=>{const e=this._onPointerEvent("pointerup",((e,i,s)=>{t(e,(e=>{this._dispatchGlobalMouseup(e,s)})),this._lastPointerMoveEvent={events:e,target:i,native:s}})),i=this._onPointerEvent("pointercancel",((e,i,s)=>{t(e,(e=>{this._dispatchGlobalMouseup(e,s)})),this._lastPointerMoveEvent={events:e,target:i,native:s}}));return new S((()=>{e.dispose(),i.dispose()}))}));case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",(()=>{const e=this._onPointerEvent("pointerdown",((e,i)=>{t(e,(e=>{this._dispatchMousedown(e,i)}))})),i=this._onPointerEvent("pointermove",(e=>{t(e,(e=>{this._dispatchDragMove(e)}))})),s=this._onPointerEvent("pointerup",((e,i)=>{t(e,(e=>{this._dispatchDragEnd(e,i)}))})),r=this._onPointerEvent("pointercancel",((e,i)=>{t(e,(e=>{this._dispatchDragEnd(e,i)}))}));return new S((()=>{e.dispose(),i.dispose(),s.dispose(),r.dispose()}))}));case"dblclick":return this._makeSharedEvent("dblclick",(()=>this._onPointerEvent("dblclick",((e,i)=>{t(e,(e=>{this._dispatchDoubleClick(e,i)}))}))));case"wheel":return this._makeSharedEvent("wheel",(()=>T(window,z("wheel"),(e=>{this._dispatchWheel(e,F(e))}),{passive:!1})))}}_addEvent(e,t,i,s){let r=this._events[t];void 0===r&&(r=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const a={object:e,context:s,callback:i,disposed:!1};return r.callbacks.push(a),new S((()=>{a.disposed=!0,r.dispatching?r.cleanup=!0:(H(r.callbacks,a),0===r.callbacks.length&&(r.disposer.dispose(),delete this._events[t]))}))}getCanvas(e,i){this.render(e),i||(i={});let s=this.resolution,r=Math.floor(this._canvasWidth*this.resolution),a=Math.floor(this._canvasHeight*this.resolution);if(i.minWidth&&i.minWidth>r){let e=i.minWidth/r;e>s&&(s=e*this.resolution)}if(i.minHeight&&i.minHeight>a){let e=i.minHeight/a;e>s&&(s=e*this.resolution)}if(i.maxWidth&&i.maxWidth<r){let e=i.maxWidth/r;e<s&&(s=e*this.resolution)}if(i.maxHeight&&i.maxHeight>a){let e=i.maxHeight/a;e<s&&(s=e*this.resolution)}i.maintainPixelRatio&&(s/=this.resolution);const n=[];let o=!1;const l=document.createElement("canvas");s!=this.resolution&&(o=!0,r=r*s/this.resolution,a=a*s/this.resolution),l.width=r,l.height=a,l.style.position="fixed",l.style.top="-10000px",this.view.appendChild(l),n.push(l);const h=l.getContext("2d");let u=0,c=0,d=!1;return t(this.layers,(e=>{if(e&&e.visible&&(e.tainted||o)){d=!0,e.exportableView=e.view,e.exportableContext=e.context,e.view=document.createElement("canvas"),e.view.style.position="fixed",e.view.style.top="-10000px",this.view.appendChild(e.view),n.push(e.view);let t=0,i=0;e.margin&&(t+=e.margin.left||0+e.margin.right||0,i+=e.margin.top||0+e.margin.bottom||0),e.view.width=r+t,e.view.height=a+i,e.context=e.view.getContext("2d"),e.dirty=!0,e.scale=s}})),d&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),t(this.layers,(e=>{if(e&&e.visible){let t=0,i=0;e.margin&&(t=-(e.margin.left||0)*this.resolution,i=-(e.margin.top||0)*this.resolution),h.drawImage(e.view,t,i),e.exportableView&&(e.view=e.exportableView,e.exportableView=void 0),e.exportableContext&&(e.context=e.exportableContext,e.exportableContext=void 0),u<e.view.clientWidth&&(u=e.view.clientWidth),c<e.view.clientHeight&&(c=e.view.clientHeight),e.scale=void 0}})),l.style.width=u+"px",l.style.height=c+"px",t(n,(e=>{e.style.position="",e.style.top="",this.view.removeChild(e)})),l}}class Bt{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,s,r){e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*r),this._height=Math.floor(t*r),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=s+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,t(e,(e=>{e.margin&&(this.margin.left=Math.max(this.margin.left,e.margin.left),this.margin.right=Math.max(this.margin.right,e.margin.right),this.margin.top=Math.max(this.margin.top,e.margin.top),this.margin.bottom=Math.max(this.margin.bottom,e.margin.bottom))}))}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Ct{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,s,r){null!=this.width&&(e=this.width,i=this.width),null!=this.height&&(t=this.height,s=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*r),this._height=Math.floor(t*r),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=s+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Dt(e,t){null==e?requestAnimationFrame(t):setTimeout((()=>{requestAnimationFrame(t)}),1e3/e)}class At{constructor(e,i={},s){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new $}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Le.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:Ae}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Se.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Ce.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:De.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:Q.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ee.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:te.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!s)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=i,0==i.accessible&&(this._a11yD=!0),null==i.useSafeResolution&&(i.useSafeResolution=!0),i.useSafeResolution&&(r=me()),this._renderer=new Tt(r),a=e instanceof HTMLElement?e:document.getElementById(e),t(ie.rootElements,(e=>{if(e.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")})),this.interfaceColors=je.new(this,{}),null===a)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let n=document.createElement("div");n.style.position="relative",n.style.height="100%",a.appendChild(n);const o=i.tooltipContainerBounds;o&&(this._tooltipContainerSettings=o),this._inner=n,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new At(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(se.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:V(100),centerY:re,tooltipText:"Created using amCharts 5",tooltipX:re,cursorOverStyle:"pointer",background:ae.new(this,{fill:ne(4671320),fillOpacity:0,tooltipY:5})})),t=ye.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",(()=>{window.open("https://www.amcharts.com/","_blank")})),e.states.create("hover",{});e.children.push(oe.new(this,{stroke:ne(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:ne(3976191)});e.children.push(oe.new(this,{stroke:ne(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:ne(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;!1!==e.accessible&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel));const t=this._renderer,i=this._getRealSize(),s=this._getCalculatedSize(i),r=Math.floor(s.width),a=Math.floor(s.height),n=Math.floor(i.width),o=Math.floor(i.height),l=se.new(this,{visible:!0,width:n,height:o});this._rootContainer=l,this._rootContainer._defaultThemes.push(ve.new(this));const h=l.children.push(se.new(this,{visible:!0,width:re,height:re}));this.container=h,t.resize(n,o,r,a),this._inner.appendChild(t.view),this._initResizeSensor();const u=document.createElement("div");if(this._htmlElementContainer=u,u.className="am5-html-container",u.style.position="absolute",u.style.pointerEvents="none",this._tooltipContainerSettings||(u.style.overflow="hidden"),this._inner.appendChild(u),!0!==this._a11yD){const e=document.createElement("div");e.className="am5-reader-container",e.setAttribute("role","alert"),e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.overflow="hidden",e.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=e,this._inner.appendChild(this._readerAlertElement);const i=document.createElement("div");i.className="am5-focus-container",i.style.position="absolute",i.style.pointerEvents="none",i.style.top="0px",i.style.left="0px",i.style.overflow="hidden",i.style.width=r+"px",i.style.height=a+"px",i.setAttribute("role","graphics-document"),q(i,!1),this._focusElementContainer=i,this._inner.appendChild(this._focusElementContainer);const s=document.createElement("div");this._tooltipElementContainer=s,s.className="am5-tooltip-container",this._inner.appendChild(s),E("keyboardevents")&&(this._disposers.push(T(window,"keydown",(e=>{16==e.keyCode?this._isShift=!0:9==e.keyCode&&(this._isShift=e.shiftKey)}))),this._disposers.push(T(window,"keyup",(e=>{16==e.keyCode&&(this._isShift=!1)}))),this._disposers.push(T(i,"keydown",(e=>{const i=this._focusedSprite;if(i){27==e.keyCode&&(le(),this._focusedSprite=void 0);let s=0,r=0;switch(e.keyCode){case 13:e.preventDefault();const a=t.getEvent(new MouseEvent("click"));return void i.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!0,target:i});case 37:s=-6;break;case 39:s=6;break;case 38:r=-6;break;case 40:r=6;break;default:return}if(0!=s||0!=r){if(e.preventDefault(),!i.isDragging()){this._keyboardDragPoint={x:0,y:0};const e=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));i.events.isEnabled("pointerdown")&&i.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:e.event,point:e.point,simulated:!0,target:i})}const a=this._keyboardDragPoint;a.x+=s,a.y+=r;const n=t.getEvent(new MouseEvent("mousemove",{clientX:a.x,clientY:a.y}),!1);i.events.isEnabled("globalpointermove")&&i.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:n.event,point:n.point,simulated:!0,target:i})}}}))),this._disposers.push(T(i,"keyup",(e=>{if(this._focusedSprite){const i=this._focusedSprite,s=e.keyCode;switch(s){case 37:case 39:case 38:case 40:if(i.isDragging()){const e=this._keyboardDragPoint,s=t.getEvent(new MouseEvent("mouseup",{clientX:e.x,clientY:e.y}));return i.events.isEnabled("globalpointerup")&&i.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:s.event,point:s.point,simulated:!0,target:i}),void(this._keyboardDragPoint=void 0)}if(i.get("focusableGroup")){const e=i.get("focusableGroup"),t=this._tabindexes.filter((t=>t.get("focusableGroup")==e&&!1!==t.getPrivate("focusable")));let r=t.indexOf(i);const a=t.length-1;r+=39==s||40==s?1:-1,r<0?r=a:r>a&&(r=0),he(t[r].getPrivate("focusElement").dom)}}}}))))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Me(this.dom,(()=>{this.autoResize&&this.resize()})),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),s=Math.floor(t.height);if(i>0&&s>0){const t=Math.floor(e.width),r=Math.floor(e.height),a=this._htmlElementContainer;if(a.style.width=i+"px",a.style.height=s+"px",!0!==this._a11yD){const e=this._focusElementContainer;e.style.width=i+"px",e.style.height=s+"px"}this._renderer.resize(t,r,i,s);const n=this._rootContainer;n.setPrivate("width",t),n.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){t(this._tickers,(t=>{t(e)}))}_runAnimations(e){i(this._animations,(t=>t._runAnimation(e)))}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,ue(this._dirtyParents).forEach((t=>{const i=this._dirtyParents[t];delete this._dirtyParents[t],i.isDisposed()||(e[i.uid]=i,i._prepareChildren())}));ue(e).forEach((t=>{e[t]._updateChildren()}));const t=[];ue(this._dirty).forEach((e=>{const i=this._dirty[e];i.isDisposed()?delete this._dirty[i.uid]:(t.push(i),i._beforeChanged())})),t.forEach((e=>{e._changed(),delete this._dirty[e.uid],e._clearDirty()})),this._isDirty=!1;const i={},s=[];ue(this._dirtyBounds).forEach((e=>{const t=this._dirtyBounds[e];delete this._dirtyBounds[e],t.isDisposed()||(i[t.uid]=t.depth(),s.push(t))})),this._positionHTMLElements(),s.sort(((e,t)=>ce(i[t.uid],i[e.uid]))),s.forEach((e=>{e._updateBounds()}));const r=this._dirtyPositions;ue(r).forEach((e=>{const t=r[e];delete r[e],t.isDisposed()||t._updatePosition()})),t.forEach((e=>{e._afterChanged()}))}_renderFrame(e){return!this._updateTick||(this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e),this._runAnimations(e),this._runDirties(),this._render(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),0===this._tickers.length&&0===this._animations.length&&!this._isDirty)}_runTicker(e,t){if(!this.isDisposed()){this.animationTime=e;this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Dt(this.fps,this._ticker))}}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const e=performance.now();if(e>=t){this.animationTime=null;break}this.animationTime=e;if(this._renderFrame(e)){this.animationTime=null;break}}}}_startTicker(){null===this._ticker&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Dt(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){void 0===this._dirty[e.uid]&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){void 0===this._dirtyParents[e.uid]&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){void 0===this._dirtyBounds[e.uid]&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){void 0===this._dirtyPositions[e.uid]&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){-1===this._animations.indexOf(e)&&(this._animations.push(e),this._startTicker())}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",(()=>{this._isDirty=!0,this._startTicker()}))}eachFrame(e){return this._tickers.push(e),this._startTicker(),new S((()=>{H(this._tickers,e)}))}markDirtyGlobal(e){e||(e=this.container),e.walkChildren((e=>{e instanceof se&&this.markDirtyGlobal(e),e.markDirty(),e.markDirtyBounds()}))}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),t(this._disposers,(e=>{e.dispose()})),this._inner&&de(this._inner),be(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){!0!==this._a11yD&&(this._readerAlertElement.innerHTML=fe(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(se.new(this,{position:"absolute",isMeasured:!1,width:re,height:re,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=ye.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){1!=this._a11yD&&(e.get("focusable")?I(this._tabindexes,e):be(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){1!=this._a11yD&&(be(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(1==this._a11yD)return;this._tabindexes.sort(((e,t)=>{const i=e.get("tabindexOrder",0),s=t.get("tabindexOrder",0);return i==s?0:i>s?1:-1}));const e=[];t(this._tabindexes,((t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const s=t.get("focusableGroup");s&&!1!==t.getPrivate("focusable")&&(-1!==e.indexOf(s)?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(s))}))}_updateCurrentFocus(){1!=this._a11yD&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(1==this._a11yD)return;if(t||(t=e.getPrivate("focusElement").dom),!t)return;e.get("visible")&&"tooltip"!=e.get("role")&&!e.isHidden()&&!1!==e.getPrivate("focusable")?"-1"!=t.getAttribute("tabindex")&&t.setAttribute("tabindex",""+this.tabindex):t.removeAttribute("tabindex");const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const s=e.get("ariaLabel");if(s){const i=pe(e,s);t.setAttribute("aria-label",i)}else t.removeAttribute("aria-label");const r=e.get("ariaLive");r?t.setAttribute("aria-live",r):t.removeAttribute("aria-live");const a=e.get("ariaChecked");null!=a?t.setAttribute("aria-checked",a?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","hidden"):t.removeAttribute("aria-hidden");const n=e.get("ariaOrientation");n?t.setAttribute("aria-orientation",n):t.removeAttribute("aria-orientation");const o=e.get("ariaValueNow");o?t.setAttribute("aria-valuenow",o):t.removeAttribute("aria-valuenow");const l=e.get("ariaValueMin");l?t.setAttribute("aria-valuemin",l):t.removeAttribute("aria-valuemin");const h=e.get("ariaValueMax");h?t.setAttribute("aria-valuemax",h):t.removeAttribute("aria-valuemax");const u=e.get("ariaValueText");u?t.setAttribute("aria-valuetext",u):t.removeAttribute("aria-valuetext");const c=e.get("ariaControls");c?t.setAttribute("aria-controls",c):t.removeAttribute("aria-controls")}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||1==this._a11yD)return;const i=document.createElement("div");"tooltip"!=t.get("role")&&(i.tabIndex=this.tabindex),i.style.position="absolute",q(i,!1);const s=[];t.setPrivate("focusElement",{dom:i,disposers:s}),this._decorateFocusElement(t),s.push(T(i,"focus",(t=>{this._handleFocus(t,e)}))),s.push(T(i,"blur",(t=>{this._handleBlur(t,e)}))),this._moveFocusElement(e,t)}_removeFocusElement(e){if(1==this._a11yD)return;be(this._tabindexes,e);const i=e.getPrivate("focusElement");if(i){this._focusElementContainer.removeChild(i.dom),t(i.disposers,(e=>{e.dispose()}))}}_hideFocusElement(e){if(1==this._a11yD)return;e.getPrivate("focusElement").dom.style.display="none"}_moveFocusElement(e,t){if(1==this._a11yD)return;const i=this._focusElementContainer,s=t.getPrivate("focusElement").dom;if(s===this._focusElementContainer.children[e])return;const r=this._focusElementContainer.children[e+1];r?i.insertBefore(s,r):i.append(s)}_positionFocusElement(e){if(1==this._a11yD)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,s=t.top==t.bottom?e.height():t.bottom-t.top,r=t.left-2,a=t.top-2;i<0&&(r+=i,i=Math.abs(i)),s<0&&(a+=s,s=Math.abs(s));const n=e.getPrivate("focusElement").dom;n.style.top=a+"px",n.style.left=r+"px",n.style.width=i+4+"px",n.style.height=s+4+"px"}_handleFocus(e,t){if(1==this._a11yD)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled("focus")&&i.events.dispatch("focus",{type:"focus",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(1==this._a11yD)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let s=i.indexOf(e)+t;s<0?s=i.length-1:s>=i.length&&(s=0),i[s].focus()}_handleBlur(e,t){if(1==this._a11yD)return;const i=this._focusedSprite;i&&i.events.isEnabled("blur")&&i.events.dispatch("blur",{type:"blur",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(1==this._a11yD)return;const t=fe(e._getText());let i=e.getPrivate("tooltipElement");"tooltip"==e.get("role")&&""!=t?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",q(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(1==this._a11yD)return;const t=e.getPrivate("tooltipElement");if(t){const e=t.parentElement;e&&e.removeChild(t)}}_invalidateAccessibility(e){if(1==this._a11yD)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this.dom.getBoundingClientRect();return{x:e.x-t.left,y:e.y-t.top}}rootPointToDocument(e){const t=this.dom.getBoundingClientRect();return{x:e.x+t.left,y:e.y+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";u(e,((e,i)=>{r(e)&&e.match(/^font/)&&(t+=i)}));const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof se?e.children.each((e=>{this._invalidateLabelBounds(e)})):e instanceof ge&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e<ie.licenses.length;e++)if(ie.licenses[e].match(/^AM5C.{5,}/i))return!0;return!1}_licenseApplied(){this._logo&&this._logo.set("forceHidden",!0)}get debugGhostView(){return this._renderer.debugGhostView}set debugGhostView(e){this._renderer.debugGhostView=e}set tapToActivate(e){this._renderer.tapToActivate=e}get tapToActivate(){return this._renderer.tapToActivate}set tapToActivateTimeout(e){this._renderer.tapToActivateTimeout=e}get tapToActivateTimeout(){return this._renderer.tapToActivateTimeout}_makeHTMLElement(e){const t=this._htmlElementContainer,i=document.createElement("div");return e.setPrivate("htmlElement",i),i.style.position="absolute",i.style.overflow="auto",i.style.boxSizing="border-box",q(i,e.get("interactive",!1)),e.events.isEnabled("click")&&(q(i,!0),this._disposers.push(T(i,"click",(t=>{const i=this._renderer.getEvent(t);e.events.dispatch("click",{type:"click",originalEvent:i.event,point:i.point,simulated:!1,target:e})})))),this._positionHTMLElement(e),t.append(i),I(this._htmlEnabledContainers,e),i}_positionHTMLElements(){t(this._htmlEnabledContainers,(e=>{this._positionHTMLElement(e)}))}_positionHTMLElement(e){const i=e.getPrivate("htmlElement");if(i){t(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],(t=>{const s=e.get(t);i.style[t]=s?s+"px":""}));const s=e.compositeOpacity();setTimeout((()=>{i.style.opacity=s+""}),10);const r=e.isVisibleDeep();r&&(i.style.display="block");const a=e.globalBounds();i.style.top=a.top+"px",i.style.left=a.left+"px";const n=e.get("width"),o=e.get("height");let l=0,h=0;if(n&&(l=e.width()),o&&(h=e.height()),n&&o)e.removePrivate("minWidth"),e.removePrivate("minHeight");else{i.style.position="fixed",i.style.width="",i.style.height="";const t=i.getBoundingClientRect();i.style.position="absolute",l=t.width,h=t.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",l),e.setPrivate("minHeight",h)}l>0&&(i.style.minWidth=l+"px"),h>0&&(i.style.minHeight=h+"px"),r&&0!=s||(i.style.display="none")}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&this._htmlElementContainer.removeChild(t),be(this._htmlEnabledContainers,e)}}_e("AM5C241025748");const Lt="en-us",zt=new Map([["ar",()=>import("../../chunks/ar2.js")],["bg-bg",()=>import("../../chunks/bg_BG2.js")],["bs-ba",()=>import("../../chunks/bs_BA2.js")],["ca-es",()=>import("../../chunks/ca_ES2.js")],["cs-cz",()=>import("../../chunks/cs_CZ2.js")],["da-dk",()=>import("../../chunks/da_DK2.js")],["de-de",()=>import("../../chunks/de_DE2.js")],["de-ch",()=>import("../../chunks/de_CH2.js")],["el-gr",()=>import("../../chunks/el_GR2.js")],["en-us",()=>import("../../chunks/en_US2.js")],["en-ca",()=>import("../../chunks/en_CA2.js")],["es-es",()=>import("../../chunks/es_ES2.js")],["et-ee",()=>import("../../chunks/et_EE2.js")],["fi-fi",()=>import("../../chunks/fi_FI2.js")],["fr-fr",()=>import("../../chunks/fr_FR2.js")],["he-il",()=>import("../../chunks/he_IL2.js")],["hr-hr",()=>import("../../chunks/hr_HR2.js")],["hu-hu",()=>import("../../chunks/hu_HU2.js")],["id-id",()=>import("../../chunks/id_ID2.js")],["it-it",()=>import("../../chunks/it_IT2.js")],["ja-jp",()=>import("../../chunks/ja_JP2.js")],["ko-kr",()=>import("../../chunks/ko_KR2.js")],["lt-lt",()=>import("../../chunks/lt_LT2.js")],["lv-lv",()=>import("../../chunks/lv_LV2.js")],["nb-no",()=>import("../../chunks/nb_NO2.js")],["nl-nl",()=>import("../../chunks/nl_NL2.js")],["pl-pl",()=>import("../../chunks/pl_PL2.js")],["pt-br",()=>import("../../chunks/pt_BR2.js")],["pt-pt",()=>import("../../chunks/pt_PT2.js")],["ro-ro",()=>import("../../chunks/ro_RO2.js")],["ru-ru",()=>import("../../chunks/ru_RU2.js")],["sk-sk",()=>import("../../chunks/sk_SK2.js")],["sl-sl",()=>import("../../chunks/sl_SL2.js")],["sr-rs",()=>import("../../chunks/sr_RS2.js")],["sv-se",()=>import("../../chunks/sv_SE2.js")],["th-th",()=>import("../../chunks/th_TH2.js")],["tr-tr",()=>import("../../chunks/tr_TR2.js")],["uk-ua",()=>import("../../chunks/uk_UA2.js")],["vi-vn",()=>import("../../chunks/vi_VN2.js")],["zh-cn",()=>import("../../chunks/zh_Hans2.js")],["zh-hk",()=>import("../../chunks/zh_Hant2.js")],["zh-tw",()=>import("../../chunks/zh_Hant2.js")]]);function Ft(e){const t=e.split("-")[0].toLowerCase();let i=null;for(const s of zt.keys())if(s.startsWith(t)){i=s;break}return i}function Ht(e){return e?zt.has(e.toLowerCase())?e.toLowerCase():Ft(e)||Lt:Lt}async function Yt(e,t=we()){const i=At.new(e);return i.locale=(await zt.get(Ht(t))()).default,i}const It=["#7ABEE5","#B39BD5","#F8AE83","#92E6E4","#FBC487","#EE967A","#CEA2D6","#89D594","#CEE68F","#F1A6D5"].map((e=>ne(e)));export{Yt as createRoot,It as esriChartColorSet};
|
|
5
|
+
import"../../intl.js";import"../../chunks/Theme.js";export{c as createRoot,e as esriChartColorSet}from"../../chunks/chartUtilsAm5.js";import"../../intl/locale.js";
|