1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[158],{16449:(e,t,r)=>{r.d(t,{H:()=>o});function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}},50158:(e,t,r)=>{r.r(t),r.d(t,{default:()=>tp});var o,i,s=r(49493),n=r(21990),l=r(98952),a=r(35968),u=r(8774);r(46636),r(30939),r(91115),r(34005),r(64357),r(71094),r(10575),r(49562);var p=r(41140),y=r(64988),d=r(52984),c=r(55114),m=r(92510),f=r(63399),h=r(85314),v=r(23096),w=r(12079),g=r(86858),_=r(9491);r(74552),r(32243);var S=r(98285),A=r(44708),M=r(8705),b=r(88442),T=r(3917),B=r(42398),Z=r(75149),N=r(62408),P=r(99422),R=r(93115),O=r(73885),L=r(92826),j=r(41144),I=r(96098),D=r(40496),C=r(54066);let J=class extends D.oY{constructor(e){super(e),this.break=new C.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new C.A({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new C.A({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new C.A({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new C.A({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new C.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"break",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"first",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"unlocated",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"last",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"middle",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],J.prototype,"waypoint",void 0);let k=J=(0,s._)([(0,A.$)("esri.layers.support.RouteStopSymbols")],J);var x=r(67502),F=r(68629);let E=class extends D.oY{constructor(e){super(e),this.directionLines=new x.A({color:[0,122,194],width:6}),this.directionPoints=new C.A({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new C.A({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new F.A({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new x.A({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new x.A({width:8,color:[20,89,127]}),this.stops=new k}};(0,s._)([(0,_.MZ)({types:I.Y7})],E.prototype,"directionLines",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],E.prototype,"directionPoints",void 0),(0,s._)([(0,_.MZ)({types:I.wC})],E.prototype,"pointBarriers",void 0),(0,s._)([(0,_.MZ)({types:I.Ac})],E.prototype,"polygonBarriers",void 0),(0,s._)([(0,_.MZ)({types:I.Y7})],E.prototype,"polylineBarriers",void 0),(0,s._)([(0,_.MZ)({types:I.Y7})],E.prototype,"routeInfo",void 0),(0,s._)([(0,_.MZ)({type:k})],E.prototype,"stops",void 0);let U=E=(0,s._)([(0,A.$)("esri.layers.support.RouteSymbols")],E);var G=r(84610),$=r(70492),K=r(68675),W=r(73801),q=r(72856),V=r(43961),Y=r(45723);let z=class extends D.oY{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};(0,s._)([(0,_.MZ)({type:String})],z.prototype,"dataType",void 0),(0,s._)([(0,V.e)(Y.et,{ignoreUnknown:!1})],z.prototype,"name",void 0),(0,s._)([(0,_.MZ)({type:[String]})],z.prototype,"parameterNames",void 0),(0,s._)([(0,_.MZ)({type:String})],z.prototype,"restrictionUsageParameterName",void 0),(0,s._)([(0,V.e)(Y.Mm,{ignoreUnknown:!1})],z.prototype,"timeNeutralAttributeName",void 0),(0,s._)([(0,_.MZ)({type:String})],z.prototype,"trafficSupport",void 0),(0,s._)([(0,V.e)(Y.dn)],z.prototype,"units",void 0),(0,s._)([(0,V.e)(Y.WU)],z.prototype,"usageType",void 0);let H=z=(0,s._)([(0,A.$)("esri.rest.support.NetworkAttribute")],z),Q=class extends D.oY{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};(0,s._)([(0,_.MZ)({type:Number})],Q.prototype,"buildTime",void 0),(0,s._)([(0,_.MZ)({type:String})],Q.prototype,"name",void 0),(0,s._)([(0,_.MZ)({type:[H]})],Q.prototype,"networkAttributes",void 0),(0,s._)([(0,_.MZ)()],Q.prototype,"networkSources",void 0),(0,s._)([(0,_.MZ)({type:String})],Q.prototype,"state",void 0);let X=Q=(0,s._)([(0,A.$)("esri.rest.support.NetworkDataset")],Q);var ee=r(70960);let et=class extends D.oY{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return null==e?null:e.map(e=>Y.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>Y.et.toJSON(e)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}
1readDefaultTravelMode(e,t){let r=t.supportedTravelModes?.find(({id:e})=>e===t.defaultTravelMode)??t.supportedTravelModes?.find(({itemId:e})=>e===t.defaultTravelMode);return r?ee.A.fromJSON(r):null}};(0,s._)([(0,_.MZ)()],et.prototype,"accumulateAttributeNames",void 0),(0,s._)([(0,S.w)("accumulateAttributeNames")],et.prototype,"readAccumulateAttributes",null),(0,s._)([(0,M.K)("accumulateAttributeNames")],et.prototype,"writeAccumulateAttributes",null),(0,s._)([(0,_.MZ)()],et.prototype,"attributeParameterValues",void 0),(0,s._)([(0,_.MZ)()],et.prototype,"capabilities",null),(0,s._)([(0,_.MZ)()],et.prototype,"currentVersion",void 0),(0,s._)([(0,_.MZ)()],et.prototype,"defaultTravelMode",void 0),(0,s._)([(0,S.w)("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],et.prototype,"readDefaultTravelMode",null),(0,s._)([(0,_.MZ)()],et.prototype,"directionsLanguage",void 0),(0,s._)([(0,V.e)(Y.Z7)],et.prototype,"directionsLengthUnits",void 0),(0,s._)([(0,_.MZ)()],et.prototype,"directionsSupportedLanguages",void 0),(0,s._)([(0,V.e)(Y.Mm,{ignoreUnknown:!1})],et.prototype,"directionsTimeAttribute",void 0),(0,s._)([(0,_.MZ)()],et.prototype,"hasZ",void 0),(0,s._)([(0,V.e)(Y.et,{ignoreUnknown:!1})],et.prototype,"impedance",void 0),(0,s._)([(0,_.MZ)({type:X})],et.prototype,"networkDataset",void 0),(0,s._)([(0,_.MZ)({type:[ee.A]})],et.prototype,"supportedTravelModes",void 0);let er=et=(0,s._)([(0,A.$)("esri.rest.support.NetworkServiceDescription")],et),eo=()=>y.A.getLogger("esri.rest.networkService");function ei(e,t,r,o){o[r]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}async function es(e,t,r){if(!e)throw new c.A("network-service:missing-url","Url to Network service is missing");let o=(0,q.jV)({f:"json",token:t},r),{data:i}=await (0,W.A)(e,o),s=i.currentVersion>=10.4?el(e,t,r):en(e,r),{defaultTravelMode:n,supportedTravelModes:l}=await s;return i.defaultTravelMode=n,i.supportedTravelModes=l,er.fromJSON(i)}async function en(e,t){let r=(0,q.jV)({f:"json"},t),{data:o}=await (0,W.A)(e.replace(/\/rest\/.*$/i,"/info"),r);if(!o?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};let{owningSystemUrl:i}=o,s=(0,g.UC)(i)+"/sharing/rest/portals/self",{data:n}=await (0,W.A)(s,r),l=(0,f.wc)("helperServices.routingUtilities.url",n);if(!l)return{supportedTravelModes:[],defaultTravelMode:null};let a=(0,q.Dl)(i),u=/\/solve$/i.test(a.path)?"Route":/\/solveclosestfacility$/i.test(a.path)?"ClosestFacility":"ServiceAreas",p=(0,q.jV)({f:"json",serviceName:u},t),y=(0,g.UC)(l)+"/GetTravelModes/execute",d=await (0,W.A)(y,p),c=[],m=null;if(d?.data?.results?.length)for(let e of d.data.results)if("supportedTravelModes"===e.paramName){if(e.value?.features){for(let{attributes:t}of e.value.features)if(t){let e=JSON.parse(t.TravelMode);c.push(e)}}}else"defaultTravelMode"===e.paramName&&(m=e.value);return{supportedTravelModes:c,defaultTravelMode:m}}async function el(e,t,r){try{let o=(0,q.jV)({f:"json",token:t},r),i=(0,g.UC)(e)+"/retrieveTravelModes",{data:{supportedTravelModes:s,defaultTravelMode:n}}=await (0,W.A)(i,o);return{supportedTravelModes:s,defaultTravelMode:n}}catch(e){throw new c.A("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:e})}}var ea=r(51705),eu=r(34698),ep=r(16614),ey=r(23613),ed=r(62242),ec=r(65760);let em=new ec.J({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"}),ef=class extends D.oY{constructor(e){super(e),this.description=null,this.type=null}};(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],ef.prototype,"description",void 0),(0,s._)([(0,_.MZ)({type:String,json:{read:em.read,write:em.write}})],ef.prototype,"type",void 0);let eh=ef=(0,s._)([(0,A.$)("esri.rest.support.GPMessage")],ef),ev=new ec.J({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"}),ew=class extends eh{constructor(e){super(e),this.type=null}};(0,s._)([(0,_.MZ)({type:String,json:{read:ev.read,write:ev.write}})],ew.prototype,"type",void 0);let eg=ew=(0,s._)([(0,A.$)("esri.rest.support.NAMessage")],ew),e_=class extends D.oY{constructor(e){super(e)}};(0,s._)([(0,_.MZ)({json:{read:{source:"string"}}})],e_.prototype,"text",void 0),(0,s._)([(0,V.e)(Y.Ec,{name:"stringType"})],e_.prototype,"type",void 0);let eS=e_=(0,s._)([(0,A.$)("esri.rest.support.DirectionsString")],e_);var eA=r(1589);let eM=class extends D.oY{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOff
1set=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,t){return(0,ep.Zn)(t.ETA,t.arriveTimeUTC)}readGeometry(e,t){return eA.A.fromJSON(t.point)}};(0,s._)([(0,_.MZ)({type:Date,json:{read:{source:"arriveTimeUTC"}}})],eM.prototype,"arriveTime",void 0),(0,s._)([(0,_.MZ)()],eM.prototype,"arriveTimeOffset",void 0),(0,s._)([(0,S.w)("arriveTimeOffset",["arriveTimeUTC","ETA"])],eM.prototype,"readArriveTimeOffset",null),(0,s._)([(0,_.MZ)({type:eA.A})],eM.prototype,"geometry",void 0),(0,s._)([(0,S.w)("geometry",["point"])],eM.prototype,"readGeometry",null),(0,s._)([(0,_.MZ)({type:[eS]})],eM.prototype,"strings",void 0);let eb=eM=(0,s._)([(0,A.$)("esri.rest.support.DirectionsEvent")],eM);var eT=r(7989);let eB=class extends a.A{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,t){let r=function(e){if(null==e||""===e)return null;let t=0,r=0,o=0,i=0,s=[],n,l,a,u,p,y,d,c,m=0,f=0,h=0;if((p=e.match(/((\+|-)[^+\-|]+|\|)/g))||(p=[]),0===parseInt(p[m],32)){let e=parseInt(p[m=2],32);y=parseInt(p[++m],32),m++,1&e&&(f=p.indexOf("|")+1,d=parseInt(p[f],32),f++),2&e&&(h=p.indexOf("|",f)+1,c=parseInt(p[h],32),h++)}else y=parseInt(p[m],32),m++;for(;m<p.length&&"|"!==p[m];){n=parseInt(p[m],32)+t,m++,t=n,l=parseInt(p[m],32)+r,m++,r=l;let e=[n/y,l/y];f&&(u=parseInt(p[f],32)+o,f++,o=u,e.push(u/d)),h&&(a=parseInt(p[h],32)+i,h++,i=a,e.push(a/c)),s.push(e)}return{paths:[s],hasZ:f>0,hasM:h>0}}(t.compressedGeometry);return null!=r?eT.A.fromJSON(r):null}};(0,s._)([(0,_.MZ)({type:[eb]})],eB.prototype,"events",void 0),(0,s._)([(0,_.MZ)({type:eT.A})],eB.prototype,"geometry",void 0),(0,s._)([(0,S.w)("geometry",["compressedGeometry"])],eB.prototype,"readGeometry",null),(0,s._)([(0,_.MZ)({type:[eS]})],eB.prototype,"strings",void 0);let eZ=eB=(0,s._)([(0,A.$)("esri.rest.support.DirectionsFeature")],eB);var eN=r(5120);let eP=class extends ey.A{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){if(!e)return[];let r=t.summary.envelope.spatialReference??t.spatialReference,o=r&&eN.A.fromJSON(r);return e.map(e=>{let t=eZ.fromJSON(e);if(null!=t.geometry&&(t.geometry.spatialReference=o),null!=t.events)for(let e of t.events)null!=e.geometry&&(e.geometry.spatialReference=o);return t})}get mergedGeometry(){return this.features?function(e,t){if(0===e.length)return new eT.A({spatialReference:t});let r=[];for(let t of e)for(let e of t.paths)r.push(...e);let o=[];r.forEach((e,t)=>{0!==t&&e[0]===r[t-1][0]&&e[1]===r[t-1][1]||o.push(e)});let{hasM:i,hasZ:s}=e[0];return new eT.A({hasM:i,hasZ:s,paths:[o],spatialReference:t})}(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter(ed.Ru)}};(0,s._)([(0,_.MZ)({type:T.A,json:{read:{source:"summary.envelope"}}})],eP.prototype,"extent",void 0),(0,s._)([(0,_.MZ)({nonNullable:!0})],eP.prototype,"features",void 0),(0,s._)([(0,S.w)("features")],eP.prototype,"readFeatures",null),(0,s._)([(0,_.MZ)()],eP.prototype,"geometryType",void 0),(0,s._)([(0,_.MZ)({readOnly:!0})],eP.prototype,"mergedGeometry",null),(0,s._)([(0,_.MZ)()],eP.prototype,"routeId",void 0),(0,s._)([(0,_.MZ)()],eP.prototype,"routeName",void 0),(0,s._)([(0,_.MZ)({value:null,readOnly:!0})],eP.prototype,"strings",null),(0,s._)([(0,_.MZ)({json:{read:{source:"summary.totalDriveTime"}}})],eP.prototype,"totalDriveTime",void 0),(0,s._)([(0,_.MZ)({json:{read:{source:"summary.totalLength"}}})],eP.prototype,"totalLength",void 0),(0,s._)([(0,_.MZ)({json:{read:{source:"summary.totalTime"}}})],eP.prototype,"totalTime",void 0);let eR=eP=(0,s._)([(0,A.$)("esri.rest.support.DirectionsFeatureSet")],eP),eO=class extends D.oY{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};(0,s._)([(0,_.MZ)({type:ey.A,json:{write:!0}}
1)],eO.prototype,"directionLines",void 0),(0,s._)([(0,_.MZ)({type:ey.A,json:{write:!0}})],eO.prototype,"directionPoints",void 0),(0,s._)([(0,_.MZ)({type:eR,json:{write:!0}})],eO.prototype,"directions",void 0),(0,s._)([(0,_.MZ)({type:a.A,json:{write:!0}})],eO.prototype,"route",void 0),(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],eO.prototype,"routeName",void 0),(0,s._)([(0,_.MZ)({type:[a.A],json:{write:!0}})],eO.prototype,"stops",void 0),(0,s._)([(0,_.MZ)({type:ey.A,json:{write:!0}})],eO.prototype,"traversedEdges",void 0),(0,s._)([(0,_.MZ)({type:ey.A,json:{write:!0}})],eO.prototype,"traversedJunctions",void 0),(0,s._)([(0,_.MZ)({type:ey.A,json:{write:!0}})],eO.prototype,"traversedTurns",void 0);let eL=eO=(0,s._)([(0,A.$)("esri.rest.support.RouteResult")],eO);function ej(e){return e?ey.A.fromJSON(e).features.filter(ed.Ru):[]}let eI=class extends D.oY{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,t){return ej(t.barriers)}readPolylineBarriers(e){return ej(e)}readPolygonBarriers(e){return ej(e)}};(0,s._)([(0,_.MZ)({type:[eg]})],eI.prototype,"messages",void 0),(0,s._)([(0,_.MZ)({type:[a.A]})],eI.prototype,"pointBarriers",void 0),(0,s._)([(0,S.w)("pointBarriers",["barriers"])],eI.prototype,"readPointBarriers",null),(0,s._)([(0,_.MZ)({type:[a.A]})],eI.prototype,"polylineBarriers",void 0),(0,s._)([(0,S.w)("polylineBarriers")],eI.prototype,"readPolylineBarriers",null),(0,s._)([(0,_.MZ)({type:[a.A]})],eI.prototype,"polygonBarriers",void 0),(0,s._)([(0,S.w)("polygonBarriers")],eI.prototype,"readPolygonBarriers",null),(0,s._)([(0,_.MZ)({type:[eL]})],eI.prototype,"routeResults",void 0);let eD=eI=(0,s._)([(0,A.$)("esri.rest.support.RouteSolveResult")],eI);function eC(e){return e instanceof ey.A}async function eJ(e,t,r){let o=[],i=[],s={},n={},l=(0,q.Dl)(e),{path:a}=l;eC(t.stops)&&ei(t.stops.features,i,"stops.features",s),eC(t.pointBarriers)&&ei(t.pointBarriers.features,i,"pointBarriers.features",s),eC(t.polylineBarriers)&&ei(t.polylineBarriers.features,i,"polylineBarriers.features",s),eC(t.polygonBarriers)&&ei(t.polygonBarriers.features,i,"polygonBarriers.features",s);let u=await (0,eu.el)(i);for(let e in s){let t=s[e];o.push(e),n[e]=u.slice(t[0],t[1])}if(function(e,t){for(let r=0;r<t.length;r++){let o=e[t[r]];if(o&&o.length){for(let e of o)if(null!=e&&e.hasZ)return!0}}return!1}(n,o)){let e=null;try{e=await es(a,t.apiKey,r)}catch{}e&&!e.hasZ&&function(e,t){for(let r=0;r<t.length;r++){let o=e[t[r]];if(o&&o.length)for(let e of o)e.z=void 0}eo().warnOnce("The remote Network Analysis service is powered by a network dataset which is not Z-aware.\nZ-coordinates of the input geometry are ignored.")}(n,o)}for(let e in n)n[e].forEach((r,o)=>{(0,ea.Jt)(t,e)[o].geometry=r});let p={...r,query:{...l.query,...(0,ep.r9)(t),f:"json"}},y=a.endsWith("/solve")?a:`${a}/solve`,{data:d}=await (0,W.A)(y,p);return function(e){let{barriers:t,directionLines:r,directionPoints:o,directions:i,messages:s,polygonBarriers:n,polylineBarriers:l,routes:a,stops:u,traversedEdges:p,traversedJunctions:y,traversedTurns:d}=e,c=e=>{let t=f.find(t=>t.routeName===e);if(null!=t)return t;let r={routeId:f.length+1,routeName:e};return f.push(r),r},m=e=>{let t=f.find(t=>t.routeId===e);if(null!=t)return t;let r={routeId:e,routeName:null};return f.push(r),r},f=[];a?.features.forEach((e,t)=>{e.geometry.spatialReference=a.spatialReference??void 0;let r=e.attributes.Name;f.push({routeId:t+1,routeName:r,route:e})}),i?.forEach(e=>{let{routeName:t}=e;c(t).directions=e});let h=u?.features.every(e=>null==e.attributes.RouteName)&&f.length>0?f[0].routeName:null;return u?.features.forEach(e=>{e.geometry&&(e.geometry.spatialReference??=u.spatialReference??void 0);let t=c(h??e.attributes.RouteName);t.stops??=[],t.stops.push(e)}),r?.features.forEach(e=>{let t=m(e.attributes.RouteID),{geometryType:o,spatialReference:i}=r;t.directionLines??={features:[],geometryType:o,spatialReference:i},t.directionLines.features.push(e)}),o?.features.forEach(e=>{let t=m(e.attributes.RouteID),{geometryType:r,spatialReference:i}=o;t.directionPoints??={features:[],geometryType:r,spatialReference:i},t.directionPoints.features.push(e)}
1),p?.features.forEach(e=>{let t=m(e.attributes.RouteID),{geometryType:r,spatialReference:o}=p;t.traversedEdges??={features:[],geometryType:r,spatialReference:o},t.traversedEdges.features.push(e)}),y?.features.forEach(e=>{let t=m(e.attributes.RouteID),{geometryType:r,spatialReference:o}=y;t.traversedJunctions??={features:[],geometryType:r,spatialReference:o},t.traversedJunctions.features.push(e)}),d?.features.forEach(e=>{let t=m(e.attributes.RouteID);t.traversedTurns??={features:[]},t.traversedTurns.features.push(e)}),eD.fromJSON({routeResults:f,barriers:t,polygonBarriers:n,polylineBarriers:l,messages:s})}(d)}var ek=r(56434),ex=r(31854),eF=r(3822),eE=r(95833),eU=r(42426),eG=r(44312),e$=r(20150),eK=r(62513),eW=r(98059),eq=r(20996);let eV=class extends(0,e$.O)(D.oY){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],eV.prototype,"doNotLocateOnRestrictedElements",void 0),(0,s._)([(0,_.MZ)({types:l.yR,json:{read:eq.rS,write:!0}})],eV.prototype,"geometry",void 0),(0,s._)([(0,V.e)(Y.Vj)],eV.prototype,"geometryType",void 0),(0,s._)([(0,_.MZ)({type:String,json:{name:"layerName",write:!0}})],eV.prototype,"name",void 0),(0,s._)([(0,V.e)(Y.vS,{name:"spatialRel"})],eV.prototype,"spatialRelationship",void 0),(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],eV.prototype,"type",void 0),(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],eV.prototype,"where",void 0);let eY=eV=(0,s._)([(0,A.$)("esri.rest.support.DataLayer")],eV),ez=o=class extends ey.A{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new o({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],ez.prototype,"doNotLocateOnRestrictedElements",void 0);let eH=ez=o=(0,s._)([(0,A.$)("esri.rest.support.NetworkFeatureSet")],ez),eQ=class extends(0,e$.O)(D.oY){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],eQ.prototype,"doNotLocateOnRestrictedElements",void 0),(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],eQ.prototype,"url",void 0);let eX=eQ=(0,s._)([(0,A.$)("esri.rest.support.NetworkUrl")],eQ),e0=i=class extends(0,e$.O)(D.oY){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.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=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.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,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,eK.PZ)(i,e)}readAccumulateAttributes(e){return null==e?null:e.map(e=>Y.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>Y.et.toJSON(e)))}writePointBarriers(e,t,r){e2(e,t,r)}writePolygonBarrier(e,t,r){e2(e,t,r)}writePolylineBarrier(e,t,r){e2(e,t,r)}readRestrictionAttributes(e){return null==e?null:e.map(e=>Y.OC.fromJSON(e))}writeRestrictionAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>Y.OC.toJSON(e)))}readStartTime(e,t){let{startTime:r}=t;return null==r?null:"now"===r?"now":new Date(r)}writeStartTime(e,t){null!=e&&(t.startTime="now"===e?"now":e.getTime())}readStops(e,t){return function(e){return e&&"type"in e?eY.fromJSON(e):e&&"url"in e?eX.fromJSON(e):e&&"features"in e&&"doNotLocateOnRestrictedElements"in e?eH.fromJSON(e):e&&"features"in e?ey.A.fromJSON(e):null}(t.stops)}writeStops(e,t,r){e2(e,t,r)}};(0,s._)([(0,_.MZ)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],e0.prototype,"accumulateAttributes",void 0),(0,s._)([(0,S.w)("accumulateAttributes")],e0.prototype,"readAccumulateAttributes",null),(0,s._)([(0,M.K)("accumulateAttributes")],e0.prototype,"writeAccumulateAttributes",null),(0,s._)([(0,_.MZ)(eW.K)],e0.prototype,"apiKey",void 0),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"attributeParameterValues",void 0),(0,s._)([(0,_.MZ)({type:String,json:{write:!0}})],e0.prototype,"directionsLanguage",void 0),(0,s._)([(0,V.e)(Y.Z7)],e0.prototype,"directionsLengthUnits",void 0),(0,s._)([(0,V.e)(Y.aJ)],e0.prototype,"directionsOutputType",void 0),(0,s._)([(0,V.e)(Y.$n)],e0.prototype,"directionsStyleName",void 0),(0,s._)([(0,V.e)(Y.Mm,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],e0.prototype,"directionsTimeAttribute",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"findBestSequence",void 0),(0,s._)([(0,_.MZ)({type:Number,json:{write:!0}})],e0.prototype,"geometryPrecision",void 0),(0,s._)([(0,_.MZ)({type:Number,json:{write:!0}})],e0.prototype,"geometryPrecisionM",void 0),(0,s._)([(0,_.MZ)({type:Number,json:{write:!0}})],e0.prototype,"geometryPrecisionZ",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"ignoreInvalidLocations",void 0),(0,s._)([(0,V.e)(Y.et,{name:"impedanceAttributeName",ignoreUnknown:!1})],e0.prototype,"impedanceAttribute",void 0),(0,s._)([(0,_.MZ)({type:Number,json:{write:!0}})],e0.prototype,"outputGeometryPrecision",void 0),(0,s._)([(0,V.e)(Y.hY)],e0.prototype,"outputGeometryPrecisionUnits",void 0),(0,s._)([(0,V.e)(Y.Sr)],e0.prototype,"outputLines",void 0),(0,s._)([(0,_.MZ)({type:eN.A,json:{name:"outSR",write:!0}})],e0.prototype,"outSpatialReference",void 0),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"overrides",void 0),(0,s._)([(0,_.MZ)({json:{name:"barriers",write:!0}})],e0.prototype,"pointBarriers",void 0),(0,s._)([(0,M.K)("pointBarriers")],e0.prototype,"writePointBarriers",null),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"polygonBarriers",void 0),(0,s._)([(0,M.K)("polygonBarriers")],e0.prototype,"writePolygonBarrier",null),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"polylineBarriers",void 0),(0,s._)([(0,M.K)("polylineBarriers")],e0.prototype,"writePolylineBarrier",null),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"preserveFirstStop",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"preserveLastStop",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"preserveObjectID",void 0),(0,s._)([(0,_.MZ)({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],e0.prototype,"restrictionAttributes",void 0),(0,s._)([(0,S.w)("restrictionAttributes")],e0.prototype,"readRestrictionAttributes",null),(0,s._)([(0,M.K)("restrictionAttributes")],e0.prototype,"writeRestrictionAttributes",null),(0,s._)([(0,V.e)(Y.hE)],e0.prototype,"restrictUTurns",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnBarriers",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnDirections",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnPolygonBarriers",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnPolylineBarriers",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnRoutes",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnStops",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnTraversedEdges",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnTraversedJunctions",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnTraversedTurns",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"returnZ",void 0),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"startTime",void 0),(0,s._)([(0,S.w)("startTime")],e0.prototype,"readStartTime",null),(0,s._)([(0,M.K)("startTime")],e0.prototype,"writeStartTime",null),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"startTimeIsUTC",void 0),(0,s._)([(0,_.MZ)({json:{write:!0}})],e0.prototype,"stops",void 0),(0,s._)([(0,S.w)("stops")],e0.prototype,"readStops",null),(0,s._)([(0,M.K)("stops")],e0.prototype,"writeStops",null),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"timeWindowsAreUTC",void 0),(0,s._)([(0,_.MZ)({type:ee.A,json:{write:!0}})],e0.prototype,"travelMode",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"useHierarchy",void 0),(0,s._)([(0,_.MZ)({type:Boolean,json:{write:!0}})],e0.prototype,"useTimeWindows",void 0);let e1=e0=i=(0,s._)([(0,A.$)("esri.rest.support.RouteParameters")],e0
1);function e2(e,t,r){null!=e&&(t[r]=d.A.isCollection(e)?{features:e.toArray().map(e=>e.toJSON())}:e.toJSON())}var e5=r(87829),e4=r(71087),e9=r(20124);function e8(e){return e.length?e:null}function e3(e){return"layers"in e}async function e6(e){let t=eN.A.WGS84;return await (0,B.initializeProjection)(e.spatialReference,t),(0,B.project)(e,t)}function e7(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function te(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:(0,w.oU)(e,t,"meters")}let tt=d.A.ofType(ek.A),tr=d.A.ofType(ex.A),to=d.A.ofType(eF.A),ti=d.A.ofType(eE.A),ts=d.A.ofType(eU.A),tn=d.A.ofType(e4.A),tl="esri.layers.RouteLayer",ta=()=>y.A.getLogger(tl),tu=class extends(0,P.dM)((0,L.j)((0,R.q)((0,O.A)((0,m.P)(N.A))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new U,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new to,this.polygonBarriers=new ti,this.polylineBarriers=new ts,this.routeInfo=null,this.spatialReference=eN.A.WGS84,this.stops=new tn,this.type="route";let t=()=>{this._setStopSymbol(this.stops)};this.addHandles((0,v.on)(()=>this.stops,"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){let i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(e=>!!e),s=i.map((e,t)=>t),n="web-map"===o.origin?"featureCollection.layers":"layers";(0,f.sM)(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",e=>ek.A.fromGraphic(e))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",e=>ex.A.fromGraphic(e))}get fullExtent(){let e=new T.A({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:eN.A.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;let t=this.stops.filter(e=>null!=e.geometry);if(t.length<2)return e;let{spatialReference:r}=t.at(0).geometry;if(null==r)return e;let o=t.toArray().map(e=>{let t=e.geometry;return[t.x,t.y]});return new e9.A({points:o,spatialReference:r}).extent}readMaxScale(e,t){let r=e3(t)?t.layers:t.featureCollection?.layers,o=r?.find(e=>null!=e.layerDefinition.maxScale);return o?.layerDefinition.maxScale??0}readMinScale(e,t){let r=e3(t)?t.layers:t.featureCollection?.layers,o=r?.find(e=>null!=e.layerDefinition.minScale);return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",e=>eF.A.fromGraphic(e))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",e=>eE.A.fromGraphic(e))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",e=>eU.A.fromGraphic(e))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",e=>eG.A.fromGraphic(e)).at(0)??null}readSpatialReference(e,t){let r=e3(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return eN.A.WGS84;let{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??Z.KK;return eN.A.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",e=>e4.A.fromGraphic(e),e=>this._setStopSymbol(e))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return n.A.routeServiceUrl}set url(e){null!=e?this._set("url",(0,j.Jf)(e,ta())):this._set("url",n.A.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}
1removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();let{fullExtent:e,portalItem:t}=this;if(!t)throw new c.A("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new c.A("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new c.A("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(null==this.routeInfo)throw new c.A("routelayer:route-unsolved","save() requires a solved route");let{portal:r}=t;await r.signIn(),r.user||await t.reload();let{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new c.A("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");let s={messages:[],origin:"portal-item",portal:r,url:o?(0,g.An)(o):void 0,writtenProperties:[]},n=this.write(void 0,s);return t.extent=await e6(e),t.title=this.title,await t.update({data:n}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new c.A("routelayer:route-unsolved","saveAs() requires a solved route");let r=$.default.from(e).clone();r.extent??=await e6(this.fullExtent),r.id=null,r.portal??=G.A.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",K.mm.MULTI_LAYER,"Route Layer"];let{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();let s=t?.folder,n=this.write(void 0,i);return await o.user.addItem({item:r,folder:s,data:n}),this.portalItem=r,(0,b.v)(i),i.portalItem=r,r}async solve(e,t){let r,o=e?.stops??this.stops,i=e?.pointBarriers??e8(this.pointBarriers),s=e?.polylineBarriers??e8(this.polylineBarriers),n=e?.polygonBarriers??e8(this.polygonBarriers);if(null==o)throw new c.A("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if(("esri.rest.support.FeatureSet"===o.declaredClass||"esri.rest.support.NetworkFeatureSet"===o.declaredClass)&&o.features.length<2||d.A.isCollection(o)&&o.length<2)throw new c.A("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(d.A.isCollection(o))for(let e of o)e.routeName=null;let l=e?.apiKey,a=this.url,u=await this._getServiceDescription(a,l,t),p=e?.travelMode??u.defaultTravelMode,y=e?.accumulateAttributes??[];null!=p&&(y.push(p.distanceAttributeName),p.timeAttributeName&&y.push(p.timeAttributeName));let m=e1.from(e??{});m.set({accumulateAttributes:y,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!n,returnPolylineBarriers:!!s,returnRoutes:!0,returnStops:!0,stops:o});try{r=await eJ(a,m,t)}catch(e){throw(0,h.zf)(e)?e:new c.A("routelayer:failed-route-request","the routing request failed",{error:e})}let f=this._toRouteLayerSolution(r);return this._isOverridden("title")||(this.title=f.routeInfo.name??"Route"),function(e,t,r){let o=t.networkDataset?.networkAttributes,i=o?.filter(({usageType:e})=>"cost"===e)??[],s=r.travelMode??t.defaultTravelMode;if(null==s)return ta().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");let{timeAttributeName:n,distanceAttributeName:l}=s,a=i.find(({name:e})=>e===n),u=i.find(({name:e})=>e===l),p=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=a?.units,d=u?.units;if(!y||!d)throw new c.A("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");let m=r.directionsLanguage??t.directionsLanguage,f=r.accumulateAttributes??t.accumulateAttributeNames??[],h=new Set(i.filter(({name:e})=>e===n||e===l||e===p||null!=e&&f.includes(e)).map(({name:e})=>e)),v=e=>{for(let t in e)h.has(t)||delete e[t]};for(let t of e.pointBarriers)null!=t.costs&&(t.addedCost=t.costs[p]??0,v(t.costs));for(let t of e.polygonBarriers)null!=t.costs&&(t.scaleFactor=t.costs[p]??1,v(t.costs));for(let t of e.polylineBarriers)null!=t.costs&&(t.scaleFactor=t.costs[p]??1,v(t.costs));let{routeInfo:w}=e,{findBestSequence:g,preserveFirstStop:_,preserveLastStop:S,startTimeIsUTC:A,timeWindowsAreUTC:M}=r;for(let t of(w.analysisSettings=new e5.A({accumulateAttributes:f,directionsLanguage:m,findBestSequence:g,preserveFirstStop:_,preserveLastStop:S,startTimeIsUTC:A,timeWindowsAreUTC:M,travelMode:s}
1),w.totalDuration=e7(w.totalCosts?.[n]??0,y),w.totalDistance=te(w.totalCosts?.[l]??0,d),w.totalLateDuration=e7(w.totalViolations?.[n]??0,y),w.totalWaitDuration=e7(w.totalWait?.[n]??0,y),null!=w.totalCosts&&v(w.totalCosts),null!=w.totalViolations&&v(w.totalViolations),null!=w.totalWait&&v(w.totalWait),e.stops))null!=t.serviceCosts&&(t.serviceDuration=e7(t.serviceCosts[n]??0,y),t.serviceDistance=te(t.serviceCosts[l]??0,d),v(t.serviceCosts)),null!=t.cumulativeCosts&&(t.cumulativeDuration=e7(t.cumulativeCosts[n]??0,y),t.cumulativeDistance=te(t.cumulativeCosts[l]??0,d),v(t.cumulativeCosts)),null!=t.violations&&(t.lateDuration=e7(t.violations[n]??0,y),v(t.violations)),null!=t.wait&&(t.waitDuration=e7(t.wait[n]??0,y),v(t.wait))}(f,u,m),f}update(e){let{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l),null!=l.geometry&&(this.spatialReference=l.geometry.spatialReference)}_getNetworkFeatures(e,t,r,o){let i=e3(e)?e.layers:e.featureCollection?.layers,s=i?.find(e=>e.layerDefinition.name===t);if(null==s)return new d.A;let{layerDefinition:n,popupInfo:l,featureSet:y}=s,c=n.drawingInfo.renderer,{features:m}=y,f=y.spatialReference??n.spatialReference??n.extent.spatialReference??Z.KK,h=c&&(0,p.L)(c),v=eN.A.fromJSON(f),w=m.map(e=>{let o=a.A.fromJSON(e);null!=o.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(o.geometry.spatialReference=v);let i=r(o);return i.symbol??=h?.getSymbol(o)??this._getNetworkSymbol(t),i.popupTemplate??=l&&u.A.fromJSON(l),i});return o&&w.some(({symbol:e})=>!e)&&o(w),new d.A(w)}_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}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;let o=await es(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length||null==this.defaultSymbols.stops||e.every(({symbol:e})=>null!=e))return;let{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(null==this.routeInfo||1===e.length)return void e.forEach((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}});let l=e.map(({sequence:e})=>e).filter(e=>null!=e),a=Math.min(...l),u=Math.max(...l);for(let l of e)l.sequence!==a?l.sequence!==u?"ok"===l.status||"not-located-on-closest"===l.status?"waypoint"!==l.locationType?"break"!==l.locationType?l.symbol=o:l.symbol=n:l.symbol=s:l.symbol=i:l.symbol=r:l.symbol=t}_toRouteLayerSolution(e){let t=e.routeResults[0].stops?.map(e=>e4.A.fromJSON(e.toJSON()));this._setStopSymbol(t);let r=new tn(t),o=new ti(e.polygonBarriers?.map(e=>{let t=eE.A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t})),i=new ts(e.polylineBarriers?.map(e=>{let t=eU.A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t})),s=new to(e.pointBarriers?.map(e=>{let t=eF.A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t})),n=e.routeResults[0].route?.toJSON(),l=eG.A.fromJSON(n);l.symbol=this.defaultSymbols.routeInfo;let a=new tr(e.routeResults[0].directionPoints?.features.map(e=>{let t=ex.A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t}));return{directionLines:new tt(e.routeResults[0].directionLines?.features.map(e=>{let t=ek.A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t})),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:l,stops:r}}
1_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",ek.A.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ex.A.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;let n=this.spatialReference.toJSON(),{fullExtent:l,maxScale:a,minScale:u}=this;return{featureSet:{features:e.toArray().map(e=>(function(e){let{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}})(e)),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():function e(t){switch(t){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:e("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:e("esriGeometryPolyline")}}}(r)}},extent:l.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:a,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",eF.A.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",eE.A.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",eU.A.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new d.A([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",eG.A.fields,"RouteInfo","Route Details")}_writeStops(){let e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",e4.A.fields,"Stops","Stops");if(null==e)return null;let{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}};(0,s._)([(0,_.MZ)({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],tu.prototype,"_featureCollection",void 0),(0,s._)([(0,M.K)(["web-map","portal-item"],"_featureCollection")],tu.prototype,"writeFeatureCollectionWebmap",null),(0,s._)([(0,_.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],tu.prototype,"_type",void 0),(0,s._)([(0,_.MZ)({nonNullable:!0,type:U})],tu.prototype,"defaultSymbols",void 0),(0,s._)([(0,_.MZ)({readOnly:!0})],tu.prototype,"directionLines",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],tu.prototype,"readDirectionLines",null),(0,s._)([(0,_.MZ)({readOnly:!0})],tu.prototype,"directionPoints",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],tu.prototype,"readDirectionPoints",null),(0,s._)([(0,_.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],tu.prototype,"featureCollectionType",void 0),(0,s._)([(0,_.MZ)({readOnly:!0})],tu.prototype,"fullExtent",null),(0,s._)([(0,_.MZ)({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],tu.prototype,"legendEnabled",void 0),(0,s._)([(0,_.MZ)({type:["show","hide"]})],tu.prototype,"listMode",void 0),(0,s._)([(0,_.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],tu.prototype,"maxScale",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],tu.prototype,"readMaxScale",null),(0,s._)([(0,_.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],tu.prototype,"minScale",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],tu.prototype,"readMinScale",null),(0,s._)([(0,_.MZ)({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],tu.prototype,"operationalLayerType",void 0),(0,s._)([(0,_.MZ)({nonNullable:!0,type:d.A.ofType(eF.A)})],tu.prototype,"pointBarriers",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],tu.prototype,"readPointBarriers",null),(0,s._)([(0,_.MZ)({nonNullable:!0,type:d.A.ofType(eE.A)})],tu.prototype,"polygonBarriers",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],tu.prototype,"readPolygonBarriers",null),(0,s._)([(0,_.MZ)({nonNullable:!0,type:d.A.ofType(eU.A)})],tu.prototype,"polylineBarriers",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],tu.prototype,"readPolylineBarriers",null),(0,s._)([(0,_.MZ)({readOnly:!0})],tu.prototype,"routeInfo",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],tu.prototype,"readRouteInfo",null),(0,s._)([(0,_.MZ)({type:eN.A})],tu.prototype,"spatialReference",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],tu.prototype,"readSpatialReference",null),(0,s._)([(0,_.MZ)({nonNullable:!0,type:d.A.ofType(e4.A)})],tu.prototype,"stops",void 0),(0,s._)([(0,S.w)(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],tu.prototype,"readStops",null),(0,s._)([(0,_.MZ)()],tu.prototype,"title",null),(0,s._)([(0,_.MZ)({readOnly:!0,json:{read:!1}})],tu.prototype,"type",void 0),(0,s._)([(0,_.MZ)()],tu.prototype,"url",null);let tp=tu=(0,s._)([(0,A.$)(tl)],tu)},88442:(e,t,r)=>{r.d(t,{v:()=>i});var o=r(16449);
1function i(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,o.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.