@arcgis/core 4.23.0 → 4.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{d209d82484aa725c5aa9.js → d006b4a239e93eeb9619.js} +1 -1
  3. package/assets/esri/core/workers/chunks/fcd87df3909e94410950.js +1 -0
  4. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +1 -1
  5. package/assets/esri/themes/base/widgets/_LayerList.scss +1 -1
  6. package/assets/esri/themes/dark/main.css +1 -1
  7. package/assets/esri/themes/dark-blue/main.css +1 -1
  8. package/assets/esri/themes/dark-green/main.css +1 -1
  9. package/assets/esri/themes/dark-purple/main.css +1 -1
  10. package/assets/esri/themes/dark-red/main.css +1 -1
  11. package/assets/esri/themes/light/main.css +1 -1
  12. package/assets/esri/themes/light/view.css +1 -1
  13. package/assets/esri/themes/light-blue/main.css +1 -1
  14. package/assets/esri/themes/light-green/main.css +1 -1
  15. package/assets/esri/themes/light-purple/main.css +1 -1
  16. package/assets/esri/themes/light-red/main.css +1 -1
  17. package/config.js +1 -1
  18. package/interfaces.d.ts +5 -17
  19. package/layers/RouteLayer.js +1 -1
  20. package/package.json +1 -1
  21. package/support/basemapUtils.js +1 -1
  22. package/support/revision.js +1 -1
  23. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  24. package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
  25. package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
  26. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
  27. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  28. package/views/MapView.js +1 -1
  29. package/widgets/Directions/DirectionsViewModel.js +1 -1
  30. package/widgets/Directions.js +1 -1
  31. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  32. package/widgets/FeatureForm/InputField.js +1 -1
  33. package/widgets/FeatureForm.js +1 -1
  34. package/assets/esri/core/workers/chunks/b04af5e4a9ae0c90a1de.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{neverReached as t}from"../core/compilerUtils.js";import{isNone as i,isSome as a}from"../core/maybe.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{getDomainRange as r}from"../layers/support/domainUtils.js";import{getFieldRange as o}from"../layers/support/fieldUtils.js";import u from"./Widget.js";import d from"./FeatureForm/FeatureFormViewModel.js";import{Heading as p,incrementHeadingLevel as c}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{DateTime as _}from"luxon";import{getLocale as v}from"../intl/locale.js";const g={base:"esri-feature-form",form:"esri-feature-form__form",formHeader:"esri-feature-form__form-header",label:"esri-feature-form__label",inputField:"esri-feature-form__input",inputDate:"esri-feature-form__input--date",inputTime:"esri-feature-form__input--time",inputRadioGroup:"esri-feature-form__input--radio-group",inputRadio:"esri-feature-form__input--radio",inputRadioLabel:"esri-feature-form__input--radio-label",inputDisabled:"esri-feature-form__input--disabled",inputSwitch:"esri-feature-form__input--switch",inputInvalid:"esri-feature-form__input--invalid",inputIconInvalid:"esri-feature-form__input-icon--invalid",errorMessage:"esri-feature-form__field-error-message",description:"esri-feature-form__description-text",dateInputPart:"esri-feature-form__date-input-part",loneDateInputPart:"esri-feature-form__date-input-part--lone",dateInputContainer:"esri-feature-form__date-input-container",dateFormatHint:"esri-feature-form__date-format-hint",group:"esri-feature-form__group",groupLabel:"esri-feature-form__group-label",groupHeader:"esri-feature-form__group-header",groupHeading:"esri-feature-form__group-header",groupTitle:"esri-feature-form__group-title",groupDescription:"esri-feature-form__group-description",groupToggleIcon:"esri-feature-form__group-toggle-icon",groupCollapsed:"esri-feature-form__group--collapsed",groupSequential:"esri-feature-form__group--sequential",groupActive:"esri-feature-form__group--active",collapseIcon:"esri-icon-up",errorIcon:"esri-icon-notice-triangle",expandIcon:"esri-icon-down",widget:"esri-widget",panel:"esri-widget--panel",input:"esri-input",select:"esri-select"},b={datePattern:"D",timePattern:"tt"};function y(e){return e&&e.inputFields}let I=class extends u{constructor(e,t){super(e,t),this._activeDateFieldEdit=null,this._activeInputName=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedInputFieldNames=new Set,this.description=null,this.feature=null,this.fieldConfig=null,this.formTemplate=null,this.groupDisplay="all",this.headingLevel=2,this.label=void 0,this.layer=null,this.messages=null,this.messagesTemplates=null,this.strict=null,this.title=null,this.viewModel=new d,this._handleSwitchClick=e=>{e.target===e.currentTarget&&e.stopImmediatePropagation()},this._handleRadioInputChange=e=>{this._commitInputValue(e.target)},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget,!0)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this)}initialize(){this.own(this.watch("feature",(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e&&e.name,this._userUpdatedInputFieldNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedInputFieldNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-combobox.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),import("@esri/calcite-components/dist/components/calcite-input-message.js"),import("@esri/calcite-components/dist/components/calcite-switch.js")])}destroy(){this._userUpdatedInputFieldNames.clear(),this._userUpdatedInputFieldNames=null}getValues(){return null}submit(){return null}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(g.base,g.widget,g.panel)},"ready"===e?this.renderForm():null)}renderForm(){const e=this.title?f(p,{key:"title",level:this.headingLevel},this.title):null,t=this.description?f("p",{class:g.description,key:"description"},this.description):null,i=e||t?f("div",{class:g.formHeader},e,t):null;return f("form",{class:g.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},i,this.renderFields())}renderFields(){const{viewModel:{inputFields:e}}=this;return e.map(((e,t)=>y(e)?this.renderGroup(e,t):this.renderLabeledField(e)))}renderGroup(e,t){const{description:i,inputFields:a,label:n,state:l}=e,s=this.viewModel.findField(this._activeInputName),r=!(!s||s.group!==e),o=`${this.id}_group_${t}`,u=`${this.id}_group-label_${t}`,d=`${this.id}_group-description_${t}`,m=i?f("p",{class:this.classes(g.groupDescription,g.description),id:d},i):null,h="sequential"===this.groupDisplay,_=h?r:"expanded"===l,v=_?g.collapseIcon:g.expandIcon;return f("fieldset",{"aria-expanded":_.toString(),"aria-labelledby":u,"aria-describedby":i?d:"",class:this.classes(g.group,h?g.groupSequential:null,_?null:g.groupCollapsed,r?g.groupActive:null),"data-group":e,id:o,key:t,onclick:this._handleGroupClick},f("button",{role:h?"presentation":void 0,class:g.groupHeader,type:"button",tabIndex:h?-1:0},f("div",{class:g.groupTitle},f(p,{class:g.groupLabel,id:u,level:this.title?c(this.headingLevel):this.headingLevel},n),m),h?null:f("span",{class:this.classes(v,g.groupToggleIcon)})),a.map((e=>this.renderLabeledField(e))))}_getFocusableInput(e,t){const i=this.viewModel.allInputFields,a="forward"===e?i:i.slice().reverse();let n;if(t)if(y(t))n=a.indexOf(t.inputFields[0]);else{let i;if(this._isInputFieldInGroup(t)&&"collapsed"===t.group.state){const{inputFields:a}=t.group;i="forward"===e?a[a.length-1]:a[0]}else i=t;n=a.indexOf(i)+1}else n=0;for(let l=n;l<a.length;l++){const e=a[l];if(e.visible)return e}return null}renderLabeledField(e){const{label:t,layer:i,type:a}=e;return f("label",{key:`${i.id}-${e.name}`,class:g.label},[t,"unsupported"!==a?this.renderInputField(e):this.renderUnsupportedField(e),this.renderAuxiliaryText(e)])}renderInputField(e){const{domain:t,name:i,type:a,value:n}=e,l=this.getCommonInputProps(e);if("coded-value"===(null==t?void 0:t.type)){if(this._inputFieldHasInputType(e,"switch")){const{fieldElement:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(i)||null==n||t.input.onValue!==n&&t.input.offValue!==n))return this.renderSwitchInputField(n,l);this._switchFieldsWithInitialIncompatibleValue.add(i)}return"radio-buttons"===e.inputType?this.renderRadioButtonsInputField(n,t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),l):this.renderSelectInputField(n,this._getFieldValueOptions(i,t),l)}return"text"===a&&"text-area"===e.inputType?f("textarea",{...l}):"datetime-picker"===e.inputType||"date"===a?this.renderDateInputField(n,l):f("input",{type:"text"===a?"text":"number",...l})}_parseDateTime(e,t,i){if(i){var a;let n=_.fromJSDate(this._parseDate(e,i));const l=_.fromMillis(null!=(a=t.value)?a:Date.now());return n="date"===i?n.set({hour:l.hour,minute:l.minute,second:l.second}):n.set({day:l.day,month:l.month,year:l.year}),n.isValid?n.toMillis():null}const n=_.fromJSDate(this._parseDate(e));return n.isValid?n.toMillis():null}renderDateInputField(e,t){const{date:i,time:a}=this._formatDate(0),n=`${this.id}-${t.key}`,l=`${n}-date`,s=`${n}-time`,r=t["data-field"],{includeTime:o}=r,{_activeDateFieldEdit:u}=this;let{date:d,time:p}=this._formatDate(e);var c,m,h,_;(null==u?void 0:u.fieldName)===r.name&&(d=null!=(c=null==(m=u.date.input)?void 0:m.value)?c:d,p=null!=(h=null==(_=u.time.input)?void 0:_.value)?h:p);return f("div",{key:`${t.key}-date`,class:g.dateInputContainer},f("div",{class:this.classes(g.dateInputPart,o?null:g.loneDateInputPart)},f("input",{"aria-label":r.label,"aria-describedby":l,type:"text",...t,"data-date-part":"date",class:this.classes(t.class,g.inputDate),value:d}),f("div",{class:g.dateFormatHint,id:l},i)),o?f("div",{class:g.dateInputPart,key:"time-input"},f("input",{"aria-describedby":s,"aria-label":r.label,type:"text",...t,"data-date-part":"time",class:this.classes(t.class,g.inputTime),value:p}),f("div",{class:g.dateFormatHint,id:s},a)):null)}renderUnsupportedField(e){const t=this.getCommonInputProps(e);return f("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(g.input,g.inputField,g.inputDisabled),"data-field":t["data-field"],onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value})}renderSelectInputField(e,t,a){const{messages:n,messagesTemplates:l}=this,s=t.map((t=>t.map((t=>f("calcite-combobox-item",{value:t.value,"text-label":t.name,key:t.value,selected:e===t.value}))))),r=a["data-field"],[o,u]=s;this._registerIncompatibleValue(e,t.flat(),r,(e=>{u.unshift(f("calcite-combobox-item",{value:`${e}`,"text-label":`${e}`,key:"incompatible-option",readOnly:!0}))}));const d=u.length>0?[f("calcite-combobox-item-group",{key:"recommended",label:n.recommended},o),f("calcite-combobox-item-group",{key:"other",label:l.other},u)]:o,p=i(r.fieldElement)||this._inputFieldHasInputType(r,"combo-box")&&r.fieldElement.input.showNoValueOption;if(!r.required&&p){const e="",t=this._inputFieldHasInputType(r,"combo-box")&&r.fieldElement.input.noValueOptionLabel||this.messages.empty;d.unshift(f("calcite-combobox-item",{value:e,"text-label":this.messages.empty,key:"empty-option"},t))}return f("calcite-combobox",{...a,"selection-mode":"single",disabled:a.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},d)}_registerIncompatibleValue(e,t,i,a){const n=this._fieldToInitialIncompatibleDomainValue,l=n.has(i.name);(l||null!=e&&""!==e&&!t.find((t=>t.value===e))||l)&&(l||n.set(i.name,e),null==a||a(n.get(i.name)))}renderRadioButtonsInputField(e,t,a){const n=a["data-field"],l=t.map((t=>this.renderRadioButton({key:t.name,label:t.name,name:n.name,value:t.value,selected:t.value===e,props:a})));this._registerIncompatibleValue(e,t,n);const s=i(n.fieldElement)||this._inputFieldHasInputType(n,"radio-buttons")&&n.fieldElement.input.showNoValueOption;if(!n.required&&s){const t="",i=this._inputFieldHasInputType(n,"radio-buttons")&&n.fieldElement.input.noValueOptionLabel||this.messages.empty,s=e===t||null===e;l.unshift(this.renderRadioButton({key:"empty-option",label:i,name:n.name,value:t,selected:s,props:a}))}return f("div",{key:`${a.key}-radio`,class:g.inputRadioGroup},l)}renderSwitchInputField(e,t){const i=t["data-field"],a=!!this._inputFieldHasInputType(i,"switch")&&e===i.fieldElement.input.onValue;return f("calcite-switch",{...t,class:g.inputSwitch,onclick:this._handleSwitchClick,checked:a,disabled:t.readOnly})}renderRadioButton({key:e,name:t,value:i,selected:a,label:n,props:l}){return f("label",{key:e,class:g.inputRadioLabel},f("input",{...l,class:g.inputRadio,name:t,type:"radio",value:i,checked:a,onchange:this._handleRadioInputChange}),n)}renderAuxiliaryText(e){const t=this._userUpdatedInputFieldNames.has(e.name)&&!e.valid?e.errorMessage:a(this.viewModel.contingencyConstraintViolations.get(e.name))?this.messages.validationErrors.valuesIncompatible:null;return a(t)?f("calcite-input-message",{status:"invalid",icon:!0,active:!0},t):e.description?f("div",{key:"description",class:g.description},e.description):void 0}getCommonInputProps(e){const{groupDisplay:t}=this,{editable:i,group:n,hint:l,maxLength:s,minLength:r,name:o,required:u,type:d,valid:p,value:c}=e,m=this._userUpdatedInputFieldNames.has(o),h=!i,f="all"===t&&a(n)&&"collapsed"===n.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":p?"false":"true",class:this.classes(g.input,g.inputField,h?g.inputDisabled:null,m&&!p?g.inputInvalid:null),key:o,label:o,minlength:r>-1?`${r}`:"",maxlength:s>-1?`${s}`:"",...this._getNumberFieldConstraints(e),readOnly:h,value:null==c?"":`${c}`,"data-field":e,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===d?this._handleNumberInputMouseDown:null,placeholder:"number"===d||"text"===d?l:"",required:u,tabIndex:f?-1:0}}_isInputFieldInGroup(e){return!y(e)&&a(e.group)}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),a=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(a.length>0){const e=new Set(a.map((e=>e.value)));return[a,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const l of this.viewModel.allInputFields){const{name:a,value:n}=l;!i(n)&&a!==e&&this.viewModel.fieldsWithContingentValues.has(a)&&(t[a]=n)}const a=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const l of a){const a=l.values[e];if(i(a)||"code"!==a.objectType&&"null"!==a.objectType)continue;const{code:s,name:r}="null"===a.objectType?{code:"",name:this.messages.empty}:a.codedValue;if(n.has(s))continue;Object.entries(t).every((([e,t])=>!l.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,l.values[e])))&&n.set(s,{name:r,value:s})}return[...n.values()]}_getNumberFieldConstraints(e){const t=r(e.domain)||o(e.field);return t&&t.max!==Number.MAX_VALUE&&t.min!==Number.MIN_VALUE?t:{min:null,max:null}}_afterInputCreateOrUpdate(e){const t=e["data-field"],i=this.viewModel.findField(this._activeInputName),a=this._fieldToInitialIncompatibleDomainValue.get(t.name)===t.value;this._fieldFocusNeeded&&i===t&&("radio-buttons"!==t.inputType||a||e.checked)&&(this._fieldFocusNeeded=!1,e.focus())}_handleInputFocus(e){const t=e.target,i=t["data-field"];this._activeInputName=i.name,"date"===i.type&&this._syncDateFieldEdits(t)}_handleInputBlur(e){const t=e.target,i=t["data-field"];if("date"===i.type){const n=e.relatedTarget,l=n&&n["data-field"];if(l&&"date"===i.type&&"date"===l.type&&i.field===l.field){if(""!==t.value&&""===n.value){var a;const l=n.getAttribute("data-date-part");n.value=this._formatDate(null!=(a=i.value)?a:Date.now())[l],this._parseDate(t.value,t.getAttribute("data-date-part"))&&this._commitInputValue(e.target,!0,!1)}return}}this._commitInputValue(t),this.scheduleRender()}_commitInputValue(e,t=!1,i=!0){const a=e["data-field"];if(this._activeDateFieldEdit){const{date:o,time:u}=this._activeDateFieldEdit,d=this._parseDateTime(e.value,a,o.active?"date":"time"),p=null!==this.viewModel.getValue(a.name),c=o.input&&(u.input||!a.includeTime),m=null===d;if(t){if(m)return;(c||!i||p)&&this._updateDateFieldValue(a,d)}else{var n,l;if(""===(null==(n=o.input)?void 0:n.value)||""===(null==(l=u.input)?void 0:l.value))this._updateDateFieldValue(a,null);else if(c){var s,r;const e=`${o.input.value} ${null!=(s=null==(r=u.input)?void 0:r.value)?s:""}`,t=this._parseDateTime(e,a);!(null!==t)&&p||this._updateDateFieldValue(a,t)}this._activeDateFieldEdit=null}}else this._updateFieldValue(e)}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:a,metaKey:n}=e,l=e.target["data-field"];if("Enter"===t)this._isInputFieldInGroup(l)&&"collapsed"===l.group.state&&(l.group.state="expanded");else{const{type:s}=l.field,r="single"===s||"double"===s,o=!i&&!a&&!n;if(("integer"===s||"small-integer"===s||r)&&o&&1===t.length){const i=Number(t),a=["-","+"],n=["e","."],l=r?[...a,...n]:a;isNaN(i)&&-1===l.indexOf(t)&&e.preventDefault()}}}_syncDateFieldEdits(e){var t,i;const a=e["data-field"];if("date"!==a.type)return;const n=e.getAttribute("data-date-part"),l="date"===n?{value:e.value,input:e,active:!0}:{...null==(t=this._activeDateFieldEdit)?void 0:t.date,active:!1},s="time"===n?{value:e.value,input:e,active:!0}:{...null==(i=this._activeDateFieldEdit)?void 0:i.time,active:!1};this._activeDateFieldEdit={fieldName:a.name,date:l,time:s}}_updateFieldValue(e){const t=e["data-field"],{name:i}=t;if(this.viewModel.setValue(i,this._parseValue(e)),this._userUpdatedInputFieldNames.add(i),this.viewModel.fieldsWithContingentValues.has(i)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>a(t))));this.viewModel.validateContingencyConstraints(e)}}_updateDateFieldValue(e,t){this.viewModel.setValue(e.name,t),this._userUpdatedInputFieldNames.add(e.name)}_parseValue(e){const t=e["data-field"],i=e.value;if(this._inputFieldHasInputType(t,"switch")&&!(e instanceof HTMLCalciteComboboxElement))return e.checked?t.fieldElement.input.onValue:t.fieldElement.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{type:a}=t;if("number"===a)return i?parseFloat(i):null;if("date"===a){if(!i)return null;const a=Number(i);if(!isNaN(a))return a;const n=e.getAttribute("data-date-part"),l=this._parseDate(i,n);if(!l)return null;let s=_.fromJSDate(l);const r=t.domain,o=_.now();let u=o;if(r&&"range"===r.type){const e=_.fromMillis(r.maxValue);o<e&&(u=e)}const d=this.viewModel.getValue(t.name),p=null!=d?_.fromMillis(d):u;return s="date"===n?s.set({hour:p.hour,minute:p.minute,second:p.second}):s.set({day:p.day,month:p.month,year:p.year}),s.toMillis()}return i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){var t;const i=e.currentTarget["data-group"],a="expanded"===i.state,n="sequential"===this.groupDisplay,l=`.${g.groupHeader}`;if(!(a&&!e.target.closest(l))){if(this._activeInputName=null==(t=this._getFocusableInput("forward",i))?void 0:t.name,n){const t=e.target.closest(l);if(a&&!t)return;this.viewModel.inputFields.forEach((e=>{y(e)&&e!==i&&(e.state="collapsed")}))}i.state=a?"collapsed":"expanded",this._fieldFocusNeeded=n,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_formatDate(e){if(null==e)return{date:"",time:""};const t=_.fromMillis(e,{locale:v(),numberingSystem:"latn"});return{date:t.toLocaleString({year:"numeric",month:"2-digit",day:"2-digit"}),time:t.toFormat(b.timePattern)}}_parseDate(e,t){if(null==e||""===e)return null;const{timePattern:i,datePattern:a}=b,n=t?"date"===t?a:i:`${a} ${i}`,l=_.fromFormat(e,n,{locale:v(),numberingSystem:"latn"});return l.isValid?l.toJSDate():null}_inputFieldHasInputType(e,t){var i;return a(e.fieldElement)&&(null==(i=e.fieldElement.input)?void 0:i.type)===t}_valueIsValidContingentValue(e,i){var a;switch(i.objectType){case"any":return!0;case"null":return null==e;case"code":return e===(null==(a=i.codedValue)?void 0:a.code);case"range":return e>=i.minValue&&e<=i.maxValue;default:return t(i.objectType),!1}}};e([n("viewModel.description")],I.prototype,"description",void 0),e([n("viewModel.feature")],I.prototype,"feature",void 0),e([n("viewModel.fieldConfig")],I.prototype,"fieldConfig",void 0),e([n("viewModel.formTemplate")],I.prototype,"formTemplate",void 0),e([l()],I.prototype,"groupDisplay",void 0),e([l()],I.prototype,"headingLevel",void 0),e([l({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],I.prototype,"label",void 0),e([n("viewModel.layer")],I.prototype,"layer",void 0),e([l(),m("esri/widgets/FeatureForm/t9n/FeatureForm")],I.prototype,"messages",void 0),e([l(),m("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],I.prototype,"messagesTemplates",void 0),e([n("viewModel.strict")],I.prototype,"strict",void 0),e([n("viewModel.title")],I.prototype,"title",void 0),e([l(),h(["value-change","submit"])],I.prototype,"viewModel",void 0),e([n("viewModel.getValues")],I.prototype,"getValues",null),e([n("viewModel.submit")],I.prototype,"submit",null),I=e([s("esri.widgets.FeatureForm")],I);const F=I;export{F as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{neverReached as t}from"../core/compilerUtils.js";import{isNone as i,isSome as a}from"../core/maybe.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{getDomainRange as r}from"../layers/support/domainUtils.js";import{getFieldRange as o}from"../layers/support/fieldUtils.js";import u from"./Widget.js";import d from"./FeatureForm/FeatureFormViewModel.js";import{Heading as p,incrementHeadingLevel as c}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{vmEvent as h}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{DateTime as _}from"luxon";import{getLocale as v}from"../intl/locale.js";const g={base:"esri-feature-form",form:"esri-feature-form__form",formHeader:"esri-feature-form__form-header",label:"esri-feature-form__label",inputField:"esri-feature-form__input",inputDate:"esri-feature-form__input--date",inputTime:"esri-feature-form__input--time",inputRadioGroup:"esri-feature-form__input--radio-group",inputRadio:"esri-feature-form__input--radio",inputRadioLabel:"esri-feature-form__input--radio-label",inputDisabled:"esri-feature-form__input--disabled",inputSwitch:"esri-feature-form__input--switch",inputInvalid:"esri-feature-form__input--invalid",inputIconInvalid:"esri-feature-form__input-icon--invalid",errorMessage:"esri-feature-form__field-error-message",description:"esri-feature-form__description-text",dateInputPart:"esri-feature-form__date-input-part",loneDateInputPart:"esri-feature-form__date-input-part--lone",dateInputContainer:"esri-feature-form__date-input-container",dateFormatHint:"esri-feature-form__date-format-hint",group:"esri-feature-form__group",groupLabel:"esri-feature-form__group-label",groupHeader:"esri-feature-form__group-header",groupHeading:"esri-feature-form__group-header",groupTitle:"esri-feature-form__group-title",groupDescription:"esri-feature-form__group-description",groupToggleIcon:"esri-feature-form__group-toggle-icon",groupCollapsed:"esri-feature-form__group--collapsed",groupSequential:"esri-feature-form__group--sequential",groupActive:"esri-feature-form__group--active",collapseIcon:"esri-icon-up",errorIcon:"esri-icon-notice-triangle",expandIcon:"esri-icon-down",widget:"esri-widget",panel:"esri-widget--panel",input:"esri-input",select:"esri-select"},b={datePattern:"D",timePattern:"tt"};function y(e){return e&&e.inputFields}let I=class extends u{constructor(e,t){super(e,t),this._activeDateFieldEdit=null,this._activeInputName=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedInputFieldNames=new Set,this.description=null,this.feature=null,this.fieldConfig=null,this.formTemplate=null,this.groupDisplay="all",this.headingLevel=2,this.label=void 0,this.layer=null,this.messages=null,this.messagesTemplates=null,this.strict=null,this.title=null,this.viewModel=new d,this._handleSwitchClick=e=>{e.target===e.currentTarget&&e.stopImmediatePropagation()},this._handleRadioInputChange=e=>{this._commitInputValue(e.target)},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget,!0)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this)}initialize(){this.own(this.watch("feature",(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e&&e.name,this._userUpdatedInputFieldNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedInputFieldNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-combobox.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),import("@esri/calcite-components/dist/components/calcite-input-message.js"),import("@esri/calcite-components/dist/components/calcite-switch.js")])}destroy(){this._userUpdatedInputFieldNames.clear(),this._userUpdatedInputFieldNames=null}getValues(){return null}submit(){return null}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(g.base,g.widget,g.panel)},"ready"===e?this.renderForm():null)}renderForm(){const e=this.title?f(p,{key:"title",level:this.headingLevel},this.title):null,t=this.description?f("p",{class:g.description,key:"description"},this.description):null,i=e||t?f("div",{class:g.formHeader},e,t):null;return f("form",{class:g.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},i,this.renderFields())}renderFields(){const{viewModel:{inputFields:e}}=this;return e.map(((e,t)=>y(e)?this.renderGroup(e,t):this.renderLabeledField(e)))}renderGroup(e,t){const{description:i,inputFields:a,label:n,state:l}=e,s=this.viewModel.findField(this._activeInputName),r=!(!s||s.group!==e),o=`${this.id}_group_${t}`,u=`${this.id}_group-label_${t}`,d=`${this.id}_group-description_${t}`,m=i?f("p",{class:this.classes(g.groupDescription,g.description),id:d},i):null,h="sequential"===this.groupDisplay,_=h?r:"expanded"===l,v=_?g.collapseIcon:g.expandIcon;return f("fieldset",{"aria-expanded":_.toString(),"aria-labelledby":u,"aria-describedby":i?d:"",class:this.classes(g.group,h?g.groupSequential:null,_?null:g.groupCollapsed,r?g.groupActive:null),"data-group":e,id:o,key:t,onclick:this._handleGroupClick},f("button",{role:h?"presentation":void 0,class:g.groupHeader,type:"button",tabIndex:h?-1:0},f("div",{class:g.groupTitle},f(p,{class:g.groupLabel,id:u,level:this.title?c(this.headingLevel):this.headingLevel},n),m),h?null:f("span",{class:this.classes(v,g.groupToggleIcon)})),a.map((e=>this.renderLabeledField(e))))}_getFocusableInput(e,t){const i=this.viewModel.allInputFields,a="forward"===e?i:i.slice().reverse();let n;if(t)if(y(t))n=a.indexOf(t.inputFields[0]);else{let i;if(this._isInputFieldInGroup(t)&&"collapsed"===t.group.state){const{inputFields:a}=t.group;i="forward"===e?a[a.length-1]:a[0]}else i=t;n=a.indexOf(i)+1}else n=0;for(let l=n;l<a.length;l++){const e=a[l];if(e.visible)return e}return null}renderLabeledField(e){const{label:t,layer:i,type:a}=e;return f("label",{key:`${i.id}-${e.name}`,class:g.label},[t,"unsupported"!==a?this.renderInputField(e):this.renderUnsupportedField(e),this.renderAuxiliaryText(e)])}renderInputField(e){const{domain:t,name:i,type:a,value:n}=e,l=this.getCommonInputProps(e);if("coded-value"===(null==t?void 0:t.type)){if(this._inputFieldHasInputType(e,"switch")){const{fieldElement:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(i)||null==n||t.input.onValue!==n&&t.input.offValue!==n))return this.renderSwitchInputField(n,l);this._switchFieldsWithInitialIncompatibleValue.add(i)}return"radio-buttons"===e.inputType?this.renderRadioButtonsInputField(n,t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),l):this.renderSelectInputField(n,this._getFieldValueOptions(i,t),l)}return"text"===a&&"text-area"===e.inputType?f("textarea",{...l}):"datetime-picker"===e.inputType||"date"===a?this.renderDateInputField(n,l):f("input",{type:"text"===a?"text":"number",...l})}_parseDateTime(e,t,i){if(i){var a;let n=_.fromJSDate(this._parseDate(e,i));const l=_.fromMillis(null!=(a=t.value)?a:Date.now());return n="date"===i?n.set({hour:l.hour,minute:l.minute,second:l.second}):n.set({day:l.day,month:l.month,year:l.year}),n.isValid?n.toMillis():null}const n=_.fromJSDate(this._parseDate(e));return n.isValid?n.toMillis():null}renderDateInputField(e,t){const{date:i,time:a}=this._formatDate(0),n=`${this.id}-${t.key}`,l=`${n}-date`,s=`${n}-time`,r=t["data-field"],{includeTime:o}=r,{_activeDateFieldEdit:u}=this;let{date:d,time:p}=this._formatDate(e);var c,m,h,_;(null==u?void 0:u.fieldName)===r.name&&(d=null!=(c=null==(m=u.date.input)?void 0:m.value)?c:d,p=null!=(h=null==(_=u.time.input)?void 0:_.value)?h:p);return f("div",{key:`${t.key}-date`,class:g.dateInputContainer},f("div",{class:this.classes(g.dateInputPart,o?null:g.loneDateInputPart)},f("input",{"aria-label":r.label,"aria-describedby":l,type:"text",...t,"data-date-part":"date",class:this.classes(t.class,g.inputDate),value:d}),f("div",{class:g.dateFormatHint,id:l},i)),o?f("div",{class:g.dateInputPart,key:"time-input"},f("input",{"aria-describedby":s,"aria-label":r.label,type:"text",...t,"data-date-part":"time",class:this.classes(t.class,g.inputTime),value:p}),f("div",{class:g.dateFormatHint,id:s},a)):null)}renderUnsupportedField(e){const t=this.getCommonInputProps(e);return f("input",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,class:this.classes(g.input,g.inputField,g.inputDisabled),"data-field":t["data-field"],onfocus:t.onfocus,readOnly:!0,tabIndex:t.tabIndex,type:"text",value:t.value})}renderSelectInputField(e,t,a){const{messages:n,messagesTemplates:l}=this,s=t.map((t=>t.map((t=>f("calcite-combobox-item",{value:t.value,"text-label":t.name,key:t.value,selected:e===t.value}))))),r=a["data-field"],[o,u]=s;this._registerIncompatibleValue(e,t.flat(),r,(e=>{u.unshift(f("calcite-combobox-item",{value:`${e}`,"text-label":`${e}`,key:"incompatible-option",readOnly:!0}))}));const d=u.length>0?[f("calcite-combobox-item-group",{key:"recommended",label:n.recommended},o),f("calcite-combobox-item-group",{key:"other",label:l.other},u)]:o,p=i(r.fieldElement)||this._inputFieldHasInputType(r,"combo-box")&&r.fieldElement.input.showNoValueOption;if(!r.required&&p){const e="",t=this._inputFieldHasInputType(r,"combo-box")&&r.fieldElement.input.noValueOptionLabel||this.messages.empty;d.unshift(f("calcite-combobox-item",{value:e,"text-label":this.messages.empty,key:"empty-option"},t))}return f("calcite-combobox",{...a,"selection-mode":"single",disabled:a.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},d)}_registerIncompatibleValue(e,t,i,a){const n=this._fieldToInitialIncompatibleDomainValue,l=n.has(i.name);(l||null!=e&&""!==e&&!t.find((t=>t.value===e))||l)&&(l||n.set(i.name,e),null==a||a(n.get(i.name)))}renderRadioButtonsInputField(e,t,a){const n=a["data-field"],l=t.map((t=>this.renderRadioButton({key:t.name,label:t.name,name:n.name,value:t.value,selected:t.value===e,props:a})));this._registerIncompatibleValue(e,t,n);const s=i(n.fieldElement)||this._inputFieldHasInputType(n,"radio-buttons")&&n.fieldElement.input.showNoValueOption;if(!n.required&&s){const t="",i=this._inputFieldHasInputType(n,"radio-buttons")&&n.fieldElement.input.noValueOptionLabel||this.messages.empty,s=e===t||null===e;l.unshift(this.renderRadioButton({key:"empty-option",label:i,name:n.name,value:t,selected:s,props:a}))}return f("div",{key:`${a.key}-radio`,class:g.inputRadioGroup},l)}renderSwitchInputField(e,t){const i=t["data-field"],a=!!this._inputFieldHasInputType(i,"switch")&&e===i.fieldElement.input.onValue;return f("calcite-switch",{...t,class:g.inputSwitch,onclick:this._handleSwitchClick,checked:a,disabled:t.readOnly})}renderRadioButton({key:e,name:t,value:i,selected:a,label:n,props:l}){return f("label",{key:e,class:g.inputRadioLabel},f("input",{...l,class:g.inputRadio,name:t,type:"radio",value:i,checked:a,onchange:this._handleRadioInputChange}),n)}renderAuxiliaryText(e){const t=this._userUpdatedInputFieldNames.has(e.name)&&!e.valid?e.errorMessage:a(this.viewModel.contingencyConstraintViolations.get(e.name))?this.messages.validationErrors.valuesIncompatible:null;return a(t)?f("calcite-input-message",{status:"invalid",icon:!0,active:!0},t):e.description?f("div",{key:"description",class:g.description},e.description):void 0}getCommonInputProps(e){const{groupDisplay:t}=this,{editable:i,group:n,hint:l,maxLength:s,minLength:r,name:o,required:u,type:d,valid:p,value:c}=e,m=this._userUpdatedInputFieldNames.has(o),h=!i,f="all"===t&&a(n)&&"collapsed"===n.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":p?"false":"true",class:this.classes(g.input,g.inputField,h?g.inputDisabled:null,m&&!p?g.inputInvalid:null),key:o,label:o,minlength:r>-1?`${r}`:"",maxlength:s>-1?`${s}`:"",...this._getNumberFieldConstraints(e),readOnly:h,value:null==c?"":`${c}`,"data-field":e,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===d?this._handleNumberInputMouseDown:null,placeholder:"number"===d||"text"===d?l:"",required:u,tabIndex:f?-1:0}}_isInputFieldInGroup(e){return!y(e)&&a(e.group)}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),a=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(a.length>0){const e=new Set(a.map((e=>e.value)));return[a,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const l of this.viewModel.allInputFields){const{name:a,value:n}=l;!i(n)&&a!==e&&this.viewModel.fieldsWithContingentValues.has(a)&&(t[a]=n)}const a=this.viewModel.joinedContingentValues.slice(),n=new Map;for(const l of a){const a=l.values[e];if(i(a)||"code"!==a.objectType&&"null"!==a.objectType)continue;const{code:s,name:r}="null"===a.objectType?{code:"",name:this.messages.empty}:a.codedValue;if(n.has(s))continue;Object.entries(t).every((([e,t])=>!l.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,l.values[e])))&&n.set(s,{name:r,value:s})}return[...n.values()]}_getNumberFieldConstraints(e){const t=r(e.domain)||o(e.field);return t&&t.max!==Number.MAX_VALUE&&t.min!==Number.MIN_VALUE?t:{min:null,max:null}}_afterInputCreateOrUpdate(e){const t=e["data-field"],i=this.viewModel.findField(this._activeInputName),a=this._fieldToInitialIncompatibleDomainValue.get(t.name)===t.value;this._fieldFocusNeeded&&i===t&&("radio-buttons"!==t.inputType||a||e.checked)&&(this._fieldFocusNeeded=!1,e.focus())}_handleInputFocus(e){const t=e.target,i=t["data-field"];this._activeInputName=i.name,"date"===i.type&&this._syncDateFieldEdits(t)}_handleInputBlur(e){const t=e.target,i=t["data-field"];if("date"===i.type){const n=e.relatedTarget,l=n&&n["data-field"];if(l&&"date"===i.type&&"date"===l.type&&i.field===l.field){if(""!==t.value&&""===n.value){var a;const l=n.getAttribute("data-date-part");n.value=this._formatDate(null!=(a=i.value)?a:Date.now())[l],this._parseDate(t.value,t.getAttribute("data-date-part"))&&this._commitInputValue(e.target,!0,!1)}return}}this._commitInputValue(t),this.scheduleRender()}_commitInputValue(e,t=!1,i=!0){const a=e["data-field"];if(this._activeDateFieldEdit){const{date:o,time:u}=this._activeDateFieldEdit,d=this._parseDateTime(e.value,a,o.active?"date":"time"),p=null!==this.viewModel.getValue(a.name),c=o.input&&(u.input||!a.includeTime),m=null===d;if(t){if(m)return;(c||!i||p)&&this._updateDateFieldValue(a,d)}else{var n,l;if(""===(null==(n=o.input)?void 0:n.value)||""===(null==(l=u.input)?void 0:l.value))this._updateDateFieldValue(a,null);else if(c){var s,r;const e=`${o.input.value} ${null!=(s=null==(r=u.input)?void 0:r.value)?s:""}`,t=this._parseDateTime(e,a);!(null!==t)&&p||this._updateDateFieldValue(a,t)}this._activeDateFieldEdit=null}}else this._updateFieldValue(e)}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:a,metaKey:n}=e,l=e.target["data-field"];if("Enter"===t)this._isInputFieldInGroup(l)&&"collapsed"===l.group.state&&(l.group.state="expanded");else{const{type:s}=l.field,r="single"===s||"double"===s,o=!i&&!a&&!n;if(("integer"===s||"small-integer"===s||r)&&o&&1===t.length){const i=Number(t),a=["-","+"],n=["e","."],l=r?[...a,...n]:a;isNaN(i)&&-1===l.indexOf(t)&&e.preventDefault()}}}_syncDateFieldEdits(e){var t,i;const a=e["data-field"];if("date"!==a.type)return;const n=e.getAttribute("data-date-part"),l="date"===n?{value:e.value,input:e,active:!0}:{...null==(t=this._activeDateFieldEdit)?void 0:t.date,active:!1},s="time"===n?{value:e.value,input:e,active:!0}:{...null==(i=this._activeDateFieldEdit)?void 0:i.time,active:!1};this._activeDateFieldEdit={fieldName:a.name,date:l,time:s}}_updateFieldValue(e){const t=e["data-field"],{name:i}=t;if(this.viewModel.setValue(i,this._parseValue(e)),this._userUpdatedInputFieldNames.add(i),this.viewModel.fieldsWithContingentValues.has(i)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>a(t))));this.viewModel.validateContingencyConstraints(e)}}_updateDateFieldValue(e,t){this.viewModel.setValue(e.name,t),this._userUpdatedInputFieldNames.add(e.name)}_parseValue(e){const t=e["data-field"],i=e.value;if(this._inputFieldHasInputType(t,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.fieldElement.input.onValue:t.fieldElement.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{type:a}=t;if("number"===a)return i?parseFloat(i):null;if("date"===a){if(!i)return null;const a=Number(i);if(!isNaN(a))return a;const n=e.getAttribute("data-date-part"),l=this._parseDate(i,n);if(!l)return null;let s=_.fromJSDate(l);const r=t.domain,o=_.now();let u=o;if(r&&"range"===r.type){const e=_.fromMillis(r.maxValue);o<e&&(u=e)}const d=this.viewModel.getValue(t.name),p=null!=d?_.fromMillis(d):u;return s="date"===n?s.set({hour:p.hour,minute:p.minute,second:p.second}):s.set({day:p.day,month:p.month,year:p.year}),s.toMillis()}return i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){var t;const i=e.currentTarget["data-group"],a="expanded"===i.state,n="sequential"===this.groupDisplay,l=`.${g.groupHeader}`;if(!(a&&!e.target.closest(l))){if(this._activeInputName=null==(t=this._getFocusableInput("forward",i))?void 0:t.name,n){const t=e.target.closest(l);if(a&&!t)return;this.viewModel.inputFields.forEach((e=>{y(e)&&e!==i&&(e.state="collapsed")}))}i.state=a?"collapsed":"expanded",this._fieldFocusNeeded=n,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_formatDate(e){if(null==e)return{date:"",time:""};const t=_.fromMillis(e,{locale:v(),numberingSystem:"latn"});return{date:t.toLocaleString({year:"numeric",month:"2-digit",day:"2-digit"}),time:t.toFormat(b.timePattern)}}_parseDate(e,t){if(null==e||""===e)return null;const{timePattern:i,datePattern:a}=b,n=t?"date"===t?a:i:`${a} ${i}`,l=_.fromFormat(e,n,{locale:v(),numberingSystem:"latn"});return l.isValid?l.toJSDate():null}_inputFieldHasInputType(e,t){var i;return a(e.fieldElement)&&(null==(i=e.fieldElement.input)?void 0:i.type)===t}_valueIsValidContingentValue(e,i){var a;switch(i.objectType){case"any":return!0;case"null":return null==e;case"code":return e===(null==(a=i.codedValue)?void 0:a.code);case"range":return e>=i.minValue&&e<=i.maxValue;default:return t(i.objectType),!1}}};e([n("viewModel.description")],I.prototype,"description",void 0),e([n("viewModel.feature")],I.prototype,"feature",void 0),e([n("viewModel.fieldConfig")],I.prototype,"fieldConfig",void 0),e([n("viewModel.formTemplate")],I.prototype,"formTemplate",void 0),e([l()],I.prototype,"groupDisplay",void 0),e([l()],I.prototype,"headingLevel",void 0),e([l({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],I.prototype,"label",void 0),e([n("viewModel.layer")],I.prototype,"layer",void 0),e([l(),m("esri/widgets/FeatureForm/t9n/FeatureForm")],I.prototype,"messages",void 0),e([l(),m("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],I.prototype,"messagesTemplates",void 0),e([n("viewModel.strict")],I.prototype,"strict",void 0),e([n("viewModel.title")],I.prototype,"title",void 0),e([l(),h(["value-change","submit"])],I.prototype,"viewModel",void 0),e([n("viewModel.getValues")],I.prototype,"getValues",null),e([n("viewModel.submit")],I.prototype,"submit",null),I=e([s("esri.widgets.FeatureForm")],I);const F=I;export{F as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1188,4889],{65845:(e,t,i)=>{i.d(t,{D:()=>o});var r=i(81153);function o(e){e&&e.writtenProperties&&e.writtenProperties.forEach((e=>{const t=e.target;e.newOrigin&&e.oldOrigin!==e.newOrigin&&(0,r.l)(t)&&t.updateOrigin(e.propName,e.newOrigin)}))}},74085:(e,t,i)=>{function r(e){}i.d(t,{Bg:()=>r}),i(80442)},81153:(e,t,i)=>{function r(e){return e&&"getAtOrigin"in e&&"originOf"in e}i.d(t,{l:()=>r})},66277:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Re});var r=i(43697),o=i(68773),s=(i(66577),i(38171)),a=i(51773),l=(i(16050),i(12501),i(95088),i(79056),i(5499),i(84382),i(30687),i(91423)),n=i(80539),u=i(20102),p=i(3920),d=i(92604),c=i(70586),m=i(16453),y=i(78286),b=i(67900),h=i(17452),f=i(5600),v=(i(67676),i(80442),i(75215)),g=i(71715),C=i(52011),T=i(30556),S=i(65845),w=i(6570),_=i(44547),N=i(8744),O=i(29600),I=i(71612),D=i(38009),x=i(16859),F=i(72965),B=i(66677),j=i(78223),E=i(96674),A=i(4095),P=i(77987),L=i(20256);let M=class extends E.wq{constructor(){super(...arguments),this.directionLines=new A.Z({color:[0,122,194],width:6}),this.directionPoints=new P.Z({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new P.Z({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new L.Z({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new A.Z({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new A.Z({width:8,color:[20,89,127]}),this.firstStop=new P.Z({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.middleStop=new P.Z({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.lastStop=new P.Z({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.invalidStop=new P.Z({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.waypointStop=new P.Z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.breakStop=new P.Z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"directionLines",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"directionPoints",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"pointBarriers",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"polygonBarriers",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"polylineBarriers",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"routeInfo",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"firstStop",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"middleStop",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"lastStop",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"invalidStop",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"waypointStop",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,types:j.LB})],M.prototype,"breakStop",void 0),M=(0,r._)([(0,C.j)("esri.layers.support.DefaultSymbols")],M);const J=M;var W,R=i(65587),V=i(15235),Z=i(93924),U=i(23334),q=i(58901),k=i(49352),z=i(21878);let G=W=class extends E.wq{constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null}static fromPortalJSON(e){var t,i;return new W({directionLineType:k.td.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:null!=(t=e.attributes.FromLevel)?t:null,geometry:q.Z.fromJSON(e.geometry),objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null,toLevel:null!=(i=e.attributes.ToLevel)?i:null})}toPortalJSON(){const e={geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),DirectionLineType:(0,c.pC)(this.directionLineType)?k.td.toJSON(this.directionLineType):null,DirectionPointID:(0,c.Wg)(this.directionPointId),Meters:(0,c.Wg)(this.distance),Minutes:(0,c.Wg)(this.duration)},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null};return(0,c.pC)(this.fromLevel)&&(e.attributes.FromLevel=this.fromLevel),(0,c.pC)(this.toLevel)&&(e.attributes.ToLevel=this.toLevel),e}};G.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],G.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({type:k.td.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:k.td.read}}})],G.prototype,"directionLineType",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.DirectionPointID"}}})],G.prototype,"directionPointId",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Meters"}}})],G.prototype,"distance",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Minutes"}}})],G.prototype,"duration",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.FromLevel"}}})],G.prototype,"fromLevel",void 0),(0,r._)([(0,f.Cb)({type:q.Z})],G.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ObjectID"}}})],G.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],G.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],G.prototype,"symbol",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ToLevel"}}})],G.prototype,"toLevel",void 0),G=W=(0,r._)([(0,C.j)("esri.rest.support.DirectionLine")],G);const H=G;var $,Y=i(13473);let K=$=class extends E.wq{constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.voiceInstruction=null}readArrivalTime(e,t){return(0,c.pC)(t.attributes.ArrivalTime)?new Date(t.attributes.ArrivalTime):null}static fromPortalJSON(e){var t,i,r,o,s,l,n,u,p,d,m,y,b;return new $({alternateName:null!=(t=e.attributes.AlternateName)?t:null,arrivalTime:(0,c.pC)(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:null!=(i=e.attributes.ArrivalUTCOffset)?i:null,azimuth:null!=(r=e.attributes.Azimuth)?r:null,branchName:null!=(o=e.attributes.BranchName)?o:null,directionPointType:k.cW.fromJSON(e.attributes.DirectionPointType),displayText:null!=(s=e.attributes.DisplayText)?s:null,exitName:null!=(l=e.attributes.ExitName)?l:null,geometry:Y.Z.fromJSON(e.geometry),intersectingName:null!=(n=e.attributes.IntersectingName)?n:null,level:null!=(u=e.attributes.Level)?u:null,name:null!=(p=e.attributes.Name)?p:null,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,sequence:e.attributes.Sequence,shortVoiceInstruction:null!=(d=e.attributes.ShortVoiceInstruction)?d:null,stopId:null!=(m=e.attributes.StopID)?m:null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null,towardName:null!=(y=e.attributes.TowardName)?y:null,voiceInstruction:null!=(b=e.attributes.VoiceInstruction)?b:null})}toPortalJSON(){const e={geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),DirectionPointType:(0,c.pC)(this.directionPointType)?k.cW.toJSON(this.directionPointType):null,Sequence:(0,c.Wg)(this.sequence),StopID:this.stopId},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null};return(0,c.pC)(this.alternateName)&&(e.attributes.AlternateName=this.alternateName),(0,c.pC)(this.arrivalTime)&&(e.attributes.ArrivalTime=this.arrivalTime.getTime()),(0,c.pC)(this.arrivalTimeOffset)&&(e.attributes.ArrivalUTCOffset=this.arrivalTimeOffset),(0,c.pC)(this.azimuth)&&(e.attributes.Azimuth=this.azimuth),(0,c.pC)(this.branchName)&&(e.attributes.BranchName=this.branchName),(0,c.pC)(this.displayText)&&(e.attributes.DisplayText=this.displayText),(0,c.pC)(this.exitName)&&(e.attributes.ExitName=this.exitName),(0,c.pC)(this.intersectingName)&&(e.attributes.IntersectingName=this.intersectingName),(0,c.pC)(this.level)&&(e.attributes.Level=this.level),(0,c.pC)(this.name)&&(e.attributes.Name=this.name),(0,c.pC)(this.shortVoiceInstruction)&&(e.attributes.ShortVoiceInstruction=this.shortVoiceInstruction),(0,c.pC)(this.towardName)&&(e.attributes.TowardName=this.towardName),(0,c.pC)(this.voiceInstruction)&&(e.attributes.VoiceInstruction=this.voiceInstruction),e}};K.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],K.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({json:{read:!1}})],K.prototype,"alternateName",void 0),(0,r._)([(0,f.Cb)()],K.prototype,"arrivalTime",void 0),(0,r._)([(0,g.r)("arrivalTime",["attributes.ArrivalTime"])],K.prototype,"readArrivalTime",null),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],K.prototype,"arrivalTimeOffset",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Azimuth"}}})],K.prototype,"azimuth",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.BranchName"}}})],K.prototype,"branchName",void 0),(0,r._)([(0,f.Cb)({type:k.cW.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:k.cW.read}}})],K.prototype,"directionPointType",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.DisplayText"}}})],K.prototype,"displayText",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ExitName"}}})],K.prototype,"exitName",void 0),(0,r._)([(0,f.Cb)({type:Y.Z})],K.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],K.prototype,"intersectingName",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],K.prototype,"level",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Name"}}})],K.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ObjectID"}}})],K.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],K.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Sequence"}}})],K.prototype,"sequence",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],K.prototype,"shortVoiceInstruction",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.StopID"}}})],K.prototype,"stopId",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],K.prototype,"symbol",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.TowardName"}}})],K.prototype,"towardName",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],K.prototype,"voiceInstruction",void 0),K=$=(0,r._)([(0,C.j)("esri.rest.support.DirectionPoint")],K);const X=K;var Q,ee=i(22974);function te(e,t){if((0,c.Wi)(e))return null;const i={},r=new RegExp(`^${t}`,"i");for(const o in e)e.hasOwnProperty(o)&&r.test(o)&&(i[o.substring(t.length)]=e[o]);return i}function ie(e,t){return(0,c.Wi)(e)||(0,c.Wi)(t)?null:Math.round((e-t)/6e4)}let re=Q=class extends E.wq{constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null}readCosts(e,t){return te(t.attributes,"Attr_")}writeCosts(e,t){if(!(0,c.Wi)(e)){t.attributes||(t.attributes={});for(const i in e)t.attributes[`Attr_${i}`]=e[i]}}static fromPortalJSON(e){var t,i;return new Q({addedCost:null!=(t=e.attributes.AddedCost)?t:null,barrierType:(0,c.pC)(e.attributes.BarrierType)?k.oi.fromJSON(e.attributes.BarrierType):null,costs:(0,c.pC)(e.attributes.Costs)?JSON.parse(e.attributes.Costs):null,curbApproach:(0,c.pC)(e.attributes.CurbApproach)?k.W7.fromJSON(e.attributes.CurbApproach):null,fullEdge:(0,c.pC)(e.attributes.FullEdge)?k.Dd.fromJSON(e.attributes.FullEdge):null,geometry:Y.Z.fromJSON(e.geometry),name:null!=(i=e.attributes.Name)?i:null,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,status:(0,c.pC)(e.attributes.Status)?k.SS.fromJSON(e.attributes.Status):null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null})}clone(){return new Q((0,ee.d9)({addedCost:this.addedCost,barrierType:this.barrierType,costs:this.costs,curbApproach:this.curbApproach,fullEdge:this.fullEdge,geometry:this.geometry,name:this.name,objectId:this.objectId,popupTemplate:this.popupTemplate,sideOfEdge:this.sideOfEdge,sourceId:this.sourceId,sourceOid:this.sourceOid,status:this.status,symbol:this.symbol}))}toPortalJSON(){return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),AddedCost:this.addedCost,BarrierType:(0,c.pC)(this.barrierType)?k.oi.toJSON(this.barrierType):null,Costs:(0,c.pC)(this.costs)?JSON.stringify(this.costs):null,CurbApproach:(0,c.pC)(this.curbApproach)?k.W7.toJSON(this.curbApproach):null,FullEdge:(0,c.pC)(this.fullEdge)?k.Dd.toJSON(this.fullEdge):null,Name:this.name,Status:(0,c.pC)(this.status)?k.SS.toJSON(this.status):null},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null}}};re.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],re.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({json:{read:!1}})],re.prototype,"addedCost",void 0),(0,r._)([(0,f.Cb)({type:k.oi.apiValues,json:{name:"attributes.BarrierType",read:{reader:k.oi.read},write:{writer:k.oi.write}}})],re.prototype,"barrierType",void 0),(0,r._)([(0,f.Cb)()],re.prototype,"costs",void 0),(0,r._)([(0,g.r)("costs",["attributes"])],re.prototype,"readCosts",null),(0,r._)([(0,T.c)("costs")],re.prototype,"writeCosts",null),(0,r._)([(0,f.Cb)({type:k.W7.apiValues,json:{read:{source:"attributes.CurbApproach",reader:k.W7.read}}})],re.prototype,"curbApproach",void 0),(0,r._)([(0,f.Cb)({type:k.Dd.apiValues,json:{name:"attributes.FullEdge",read:{reader:k.Dd.read},write:{writer:k.Dd.write}}})],re.prototype,"fullEdge",void 0),(0,r._)([(0,f.Cb)({type:Y.Z,json:{write:!0}})],re.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.Name",write:!0}})],re.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.ObjectID",write:!0}})],re.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],re.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({type:k.BW.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.BW.read}}})],re.prototype,"sideOfEdge",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SourceID"}}})],re.prototype,"sourceId",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SourceOID"}}})],re.prototype,"sourceOid",void 0),(0,r._)([(0,f.Cb)({type:k.SS.apiValues,json:{read:{source:"attributes.Status",reader:k.SS.read}}})],re.prototype,"status",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],re.prototype,"symbol",void 0),re=Q=(0,r._)([(0,C.j)("esri.rest.support.PointBarrier")],re);const oe=re;var se,ae=i(38913);let le=se=class extends E.wq{constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null}readCosts(e,t){return te(t.attributes,"Attr_")}writeCosts(e,t){if(!(0,c.Wi)(e)){t.attributes||(t.attributes={});for(const i in e)t.attributes[`Attr_${i}`]=e[i]}}static fromPortalJSON(e){var t,i;return new se({barrierType:(0,c.pC)(e.attributes.BarrierType)?k.oi.fromJSON(e.attributes.BarrierType):null,costs:(0,c.pC)(e.attributes.Costs)?JSON.parse(e.attributes.Costs):null,geometry:ae.Z.fromJSON(e.geometry),name:null!=(t=e.attributes.Name)?t:null,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,scaleFactor:null!=(i=e.attributes.ScaleFactor)?i:null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null})}clone(){return new se((0,ee.d9)({barrierType:this.barrierType,costs:this.costs,geometry:this.geometry,name:this.name,objectId:this.objectId,popupTemplate:this.popupTemplate,scaleFactor:this.scaleFactor,symbol:this.symbol}))}toPortalJSON(){var e,t;return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),BarrierType:(0,c.pC)(this.barrierType)?k.oi.toJSON(this.barrierType):null,Costs:(0,c.pC)(this.costs)?JSON.stringify(this.costs):null,Name:null!=(e=this.name)?e:null,ScaleFactor:null!=(t=this.scaleFactor)?t:null},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null}}};le.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],le.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({type:k.oi.apiValues,json:{name:"attributes.BarrierType",read:{reader:k.oi.read},write:{writer:k.oi.write}}})],le.prototype,"barrierType",void 0),(0,r._)([(0,f.Cb)()],le.prototype,"costs",void 0),(0,r._)([(0,g.r)("costs",["attributes"])],le.prototype,"readCosts",null),(0,r._)([(0,T.c)("costs")],le.prototype,"writeCosts",null),(0,r._)([(0,f.Cb)({type:ae.Z,json:{write:!0}})],le.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.Name",write:!0}})],le.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.ObjectID",write:!0}})],le.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],le.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],le.prototype,"scaleFactor",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],le.prototype,"symbol",void 0),le=se=(0,r._)([(0,C.j)("esri.rest.support.PolygonBarrier")],le);const ne=le;var ue;let pe=ue=class extends E.wq{constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null}readCosts(e,t){return te(t.attributes,"Attr_")}static fromPortalJSON(e){var t,i;return new ue({barrierType:(0,c.pC)(e.attributes.BarrierType)?k.oi.fromJSON(e.attributes.BarrierType):null,costs:(0,c.pC)(e.attributes.Costs)?JSON.parse(e.attributes.Costs):null,geometry:q.Z.fromJSON(e.geometry),name:null!=(t=e.attributes.Name)?t:null,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,scaleFactor:null!=(i=e.attributes.ScaleFactor)?i:null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null})}clone(){return new ue((0,ee.d9)({barrierType:this.barrierType,costs:this.costs,geometry:this.geometry,name:this.name,objectId:this.objectId,popupTemplate:this.popupTemplate,scaleFactor:this.scaleFactor,symbol:this.symbol}))}toPortalJSON(){return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),BarrierType:(0,c.pC)(this.barrierType)?k.oi.toJSON(this.barrierType):null,Costs:(0,c.pC)(this.costs)?JSON.stringify(this.costs):null,Name:this.name,ScaleFactor:this.scaleFactor},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null}}};pe.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],pe.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({type:k.oi.apiValues,json:{read:{source:"attributes.BarrierType",reader:k.oi.read}}})],pe.prototype,"barrierType",void 0),(0,r._)([(0,f.Cb)()],pe.prototype,"costs",void 0),(0,r._)([(0,g.r)("costs",["attributes"])],pe.prototype,"readCosts",null),(0,r._)([(0,f.Cb)({type:q.Z,json:{write:!0}})],pe.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.Name",write:!0}})],pe.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.ObjectID",write:!0}})],pe.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],pe.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],pe.prototype,"scaleFactor",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],pe.prototype,"symbol",void 0),pe=ue=(0,r._)([(0,C.j)("esri.rest.support.PolylineBarrier")],pe);const de=pe;var ce=i(49827);let me=class extends E.wq{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}};(0,r._)([(0,f.Cb)({type:[String],json:{read:{source:"accumulateAttributeNames"},write:{target:"accumulateAttributeNames"}}})],me.prototype,"accumulateAttributes",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],me.prototype,"directionsLanguage",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],me.prototype,"findBestSequence",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],me.prototype,"preserveFirstStop",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],me.prototype,"preserveLastStop",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],me.prototype,"startTimeIsUTC",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],me.prototype,"timeWindowsAreUTC",void 0),(0,r._)([(0,f.Cb)({type:ce.Z,json:{write:!0}})],me.prototype,"travelMode",void 0),me=(0,r._)([(0,C.j)("esri.layers.support.RouteSettings")],me);const ye=me;var be;let he=be=class extends E.wq{constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.version="1.0.0"}readEndTime(e,t){return(0,c.pC)(t.attributes.EndTimeUTC)?new Date(t.attributes.EndTimeUTC):null}readEndTimeOffset(e,t){return ie(t.attributes.EndTime,t.attributes.EndTimeUTC)}readStartTime(e,t){return(0,c.pC)(t.attributes.StartTimeUTC)?new Date(t.attributes.StartTimeUTC):null}readStartTimeOffset(e,t){return ie(t.attributes.StartTime,t.attributes.StartTimeUTC)}readTotalCosts(e,t){return te(t.attributes,"Total_")}readTotalViolations(e,t){return te(t.attributes,"TotalViolation_")}readTotalWait(e,t){return te(t.attributes,"TotalWait_")}static fromPortalJSON(e){var t,i,r,o,s,l;return new be({analysisSettings:(0,c.pC)(e.attributes.AnalysisSettings)?ye.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:(0,c.pC)(e.attributes.EndTime)?new Date(e.attributes.EndTime):null,endTimeOffset:null!=(t=e.attributes.EndUTCOffset)?t:null,geometry:q.Z.fromJSON(e.geometry),messages:(0,c.pC)(e.attributes.Messages)?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,startTime:(0,c.pC)(e.attributes.StartTime)?new Date(e.attributes.StartTime):null,startTimeOffset:null!=(i=e.attributes.StartUTCOffset)?i:null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null,totalCosts:(0,c.pC)(e.attributes.TotalCosts)?JSON.parse(e.attributes.TotalCosts):null,totalDistance:null!=(r=e.attributes.TotalMeters)?r:null,totalDuration:null!=(o=e.attributes.TotalMinutes)?o:null,totalLateDuration:null!=(s=e.attributes.TotalLateMinutes)?s:null,totalWaitDuration:null!=(l=e.attributes.TotalWaitMinutes)?l:null,version:e.attributes.Version})}toPortalJSON(){return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),AnalysisSettings:(0,c.pC)(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:(0,c.pC)(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:(0,c.pC)(this.messages)?JSON.stringify(this.messages):null,RouteName:(0,c.Wg)(this.name),StartTime:(0,c.pC)(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:(0,c.pC)(this.totalCosts)?JSON.stringify(this.totalCosts):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:(0,c.Wg)(this.version)},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null}}};he.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],he.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"analysisSettings",void 0),(0,r._)([(0,f.Cb)()],he.prototype,"endTime",void 0),(0,r._)([(0,g.r)("endTime",["attributes.EndTimeUTC"])],he.prototype,"readEndTime",null),(0,r._)([(0,f.Cb)()],he.prototype,"endTimeOffset",void 0),(0,r._)([(0,g.r)("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],he.prototype,"readEndTimeOffset",null),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.FirstStopID"}}})],he.prototype,"firstStopId",void 0),(0,r._)([(0,f.Cb)({type:q.Z})],he.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.LastStopID"}}})],he.prototype,"lastStopId",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"messages",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.Name"}}})],he.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.ObjectID"}}})],he.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],he.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)()],he.prototype,"startTime",void 0),(0,r._)([(0,g.r)("startTime",["attributes.StartTimeUTC"])],he.prototype,"readStartTime",null),(0,r._)([(0,f.Cb)()],he.prototype,"startTimeOffset",void 0),(0,r._)([(0,g.r)("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],he.prototype,"readStartTimeOffset",null),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.StopCount"}}})],he.prototype,"stopCount",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],he.prototype,"symbol",void 0),(0,r._)([(0,f.Cb)()],he.prototype,"totalCosts",void 0),(0,r._)([(0,g.r)("totalCosts",["attributes"])],he.prototype,"readTotalCosts",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"totalDistance",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"totalDuration",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"totalLateDuration",void 0),(0,r._)([(0,f.Cb)()],he.prototype,"totalViolations",void 0),(0,r._)([(0,g.r)("totalViolations",["attributes"])],he.prototype,"readTotalViolations",null),(0,r._)([(0,f.Cb)()],he.prototype,"totalWait",void 0),(0,r._)([(0,g.r)("totalWait",["attributes"])],he.prototype,"readTotalWait",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"totalWaitDuration",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],he.prototype,"version",void 0),he=be=(0,r._)([(0,C.j)("esri.rest.support.RouteInfo")],he);const fe=he;var ve=i(36030);const ge={type:String,json:{read:{source:"token"},write:{target:"token"}}};var Ce,Te=i(82971);let Se=Ce=class extends E.wq{constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return(0,v.TJ)(Ce,e)}writePointBarriers(e,t,i){this._writeNetworkFeatures(e,t,i)}writePolygonBarrier(e,t,i){this._writeNetworkFeatures(e,t,i)}writePolylineBarrier(e,t,i){this._writeNetworkFeatures(e,t,i)}readStartTime(e,t){return null!=t.startTime?new Date(t.startTime):null}writeStartTime(e,t){t.startTime=e?e.getTime():null}writeStops(e,t,i){this._writeNetworkFeatures(e,t,i)}clone(){return new Ce((0,ee.d9)({accumulateAttributes:this.accumulateAttributes,apiKey:this.apiKey,attributeParameterValues:this.attributeParameterValues,directionsLanguage:this.directionsLanguage,directionsLengthUnits:this.directionsLengthUnits,directionsOutputType:this.directionsOutputType,directionsStyleName:this.directionsStyleName,directionsTimeAttribute:this.directionsTimeAttribute,findBestSequence:this.findBestSequence,ignoreInvalidLocations:this.ignoreInvalidLocations,impedanceAttribute:this.impedanceAttribute,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:this.outputGeometryPrecisionUnits,outputLines:this.outputLines,outSpatialReference:this.outSpatialReference,pointBarriers:this.pointBarriers,polygonBarriers:this.polygonBarriers,polylineBarriers:this.polylineBarriers,preserveFirstStop:this.preserveFirstStop,preserveLastStop:this.preserveLastStop,restrictionAttributes:this.restrictionAttributes,restrictUTurns:this.restrictUTurns,returnBarriers:this.returnBarriers,returnDirections:this.returnDirections,returnPolygonBarriers:this.returnPolygonBarriers,returnPolylineBarriers:this.returnPolylineBarriers,returnRoutes:this.returnRoutes,returnStops:this.returnStops,returnZ:this.returnZ,startTime:this.startTime,startTimeIsUTC:this.startTimeIsUTC,stops:this.stops,timeWindowsAreUTC:this.timeWindowsAreUTC,travelMode:this.travelMode,useHierarchy:this.useHierarchy,useTimeWindows:this.useTimeWindows}))}_writeNetworkFeatures(e,t,i){t[i]=n.Z.isCollection(e)?{features:e.toArray().map((e=>e.toJSON()))}:e.toJSON()}};(0,r._)([(0,f.Cb)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Se.prototype,"accumulateAttributes",void 0),(0,r._)([(0,f.Cb)(ge)],Se.prototype,"apiKey",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"attributeParameterValues",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Se.prototype,"directionsLanguage",void 0),(0,r._)([(0,ve.J)(k.GX)],Se.prototype,"directionsLengthUnits",void 0),(0,r._)([(0,ve.J)(k.$7)],Se.prototype,"directionsOutputType",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Se.prototype,"directionsStyleName",void 0),(0,r._)([(0,f.Cb)({type:String,json:{write:!0}})],Se.prototype,"directionsTimeAttribute",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"findBestSequence",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"ignoreInvalidLocations",void 0),(0,r._)([(0,f.Cb)({type:String,json:{read:{source:"impedanceAttributeName"},write:{target:"impedanceAttributeName"}}})],Se.prototype,"impedanceAttribute",void 0),(0,r._)([(0,f.Cb)({type:Number,json:{write:!0}})],Se.prototype,"outputGeometryPrecision",void 0),(0,r._)([(0,ve.J)(k.q$)],Se.prototype,"outputGeometryPrecisionUnits",void 0),(0,r._)([(0,ve.J)(k.no)],Se.prototype,"outputLines",void 0),(0,r._)([(0,f.Cb)({type:Te.Z,json:{write:!0}})],Se.prototype,"outSpatialReference",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"pointBarriers",void 0),(0,r._)([(0,T.c)("pointBarriers")],Se.prototype,"writePointBarriers",null),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"polygonBarriers",void 0),(0,r._)([(0,T.c)("polygonBarriers")],Se.prototype,"writePolygonBarrier",null),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"polylineBarriers",void 0),(0,r._)([(0,T.c)("polylineBarriers")],Se.prototype,"writePolylineBarrier",null),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"preserveFirstStop",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"preserveLastStop",void 0),(0,r._)([(0,f.Cb)({type:[String],json:{write:!0}})],Se.prototype,"restrictionAttributes",void 0),(0,r._)([(0,ve.J)(k.ip)],Se.prototype,"restrictUTurns",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnBarriers",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnDirections",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnPolygonBarriers",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnPolylineBarriers",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnRoutes",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnStops",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"returnZ",void 0),(0,r._)([(0,f.Cb)({type:Date,json:{type:Number,write:!0}})],Se.prototype,"startTime",void 0),(0,r._)([(0,g.r)("startTime")],Se.prototype,"readStartTime",null),(0,r._)([(0,T.c)("startTime")],Se.prototype,"writeStartTime",null),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"startTimeIsUTC",void 0),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"stops",void 0),(0,r._)([(0,T.c)("stops")],Se.prototype,"writeStops",null),(0,r._)([(0,f.Cb)({json:{write:!0}})],Se.prototype,"timeWindowsAreUTC",void 0),(0,r._)([(0,f.Cb)({type:ce.Z,json:{write:!0}})],Se.prototype,"travelMode",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"useHierarchy",void 0),(0,r._)([(0,f.Cb)({type:Boolean,json:{write:!0}})],Se.prototype,"useTimeWindows",void 0),Se=Ce=(0,r._)([(0,C.j)("esri.rest.support.RouteParameters")],Se);const we=Se;var _e;let Ne=_e=class extends E.wq{constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return ie(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return te(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return ie(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}readServiceCosts(e,t){return te(t.attributes,"Attr_")}writeServiceCosts(e,t){if(!(0,c.Wi)(e)){t.attributes||(t.attributes={});for(const i in e)t.attributes[`Attr_${i}`]=e[i]}}writeTimeWindowEnd(e,t){(0,c.Wi)(e)||(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){(0,c.Wi)(e)||(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return te(t.attributes,"Violation_")}readWait(e,t){return te(t.attributes,"Wait_")}static fromPortalJSON(e){var t,i,r,o,s,l,n,u,p,d;return new _e({arriveCurbApproach:(0,c.pC)(e.attributes.ArrivalCurbApproach)?k.W7.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:(0,c.pC)(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:(0,c.pC)(e.attributes.CumulativeCosts)?JSON.parse(e.attributes.CumulativeCosts):null,cumulativeDistance:null!=(t=e.attributes.CumulativeMeters)?t:null,cumulativeDuration:null!=(i=e.attributes.CumulativeMinutes)?i:null,curbApproach:(0,c.pC)(e.attributes.CurbApproach)?k.W7.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:(0,c.pC)(e.attributes.DepartureCurbApproach)?k.W7.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:(0,c.pC)(e.attributes.DepartureTime)?new Date(e.attributes.DepartureTime):null,departTimeOffset:null!=(r=e.attributes.DepartureUTCOffset)?r:null,geometry:Y.Z.fromJSON(e.geometry),lateDuration:null!=(o=e.attributes.LateMinutes)?o:null,locationType:(0,c.pC)(e.attributes.LocationType)?k.yP.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.__OBJECTID,popupTemplate:(0,c.pC)(e.popupInfo)?a.Z.fromJSON(e.popupInfo):null,routeName:e.attributes.RouteName,sequence:null!=(s=e.attributes.Sequence)?s:null,serviceCosts:(0,c.pC)(e.attributes.ServiceCosts)?JSON.parse(e.attributes.ServiceCosts):null,serviceDistance:null!=(l=e.attributes.ServiceMeters)?l:null,serviceDuration:null!=(n=e.attributes.ServiceMinutes)?n:null,status:(0,c.pC)(e.attributes.Status)?k.SS.fromJSON(e.attributes.Status):null,symbol:(0,c.pC)(e.symbol)?(0,z.im)(e.symbol):null,timeWindowEnd:(0,c.pC)(e.attributes.TimeWindowEnd)?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:null!=(u=e.attributes.TimeWindowEndUTCOffset)?u:null,timeWindowStart:(0,c.pC)(e.attributes.TimeWindowStart)?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:null!=(p=e.attributes.TimeWindowStartUTCOffset)?p:null,waitDuration:null!=(d=e.attributes.WaitMinutes)?d:null})}clone(){return new _e((0,ee.d9)({arriveCurbApproach:this.arriveCurbApproach,arriveTime:this.arriveTime,arriveTimeOffset:this.arriveTimeOffset,bearing:this.bearing,bearingTol:this.bearingTol,cumulativeCosts:this.cumulativeCosts,cumulativeDistance:this.cumulativeDistance,cumulativeTime:this.cumulativeDuration,curbApproach:this.curbApproach,departCurbApproach:this.departCurbApproach,departTime:this.departTime,departTimeOffset:this.departTimeOffset,distanceToNetworkInMeters:this.distanceToNetworkInMeters,geometry:this.geometry,lateDuration:this.lateDuration,locationType:this.locationType,name:this.name,navLatency:this.navLatency,objectId:this.objectId,popupTemplate:this.popupTemplate,posAlong:this.posAlong,routeName:this.routeName,serviceCosts:this.serviceCosts,serviceDistance:this.serviceDistance,serviceDuration:this.serviceDuration,sequence:this.sequence,sideOfEdge:this.sideOfEdge,snapX:this.snapX,snapY:this.snapY,snapZ:this.snapZ,sourceId:this.sourceId,sourceOid:this.sourceOid,status:this.status,symbol:this.symbol,timeWindowEnd:this.timeWindowEnd,timeWindowEndOffset:this.timeWindowEndOffset,timeWindowStart:this.timeWindowStart,timeWindowStartOffset:this.timeWindowStartOffset,waitDuration:this.waitDuration}))}toPortalJSON(){var e,t;return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,attributes:{__OBJECTID:(0,c.Wg)(this.objectId),ArrivalCurbApproach:(0,c.pC)(this.arriveCurbApproach)?k.W7.toJSON(this.arriveCurbApproach):null,ArrivalTime:(0,c.pC)(this.arriveTime)?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:(0,c.pC)(this.cumulativeCosts)?JSON.stringify(this.cumulativeCosts):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:(0,c.pC)(this.curbApproach)?k.W7.toJSON(this.curbApproach):null,DepartureCurbApproach:(0,c.pC)(this.departCurbApproach)?k.W7.toJSON(this.departCurbApproach):null,DepartureTime:(0,c.pC)(this.departTime)?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:(0,c.pC)(this.locationType)?k.yP.toJSON(this.locationType):null,Name:(0,c.Wg)(this.name),RouteName:(0,c.Wg)(this.routeName),Sequence:this.sequence,ServiceCosts:(0,c.pC)(this.serviceCosts)?JSON.stringify(this.serviceCosts):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:(0,c.pC)(this.status)?k.SS.toJSON(this.status):null,TimeWindowEnd:(0,c.pC)(this.timeWindowEnd)?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:null!=(e=this.timeWindowEndOffset)?e:this.arriveTimeOffset,TimeWindowStart:(0,c.pC)(this.timeWindowStart)?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:null!=(t=this.timeWindowEndOffset)?t:this.arriveTimeOffset,WaitMinutes:this.waitDuration},symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,popupInfo:(0,c.pC)(this.popupTemplate)?this.popupTemplate.toJSON():null}}};Ne.fields=[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],Ne.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},(0,r._)([(0,f.Cb)({type:k.W7.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:k.W7.read}}})],Ne.prototype,"arriveCurbApproach",void 0),(0,r._)([(0,f.Cb)({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],Ne.prototype,"arriveTime",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"arriveTimeOffset",void 0),(0,r._)([(0,g.r)("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],Ne.prototype,"readArriveTimeOffset",null),(0,r._)([(0,f.Cb)({json:{name:"attributes.Bearing",read:!1,write:!0}})],Ne.prototype,"bearing",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.BearingTol",read:!1,write:!0}})],Ne.prototype,"bearingTol",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"cumulativeCosts",void 0),(0,r._)([(0,g.r)("cumulativeCosts",["attributes"])],Ne.prototype,"readCumulativeCosts",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"cumulativeDistance",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"cumulativeDuration",void 0),(0,r._)([(0,f.Cb)({type:k.W7.apiValues,json:{name:"attributes.CurbApproach",read:{reader:k.W7.read},write:{writer:k.W7.write}}})],Ne.prototype,"curbApproach",void 0),(0,r._)([(0,f.Cb)({type:k.W7.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:k.W7.read}}})],Ne.prototype,"departCurbApproach",void 0),(0,r._)([(0,f.Cb)({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],Ne.prototype,"departTime",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"departTimeOffset",void 0),(0,r._)([(0,g.r)("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],Ne.prototype,"readDepartTimeOffset",null),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],Ne.prototype,"distanceToNetworkInMeters",void 0),(0,r._)([(0,f.Cb)({type:Y.Z,json:{write:!0}})],Ne.prototype,"geometry",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.LateMinutes",read:!1}})],Ne.prototype,"lateDuration",void 0),(0,r._)([(0,f.Cb)({type:k.yP.apiValues,json:{name:"attributes.LocationType",read:{reader:k.yP.read},write:{writer:k.yP.write}}})],Ne.prototype,"locationType",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.Name",write:!0}})],Ne.prototype,"name",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.NavLatency"}}})],Ne.prototype,"navLatency",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.ObjectID",write:!0}})],Ne.prototype,"objectId",void 0),(0,r._)([(0,f.Cb)({type:a.Z,json:{read:!1}})],Ne.prototype,"popupTemplate",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.PosAlong"}}})],Ne.prototype,"posAlong",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.RouteName",write:!0}})],Ne.prototype,"routeName",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"serviceCosts",void 0),(0,r._)([(0,g.r)("serviceCosts",["attributes"])],Ne.prototype,"readServiceCosts",null),(0,r._)([(0,T.c)("serviceCosts")],Ne.prototype,"writeServiceCosts",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"serviceDistance",void 0),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"serviceDuration",void 0),(0,r._)([(0,f.Cb)({json:{name:"attributes.Sequence",write:!0}})],Ne.prototype,"sequence",void 0),(0,r._)([(0,f.Cb)({type:k.BW.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.BW.read}}})],Ne.prototype,"sideOfEdge",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SnapX"}}})],Ne.prototype,"snapX",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SnapY"}}})],Ne.prototype,"snapY",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SnapZ"}}})],Ne.prototype,"snapZ",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SourceID"}}})],Ne.prototype,"sourceId",void 0),(0,r._)([(0,f.Cb)({json:{read:{source:"attributes.SourceOID"}}})],Ne.prototype,"sourceOid",void 0),(0,r._)([(0,f.Cb)({type:k.SS.apiValues,json:{read:{source:"attributes.Status",reader:k.SS.read}}})],Ne.prototype,"status",void 0),(0,r._)([(0,f.Cb)({types:j.LB,json:{read:!1}})],Ne.prototype,"symbol",void 0),(0,r._)([(0,f.Cb)({type:Date,json:{name:"attributes.TimeWindowEnd"}})],Ne.prototype,"timeWindowEnd",void 0),(0,r._)([(0,T.c)("timeWindowEnd")],Ne.prototype,"writeTimeWindowEnd",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"timeWindowEndOffset",void 0),(0,r._)([(0,f.Cb)({type:Date,json:{name:"attributes.TimeWindowStart"}})],Ne.prototype,"timeWindowStart",void 0),(0,r._)([(0,T.c)("timeWindowStart")],Ne.prototype,"writeTimeWindowStart",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"timeWindowStartOffset",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"violations",void 0),(0,r._)([(0,g.r)("violations",["attributes"])],Ne.prototype,"readViolations",null),(0,r._)([(0,f.Cb)({json:{read:!1}})],Ne.prototype,"waitDuration",void 0),(0,r._)([(0,f.Cb)()],Ne.prototype,"wait",void 0),(0,r._)([(0,g.r)("wait",["attributes"])],Ne.prototype,"readWait",null),Ne=_e=(0,r._)([(0,C.j)("esri.rest.support.Stop")],Ne);const Oe=Ne;var Ie=i(65091);function De(e){return e.length?e:null}function xe(e){return"layers"in e}async function Fe(e){const t=Te.Z.WGS84;return await(0,_.iQ)(e.spatialReference,t),(0,_.iV)(e,t)}function Be(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function je(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:(0,b.En)(e,t,"meters")}const Ee=n.Z.ofType(H),Ae=n.Z.ofType(X),Pe=n.Z.ofType(oe),Le=n.Z.ofType(ne),Me=n.Z.ofType(de),Je=n.Z.ofType(Oe);let We=class extends((0,I.h)((0,F.M)((0,D.q)((0,x.I)((0,m.R)((0,p.p)(O.Z))))))){constructor(...e){super(...e),this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new J,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Pe,this.polygonBarriers=new Le,this.polylineBarriers=new Me,this.routeInfo=null,this.spatialReference=Te.Z.WGS84,this.stops=new Je,this.type="route"}writeFeatureCollectionWebmap(e,t,i,r){const o=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=o.map(((e,t)=>t)),a="web-map"===r.origin?"featureCollection.layers":"layers";(0,y.RB)(a,o,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>H.fromPortalJSON(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>X.fromPortalJSON(e)))}get fullExtent(){if((0,c.pC)(this.routeInfo)&&(0,c.pC)(this.routeInfo.geometry))return this.routeInfo.geometry.extent;if(this.stops.length>1){const{spatialReference:e}=this.stops[0],t=new Ie.Z({spatialReference:e}),i=this.stops.toArray().map((e=>e.geometry));for(const e of i)(0,c.pC)(e)&&t.addPoint(e);return t.extent}return new w.Z({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:Te.Z.WGS84})}readMaxScale(e,t){var i;const r=(xe(t)?t.layers:t.featureCollection.layers).find((e=>(0,c.pC)(e.layerDefinition.maxScale)));return null!=(i=null==r?void 0:r.layerDefinition.maxScale)?i:0}readMinScale(e,t){var i;const r=(xe(t)?t.layers:t.featureCollection.layers).find((e=>(0,c.pC)(e.layerDefinition.minScale)));return null!=(i=null==r?void 0:r.layerDefinition.minScale)?i:0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",(e=>oe.fromPortalJSON(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>ne.fromPortalJSON(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>de.fromPortalJSON(e)))}readRouteInfo(e,t){const i=this._getNetworkFeatures(t,"RouteInfo",(e=>fe.fromPortalJSON(e)));return i.length>0?i.getItemAt(0):null}readSpatialReference(e,t){var i,r;const o=xe(t)?t.layers:t.featureCollection.layers;if(!o.length)return Te.Z.WGS84;const{layerDefinition:s}=o[0],a=null!=(i=null!=(r=s.spatialReference)?r:s.extent.spatialReference)?i:N.Zn;return Te.Z.fromJSON(a)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>Oe.fromPortalJSON(e)),(e=>this._setStopSymbol(e)))}get title(){return(0,c.pC)(this.routeInfo)&&(0,c.pC)(this.routeInfo.name)?this.routeInfo.name:"Route"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return o.Z.routeServiceUrl}set url(e){null!=e?this._set("url",(0,B.Nm)(e,d.Z.getLogger(this.declaredClass))):this._set("url",o.Z.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){(0,c.pC)(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),(0,c.pC)(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),(0,c.pC)(this.routeInfo)&&this._set("routeInfo",null),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new u.Z("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new u.Z("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new u.Z("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if((0,c.Wi)(this.routeInfo))throw new u.Z("routelayer:route-unsolved","save() requires a solved route");const{portal:i}=t;if(await i._signIn(),i.user||await t.reload(),i.user.username!==t.owner)throw new u.Z("routelayer:not-portal-item-owner","You can only overwrite your portal items");const{itemUrl:r}=t,o={messages:[],origin:"portal-item",portal:i,url:r&&(0,h.mN)(r),writtenProperties:[]},s=this.write(null,o);return t.extent=await Fe(e),t.title=this.title,await t.update({data:s}),t}async saveAs(e,t={}){if(await this.load(),(0,c.Wi)(this.routeInfo))throw new u.Z("routelayer:route-unsolved","saveAs() requires a solved route");const i=V.default.from(e).clone();null!=i.extent||(i.extent=await Fe(this.fullExtent)),i.id=null,null!=i.portal||(i.portal=R.Z.getDefault()),null!=i.title||(i.title=this.title),i.type="Feature Collection",i.typeKeywords=["Data","Feature Collection","Multilayer","Route Layer"];const{portal:r}=i,o={messages:[],origin:"portal-item",portal:r,url:null,writtenProperties:[]};await r._signIn();const s=null==t?void 0:t.folder,a=this.write(null,o);return await r.user.addItem({item:i,folder:s,data:a}),this.portalItem=i,(0,S.D)(o),o.portalItem=i,i}async solve(e,t){var i,r,o,s,a,l;const p=null!=(i=null==e?void 0:e.stops)?i:this.stops,d=null!=(r=null==e?void 0:e.pointBarriers)?r:De(this.pointBarriers),m=null!=(o=null==e?void 0:e.polylineBarriers)?o:De(this.polylineBarriers),y=null!=(s=null==e?void 0:e.polygonBarriers)?s:De(this.polygonBarriers);if((0,c.Wi)(p))throw new u.Z("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((function(e){return"esri.rest.support.FeatureSet"===e.declaredClass}(p)||function(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}(p))&&p.features.length<2||n.Z.isCollection(p)&&p.length<2)throw new u.Z("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");const b=await(0,Z.bI)(this.url,null==e?void 0:e.apiKey,t),h=b.supportedTravelModes.find((e=>e.id===b.defaultTravelMode)),f=null!=(a=null==e?void 0:e.travelMode)?a:h,{distanceAttributeName:v}=f,g=null!=(l=null==e?void 0:e.accumulateAttributes)?l:[];g.push(v);const C={startTime:new Date},T={accumulateAttributes:g,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:d,polylineBarriers:m,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!d,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!m,returnRoutes:!0,returnStops:!0,stops:p},S=e?we.from(e):new we;for(const e in C)null==S[e]&&(S[e]=C[e]);S.set(T);const w=await(0,U.F)(this.url,S,t),_=this._toRouteLayerSolution(w);return this._isOverridden("title")||(this.title=(0,c.yl)(_.routeInfo.name,"Route")),function(e,t,i){var r,o,s,a,l,n,p,d,m,y,b;const h=t.networkDataset.networkAttributes.filter((e=>"esriNAUTCost"===e.usageType)),f=t.supportedTravelModes.find((e=>e.id===t.defaultTravelMode)),v=null!=(r=i.travelMode)?r:f,{timeAttributeName:g,distanceAttributeName:C}=v,T=h.find((e=>e.name===g)),S=h.find((e=>e.name===C)),w=null!=(o=null!=(s=null==(a=i.travelMode)?void 0:a.impedanceAttributeName)?s:i.impedanceAttribute)?o:t.impedance,_=k.hB.fromJSON(null==T?void 0:T.units),N=k.GX.fromJSON(null==S?void 0:S.units);if(!_||!N)throw new u.Z("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const O=null!=(l=i.directionsLanguage)?l:t.directionsLanguage,I=null!=(n=null!=(p=i.accumulateAttributes)?p:t.accumulateAttributeNames)?n:[],D=new Set(h.filter((({name:e})=>e===g||e===C||e===w||I.includes(e))).map((({name:e})=>e))),x=e=>{for(const t in e)D.has(t)||delete e[t]};for(const t of e.pointBarriers){var F;(0,c.pC)(t.costs)&&(t.addedCost=null!=(F=t.costs[w])?F:0,x(t.costs))}for(const t of e.polygonBarriers){var B;(0,c.pC)(t.costs)&&(t.scaleFactor=null!=(B=t.costs[w])?B:1,x(t.costs))}for(const t of e.polylineBarriers){var j;(0,c.pC)(t.costs)&&(t.scaleFactor=null!=(j=t.costs[w])?j:1,x(t.costs))}const{routeInfo:E}=e,{findBestSequence:A,preserveFirstStop:P,preserveLastStop:L,startTimeIsUTC:M,timeWindowsAreUTC:J}=i;E.analysisSettings=new ye({accumulateAttributes:I,directionsLanguage:O,findBestSequence:A,preserveFirstStop:P,preserveLastStop:L,startTimeIsUTC:M,timeWindowsAreUTC:J,travelMode:v}),E.totalDuration=Be(null!=(d=E.totalCosts[g])?d:0,_),E.totalDistance=je(null!=(m=E.totalCosts[C])?m:0,N),E.totalLateDuration=Be(null!=(y=E.totalViolations[g])?y:0,_),E.totalWaitDuration=Be(null!=(b=E.totalWait[g])?b:0,_),(0,c.pC)(E.totalCosts)&&x(E.totalCosts),(0,c.pC)(E.totalViolations)&&x(E.totalViolations),(0,c.pC)(E.totalWait)&&x(E.totalWait);for(const t of e.stops){var W,R,V,Z,U,q;(0,c.pC)(t.serviceCosts)&&(t.serviceDuration=Be(null!=(W=t.serviceCosts[g])?W:0,_),t.serviceDistance=je(null!=(R=t.serviceCosts[C])?R:0,N),x(t.serviceCosts)),(0,c.pC)(t.cumulativeCosts)&&(t.cumulativeDuration=Be(null!=(V=t.cumulativeCosts[g])?V:0,_),t.cumulativeDistance=je(null!=(Z=t.cumulativeCosts[C])?Z:0,N),x(t.cumulativeCosts)),(0,c.pC)(t.violations)&&(t.lateDuration=Be(null!=(U=t.violations[g])?U:0,_),x(t.violations)),(0,c.pC)(t.wait)&&(t.waitDuration=Be(null!=(q=t.wait[g])?q:0,_),x(t.wait))}}(_,b,S),_}update(e){const{stops:t,directionLines:i,directionPoints:r,pointBarriers:o,polylineBarriers:s,polygonBarriers:a,routeInfo:l}=e;this.set({stops:t,pointBarriers:o,polylineBarriers:s,polygonBarriers:a}),this._set("directionLines",i),this._set("directionPoints",r),this._set("routeInfo",l)}_getLayerDefinition(){return{capabilities:"Query,Update,Editing",extent:this.fullExtent.toJSON(),hasM:!1,hasZ:!1,maxScale:this.maxScale,minScale:this.minScale,objectIdField:"__OBJECTID",spatialReference:this.spatialReference.toJSON(),type:"Feature Layer",typeIdField:""}}_getNetworkFeatures(e,t,i,r){const o=(xe(e)?e.layers:e.featureCollection.layers).find((e=>e.layerDefinition.name===t));if((0,c.Wi)(o))return new n.Z;const{layerDefinition:u,popupInfo:p,featureSet:d}=o,m=u.drawingInfo.renderer,{features:y}=d,b=m&&(0,l.a)(m),h=y.map((e=>{var r;const o=i(e),{attributes:l}=e,n=new s.Z({attributes:l});return null!=o.symbol||(o.symbol=null!=(r=null==b?void 0:b.getSymbol(n))?r:this._getNetworkSymbol(t)),null!=o.popupTemplate||(o.popupTemplate=p&&a.Z.fromJSON(p)),o}));return r&&h.some((e=>!e.symbol))&&r(h),new n.Z(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}_setStopSymbol(e){if(!e)return;if(e.length<2){for(const t of e)t.symbol=this.defaultSymbols.invalidStop;return}const t=e.map((e=>e.sequence)).filter((e=>(0,c.pC)(e))),i=Math.min(...t),r=Math.max(...t);for(const t of e)t.sequence!==i?t.sequence!==r?"ok"===t.status||"not-located-on-closest"===t.status?"waypoint"!==t.locationType?"break"!==t.locationType?t.symbol=this.defaultSymbols.middleStop:t.symbol=this.defaultSymbols.breakStop:t.symbol=this.defaultSymbols.waypointStop:t.symbol=this.defaultSymbols.invalidStop:t.symbol=this.defaultSymbols.lastStop:t.symbol=this.defaultSymbols.firstStop}_toRouteLayerSolution(e){var t,i,r;const o=e.routeResults[0].stops.map((e=>Oe.fromJSON(e.toJSON())));this._setStopSymbol(o);const s=new Je(o),a=new Le(null==(t=e.polygonBarriers)?void 0:t.map((e=>{const t=ne.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),l=new Me(null==(i=e.polylineBarriers)?void 0:i.map((e=>{const t=de.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),n=new Pe(null==(r=e.pointBarriers)?void 0:r.map((e=>{const t=oe.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),u=fe.fromJSON(e.routeResults[0].route.toJSON());u.symbol=this.defaultSymbols.routeInfo;const p=new Ae(e.routeResults[0].directionPoints.features.map((e=>{const t=X.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new Ee(e.routeResults[0].directionLines.features.map((e=>{const t=H.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:p,pointBarriers:n,polygonBarriers:a,polylineBarriers:l,routeInfo:u,stops:s}}_writeDirectionLines(){return(0,c.Wi)(this.directionLines)||!this.directionLines.length?null:{featureSet:{features:this.directionLines.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionLines.toJSON()}},fields:H.fields,geometryType:"esriGeometryPolyline",name:"DirectionLines",title:"Direction Lines"},popupInfo:H.popupInfo}}_writeDirectionPoints(){return(0,c.Wi)(this.directionPoints)||!this.directionPoints.length?null:{featureSet:{features:this.directionPoints.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.directionPoints.toJSON()}},fields:X.fields,geometryType:"esriGeometryPoint",name:"DirectionPoints",title:"Direction Points"},popupInfo:X.popupInfo}}_writePointBarriers(){return(0,c.Wi)(this.pointBarriers)||!this.pointBarriers.length?null:{featureSet:{features:this.pointBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.pointBarriers.toJSON()}},fields:oe.fields,geometryType:"esriGeometryPoint",name:"Barrier",title:"Point Barrier"},popupInfo:oe.popupInfo}}_writePolygonBarriers(){return(0,c.Wi)(this.polygonBarriers)||!this.polygonBarriers.length?null:{featureSet:{features:this.polygonBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolygon"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polygonBarriers.toJSON()}},fields:ne.fields,geometryType:"esriGeometryPolygon",name:"PolygonBarriers",title:"Polygon Barriers"},popupInfo:ne.popupInfo}}_writePolylineBarriers(){return(0,c.Wi)(this.polylineBarriers)||!this.polylineBarriers.length?null:{featureSet:{features:this.polylineBarriers.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.polylineBarriers.toJSON()}},fields:de.fields,geometryType:"esriGeometryPolyline",name:"PolylineBarriers",title:"Line Barriers"},popupInfo:de.popupInfo}}_writeRouteInfo(){return(0,c.Wi)(this.routeInfo)?null:{featureSet:{features:[this.routeInfo.toPortalJSON()],geometryType:"esriGeometryPolyline"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"simple",symbol:this.defaultSymbols.routeInfo.toJSON()}},fields:fe.fields,geometryType:"esriGeometryPolyline",name:"RouteInfo",title:"Route Details"},popupInfo:fe.popupInfo}}_writeStops(){return(0,c.Wi)(this.stops)||!this.stops.length?null:{featureSet:{features:this.stops.toArray().map((e=>e.toPortalJSON())),geometryType:"esriGeometryPoint"},layerDefinition:{...this._getLayerDefinition(),drawingInfo:{renderer:{type:"uniqueValue",field1:"Sequence",defaultSymbol:this.defaultSymbols.middleStop.toJSON(),uniqueValueInfos:[{value:"1",symbol:this.defaultSymbols.firstStop.toJSON(),label:"First Stop"},{value:`${this.stops.length}`,symbol:this.defaultSymbols.lastStop.toJSON(),label:"Last Stop"}]}},fields:Oe.fields,geometryType:"esriGeometryPoint",name:"Stops",title:"Stops"},popupInfo:Oe.popupInfo}}};(0,r._)([(0,f.Cb)({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],We.prototype,"_featureCollection",void 0),(0,r._)([(0,T.c)(["web-map","portal-item"],"_featureCollection")],We.prototype,"writeFeatureCollectionWebmap",null),(0,r._)([(0,f.Cb)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],We.prototype,"_type",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,type:J})],We.prototype,"defaultSymbols",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],We.prototype,"directionLines",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],We.prototype,"readDirectionLines",null),(0,r._)([(0,f.Cb)({readOnly:!0})],We.prototype,"directionPoints",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],We.prototype,"readDirectionPoints",null),(0,r._)([(0,f.Cb)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],We.prototype,"featureCollectionType",void 0),(0,r._)([(0,f.Cb)({readOnly:!0})],We.prototype,"fullExtent",null),(0,r._)([(0,f.Cb)({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],We.prototype,"legendEnabled",void 0),(0,r._)([(0,f.Cb)({type:["show","hide"]})],We.prototype,"listMode",void 0),(0,r._)([(0,f.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],We.prototype,"maxScale",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],We.prototype,"readMaxScale",null),(0,r._)([(0,f.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],We.prototype,"minScale",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],We.prototype,"readMinScale",null),(0,r._)([(0,f.Cb)({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],We.prototype,"operationalLayerType",void 0),(0,r._)([(0,f.Cb)({nonNullable:!0,type:n.Z.ofType(oe)})],We.prototype,"pointBarriers",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],We.prototype,"readPointBarriers",null),(0,r._)([(0,f.Cb)({nonNullable:!0,type:n.Z.ofType(ne)})],We.prototype,"polygonBarriers",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],We.prototype,"readPolygonBarriers",null),(0,r._)([(0,f.Cb)({nonNullable:!0,type:n.Z.ofType(de)})],We.prototype,"polylineBarriers",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],We.prototype,"readPolylineBarriers",null),(0,r._)([(0,f.Cb)({readOnly:!0})],We.prototype,"routeInfo",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],We.prototype,"readRouteInfo",null),(0,r._)([(0,f.Cb)({type:Te.Z})],We.prototype,"spatialReference",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],We.prototype,"readSpatialReference",null),(0,r._)([(0,f.Cb)({nonNullable:!0,type:n.Z.ofType(Oe)})],We.prototype,"stops",void 0),(0,r._)([(0,g.r)(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],We.prototype,"readStops",null),(0,r._)([(0,f.Cb)()],We.prototype,"title",null),(0,r._)([(0,f.Cb)({readOnly:!0,json:{read:!1}})],We.prototype,"type",void 0),(0,r._)([(0,f.Cb)()],We.prototype,"url",null),We=(0,r._)([(0,C.j)("esri.layers.RouteLayer")],We);const Re=We},16859:(e,t,i)=>{i.d(t,{I:()=>C});var r=i(43697),o=i(40330),s=i(3172),a=i(66643),l=i(20102),n=i(92604),u=i(70586),p=i(95330),d=i(17452),c=i(5600),m=(i(67676),i(80442),i(75215),i(71715)),y=i(52011),b=i(30556),h=i(65587),f=i(15235),v=i(86082);const g=n.Z.getLogger("esri.layers.mixins.PortalLayer"),C=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new f.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||g.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==o.id?void 0:o.id.findCredential(this.url):null;if(!t)return!0;const i=T.credential===t?T.user:await this._fetchEditingUser(e);return T.credential=t,T.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,i;const r=null==(t=this.portalItem)||null==(i=t.portal)?void 0:i.user;if(r)return r;const l=o.id.findServerInfo(this.url);if(null==l||!l.owningSystemUrl)return null;const n=`${l.owningSystemUrl}/sharing/rest`,p=h.Z.getDefault();if(p&&p.loaded&&(0,d.Fv)(p.restUrl)===(0,d.Fv)(n))return p.user;const c=`${n}/community/self`,m=(0,u.pC)(e)?e.signal:null,y=await(0,a.q6)((0,s.default)(c,{authMode:"no-prompt",query:{f:"json"},signal:m}));return y.ok?v.default.fromJSON(y.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||h.Z.getDefault());return i&&r&&!(0,d.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,c.Cb)({type:f.default})],t.prototype,"portalItem",null),(0,r._)([(0,m.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,b.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,c.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},T={credential:null,user:null}},12501:(e,t,i)=>{i.d(t,{Z:()=>y});var r,o=i(43697),s=i(22974),a=i(5600),l=(i(75215),i(52011)),n=i(30556),u=i(35671),p=i(5499),d=i(12571),c=i(84475);let m=r=class extends((0,d.W)(p.Z)){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new c.DictionaryLoader(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,i,r){null!=r&&r.origin||super.writeVisualVariables(e,t,i,r)}clone(){return new r({config:(0,s.d9)(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:(0,s.d9)(this.fieldMap),url:(0,s.d9)(this.url),visualVariables:(0,s.d9)(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await(0,u.io)(e,t,this.scaleExpression);for(const i in this.fieldMap){const r=this.fieldMap[i];t.has(r)&&e.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};(0,o._)([(0,a.Cb)({type:c.DictionaryLoader})],m.prototype,"_loader",null),(0,o._)([(0,a.Cb)({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],m.prototype,"config",void 0),(0,o._)([(0,a.Cb)({type:Object,json:{write:!0}})],m.prototype,"fieldMap",void 0),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],m.prototype,"scaleExpression",void 0),(0,o._)([(0,n.c)("scaleExpression")],m.prototype,"writeData",null),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],m.prototype,"scaleExpressionTitle",void 0),(0,o._)([(0,a.Cb)({type:String,json:{write:!0}})],m.prototype,"url",void 0),(0,o._)([(0,n.c)("visualVariables")],m.prototype,"writeVisualVariables",null),m=r=(0,o._)([(0,l.j)("esri.renderers.DictionaryRenderer")],m);const y=m},95088:(e,t,i)=>{i.d(t,{Z:()=>D});var r,o=i(43697),s=i(22303),a=i(22974),l=i(44422),n=i(75215),u=i(36030),p=i(5600),d=i(52011),c=i(35671),m=i(5499),y=i(12571),b=i(96674),h=i(92604),f=(i(67676),i(80442),i(90578));const v=h.Z.getLogger("esri.renderers.support.AttributeColorInfo");let g=r=class extends b.wq{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return null==e?e:"function"==typeof e?(v.error(".field: field must be a string value"),null):(0,n.Zs)(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new r({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};(0,o._)([(0,p.Cb)({type:s.Z,json:{type:[Number],write:!0}})],g.prototype,"color",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"field",void 0),(0,o._)([(0,f.p)("field")],g.prototype,"castField",null),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"label",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"valueExpression",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],g.prototype,"valueExpressionTitle",void 0),g=r=(0,o._)([(0,d.j)("esri.renderers.support.AttributeColorInfo")],g);const C=g;var T;let S=T=class extends b.wq{constructor(){super(...arguments),this.unit=null}clone(){return new T({unit:this.unit})}};(0,o._)([(0,p.Cb)({type:String,json:{write:!0}})],S.prototype,"unit",void 0),S=T=(0,o._)([(0,d.j)("esri.renderers.support.DotDensityLegendOptions")],S);const w=S;var _,N=i(20256),O=i(4095);let I=_=class extends((0,y.W)(m.Z)){constructor(e){super(e),this.attributes=null,this.backgroundColor=new s.Z([0,0,0,0]),this.blendDots=!0,this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new O.Z,this.dotValue=null,this.referenceDotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new N.Z({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes&&this.attributes.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new _({attributes:(0,a.d9)(this.attributes),backgroundColor:(0,a.d9)(this.backgroundColor),dotBlendingEnabled:(0,a.d9)(this.dotBlendingEnabled),dotShape:(0,a.d9)(this.dotShape),dotSize:(0,a.d9)(this.dotSize),dotValue:(0,a.d9)(this.dotValue),legendOptions:(0,a.d9)(this.legendOptions),outline:(0,a.d9)(this.outline),referenceScale:(0,a.d9)(this.referenceScale),visualVariables:(0,a.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes.map((e=>e.field||e.valueExpression||""))}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await(0,c.io)(e,t,i.valueExpression),i.field&&e.add(i.field)}};(0,o._)([(0,p.Cb)({type:[C],json:{write:!0}})],I.prototype,"attributes",void 0),(0,o._)([(0,p.Cb)({type:s.Z,json:{write:!0}})],I.prototype,"backgroundColor",void 0),(0,o._)([(0,p.Cb)({type:Boolean}),(0,l.B)("dotBlendingEnabled")],I.prototype,"blendDots",void 0),(0,o._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],I.prototype,"dotBlendingEnabled",void 0),(0,o._)([(0,p.Cb)({type:String,json:{write:!1}})],I.prototype,"dotShape",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1}}}})],I.prototype,"dotSize",void 0),(0,o._)([(0,p.Cb)({type:w,json:{write:!0}})],I.prototype,"legendOptions",void 0),(0,o._)([(0,p.Cb)({type:O.Z,json:{default:null,write:!0}})],I.prototype,"outline",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{write:!0}})],I.prototype,"dotValue",void 0),(0,o._)([(0,p.Cb)({type:Number}),(0,l.B)("dotValue")],I.prototype,"referenceDotValue",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{write:!0}})],I.prototype,"referenceScale",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{write:!0}})],I.prototype,"seed",void 0),(0,o._)([(0,u.J)({dotDensity:"dot-density"})],I.prototype,"type",void 0),I=_=(0,o._)([(0,d.j)("esri.renderers.DotDensityRenderer")],I);const D=I},79056:(e,t,i)=>{i.d(t,{Z:()=>f});var r,o=i(43697),s=i(22303),a=i(22974),l=i(5600),n=(i(75215),i(36030)),u=i(52011),p=i(35671),d=i(5499),c=i(96674);i(67676),i(80442);let m=r=class extends c.wq{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new r({color:this.color,ratio:this.ratio})}};(0,o._)([(0,l.Cb)({type:s.Z,json:{write:!0}})],m.prototype,"color",void 0),(0,o._)([(0,l.Cb)({type:Number,json:{write:!0}})],m.prototype,"ratio",void 0),m=r=(0,o._)([(0,u.j)("esri.renderers.support.HeatmapColorStop")],m);const y=m;var b;let h=b=class extends d.Z{constructor(e){super(e),this.blurRadius=10,this.referenceScale=0,this.colorStops=[new y({ratio:0,color:new s.Z("rgba(255, 140, 0, 0)")}),new y({ratio:.75,color:new s.Z("rgba(255, 140, 0, 1)")}),new y({ratio:.9,color:new s.Z("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.maxPixelIntensity=100,this.minPixelIntensity=0,this.type="heatmap"}async collectRequiredFields(e,t){const i=this.field;i&&"string"==typeof i&&(0,p.AB)(e,t,i)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new b({blurRadius:this.blurRadius,referenceScale:this.referenceScale,colorStops:(0,a.d9)(this.colorStops),field:this.field,maxPixelIntensity:this.maxPixelIntensity,minPixelIntensity:this.minPixelIntensity})}};(0,o._)([(0,l.Cb)({type:Number,json:{write:!0}})],h.prototype,"blurRadius",void 0),(0,o._)([(0,l.Cb)({type:Number})],h.prototype,"referenceScale",void 0),(0,o._)([(0,l.Cb)({type:[y],json:{write:!0}})],h.prototype,"colorStops",void 0),(0,o._)([(0,l.Cb)({type:String,json:{write:!0}})],h.prototype,"field",void 0),(0,o._)([(0,l.Cb)({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:null==i})}}})],h.prototype,"fieldOffset",void 0),(0,o._)([(0,l.Cb)({type:Number,json:{write:!0}})],h.prototype,"maxPixelIntensity",void 0),(0,o._)([(0,l.Cb)({type:Number,json:{write:!0}})],h.prototype,"minPixelIntensity",void 0),(0,o._)([(0,n.J)({heatmap:"heatmap"})],h.prototype,"type",void 0),h=b=(0,o._)([(0,u.j)("esri.renderers.HeatmapRenderer")],h);const f=h},84382:(e,t,i)=>{i.d(t,{Z:()=>m});var r,o=i(43697),s=i(22974),a=i(5600),l=(i(75215),i(36030)),n=i(52011),u=i(5499),p=i(12571),d=i(9833);let c=r=class extends((0,p.W)(u.Z)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.getSymbols().map((i=>i.collectRequiredFields(e,t))))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return this.getSymbols().reduce(((e,t)=>e+JSON.stringify(t)),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new r({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:(0,s.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};(0,o._)([(0,a.Cb)({type:String,json:{write:!0}})],c.prototype,"description",void 0),(0,o._)([(0,a.Cb)({type:String,json:{write:!0}})],c.prototype,"label",void 0),(0,o._)([(0,a.Cb)(d.G)],c.prototype,"symbol",void 0),(0,o._)([(0,l.J)({simple:"simple"})],c.prototype,"type",void 0),c=r=(0,o._)([(0,n.j)("esri.renderers.SimpleRenderer")],c);const m=c},84475:(e,t,i)=>{i.r(t),i.d(t,{DictionaryLoader:()=>b});var r=i(22303),o=i(3172),s=i(20102),a=i(92604),l=i(13867),n=i(70586),u=i(95330),p=i(19153),d=i(59266),c=i(17386);const m=a.Z.getLogger("esri.renderers.support.DictionaryLoader"),y={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class b{constructor(e,t,i){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new l.Z(100),this.url=e,this.config=t,this.fieldMap=i}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,t){let i;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(t));try{i=await this._dictionaryPromise}catch(e){if((0,u.D_)(e))return this._dictionaryPromise=null,null}const o={};if(this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t];if(i&&null!=e.attributes[i]){const r=""+e.attributes[i];o[t]=r}else o[t]=""}const s=i(o,t);if(!s||"string"!=typeof s)return null;const a=(0,p.hP)(s).toString(),l=this._symbolCache.get(a);if(l)return l.catch((()=>{this._symbolCache.pop(a)})),l;const d=s.split(";"),c=[],m=[];for(const e of d)if(e)if(e.includes("po:")){const t=e.substr(3).split("|");if(3===t.length){const e=t[0],i=t[1];let o=t[2];if("DashTemplate"===i)o=o.split(" ").map((e=>Number(e)));else if("Color"===i){const e=new r.Z(o).toRgba();o=[e[0],e[1],e[2],255*e[3]]}else o=Number(o);m.push({primitiveName:e,propertyName:i,value:o})}}else if(e.includes("|")){for(const t of e.split("|"))if(this._itemNames.has(t)){c.push(t);break}}else this._itemNames.has(e)&&c.push(e);const y=!(0,n.pC)(e.geometry)||!e.geometry.hasZ&&"point"===e.geometry.type,b=this._cimPartsToCIMSymbol(c,m,y,t);return this._symbolCache.put(a,b,1),b}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void m.error("no valid URL!");const t=(0,n.pC)(e)?e.abortOptions:null,i=(0,o.default)(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},...t}),[{data:r}]=await Promise.all([i,(0,d.LC)()]);if(!r)throw this._dictionaryPromise=null,new s.Z("esri.renderers.DictionaryRenderer","Bad dictionary data!");const a=r.expression,l=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=l.symbol;const u={};if(this.config){const e=this.config;for(const t in e)u[t]=e[t]}if(l.configuration)for(const e of l.configuration)u.hasOwnProperty(e.name)||(u[e.name]=e.value);const p=[];if((0,n.pC)(e)&&e.fields&&this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t],r=e.fields.filter((e=>e.name===i));r.length>0&&p.push({...r[0],name:t})}return this._dictionaryPromise=(0,d.pp)(a,(0,n.pC)(e)?e.spatialReference:null,p,u).then((e=>{const t={scale:0};return(i,r)=>{const o=e.repurposeFeature({geometry:null,attributes:i});return t.scale=(0,n.pC)(r)?r.scale:void 0,e.evaluate({$feature:o,$view:t})}})).catch((e=>(m.error("Creating dictinoary expression failed:",e),null))),this._dictionaryPromise}async _cimPartsToCIMSymbol(e,t,i,r){const o=new Array(e.length);for(let t=0;t<e.length;t++)o[t]=this._getSymbolPart(e[t],r);const s=await Promise.all(o),a=this.fieldMap;for(const e of s)h(e,a);return new c.Z({data:this._combineSymbolParts(s,t,i)})}async _getSymbolPart(e,t){if(this._ongoingRequests.has(e))return this._ongoingRequests.get(e).then((e=>e.data));const i=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),r=(0,o.default)(i,{responseType:"json",query:{f:"json"},...t});this._ongoingRequests.set(e,r);try{return(await r).data}catch(t){return this._ongoingRequests.delete(e),Promise.reject(t)}}_combineSymbolParts(e,t,i){if(!e||0===e.length)return null;const r={...e[0]};if(e.length>1){r.symbolLayers=[];for(const t of e){const e=t;r.symbolLayers.unshift(...e.symbolLayers)}}return i&&(r.callout=y),{type:"CIMSymbolReference",symbol:r,primitiveOverrides:t}}}function h(e,t){if(!e)return;const i=e.symbolLayers;if(!i)return;let r=i.length;for(;r--;){const e=i[r];e&&!1!==e.enable&&"CIMVectorMarker"===e.type&&f(e,t)}}function f(e,t){const i=e.markerGraphics;if(i)for(const e of i){if(!e)continue;const i=e.symbol;if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":h(i,t);break;case"CIMTextSymbol":i.fieldMap=t}}}},91423:(e,t,i)=>{i.d(t,{a:()=>l});var r=i(20941),o=i(63213),s=i(32400);const a=(0,o.d)({types:s.A});function l(e,t,i){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(i&&i.messages&&i.messages.push(new r.Z("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:i})),null):a(e,t,i):null}},99282:(e,t,i)=>{i.d(t,{a:()=>s});var r=i(67900),o=i(68441);const s={inches:(0,r.En)(1,"meters","inches"),feet:(0,r.En)(1,"meters","feet"),"us-feet":(0,r.En)(1,"meters","us-feet"),yards:(0,r.En)(1,"meters","yards"),miles:(0,r.En)(1,"meters","miles"),"nautical-miles":(0,r.En)(1,"meters","nautical-miles"),millimeters:(0,r.En)(1,"meters","millimeters"),centimeters:(0,r.En)(1,"meters","centimeters"),decimeters:(0,r.En)(1,"meters","decimeters"),meters:(0,r.En)(1,"meters","meters"),kilometers:(0,r.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.ty)(1,"meters",o.sv.radius)}},32400:(e,t,i)=>{i.d(t,{A:()=>p,o:()=>d});var r=i(16050),o=i(12501),s=i(95088),a=i(79056),l=i(5499),n=i(84382),u=i(30687);const p={key:"type",base:l.Z,typeMap:{heatmap:a.Z,simple:n.Z,"unique-value":u.Z,"class-breaks":r.Z,"dot-density":s.Z,dictionary:o.Z},errorContext:"renderer"},d={key:"type",base:l.Z,typeMap:{simple:n.Z,"unique-value":u.Z,"class-breaks":r.Z},errorContext:"renderer"}},51706:(e,t,i)=>{var r,o;function s(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function a(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?r.Expression:e.field&&"string"==typeof e.field?r.Field:r.Unknown}function n(e,t){const i=t||l(e),s=e.valueUnit||"unknown";return i===r.Unknown?o.Constant:e.stops?o.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?o.ClampedLinear:"unknown"===s?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?o.Proportional:o.Additive:o.Identity:o.RealWorldSize}i.d(t,{RY:()=>r,hL:()=>o,PS:()=>l,QW:()=>n,iY:()=>s,qh:()=>a}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(r||(r={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(o||(o={}))},28101:(e,t,i)=>{i.d(t,{PR:()=>S,Lq:()=>y,Km:()=>b,cM:()=>h,ap:()=>f,V3:()=>C,B3:()=>m});var r=i(22303),o=i(38171),s=i(74085),a=i(92604),l=i(70586),n=i(99282),u=i(51706);const p=a.Z.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),d=new o.Z,c=Math.PI,m=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function y(e,t,i){const o="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"color"===e.type)):e;if(!o)return;if("esri.renderers.visualVariables.ColorVariable"!==o.declaredClass)return void p.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const s="number"==typeof t,a=s?null:t,n=a&&a.attributes;let u=s?t:null;const d=o.field,{ipData:c,hasExpression:m}=o.cache;let y=o.cache.compiledFunc;if(!d&&!m){const e=o.stops;return e&&e[0]&&e[0].color}if("number"!=typeof u)if(m){if(!(0,l.pC)(i)||!(0,l.pC)(i.arcade))return void p.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,r=t.getViewInfo(e),s=t.createExecContext(a,r);if(!y){const e=t.createSyntaxTree(o.valueExpression);y=t.createFunction(e),o.cache.compiledFunc=y}u=t.executeFunction(y,s)}else n&&(u=n[d]);const b=o.normalizationField,h=n?parseFloat(n[b]):void 0;if(null!=u&&(!b||s||!isNaN(h)&&0!==h)){isNaN(h)||s||(u/=h);const e=T(u,c);if(e){const t=e[0],s=e[1],a=t===s?o.stops[t].color:r.Z.blendColors(o.stops[t].color,o.stops[s].color,e[2],(0,l.pC)(i)?i.color:void 0);return new r.Z(a)}}}function b(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"opacity"===e.type)):e;if(!r)return;if("esri.renderers.visualVariables.OpacityVariable"!==r.declaredClass)return void p.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const o="number"==typeof t,s=o?null:t,a=s&&s.attributes;let n=o?t:null;const u=r.field,{ipData:d,hasExpression:c}=r.cache;let m=r.cache.compiledFunc;if(!u&&!c){const e=r.stops;return e&&e[0]&&e[0].opacity}if("number"!=typeof n)if(c){if((0,l.Wi)(i)||(0,l.Wi)(i.arcade))return void p.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,o=t.getViewInfo(e),a=t.createExecContext(s,o);if(!m){const e=t.createSyntaxTree(r.valueExpression);m=t.createFunction(e),r.cache.compiledFunc=m}n=t.executeFunction(m,a)}else a&&(n=a[u]);const y=r.normalizationField,b=a?parseFloat(a[y]):void 0;if(null!=n&&(!y||o||!isNaN(b)&&0!==b)){isNaN(b)||o||(n/=b);const e=T(n,d);if(e){const t=e[0],i=e[1];if(t===i)return r.stops[t].opacity;{const o=r.stops[t].opacity;return o+(r.stops[i].opacity-o)*e[2]}}}}function h(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"rotation"===e.type)):e;if(!r)return;if("esri.renderers.visualVariables.RotationVariable"!==r.declaredClass)return void p.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const o=r.axis||"heading",s="heading"===o&&"arithmetic"===r.rotationType?90:0,a="heading"===o&&"arithmetic"===r.rotationType?-1:1,n="number"==typeof t?null:t,u=n&&n.attributes,d=r.field,{hasExpression:c}=r.cache;let m=r.cache.compiledFunc,y=0;if(!d&&!c)return y;if(c){if((0,l.Wi)(i)||(0,l.Wi)(i.arcade))return void p.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,o=t.getViewInfo(e),s=t.createExecContext(n,o);if(!m){const e=t.createSyntaxTree(r.valueExpression);m=t.createFunction(e),r.cache.compiledFunc=m}y=t.executeFunction(m,s)}else u&&(y=u[d]||0);return y="number"!=typeof y||isNaN(y)?null:s+a*y,y}function f(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"size"===e.type)):e;if(!r)return;if("esri.renderers.visualVariables.SizeVariable"!==r.declaredClass)return void p.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const o=function(e,t,i,r,o){switch(t.transformationType){case u.hL.Additive:return function(e,t,i,r){return e+(v(t.minSize,i,r)||t.minDataValue)}(e,t,i,r);case u.hL.Constant:return function(e,t,i){const r=e.stops;let o=r&&r.length&&r[0].size;return null==o&&(o=e.minSize),v(o,t,i)}(t,i,r);case u.hL.ClampedLinear:return function(e,t,i,r){const o=(e-t.minDataValue)/(t.maxDataValue-t.minDataValue),s=v(t.minSize,i,r),a=v(t.maxSize,i,r),n=(0,l.pC)(r)?r.shape:void 0;if(e<=t.minDataValue)return s;if(e>=t.maxDataValue)return a;if("area"===t.scaleBy&&n){const e="circle"===n,t=e?c*(s/2)**2:s*s,i=t+o*((e?c*(a/2)**2:a*a)-t);return e?2*Math.sqrt(i/c):Math.sqrt(i)}return s+o*(a-s)}(e,t,i,r);case u.hL.Proportional:return function(e,t,i,r){const o=(0,l.pC)(r)?r.shape:void 0,s=e/t.minDataValue,a=v(t.minSize,i,r),n=v(t.maxSize,i,r);let u=null;return u="circle"===o?2*Math.sqrt(s*(a/2)**2):"square"===o||"diamond"===o||"image"===o?Math.sqrt(s*a**2):s*a,g(u,a,n)}(e,t,i,r);case u.hL.Stops:return function(e,t,i,r,o){const[s,a,l]=T(e,o);if(s===a)return v(t.stops[s].size,i,r);{const e=v(t.stops[s].size,i,r);return e+(v(t.stops[a].size,i,r)-e)*l}}(e,t,i,r,o);case u.hL.RealWorldSize:return function(e,t,i,r){const o=((0,l.pC)(r)&&r.resolution?r.resolution:1)*n.a[t.valueUnit],s=v(t.minSize,i,r),a=v(t.maxSize,i,r),{valueRepresentation:u}=t;let p=null;return p="area"===u?2*Math.sqrt(e/c)/o:"radius"===u||"distance"===u?2*e/o:e/o,g(p,s,a)}(e,t,i,r);case u.hL.Identity:return e;case u.hL.Unknown:return null}}(function(e,t,i){const r="number"==typeof t,o=r?null:t,s=o&&o.attributes;let a=r?t:null;const{isScaleDriven:n}=e.cache;let d=e.cache.compiledFunc;if(n){const t=(0,l.pC)(i)?i.scale:void 0,r=(0,l.pC)(i)?i.view:void 0;a=null==t||"3d"===r?function(e){let t=null,i=null;const r=e.stops;return r?(t=r[0].value,i=r[r.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}(e):t}else if(!r)switch(e.inputValueType){case u.RY.Expression:{if((0,l.Wi)(i)||(0,l.Wi)(i.arcade))return void p.error("Use of arcade expressions requires an arcade context");const t={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},r=i.arcade.arcadeUtils,s=r.getViewInfo(t),n=r.createExecContext(o,s);if(!d){const t=r.createSyntaxTree(e.valueExpression);d=r.createFunction(t),e.cache.compiledFunc=d}a=r.executeFunction(d,n);break}case u.RY.Field:s&&(a=s[e.field]);break;case u.RY.Unknown:a=null}if(!(0,u.qh)(a))return null;if(r||!e.normalizationField)return a;const c=s?parseFloat(s[e.normalizationField]):null;return(0,u.qh)(c)&&0!==c?a/c:null}(r,t,i),r,t,i,r.cache.ipData);return null==o||isNaN(o)?0:o}function v(e,t,i){return null==e?null:(0,u.iY)(e)?f(e,t,i):(0,u.qh)(e)?e:null}function g(e,t,i){return(0,u.qh)(i)&&e>i?i:(0,u.qh)(t)&&e<t?t:e}function C(e,t,i){const{isScaleDriven:r}=e.cache;if(!(r&&"3d"===i||t))return null;const o={scale:t,view:i};let s=v(e.minSize,d,o),a=v(e.maxSize,d,o);if(null!=s||null!=a){if(s>a){const e=a;a=s,s=e}return{minSize:s,maxSize:a}}}function T(e,t){if(!t)return;let i=0,r=t.length-1;return t.some(((t,o)=>e<t?(r=o,!0):(i=o,!1))),[i,r,(e-t[i])/(t[r]-t[i])]}function S(e,t,i){const r=["proportional","proportional","proportional"];for(const o of e){const e=o.useSymbolValue?"symbol-value":f(o,t,i);switch(o.axis){case"width":r[0]=e;break;case"depth":r[1]=e;break;case"height":r[2]=e;break;case"width-and-depth":r[0]=e,r[1]=e;break;case"all":case void 0:case null:r[0]=e,r[1]=e,r[2]=e;break;default:(0,s.Bg)(o.axis)}}return r}},23334:(e,t,i)=>{i.d(t,{F:()=>N});var r=i(3172),o=i(70586),s=i(28263),a=i(82526),l=i(93924),n=i(11282),u=i(43697),p=i(38171),d=i(96674),c=i(5600),m=(i(67676),i(80442),i(75215),i(71715)),y=i(52011),b=i(74889),h=i(79166),f=i(95642);let v=class extends d.wq{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null}};(0,u._)([(0,c.Cb)({type:b.default,json:{write:!0}})],v.prototype,"directionLines",void 0),(0,u._)([(0,c.Cb)({type:b.default,json:{write:!0}})],v.prototype,"directionPoints",void 0),(0,u._)([(0,c.Cb)({type:f.Z,json:{write:!0}})],v.prototype,"directions",void 0),(0,u._)([(0,c.Cb)({type:p.Z,json:{write:!0}})],v.prototype,"route",void 0),(0,u._)([(0,c.Cb)({type:String,json:{write:!0}})],v.prototype,"routeName",void 0),(0,u._)([(0,c.Cb)({type:[p.Z],json:{write:!0}})],v.prototype,"stops",void 0),v=(0,u._)([(0,y.j)("esri.rest.support.RouteResult")],v);const g=v;function C(e){return e&&b.default.fromJSON(e).features.map((e=>e))}let T=class extends d.wq{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,t){return C(t.barriers)}readPolylineBarriers(e){return C(e)}readPolygonBarriers(e){return C(e)}};(0,u._)([(0,c.Cb)({type:[h.Z]})],T.prototype,"messages",void 0),(0,u._)([(0,c.Cb)({type:[p.Z]})],T.prototype,"pointBarriers",void 0),(0,u._)([(0,m.r)("pointBarriers",["barriers"])],T.prototype,"readPointBarriers",null),(0,u._)([(0,c.Cb)({type:[p.Z]})],T.prototype,"polylineBarriers",void 0),(0,u._)([(0,m.r)("polylineBarriers")],T.prototype,"readPolylineBarriers",null),(0,u._)([(0,c.Cb)({type:[p.Z]})],T.prototype,"polygonBarriers",void 0),(0,u._)([(0,m.r)("polygonBarriers")],T.prototype,"readPolygonBarriers",null),(0,u._)([(0,c.Cb)({type:[g]})],T.prototype,"routeResults",void 0),T=(0,u._)([(0,y.j)("esri.rest.support.RouteSolveResult")],T);const S=T,w=(0,s.E)({accumulateAttributes:{name:"accumulateAttributeNames"},attributeParameterValues:!0,directionsTimeAttribute:{name:"directionsTimeAttributeName"},impedanceAttribute:{name:"impedanceAttributeName"},outSpatialReference:{name:"outSR",getter:e=>e.outSpatialReference.wkid},pointBarriers:{name:"barriers"},polylineBarriers:!0,polygonBarriers:!0,restrictionAttributes:{name:"restrictionAttributeNames"},stops:!0,travelMode:!0});function _(e){return"esri.rest.support.FeatureSet"===(null==e?void 0:e.declaredClass)}async function N(e,t,i){const s=[],u=[],p={},d={},c=(0,n.en)(e),{path:m}=c;_(t.stops)&&(0,l.et)(t.stops.features,u,"stops.features",p),_(t.pointBarriers)&&(0,l.et)(t.pointBarriers.features,u,"pointBarriers.features",p),_(t.polylineBarriers)&&(0,l.et)(t.polylineBarriers.features,u,"polylineBarriers.features",p),_(t.polygonBarriers)&&(0,l.et)(t.polygonBarriers.features,u,"polygonBarriers.features",p);const y=await(0,a.aX)(u);for(const e in p){const t=p[e];s.push(e),d[e]=y.slice(t[0],t[1])}if((0,l.Wf)(d,s)){let e=null;try{e=await(0,l.bI)(m,t.apiKey,i)}catch{}e&&!e.hasZ&&(0,l.ef)(d,s)}for(const e in d)d[e].forEach(((i,r)=>{t.get(e)[r].geometry=i}));const b={...i,query:{...c.query,...w.toQueryParams(t),f:"json"}},h=m.endsWith("/solve")?m:`${m}/solve`,{data:f}=await(0,r.default)(h,b);return function(e){var t,i,r,s,a;const l=new Map,{directionLines:n,directionPoints:u,directions:p,routes:d,stops:c,barriers:m,polygonBarriers:y,polylineBarriers:b,messages:h}=e,f=null!=(t=null!=(i=null!=(r=null!=(s=null==d?void 0:d.spatialReference)?s:null==c?void 0:c.spatialReference)?r:null==m?void 0:m.spatialReference)?i:null==y?void 0:y.spatialReference)?t:null==b?void 0:b.spatialReference;null==d||d.features.forEach((e=>{const t=e.attributes.Name,i=e.attributes.ObjectID;l.has(t)?(l.get(t).route=e,l.get(t).routeId=i):l.set(t,{route:e,routeId:i,routeName:t}),(0,o.pC)(e.geometry)&&(e.geometry.spatialReference=f)})),null==p||p.forEach((e=>{const t=e.routeName;l.has(t)?l.get(t).directions=e:l.set(t,{routeName:t,directions:e})})),null==c||c.features.forEach((e=>{var t;const i=null!=(t=e.attributes.RouteName)?t:null;l.has(i)?l.get(i).stops?l.get(i).stops.push(e):l.get(i).stops=[e]:l.set(i,{stops:[e],routeName:i}),(0,o.pC)(e.geometry)&&(e.geometry.spatialReference=f)}));const v=null==(a=null==c?void 0:c.features.every((e=>null==e.attributes.RouteName)))||a;if((null==c?void 0:c.features.length)>0&&v){const e=Array.from(l.keys())[0];l.get(e).stops=l.get(null).stops,l.delete(null)}null==n||n.features.forEach((e=>{var t;const i=e.attributes.RouteID,r=null==(t=Array.from(l.values()).find((e=>e.routeId===i)))?void 0:t.routeName;if(r)if(l.has(r))if(l.get(r).directionLines)l.get(r).directionLines.features.push(e);else{const{fieldAliases:t,geometryType:i,spatialReference:o}=n;l.get(r).directionLines={features:[e],fieldAliases:t,geometryType:i,spatialReference:o}}else{const{fieldAliases:t,geometryType:i,spatialReference:o}=n;l.set(r,{routeName:r,directionLines:{features:[e],fieldAliases:t,geometryType:i,spatialReference:o}})}})),null==u||u.features.forEach((e=>{var t;const i=e.attributes.RouteID,r=null==(t=Array.from(l.values()).find((e=>e.routeId===i)))?void 0:t.routeName;if(r)if(l.has(r))if(l.get(r).directionPoints)l.get(r).directionPoints.features.push(e);else{const{fieldAliases:t,geometryType:i,spatialReference:o}=u;l.get(r).directionPoints={features:[e],fieldAliases:t,geometryType:i,spatialReference:o}}else{const{fieldAliases:t,geometryType:i,spatialReference:o}=u;l.set(r,{routeName:r,directionPoints:{features:[e],fieldAliases:t,geometryType:i,spatialReference:o}})}}));const g=Array.from(l.values());return S.fromJSON({routeResults:g,barriers:m,polygonBarriers:y,polylineBarriers:b,messages:h})}(f)}},95642:(e,t,i)=>{i.d(t,{Z:()=>f});var r=i(43697),o=(i(66577),i(70586)),s=i(5600),a=(i(67676),i(80442),i(75215),i(71715)),l=i(52011),n=i(38171);let u=class extends n.Z{};(0,r._)([(0,s.Cb)()],u.prototype,"events",void 0),(0,r._)([(0,s.Cb)()],u.prototype,"strings",void 0),u=(0,r._)([(0,l.j)("esri.rest.support.DirectionsFeature")],u);const p=u;var d=i(74889),c=i(6570),m=i(82971),y=i(58901),b=i(13473);let h=class extends d.default{constructor(e){super(e),this.extent=null,this.features=null,this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){var i;if(!e)return[];const r=null!=(i=t.summary.envelope.spatialReference)?i:t.spatialReference,o=r&&m.Z.fromJSON(r);return e.map((e=>{var t,i;const r=this._decompressGeometry(e.compressedGeometry),s=new y.Z({...r,spatialReference:o}),a=null!=(t=null==(i=e.events)?void 0:i.map((e=>{const{arriveTimeUTC:t,ETA:i,point:{x:r,y:s,z:a},strings:l}=e;return new p({geometry:new b.Z({x:r,y:s,z:a,hasZ:void 0!==a,spatialReference:o}),attributes:{ETA:i,arriveTimeUTC:t},strings:l})})))?t:[];return new p({attributes:e.attributes,events:a,geometry:s,strings:e.strings})}))}get mergedGeometry(){if(!this.features)return null;const e=this.features.map((({geometry:e})=>(0,o.Wg)(e))),t=this.get("extent.spatialReference");return this._mergePolylinesToSinglePath(e,t)}get strings(){return this.features.map((({strings:e})=>e))}_decompressGeometry(e){let t=0,i=0,r=0,o=0;const s=[];let a,l,n,u,p,d,c,m,y=0,b=0,h=0;if(p=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),p||(p=[]),0===parseInt(p[y],32)){y=2;const e=parseInt(p[y],32);y++,d=parseInt(p[y],32),y++,1&e&&(b=p.indexOf("|")+1,c=parseInt(p[b],32),b++),2&e&&(h=p.indexOf("|",b)+1,m=parseInt(p[h],32),h++)}else d=parseInt(p[y],32),y++;for(;y<p.length&&"|"!==p[y];){a=parseInt(p[y],32)+t,y++,t=a,l=parseInt(p[y],32)+i,y++,i=l;const e=[a/d,l/d];b&&(u=parseInt(p[b],32)+r,b++,r=u,e.push(u/c)),h&&(n=parseInt(p[h],32)+o,h++,o=n,e.push(n/m)),s.push(e)}return{paths:[s],hasZ:b>0,hasM:h>0}}_mergePolylinesToSinglePath(e,t){if(0===e.length)return new y.Z({spatialReference:t});const i=[];for(const t of e)for(const e of t.paths)i.push(...e);const r=[];i.forEach(((e,t)=>{0!==t&&e[0]===i[t-1][0]&&e[1]===i[t-1][1]||r.push(e)}));const{hasM:o,hasZ:s}=e[0];return new y.Z({hasM:o,hasZ:s,paths:[r],spatialReference:t})}};(0,r._)([(0,s.Cb)({type:c.Z,json:{read:{source:"summary.envelope"}}})],h.prototype,"extent",void 0),(0,r._)([(0,s.Cb)()],h.prototype,"features",void 0),(0,r._)([(0,a.r)("features")],h.prototype,"readFeatures",null),(0,r._)([(0,s.Cb)()],h.prototype,"geometryType",void 0),(0,r._)([(0,s.Cb)({readOnly:!0})],h.prototype,"mergedGeometry",null),(0,r._)([(0,s.Cb)()],h.prototype,"routeId",void 0),(0,r._)([(0,s.Cb)()],h.prototype,"routeName",void 0),(0,r._)([(0,s.Cb)({value:null,readOnly:!0})],h.prototype,"strings",null),(0,r._)([(0,s.Cb)({json:{read:{source:"summary.totalDriveTime"}}})],h.prototype,"totalDriveTime",void 0),(0,r._)([(0,s.Cb)({json:{read:{source:"summary.totalLength"}}})],h.prototype,"totalLength",void 0),(0,r._)([(0,s.Cb)({json:{read:{source:"summary.totalTime"}}})],h.prototype,"totalTime",void 0),h=(0,r._)([(0,l.j)("esri.rest.support.DirectionsFeatureSet")],h);const f=h},74889:(e,t,i)=>{i.r(t),i.d(t,{default:()=>C});var r,o=i(43697),s=i(66577),a=i(38171),l=i(35454),n=i(96674),u=i(22974),p=i(70586),d=i(5600),c=(i(75215),i(71715)),m=i(52011),y=i(30556),b=i(82971),h=i(33955),f=i(1231);const v=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=r=class extends n.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const i=b.Z.fromJSON(t.spatialReference),r=[];for(let t=0;t<e.length;t++){const o=e[t],s=a.Z.fromJSON(o),l=o.geometry&&o.geometry.spatialReference;(0,p.pC)(s.geometry)&&!l&&(s.geometry.spatialReference=i);const n=o.aggregateGeometries,u=s.aggregateGeometries;if(n&&(0,p.pC)(u))for(const e in u){const t=u[e],r=n[e],o=null==r?void 0:r.spatialReference;(0,p.pC)(t)&&!o&&(t.spatialReference=i)}r.push(s)}return r}writeGeometryType(e,t,i,r){if(e)return void v.write(e,t,i,r);const{features:o}=this;if(o)for(const e of o)if(e&&(0,p.pC)(e.geometry))return void v.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,r=(0,h.im)(e);return!i&&t.spatialReference&&(r.spatialReference=b.Z.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){const r=t.features[i];if(r.geometry){const t=e&&e[i];r.geometry=t&&t.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,i],translate:[r,o]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((o-e)/i)));for(let e=0,t=s.length;e<t;e++)a((0,p.Wg)(s[e].geometry))||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:i}=this;if(!i)return this;const{translate:[r,o],scale:[s,a]}=i,l=this._getHydrationFunction(e,(e=>e*s+r),(e=>o-e*a));for(const{geometry:e}of t)(0,p.pC)(e)&&l(e);return this.transform=null,this}_quantizePoints(e,t,i){let r,o;const s=[];for(let a=0,l=e.length;a<l;a++){const l=e[a];if(a>0){const e=t(l[0]),a=i(l[1]);e===r&&a===o||(s.push([e-r,a-o]),r=e,o=a)}else r=t(l[0]),o=i(l[1]),s.push([r,o])}return s.length>0?s:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,h.oU)(e)?e.rings:e.paths,o=[];for(let e=0,s=r.length;e<s;e++){const s=r[e],a=this._quantizePoints(s,t,i);a&&o.push(a)}return o.length>0?((0,h.oU)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,i);return r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y)}:"polyline"===e||"polygon"===e?e=>{const r=(0,h.oU)(e)?e.rings:e.paths;let o,s;for(let e=0,a=r.length;e<a;e++){const a=r[e];for(let e=0,r=a.length;e<r;e++){const r=a[e];e>0?(o+=r[0],s+=r[1]):(o=r[0],s=r[1]),r[0]=t(o),r[1]=i(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax)}:"multipoint"===e?e=>{const r=e.points;let o,s;for(let e=0,a=r.length;e<a;e++){const a=r[e];e>0?(o+=a[0],s+=a[1]):(o=a[0],s=a[1]),a[0]=t(o),a[1]=i(s)}}:void 0}};(0,o._)([(0,d.Cb)({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,d.Cb)({type:[a.Z],json:{write:!0}})],g.prototype,"features",void 0),(0,o._)([(0,c.r)("features")],g.prototype,"readFeatures",null),(0,o._)([(0,d.Cb)({type:[f.Z],json:{write:!0}})],g.prototype,"fields",void 0),(0,o._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:v.read}}})],g.prototype,"geometryType",void 0),(0,o._)([(0,y.c)("geometryType")],g.prototype,"writeGeometryType",null),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),(0,o._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),(0,o._)([(0,d.Cb)({types:s.qM,json:{write:!0}})],g.prototype,"queryGeometry",void 0),(0,o._)([(0,c.r)("queryGeometry")],g.prototype,"readQueryGeometry",null),(0,o._)([(0,d.Cb)({type:b.Z,json:{write:!0}})],g.prototype,"spatialReference",void 0),(0,o._)([(0,y.c)("spatialReference")],g.prototype,"writeSpatialReference",null),(0,o._)([(0,d.Cb)({json:{write:!0}})],g.prototype,"transform",void 0),g=r=(0,o._)([(0,m.j)("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0;const C=g}}]);