PageSourceSearch

https://www.trafikverket.se/Static/dist/1362.744037f068f0af666e5c.js

js trafikverket.se collected 2026-09-24 09:01:01 UTC 55,393 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkknowit_seed_project=self.webpackChunkknowit_seed_project||[]).push([[1362],{31753(e,t,i){i.d(t,{A6:()=>f,B8:()=>d,Xd:()=>u,Xr:()=>g,Yc:()=>A,lw:()=>p,x8:()=>c});var n=i(79441),s=i(19165),o=i(19913),a=i(78115),r=i(71573),l=i(48691);function c(e,t,i){i*=.5;const n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function u(e,t){const i=2*Math.acos(t[3]),n=Math.sin(i/2);return n>(0,a.FD)()?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),i}function p(e,t,i){const n=t[0],s=t[1],o=t[2],a=t[3],r=i[0],l=i[1],c=i[2],u=i[3];return e[0]=n*u+a*r+s*c-o*l,e[1]=s*u+a*l+o*r-n*c,e[2]=o*u+a*c+n*l-s*r,e[3]=a*u-n*r-s*l-o*c,e}function h(e,t,i,n){const s=t[0],o=t[1],r=t[2],l=t[3];let c,u,p,h,d,g=i[0],y=i[1],f=i[2],m=i[3];return u=s*g+o*y+r*f+l*m,u<0&&(u=-u,g=-g,y=-y,f=-f,m=-m),1-u>(0,a.FD)()?(c=Math.acos(u),p=Math.sin(c),h=Math.sin((1-n)*c)/p,d=Math.sin(n*c)/p):(h=1-n,d=n),e[0]=h*s+d*g,e[1]=h*o+d*y,e[2]=h*r+d*f,e[3]=h*l+d*m,e}function d(e,t){const i=t[0],n=t[1],s=t[2],o=t[3],a=i*i+n*n+s*s+o*o,r=a?1/a:0;return e[0]=-i*r,e[1]=-n*r,e[2]=-s*r,e[3]=o*r,e}function g(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){const i=t[0]+t[4]+t[8];let n;if(i>0)n=Math.sqrt(i+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);const s=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*s+s]-t[3*o+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*s+o]-t[3*o+s])*n,e[s]=(t[3*s+i]+t[3*i+s])*n,e[o]=(t[3*o+i]+t[3*i+o])*n}return e}function f(e,t,i,n){const s=.5*Math.PI/180;t*=s,i*=s,n*=s;const o=Math.sin(t),a=Math.cos(t),r=Math.sin(i),l=Math.cos(i),c=Math.sin(n),u=Math.cos(n);return e[0]=o*l*u-a*r*c,e[1]=a*r*u+o*l*c,e[2]=a*l*c-o*r*u,e[3]=a*l*u+o*r*c,e}const m=l.C,v=l.hZ,_=l.WQ,w=p,C=l.hs,M=l.Om,b=l.Cc,P=l.Bw,S=P,x=l.m3,Z=x,R=l.S8,E=l.t2,k=l.aI;function A(e,t,i){const n=(0,r.Om)(t,i);return n<-.999999?((0,r.$A)(D,V,t),(0,r.Il)(D)<1e-6&&(0,r.$A)(D,G,t),(0,r.S8)(D,D),c(e,D,Math.PI),e):n>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,r.$A)(D,t,i),e[0]=D[0],e[1]=D[1],e[2]=D[2],e[3]=1+n,R(e,e))}const D=(0,o.vt)(),V=(0,o.fA)(1,0,0),G=(0,o.fA)(0,1,0);const I=(0,s.vt)(),T=(0,s.vt)();const L=(0,n.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(e,t){const i=t[0],n=t[1],s=t[2];return e[0]=i,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-i*i-n*n-s*s)),e},conjugate:g,copy:m,dot:M,equals:k,exactEquals:E,fromEuler:f,fromMat3:y,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:d,len:S,length:P,lerp:b,mul:w,multiply:p,normalize:R,random:function(e){const t=a.Ov,i=t(),n=t(),s=t(),o=Math.sqrt(1-i),r=Math.sqrt(i);return e[0]=o*Math.sin(2*Math.PI*n),e[1]=o*Math.cos(2*Math.PI*n),e[2]=r*Math.sin(2*Math.PI*s),e[3]=r*Math.cos(2*Math.PI*s),e},rotateX:function(e,t,i){i*=.5;const n=t[0],s=t[1],o=t[2],a=t[3],r=Math.sin(i),l=Math.cos(i);return e[0]=n*l+a*r,e[1]=s*l+o*r,e[2]=o*l-s*r,e[3]=a*l-n*r,e},rotateY:function(e,t,i){i*=.5;const n=t[0],s=t[1],o=t[2],a=t[3],r=Math.sin(i),l=Math.cos(i);return e[0]=n*l-o*r,e[1]=s*l+a*r,e[2]=o*l+n*r,e[3]=a*l-s*r,e},rotateZ:function(e,t,i){i*=.5;const n=t[0],s=t[1],o=t[2],a=t[3],r=Math.sin(i),l=Math.cos(i);return e[0]=n*l+s*r,e[1]=s*l-n*r,e[2]=o*l+a*r,e[3]=a*l-o*r,e},rotationTo:A,scale:C,set:v,setAxes:function(e,t,i,n){const s=L;return s[0]=i[0],s[3]=i[1],s[6]=i[2],s[1]=n[0],s[4]=n[1],s[7]=n[2],s[2]=-t[0],s[5]=-t[1],s[8]=-t[2],R(e,y(e,s))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,i,n,s,o){return h(I,t,s,o),h(T,i,n,o),h(e,I,T,2*o*(1-o)),e},sqrLen:Z,squaredLength:x,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}));i.d(t,["hZ",0,v,"t2",0,E])},16450(e,t,i){i.d(t,{L:()=>l,l:()=>h});var n=i(3132),s=i(40377),o=i(70214),a=i(37623),r=i(61985);function l(e,t,i){const n=i?.createCollection?.()??new s.A,o=i?.recycleItems?new c:null,a=(e,t=0)=>{if(!e?.length)return;const i=n.splice(t,e.length);o?o.processRemoved(e):i.forEach(p)},l=(e,i=0)=>{if(!e?.length)return;const s=[];for(const i of e){const e=o?.use(i);if(e)s.push(e);else{const e=t(i);o?.register(i,e),s.push(e)}}n.addMany(s,i)},u=(0,r.on)(e,"after-splice",({added:e,start:t,removed:i})=>{a(i,t),l(e,t)},{sync:!0,onListenerRemove:e=>a(e.items),onListenerAdd:e=>l(e.items)});return n.addHandles(u),n}class c{constructor(){this._originalToMapped=new Map,this._removedItemCandidates=new Set,this._garbageCollectionQueued=!1}processRemoved(e){if(!e?.length)return;const{_removedItemCandidates:t}=this;for(const i of e)this._getItem(i)?.markRemoved()&&(t.add(i),this._queueGarbageCollection())}use(e){const t=this._getItem(e);return t&&(t.removed=!1),t?.item}register(e,t){this._originalToMapped.set(e,new u(t))}_getItem(e){return this._originalToMapped.get(e)}_queueGarbageCollection(){this._garbageCollectionQueued||(this._garbageCollectionQueued=!0,queueMicrotask(()=>
1this._garbageCollectCandidates()))}_garbageCollectCandidates(){this._garbageCollectionQueued=!1;const{_removedItemCandidates:e}=this,t=Array.from(e);e.clear(),t.forEach(e=>this._garbageCollectIfRemoved(e))}_garbageCollectIfRemoved(e){const{_originalToMapped:t}=this,i=this._getItem(e);i?.removed&&(p(i.item),t.delete(e))}}class u{constructor(e){this.item=e,this.removed=!1}markRemoved(){return this.removed=!0,!0}}function p(e){"object"==typeof e&&e&&("destroy"in e&&"function"==typeof e.destroy?e.destroy():(0,o.wt)(e))}function h(e,t,i){const r=new s.A,c=l(e,e=>(0,n.UT)(async i=>{const n=await t(e,i);if((0,a.G4)(i))throw p(n),(0,a.NK)();return n}),i),u=()=>null,h=async e=>{const t=await e.promise,i=c.indexOf(e);i<0||r.splice(i,1,t)};r.addMany(c.items.map(u));for(const e of c)(0,a.QZ)(h(e));const d=c.on("after-splice",({added:e,start:t,deleteCount:i})=>{const n=r.splice(t,i);for(const e of n)p(e);if(e?.length){r.addMany(e.map(u),t);for(const t of e)(0,a.QZ)(h(t))}});return r.addHandles([(0,o.DQ)(c),d]),r}},10565(e,t,i){i.d(t,{n:()=>s});var n=i(39369);function s(e,t,i,s){let o=null,a=1e3;"number"==typeof t?(a=t,s=i):(o=t??null,a=i);const r=(0,n.v)(0);let l;const c=()=>{r.value=0,e.apply(s,l)},u=(...e)=>{o&&o.apply(s,e),l=e,a?r.value||(r.value=setTimeout(c,a)):c()};return u.remove=()=>{r.value&&(clearTimeout(r.value),r.value=0)},u.forceUpdate=()=>{r.value&&(clearTimeout(r.value),c())},u.hasPendingUpdates=()=>!!r.value,u}},33895(e,t,i){i.d(t,{q:()=>r});var n=i(67709),s=i(1912),o=i(38648),a=i(81832);class r{constructor(e){this.geometry=e,this.spatialReference=e.spatialReference}export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new r(this.geometry);return t.spatialReference=this.spatialReference,t.coordinates=e??this.coordinates.map(e=>e.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await(0,a.initializeProjection)([{source:this.spatialReference,dest:e}],{signal:t});const i=new n.A({spatialReference:this.spatialReference,points:this.coordinates.map(e=>[e.x,e.y])}),s=(0,a.project)(i,e);if(!s)return null;const o=this.coordinates.map((e,t)=>{const i=e.clone(),n=s.points[t];return i.x=n[0],i.y=n[1],i}),r=this.clone(o);return r.spatialReference=e,r}projectSync(e){if(this.spatialReference.equals(e))return this.clone();const t=new n.A({spatialReference:this.spatialReference,points:this.coordinates.map(e=>[e.x,e.y])}),i=(0,a.project)(t,e);if(!i)return null;const s=this.coordinates.map((e,t)=>{const n=e.clone(),s=i.points[t];return n.x=s[0],n.y=s[1],n}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const t=new r(e);if(e instanceof r)return t.coordinates=e.coordinates.map(e=>e.clone()),t._exporter=(t,i)=>{const n=e.clone(t);return n.spatialReference=i,n},t;switch(e.type){case"point":{const i=e,{hasZ:n,hasM:o}=i;return t.coordinates=n&&o?[new l(i.x,i.y,i.z,i.m)]:n?[new l(i.x,i.y,i.z)]:o?[new l(i.x,i.y,null,i.m)]:[new l(i.x,i.y)],t._exporter=(t,i)=>e.hasM?new s.A(t[0].x,t[0].y,t[0].z,t[0].m,i):new s.A(t[0].x,t[0].y,t[0].z,i),t}case"multipoint":{const i=e,{hasZ:s,hasM:o}=i;return t.coordinates=s&&o?i.points.map(e=>new l(e[0],e[1],e[2],e[3])):s?i.points.map(e=>new l(e[0],e[1],e[2])):o?i.points.map(e=>new l(e[0],e[1],null,e[2])):i.points.map(e=>new l(e[0],e[1])),t._exporter=(t,i)=>e.hasM?new n.A({points:t.map(e=>[e.x,e.y,e.z??0,e.m??0]),hasZ:!0,hasM:!0,spatialReference:i}):new n.A({points:t.map(e=>[e.x,e.y,e.z??0]),spatialReference:i}),t}case"polyline":{const i=e,n=[],s=[],{hasZ:a,hasM:r}=e;let c=0;for(const e of i.paths)if(s.push([c,c+e.length]),c+=e.length,a&&r)for(const t of e)n.push(new l(t[0],t[1],t[2],t[3]));else if(a)for(const t of e)n.push(new l(t[0],t[1],t[2]));else if(r)for(const t of e)n.push(new l(t[0],t[1],null,t[2]));else for(const t of e)n.push(new l(t[0],t[1]));return t.coordinates=n,t._exporter=(t,i)=>{const n=e.hasM?t.map(e=>[e.x,e.y,e.z??0,e.m??0]):t.map(e=>[e.x,e.y,e.z??0]),a=s.map(e=>n.slice(e[0],e[1]));return new o.A({paths:a,hasM:e.hasM,hasZ:!0,spatialReference:i})},t}}}}
1class l{constructor(e,t,i=null,n=null,s=null,o=null){this.x=e,this.y=t,this.z=i,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new l(this.x,this.y,this.z,this.m)}}},24266(e,t,i){i.r(t),i.d(t,{default:()=>ut});var n=i(31635),s=i(40377),o=i(62991),a=i(69636),r=i(96966),l=i(73783),c=i(16450),u=i(11682),p=i(70214),h=i(61985);let d=class extends l.A{constructor(e){super(e)}initialize(){this.addHandles(function(e){return(0,p.vE)([(0,h.wB)(()=>{const{analysis:t,sketchGraphic:i,toolState:n,visible:s}=e.analysisViewData,{geometryVisualizationVisible:o}=t.viewOptions;return{geometryVisualizationVisible:o,geometry:t.geometry,sketchGraphic:i,toolState:n,visible:s}},({geometryVisualizationVisible:t,sketchGraphic:i,toolState:n,visible:s})=>{if(e.remove(),s)return t&&null!=i&&"reshaping"!==n&&"sketching"!==n?e.show(i):void 0},h.pc)])}({analysisViewData:this.analysisViewData,remove:()=>{},show:()=>{}}))}get updating(){return!1}};(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],d.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],d.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)()],d.prototype,"updating",null),d=(0,n.Cg)([(0,a.$K)("esri.views.2d.analysis.ElevationProfile.ElevationProfileInputVisualization2D")],d);var g=i(20857),y=i(60861),f=i(10565),m=i(60936),v=i(72906);let _={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:_.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0,signal:null}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:(0,v.oU)(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,profileLinesUpdateThrottleMillis:100,indicatorPointStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function w(){return _}var C=i(81832);let M=class extends l.A{constructor(e){super(e),this.visible=!1,this._element=function(){const e=document.createElement("div"),{size:t,borderStyle:i,borderColor:n,borderWidth:s,boxShadow:o}=w().indicatorPointStyle,{style:a}=e;return a.display="block",a.position="absolute",a.top="0",a.left="0",a.contain="strict",a.boxSizing="border-box",a.width=`${t}px`,a.height=`${t}px`,a.marginTop=`-${t/2}px`,a.marginLeft=`-${t/2}px`,a.border=`${i} ${s}px ${n}`,a.borderRadius=`${t}px`,a.boxShadow=o,e}()}initialize(){this.view.surface?.appendChild(this._element),this.addHandles([(0,h.wB)(()=>this.visible&&!!this._screenPoint,e=>{this._element.style.display=e?"block":"none"},h.pc),(0,h.wB)(()=>({color:this.line.color.toCss(),zIndex:this._zIndex}),({color:e,zIndex:t})=>{Object.assign(this._element.style,{background:e,zIndex:t.toString()})},h.pc),(0,h.wB)(()=>this._screenPoint,e=>{e&&(this._element.style.transform=`translate(${e.x}px, ${e.y}px)`)},h.pc)])}destroy(){this._element.remove()}get updating(){return!1}get _result(){return this.analysisViewData.results.find(e=>e.computation.profile===this.line)}get _zIndex(){const{results:e}=this.analysisViewData,t=e.findIndex(e=>e.computation.profile===this.line);return e.length-(-1===t?0:t)}get _screenPoint(){const{view:e}=this;"3d"===e.type?(e.commitProperty("size"),e.commitProperty("camera")):e.commitProperty("center");const t=e?.spatialReference,i=t?(0,C.projectOrLoad)(this._result?.indicatorPoint,t).geometry:null;return i&&e?.ready?e.toScreen(i):null}};(0,n.Cg)([(0,a.MZ)()],M.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)()],M.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)()],M.prototype,"line",void 0),(0,n.Cg)([(0,a.MZ)()],M.prototype,"visible",void 0),(0,n.Cg)([(0,a.MZ)()],M.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)()],M.prototype,"_result",null),(0,n.Cg)([(0,a.MZ)()],M.prototype,"_zIndex",null),(0,n.Cg)([(0,a.MZ)()],M.prototype,"_screenPoint",null),M=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileIndicatorPointVisualization")],M);var b=i(42519);let P=class extends l.A{constructor(e){super(e),this._graphic=new g.A,this._updateGeometryThrottled=(0,f.n)(e=>{e&&(this._graphic.geometry=function(e,t){if(!e||0===e.length)return;const i=e.length-1,n=[];let s=[];for(let t=0;t<=i;t++){const{x:o,y:a,z:r}=e[t];null!=r&&s.push([o,a,r]),t!==i&&null!=r||!s.length||(n.push(s),s=[])}return(0,b.LZ)(n,t,!0)}(e.samples,e.spatialReference))},w().profileLinesUpdateThrottleMillis)}initialize(){this.addGraphic(this._graphic),this._indicatorVisualization=new M({anal
1ysisViewData:this.analysisViewData,line:this.line,view:this.view}),this.addHandles([(0,h.wB)(()=>this._effectiveLineVisible,e=>{this._graphic.visible=e},h.pc),(0,h.wB)(()=>this._effectiveIndicatorVisible,e=>{this._indicatorVisualization.visible=e},h.pc),(0,h.wB)(()=>this._colorUpdateParameters,e=>this._updateColor(e),h.pc),(0,h.wB)(()=>this.analysisViewData.analysis.geometry,()=>{this._graphic.geometry=null},h.pc),(0,h.wB)(()=>this._geometryUpdateParameters,e=>this._updateGeometryThrottled(e),h.pc),this._updateGeometryThrottled])}destroy(){this._graphic.destroy()}get updating(){return this._updateGeometryThrottled.hasPendingUpdates()}get _result(){return this.analysisViewData.results.find(e=>e.computation.profile===this.line)}get _effectiveLineVisible(){return this.getEffectiveVisible("lineVisible")}get _effectiveIndicatorVisible(){const e=this.getEffectiveVisible("indicatorPointVisible");return this._effectiveLineVisible?e&&!!this._graphic.geometry:e}getEffectiveVisible(e){const{analysisViewData:t,_result:i}=this;return t.visible&&!!i?.available&&i.computation.profile.viewOptions[e]}get _geometryUpdateParameters(){const e={samples:this._result?.samples,spatialReference:this.view.spatialReference};return e.samples&&this._effectiveLineVisible&&1!==this.analysisViewData.progress?null:e}get _colorUpdateParameters(){const e=this._result?.computation.profile.color;return e?{color:e.toArray(),contrastColor:(0,y.bJ)(e).toArray()}:null}_updateColor(e){e&&(this._graphic.symbol=new m.A({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",capStyle:"Butt",color:e.color,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],joinStyle:"Round",width:1.5},{type:"CIMSolidStroke",capStyle:"Butt",color:e.contrastColor,joinStyle:"Round",width:1.5}]}}}))}};(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],P.prototype,"addGraphic",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],P.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],P.prototype,"line",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],P.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)()],P.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)()],P.prototype,"_result",null),(0,n.Cg)([(0,a.MZ)()],P.prototype,"_effectiveLineVisible",null),(0,n.Cg)([(0,a.MZ)()],P.prototype,"_effectiveIndicatorVisible",null),(0,n.Cg)([(0,a.MZ)()],P.prototype,"_geometryUpdateParameters",null),(0,n.Cg)([(0,a.MZ)()],P.prototype,"_colorUpdateParameters",null),P=(0,n.Cg)([(0,a.$K)("esri.views.2d.analysis.ElevationProfile.ElevationProfileLineVisualization2D")],P);let S=class extends l.A{constructor(e){super(e),this._graphicsLayer=new u.A({listMode:"hide",internal:!0})}initialize(){const{view:e,analysisViewData:t}=this;e.map.add(this._graphicsLayer),e.map.layers.reorder(this._graphicsLayer,0),this._inputVisualization=new d({view:e,analysisViewData:t}),this._lineVisualizations=(0,c.L)(()=>t.flatProfiles,i=>new P({view:e,analysisViewData:t,line:i,addGraphic:e=>{e.attributes={index:t.flatProfiles.indexOf(i)},this._graphicsLayer.add(e),this._graphicsLayer.graphics.sort((e,t)=>{const i=e.attributes?.index??0;return(t.attributes?.index??0)-i})}}))}destroy(){this._inputVisualization.destroy(),this._lineVisualizations.destroy(),this._graphicsLayer.graphics.drain(e=>{e.destroyed||e.destroy()}),this._graphicsLayer.removeFromParent(),this._graphicsLayer.destroy()}get updating(){return this._inputVisualization.updating||this._lineVisualizations.some(e=>e.updating)}};(0,n.Cg)([(0,a.MZ)()],S.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)()],S.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)()],S.prototype,"updating",null),S=(0,n.Cg)([(0,a.$K)("esri.views.2d.analysis.ElevationProfile.ElevationProfileVisualization2D")],S);var x=i(3223),Z=i(3132),R=i(53244);function E(e,t){let i,n=!1;return function(...s){const o=e.apply(this,s);return n&&void 0!==i&&t?.(i,o)?i:(n=!0,i=o,o)}}var k=i(15565),A=i(91700),D=i(57725),V=i(37623);class G{constructor(e){this._store=e}destroy(){this._store.destroy()}get(e){return this._store.get(e)}put(e,t){this._store.put(e,t)}}var I=i(19541),T=i(92174),L=i(44223);class z extends o.A{constructor(e,t,i){super(e,t,i),this.name="unknown",this.name=e}}class O extends z{constructor(){super("too-complex","The input geometry has too many points.")}}class q extends z{constructor(){super("elevation-query-error","Error querying elevation from provider.")}}class U extends z{constructor(){super("unknown","Unknown error.")}}class H extends o.A{constructor(){super("invalid-geometry","The input geometry is invali
1d.")}}var j=i(4506),F=i(67709),$=i(472),B=i(53334),N=i(71573),Q=i(1018),K=i(38648),W=i(44153);async function X(e,t,n,s,o,a,r){let l,c,u;const p=e.spatialReference,h=p.isGeographic||p.isWebMercator;let d=0;if(!h){const{execute:t}=await i.e(26510).then(i.bind(i,26510));(0,V.Te)(r),d=t(e,{unit:"meters"}),(0,V.Te)(r)}const g=1/(0,v.GA)(s);if(h){await(0,C.initializeProjection)([{source:p,dest:s},{source:p,dest:W.A.WGS84}],r);const i=function(e){return(0,Q.TT)(e.spatialReference)?e:(0,C.project)(e,W.A.WGS84)}(e);l=(0,Q.l1)([i],"meters")[0];const h=Y(l,o);if(ye(e,l,h)>a)throw new O;const d=J(i,t,n);({densifiedPath:c,distances:u}=function(e,t,i){const{hasZ:n}=e;return re(e,t,i,le,n?pe:ue)}(d,h,g)),c=(0,C.project)(c,s)}else{await(0,C.initializeProjection)([{source:p,dest:s}],r),l=d;const i=Y(l,o);if(ye(e,l,i)>a)throw new O;const h=J(e,t,n);({densifiedPath:c,distances:u}=function(e,t,i){const{hasZ:n}=e;return re(e,t,i,ce,n?de:he)}(h,i,g)),(0,V.Te)(r),c=(0,C.project)(c,s)}return{densifiedPath:c,pathLength:l*g,distances:u}}function Y(e,t){const i=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,i)}function J(e,t,i){if(null==t)return ee(e);const n=e.spatialReference,s=t.mode,o=(0,I.Ze)(t,n);let a=null;switch(i.type){case"2d":a=function({hasZ:e},t,i){return"absolute-height"===t?e?([e,t,n])=>[e,t,n+i]:([e,t])=>[e,t,i]:null}(e,s,o);break;case"3d":a=function({spatialReference:e,hasZ:t},i,n,{elevationProvider:s}){const o=(t,i,n,o)=>s?.getElevation(t,i,n,e,o)??0;switch(i){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,i])=>[e,t,i+n]:([e,t])=>[e,t,n];case"relative-to-ground":return t?([e,t,i])=>[e,t,i+o(e,t,i,"ground")+n]:([e,t])=>[e,t,o(e,t,0,"ground")+n];case"relative-to-scene":return t?([e,t,i])=>[e,t,i+o(e,t,i,"scene")+n]:([e,t])=>[e,t,o(e,t,0,"scene")+n];default:return null}}(e,s,o,i)}return null==a?ee(e):new K.A({hasZ:!0,hasM:!1,spatialReference:n,paths:te(e.paths,a)})}function ee(e){return e.hasZ?new K.A({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:te(e.paths,([e,t])=>[e,t])}):e}function te(e,t){const i=e.length,n=new Array(i);for(let s=0;s<i;++s){const i=e[s],o=i.length,a=new Array(i.length);n[s]=a;for(let e=0;e<o;++e)a[e]=t(i[e])}return n}function ie(e){return se(e)&&e.paths.some(e=>e.length>1)}function ne(e){return function(e){return oe(e)&&se(e?.geometry)}(e)&&ie(e.geometry)}function se(e){return!oe(e)&&null!=e&&"polyline"===e.type}function oe(e){return null!=e&&"geometry"in e}function ae(e){const t=e?.layer;return null!=t&&"graphics"===t.type&&t.internal}function re(e,t,i,n,s){const{spatialReference:o,hasZ:a}=e,r={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:o,metersPerSR:(0,v.GA)(o)},l=[],c=[];let u=0;for(let o=0;o<e.paths.length;++o){const a=e.paths[o],p=new Array,h=new Array;let d=0;for(let e=1;e<a.length;++e){const o=a[e-1],l=a[e],c=n(r,o,l);let g;for(g=d;g<c.distance&&!(0,j.Io)(g,c.distance);g+=t)p.push(s(c,g)),h.push((u+g)*i);d=g-c.distance,u+=c.distance,p.push(l),h.push(u*i)}l[o]=p,c[o]=h}return{densifiedPath:new K.A({spatialReference:o,hasZ:a,paths:l}),distances:c}}function le(e,t,i){return e.distance=0,(0,Q._3)(e,t,i,e.spatialReference),e.from=t,e.to=i,e}function ce(e,t,i){return e.from=t,e.to=i,e.distance=(0,B.Io)(i,t)*e.metersPerSR,e}function ue({from:e,azimuth:t,spatialReference:i},n){return(0,Q.vN)([0,0],e,t,n,i)}function pe({from:e,to:t,azimuth:i,distance:n,spatialReference:s},o){const a=o/n,r=[0,0,(0,j.Cc)(e[2],t[2],a)];return(0,Q.vN)(r,e,i,o,s),r}function he({from:e,to:t,distance:i},n){return(0,B.Cc)([0,0],e,t,n/i)}function de({from:e,to:t,distance:i},n){return(0,N.Cc)([0,0,0],e,t,n/i)}function ge(e){return e.paths.reduce((e,t)=>e+t.length,0)}function ye(e,t,i){return ge(e)+Math.floor(t/i)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}function fe(e,t){const i=e.length;if(0===i)return null;const n=e[0],s=n.sampledZ;let o=s,a=s,r=0,l=0,c=null,u=null,p=null!=s?s:0,h=0,d=0,g=null!=s?1:0,y=0,f=0;const m=(0,v.GA)(t),_=(0,v.G9)(t),C=w().minSlopeSampleDistance/m,M=2*C,b=new we,P=new we,S=()=>{Z(),b.copy(P),P.reset()},x=(e,t)=>{S(),e>0&&e-b.start<=M&&(e=b.start+C),P.restart(e,t)},Z=()=>
1{if(b.isHole||P.isHole)return;const e=P.avgElevation-b.avgElevation,t=P.start-b.start,i=e*_,n=t*m,s=(0,v.oU)(Math.atan2(i,n),"radians","degrees");s>0?(h+=s,c=ve(c,s),y++):s<0&&(d-=s,u=ve(u,-s),f++)};null!=n.sampledZ&&x(n.distance,n.sampledZ);for(let t=1;t<i;++t){const i=e[t-1],n=e[t],s=n.sampledZ;if(null==s){P.isHole||S();continue}g++,p+=s,o=me(o,s),a=ve(a,s),P.isHole||n.distance-P.start>=C?x(n.distance,s):P.insert(s);const c=i.sampledZ;if(null!=c){const e=s-c;e>0?r+=e:e<0&&(l-=e)}}return S(),0===g?null:{maxDistance:e[i-1].distance,minElevation:o,maxElevation:a,avgElevation:0===g?null:p/g,elevationGain:r,elevationLoss:l,maxPositiveSlope:c,maxNegativeSlope:u,avgPositiveSlope:0===y?null:h/y,avgNegativeSlope:0===f?null:d/f}}function me(e,t){return null==t?e:null!=e?Math.min(e,t):t}function ve(e,t){return null==t?e:null!=e?Math.max(e,t):t}function _e(e,t){return null!=e&&null!=t?e*t:null}class we{constructor(){this._start=0,this._totalElevation=0,this._sampleCount=0}get avgElevation(){return this._totalElevation/this._sampleCount}get isHole(){return 0===this._sampleCount}get start(){return this._start}copy(e){this._start=e._start,this._sampleCount=e._sampleCount,this._totalElevation=e._totalElevation}reset(){this._start=0,this._sampleCount=0,this._totalElevation=0}restart(e,t){this._start=e,this._sampleCount=1,this._totalElevation=t}insert(e){++this._sampleCount,this._totalElevation+=e}}function Ce(e,t,i=[]){if(e>=t)return i;if(i.push(e),t-e<2)return i;const n=t-1;i.push(n);const s=Me(e+1,n);for(;;){const e=s.next();if(e.done)break;i.push(e.value)}return i}function*Me(e,t){if(e>=t)return;const i=e+Math.floor((t-e)/2);yield i;const n=Me(e,i),s=Me(i+1,t);for(;;){const e=n.next(),t=s.next();if(e.done&&t.done)break;e.done||(yield e.value),t.done||(yield t.value)}}var be=i(78978),Pe=i(49437);function*Se(e,t){const{densificationResult:i}=e,n={...e,abortOptions:t,densificationResult:i},s=Ce(0,n.result.samples.length),o=s.slice(0,n.provider.numSamplesForPreview);yield xe(n,o,!0);const a=(0,x.Ho)(s,n.provider.numSamplesPerChunk);for(const e of a)yield xe(n,e,!1)}async function xe({densificationResult:e,result:t,provider:i,queue:n,abortOptions:s,cache:o},a,r){const{densifiedPath:l,pathLength:c}=e,u=t.spatialReference,{samples:p}=t,h=[];for(let e=0;e<a.length;e++){const t=p[a[e]];h[e]=[...t.coordinate]}try{return await n.push({geometry:new F.A({spatialReference:u,points:h,hasZ:l.hasZ}),provider:i,indices:a,preview:r,result:t,parameters:{...w().defaultQueryOptions(),minDemResolution:r?c/i.numSamplesForPreview:c/p.length,cache:o,signal:s.signal??null,noDataValue:Number.MAX_VALUE}},s),{...t}}catch(e){return(0,V.jH)(e),null}}function Ze(e){return new be.F({priority:Pe.W6.ELEVATION_PROFILE,concurrency:1,scheduler:e,process:async e=>{(0,V.Te)(e.parameters);try{await async function({geometry:e,provider:t,indices:i,preview:n,result:s,parameters:o}){if(0===i.length)return;const a=await async function(e,t,i){try{return await e.queryElevation(t,i)}catch(e){throw new q}}(t,e,o),r=a.geometry,{hasZ:l,points:c}=r,u=a.noDataValue||o.noDataValue,{samples:p}=s;for(let e=0;e<i.length;e++){const t=p[i[e]];if(t.isHole)continue;const n=l?c[e][2]:null;null===n||n===u?t.sampledZ=null:(s.hasZ=!0,t.sampledZ=n),t.sampled=!0}(function(e){const t=e.length-1;let i=0;for(let n=1;n<=t;n++)(e[n].sampled||n===t)&&(Re(e,i,n),i=n)})(p),s.progress=n?0:s.progress+i.length/p.length,s.statistics=fe(s.samples,s.spatialReference)}(e)}catch(e){(0,V.jH)(e)}}})}function Re(e,t,i){if(i-t===1)return;const n=e[t],s=n.sampledZ,o=e[i],a=o.sampledZ;if(null==s||null==a){for(let n=t+1;n<i;n++)e[n].sampledZ=null;return}const r=n.distance,l=o.distance-r;for(let n=t+1;n<i;n++){const t=e[n],i=(t.distance-r)/l;t.sampledZ=(0,j.Cc)(s,a,i)}}function Ee({densifiedPath:e,distances:t}){const i=e.spatialReference,n=(0,$.mL)(i),s=e.paths,o=s.length,a=[];let r=null,l=0;for(let e=0;e<o;e++){const i=s[e],o=i.length,c=t[e];for(let e=0;e<o;e++){const t=i[e],s=c[e];n&&(t[0]=n.normalize(t[0])),r&&0===e&&ke(a,r,t,l,s),a.push(Ae(t,s)),r=t,l=s}}return{progress:0,samples:a,hasZ:!1,statistics:null,spatialReference:i}}function ke(e,t,i,n,s){e.push(De(t,n)),e.push(De(i,s))}
1function Ae(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!1,isHole:!1}}function De(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!0,isHole:!0}}function Ve(e){return e>.999999?1:e}let Ge=class extends l.A{constructor(e){super(e),this.error=null,this._getStableEffectiveUnits=E(()=>{const e=function(e){let t=null,i=null,n=null;for(const s of e){if(null==s)continue;const{statistics:e,spatialReference:o}=s;if(null==e)continue;const a=(0,v.GA)(o);t=ve(t,_e(e.maxDistance,a));const r=(0,v.G9)(o);n=me(n,_e(e.minElevation,r)),i=ve(i,_e(e.maxElevation,r))}return{minDistance:0,maxDistance:t??0,minElevation:n??0,maxElevation:i??0}}(this._activeComputations.map(e=>e.result.rawResult)),t=this.analysis.displayUnits,i=(0,T.c)(this.view);return{distance:(0,v.Vs)(e.maxDistance,"meters",t.distance??i),elevation:(0,v.jE)(e.maxElevation,"meters",t.elevation??i)}},k.gh),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getStableUpdateParameters=E(()=>({stationary:this.view.stationary??!0,activeComputations:this._activeComputations,generationParameters:this._generationParameters}),k.gh),this._getStableGenerationParameters=E(()=>{const{view:e,analysis:t}=this;return e?.ready&&this._queue?{view:e,geometry:t.geometry,geometryIsValid:t.valid,elevationInfo:this.elevationInfo,queue:this._queue,cache:this._tileCache,options:this._options,slicePlane:"3d"===e.type?e.slice.plane:null}:null},k.gh),this._getStableElevationInfo=E(()=>this.analysis.elevationInfo??Ie,D.CM),this._getStableOptions=E(()=>{const{densificationMaxSamples:e,defaultDemResolution:t,maxTotalSamples:i}=w();let n=this._minDemResolution??t;return n=parseFloat(n.toFixed(2)),{samplingDistance:n,densificationMaxSamples:Math.round(e/this._activeComputations.length),maxTotalSamples:i}},k.gh),this._updateThrottled=(0,f.n)(e=>this._update(e),w().updateThrottleMillis)}initialize(){this._flatProfilesCollection=new R.A({getCollections:()=>[this.analysis.profiles],getChildrenFunction:e=>"group"===e.type?e.profiles:null,itemFilterFunction:e=>"group"!==e.type}),this._computationsCollection=(0,c.L)(()=>this._flatProfilesCollection,e=>this.computationFactory.create({controller:this,profile:e,onInvalidate:e=>this._invalidateComputation(e)}),{recycleItems:!0}),this.addHandles([(0,p.DQ)(this._flatProfilesCollection),this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),(0,h.wB)(()=>this._updateParameters,e=>this._updateThrottled(e),h.pc),this._updateThrottled]);const e="3d"===this.view.type?this.view.resourceController:void 0;this._queue=Ze(e?.scheduler),e?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=(0,D.pR)(this._queue),this._currentTileCache=(0,D.pR)(this._currentTileCache)}get effectiveDisplayUnits(){return this._getStableEffectiveUnits()}get progress(){let e=0,t=0;for(const i of this._activeComputations)e++,t+=i.progress;return Ve(e>0?t/e:0)}get updating(){const{progress:e}=this,t=!!this._queue?.updating,i=this._updateThrottled.hasPendingUpdates(),n=null!=this._updateTask&&!this._updateTask.finished;return t||i||n||e>0&&e<1}get results(){return this._computations.map(e=>e.result)}get statistics(){return function(e){const t=e.filter(x.Ru),i=t.length;if(0===i)return null;const n=t[0];if(1===i)return n;let s=n.maxDistance,o=n.minElevation,a=n.maxElevation,r=n.maxPositiveSlope,l=n.maxNegativeSlope;for(let e=1;e<t.length;++e){const i=t[e];s=ve(s,i.maxDistance),o=me(o,i.minElevation),a=ve(a,i.maxElevation),r=ve(r,i.maxPositiveSlope),l=ve(l,i.maxNegativeSlope)}return{maxDistance:s,minElevation:o,maxElevation:a,avgElevation:null,elevationGain:null,elevationLoss:null,maxPositiveSlope:r,maxNegativeSlope:l,avgPositiveSlope:null,avgNegativeSlope:null}}(this._activeComputations.map(e=>e.result.statistics))}get indicatorPoints(){return this._computations.map(e=>e.indicatorPoint)}get flatProfiles(){return this._flatProfilesCollection}onElevationChange(e){const{view:t}=this;return"3d"===t?.type?(0,h.on)(()=>t.elevationProvider,"elevation-change",e,{onListenerAdd:e,onListenerRemove:e}):(0,p.hA)()}get _tileCache(){this._currentTileCache=(0,D.pR)(this._currentTileCache);const e=this.view;if("3d"===e?.type){const t=e.basemapTerrain?.elevationQueryCache;if(null!=t)return t}return null==this._currentTileCache&&(this._currentTileCache=new G(new A.q(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(e=>e.profile.enabled&&e.available)}get _minDemResolution(){const e=this._minDemResolutions;return e.length>0?(0,x.jk)(e):null}get _minDemResolutions(){const e=[];for(const{minDemResolution:t}of this._activeComputations)null!=t&&e.push(t);return e}get _updateParameters(){return this._getStableUpdateParameters()}get _generationParameters(){return this._getStableGenerationParameters()}get elevationInfo(){return this._getStableElevationInfo()}get _options(){return this._getStableOptions()}_update({stationary:e,activeComputations:t,generationParameters:i}){this._abortUpdate(),e&&(null!=i?this._updateTask=(0,Z.UT)(async e=>{this.error=null;const n=t.filter(e=>!this._isComputationValid(e,i));try{if(!i.geometryIsValid)throw new H;const t=async function*(e,t){const{view:i,geometry:n,elevationInfo:s,providers:o,options:a}=e,r=i.spatialReference;if(!r||null==n||!ie(n))throw new H;const l=o.length;if(0===l)return null;const c=Math.round(a.maxTotalSamples/l);if(ge(n)>c)throw new O;const u=await X(n,s,i,r,a,c,t);(0,V.Te)(t);let p=0;const h=new Array(l),d=new Array(l);for(let i=0;i<l;i++){const n=Ee(u);h[i]=n,p+=n.samples.length;const s={...e,provider:o[i],result:n,densificationResult:u};d[i]=Se(s,t)[Symbol.iterator]()}if(p>a.maxTotalSamples)throw new O;const g=await Promise.all(d.map(e=>{const t=e.next();return!0===t.done?Promise.resolve(null):t.value}));(0,V.Te)(t);for(let e=0;e<l;e++)h[e]=g[e];yield h,await(0,V.Pl)(e.delayAfterPreview??w().delayAfterPreviewMillis,null,t.signal),(0,V.Te)(t);const y=[];try{let e;do{e=!1;for(let t=0;t<l;t++){const i=d[t].next();!1===i.done&&(y.push({resultPromise:i.value,index:t}),e=!0)}}while(e)}
1finally{d.forEach(e=>e.return?.())}for(const{resultPromise:e,index:i}of y)h[i]=await e,(0,V.Te)(t),yield h;for(const e of h)null!=e&&(e.progress=1);yield h}({...i,providers:n},{signal:e});let s=!1;for await(const o of t){(0,V.Te)(e),s||(this._clearInvalidResults(i),s=!0);for(let e=0;e<n.length;e++)n[e].setResult(o[e])}for(const e of n)this._parametersPerComputation.set(e,i)}catch(e){(0,V.QP)(e),this._abortUpdate(),this.error=e instanceof z?e:e instanceof H?null:new U,n.forEach(e=>e.clearResult())}}):this._clearResults())}_abortUpdate(){this._updateTask=(0,D.DC)(this._updateTask)}_isComputationValid(e,t){return this._parametersPerComputation.has(e)&&this._parametersPerComputation.get(e)===t}_invalidateComputation(e){this._parametersPerComputation.delete(e),this._updateThrottled(this._updateParameters)}_clearInvalidResults(e){for(const t of this._computations)this._isComputationValid(t,e)||(t.clearResult(),this._parametersPerComputation.delete(t))}_clearResults(){for(const e of this._computations)e.clearResult(),this._parametersPerComputation.delete(e)}};(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],Ge.prototype,"analysis",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],Ge.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],Ge.prototype,"computationFactory",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],Ge.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"error",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],Ge.prototype,"effectiveDisplayUnits",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"progress",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"results",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"statistics",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"indicatorPoints",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"flatProfiles",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_updateTask",void 0),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_queue",void 0),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_tileCache",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_flatProfilesCollection",void 0),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_computationsCollection",void 0),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_computations",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_activeComputations",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],Ge.prototype,"_minDemResolution",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_minDemResolutions",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_updateParameters",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_generationParameters",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"elevationInfo",null),(0,n.Cg)([(0,a.MZ)()],Ge.prototype,"_options",null),Ge=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileController")],Ge);const Ie=new L.A({...I.qt});var Te=i(14755),Le=i(36329),ze=i(1912);function Oe(e,t,i){return null==e?null:(0,v.oU)(e*t,"meters",i)}function qe(e,t,i){return null==e?null:(0,v.oU)(e*t,"meters",i)}let Ue=class extends Te.Pw{constructor(e){super(e),this._getSamplesMemoized=(0,Le.B)((e,t)=>function(e,t){if(null==e||null==t)return null;const{samples:i,spatialReference:n}=e,{distance:s,elevation:o}=t,a=(0,v.GA)(n),r=(0,v.G9)(n),l=i.length,c=new Array(l);for(let e=0;e<l;++e){const t=i[e],n=t.sampledZ,l=t.coordinate;c[e]={x:l[0],y:l[1],z:n,distance:Oe(t.distance,a,s),elevation:qe(n,r,o)}}return c}(e,t)),this._getStatisticsMemoized=(0,Le.B)((e,t)=>function(e,t){if(null==e||null==t||null==e.statistics||null==e.spatialReference)return null;const{distance:i,elevation:n}=t,{statistics:s,spatialReference:o}=e,a=(0,v.GA)(o),r=(0,v.G9)(o);return{maxDistance:Oe(s.maxDistance,a,i),minElevation:qe(s.minElevation,r,n),maxElevation:qe(s.maxElevation,r,n),avgElevation:qe(s.avgElevation,r,n),elevationGain:qe(s.elevationGain,r,n),elevationLoss:qe(s.elevationLoss,r,n),maxPositiveSlope:s.maxPositiveSlope,maxNegativeSlope:s.maxNegativeSlope,avgPositiveSlope:s.avgPositiveSlope,avgNegativeSlope:s.avgNegativeSlope}}(e,t)),this.rawResult=null}get available(){const{computation:e}=this;return e.profile.enabled&&e.available}get profile(){return this.computation.profile}get progress(){return Ve(null!=this.rawResult&&this.computation.profile.enabled?this.rawResult.progress:0)}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveDisplayUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveDisplayUnits)}get indicatorPoint(){if(!this.computation.profile.enabled)return null;const e=this.computation.controller.analysisViewData.indicatorRelativePosition;if(null==e)return null;const{rawResult:t,samples:i}=this;if(null==i||null==t)return null;const n=i.length;if(0===n)return null;const s=function(e,t,i){if(!e||0===e.length)return;const n=e.length-1,s=e[0];if(t<=i(s))return s;const o=e[n];if(t>=i(o))return o;let a=0,r=0,l=n;for(;a<l;){r=a+Math.floor((l-a)/2);const s=e[r],o=i(s);if(o===t)return s;if(t<o){if(r>0){const n=e[r-1],a=i(n);if(t>a)return t-a>=o-t?s:n}l=r}else{if(r<n){const n=e[r+1],a=i(n);if(t<a)return t-o>=a-t?n:s}a=r+1}}return e[r]}(i,e*i[n-1].distance,e=>e.distance);if(null==s)return null;const{x:o,y:a,z:r}=s;return null==r?null:new ze.A({x:o,y:a,z:r,spatialReference:t.spatialReference})}};(0,n.Cg)([(0,a.MZ)()],Ue.prototype,"available",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],Ue.prototype,"profile",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],Ue.prototype,"progress",null),(0,n.Cg)([(0,a.MZ)()],Ue.prototype,"samples",null),(0,n.Cg)([(0,a.MZ)()],Ue.prototype,"statistics",null),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],Ue.prototype,"computation",void 0),(0,n.Cg)([(0,a.MZ)()],Ue.prototype,"rawResult",void 0),(0,n.Cg)([(0,a.MZ)()],Ue.prototype,"indicatorPoint",null),Ue=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileResult")],Ue);let He=class extends l.A{constructor(e){super(e),this.result=new Ue({computation:this}),this.numSamplesForPreview=30,this.numSamplesPerChunk=200}initialize(){this.addHandles([(0,h.wB)(()=>{const{geometry:e,elevationInfo:t}=this.controller.analysis;return[e,t]},()=>this.onInvalidate(this),h.OH)])}setResult(e){this.result.rawResult=e}clearResult(){this.setResult(null)}get progress(){return this.result.progress}get indicatorPoint(){return this.result.indicatorPoint}get available(){return!0}get minDemResolution(){return w().defaultDemResolution}};(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],He.prototype,"controller",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],He.prototype,"profile",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],He.prototype,"onInvalidate",void 0),(0,n.Cg)([(0,a.MZ)()],He.prototype,"result",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],He.prototype,"progress",null),(0,n.Cg)([(0,a.MZ)()],He.prototype,"indicatorPoint",null),(0,n.Cg)([(0,a.MZ)()],He.prototype,"available",null),(0,n.Cg)([(0,a.MZ)()],He.prototype,"numSamplesForPreview",void 0),(0,n.Cg)([(0,a.MZ)()],He.prototype,"numSamplesPerChunk",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],He.prototype,"minDemResolution",null),He=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileLineComputation")],He);var je=i(11588);function Fe(e){if(null==e)return null;if((0,je.Q)(e))return $e(e);const t=e.tileInfo;if(null==t)return null;const i=t.lods?.at(-1);return null==i?null:i.resolution*(0,v.GA)(t.spatialReference)}function $e(e){if(null==e)return null;const t=e.layers.items.map(Be).filter(x.Ru);return(0,x.jk)(t)??null}function Be(e){return e&&"tileInfo"in e?Fe(e):null}let Ne=class extends He{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getStableQueryElevationDependencies=E(()=>({ground:this._ground,groundLayers:this._getStableGroundLayers()}),k.gh),this._getStableGroundLayers=E(()=>this._ground?.layers?.toArray(),k.gh)}get minDemResolution(){return $e(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)||!0===this._groundLayers?.some(e=>e.visible)}initialize(){this.addHandles([(0,h.wB)(()=>this._queryElevationDependencies,()=>this.onInvalidate(this)),(0,h.wB)(()=>this._ground,e=>{e&&!e.loaded&&e.load()},{initial:!0})])}async queryElevation(e,t){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}
1: no dependencies`);const{ground:n}=i;if(null==n)throw new Error("No ground configured in the view");const s=await n.queryElevation(e,t),o=(0,v.G9)(e.spatialReference),a=(0,v.G9)(n.allLayers.at(0).spatialReference);if(o!==a){const e=s.geometry;e.points=e.points.map(([e,i,n])=>[e,i,n===t.noDataValue?n:n*a/o])}return s}get _queryElevationDependencies(){return this._getStableQueryElevationDependencies()}get _ground(){return this.controller.view?.map?.ground}get _groundLayers(){return this.controller.view?.map?.basemap?.groundLayers}};(0,n.Cg)([(0,a.MZ)()],Ne.prototype,"minDemResolution",null),(0,n.Cg)([(0,a.MZ)()],Ne.prototype,"available",null),(0,n.Cg)([(0,a.MZ)()],Ne.prototype,"_queryElevationDependencies",null),(0,n.Cg)([(0,a.MZ)()],Ne.prototype,"_ground",null),(0,n.Cg)([(0,a.MZ)()],Ne.prototype,"_groundLayers",null),Ne=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileLineGroundComputation")],Ne);var Qe=i(33895);let Ke=class extends He{constructor(){super(...arguments),this.type="input",this.numSamplesForPreview=50,this.numSamplesPerChunk=500,this._getStableElevationDependencies=E(()=>{const{view:e}=this.controller;if(!e)return null;const t=this._getStableElevationInfo();return{view:e,stationary:!this._requiresElevationAlignment||e.stationary,elevationInfo:t,visibleLayerIds:this._getStableLayerIds(),spatialReference:this._getStableSpatialReference()}},k.gh),this._getStableElevationInfo=E(()=>this.controller.elevationInfo,D.CM),this._getStableSpatialReference=E(()=>this.controller.view?.spatialReference,D.CM),this._getStableLayerIds=E(()=>{const{view:e}=this.controller;return"3d"!==e.type?[]:function(e){return e?.map?.allLayers?.toArray().filter(e=>("graphics"!==e.type||!e.internal)&&e.visible).map(e=>e.uid)??[]}(e)},k.gh)}initialize(){const e=()=>this.onInvalidate(this);this.addHandles([(0,h.wB)(()=>this._queryElevationDependencies,e,h.OH),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:i}){const n=this._queryElevationDependencies;if(null==n)throw new Error(`${this.declaredClass}: no dependencies`);const{view:s,spatialReference:o}=n;if(this._requiresElevationAlignment&&"3d"===s.type&&o){const n=await Qe.q.fromGeometry(e).project(o,i);if(!n)return{geometry:e,noDataValue:t};const a=s.elevationProvider;return n.coordinates.forEach(e=>{e.z=a.getElevation(e.x,e.y,0,o,"ground")??0}),{geometry:n.export(),noDataValue:t}}return{geometry:e,noDataValue:t}}get _requiresElevationAlignment(){return"on-the-ground"===this.controller.elevationInfo?.mode&&"3d"===this.controller.view.type}get _queryElevationDependencies(){return this._getStableElevationDependencies()}};(0,n.Cg)([(0,a.MZ)()],Ke.prototype,"_queryElevationDependencies",null),Ke=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileLineInputComputation")],Ke);let We=class extends He{constructor(){super(...arguments),this.type="query",this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return Fe(this.profile.source)}get available(){const{source:e}=this.profile;return!!e&&(null==e.visible||e.visible)&&(null==e.layers||e.layers.some(e=>e.visible))}initialize(){this.addHandles((0,h.wB)(()=>this.profile.source,()=>this.onInvalidate(this),h.OH))}queryElevation(e,t){if(!this.profile.source)throw new Error("No source configured for the elevation profile line");return this.profile.source.queryElevation(e,t)}};(0,n.Cg)([(0,a.MZ)({readOnly:!0})],We.prototype,"minDemResolution",null),(0,n.Cg)([(0,a.MZ)()],We.prototype,"available",null),We=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileLineQueryComputation")],We);var Xe=i(68660),Ye=i(24826),Je=i(33627),et=i(92402),tt=i(47812),it=i(90876),nt=i(74260),st=i(60586);const ot=s.A.ofType(it.A);var at=i(97102);let rt=class extends l.A{constructor(e){super(e),this._sketchViewModels=new s.A,this._updatingHandles=new Xe.U,this._operationManager=new Je.b}initialize(){const{view:e}=this;this._allLayerSnappingOptions=function(e,t){const i=(0,c.L)(t?.excludeInternal?()=>e.map?.allLayers.filter(e=>!("internal"in e)||!e.internal):()=>e.map?.allLayers,e=>new it.A({layer:e}),{recycleItems:!0,createCollection:()=>new ot}),n=new st.A({enabled:!0,selfEnabled:t?.selfEnabled??!1,featureEnabled:!0,featureSources:i,distance:t?.distance??nt.N.distance,touchSensitivityMultiplier:t?.touchSensitivityMultiplier??nt.N.touchSensitivityMultiplier});return{...(0,p.DQ)(i),options:n}}(this.view,{selfEnabled:!0,excludeInternal:!0}),this._graphicsLayer=new u.A({listMode:"hide",internal:!0}),this._externalGeometryChangeHandle=(0,h.C1)(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),h.OH),this.addHandles([(0,h.wB)(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:i,geometryVisualizationVisible:n,visible:s})=>{!function(e,t){t&&(t.removeFromParent(),e?.add(t))}(e,t);const o=this.sketchGraphic;switch(o&&(o.visible=s),i){case"idle":case"reshaping-disabled":o&&!n&&(o.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case"reshaping":(0,V.QZ)(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},h.pc),(0,h.wB)(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},h.pc),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>(0,D.pR)(e));const e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateAnalysisFromSketchGraphic())}get state(){const{visible:e,interactive:t}=this.analysisViewData;if(!e)return"idle";switch(this._operationManager.currentOperationType){case"place":return this._sketching?"sketching":"awaiting-sketch";case"pick-feature":return"picking";default:return this._analysis.geometry?t?"reshaping":"reshaping-disabled":"idle"}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return function(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};
1return new m.A({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new Ye.A({color:[0,0,0,0]})}(this.view.type)}place(e){return this._operationManager.start("place",async t=>{const i=this._createSketchViewModel(),n=this._analysis.clone();this._ensureUpdatedSketchGraphic();const s=this.sketchGraphic,o=this._analysis.elevationInfo,a=(0,p.hA)(()=>{this.sketchGraphic===s&&(this._graphicsLayer.elevationInfo=o)}),r=i.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case"active":this._updateAnalysisFromSketchGraphic();break;case"complete":this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case"cancel":t.stop()}});t.handles.push(r,(0,p.hA)(()=>(r.remove(),i.destroy(),this._sketchViewModels.remove(i),this._updateAnalysisFromSketchGraphic(),this._analysis.valid?(0,V.G4)(e)||n.equals(this._analysis)?t.reject():void t.resolve({}):(this._clear(),t.reject()))),a),this._graphicsLayer.elevationInfo=lt,await this._updatingHandles.addPromise((0,V.QZ)(i.create("polyline")))},e)}async pickFeature(e){return this._operationManager.start("pick-feature",async e=>{const{view:t}=this;t.closePopup();let i=null;e.handles.push(t.on("immediate-click",n=>{n.defer(async()=>{i?.abort(),i=(0,Z.UT)(async i=>{const{results:s}=await t.hitTest(n);(0,V.Te)(i);let o=null;for(const e of s)if("graphic"===e.type&&ne(e.graphic)&&!ae(e.graphic)){o=e.graphic;break}
1o&&(n.preventDefault(),n.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(o),this._externalGeometryChangeHandle.resume(),e.resolve({feature:o}),e.stop())}),await i.promise})},et.oj.TOOL),t.on("key-down",t=>{(0,tt.$X)(t)&&(e.reject(),e.stop())},et.oj.TOOL),t.acquireCursor("crosshair","high"),(0,p.hA)(()=>{i?.abort(),e.reject()})),t.focus()},e)}_startReshape(){const e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start("reshape",async t=>{const i=()=>{const t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:"reshape"})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const n=e.on("update",e=>{this._updateAnalysisFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?(0,V.QZ)(i()):t.resolve())});t.handles.push(n,(0,p.hA)(()=>{n.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await i()})}_createSketchViewModel(){return new at.A({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;const t=this.sketchGraphic??=new g.A({symbol:this._lineSymbol,geometry:e});return t.geometry=e,this._addSketchGraphic(t),t}_addSketchGraphic(e){const{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),1!==t.length&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;se(e)||(e=null);const t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"analysisViewData",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"view",void 0),(0,n.Cg)([(0,a.MZ)()],rt.prototype,"sketchGraphic",null),(0,n.Cg)([(0,a.MZ)({nonNullable:!0})],rt.prototype,"state",null),(0,n.Cg)([(0,a.MZ)()],rt.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)()],rt.prototype,"_sketching",null),(0,n.Cg)([(0,a.MZ)()],rt.prototype,"_analysis",null),(0,n.Cg)([(0,a.MZ)()],rt.prototype,"_lineSymbol",null),rt=(0,n.Cg)([(0,a.$K)("esri.views.analysis.ElevationProfile.ElevationProfileTool")],rt);const lt=new L.A({mode:"on-the-ground",offset:0});let ct=class extends r.A{constructor(e){super(e),this.type="elevation-profile-view-2d",this.analysis=null,this.indicatorRelativePosition=null}initialize(){const{analysis:e,view:t}=this;this._controller=new Ge({analysis:e,analysisViewData:this,view:t,computationFactory:{create:e=>{switch(e.profile.type){case"ground":return new Ne(e);case"input":return new Ke(e);case"query":return new We(e);case"scene":throw new o.A("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new S({view:t,analysisViewData:this}),this._sketchTool=new rt({view:t,analysisViewData:this})}destroy(){this._controller?.destroy(),this._visualization?.destroy(),this._sketchTool?.destroy()}get effectiveDisplayUnits(){return this._controller?.effectiveDisplayUnits??{distance:"meters",elevation:"meters"}}get error(){return this._controller?.error}get flatProfiles(){return this._controller?.flatProfiles??pt}get indicatorPoints(){return this._controller?.indicatorPoints??[]}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get progress(){return this._controller?.progress??0}get results(){return this._controller?.results??[]}get statistics(){return this._controller?.statistics}get updating(){return!0===this._controller?.updating||!0===this._visualization?.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(e){super.visible=e}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(e){return this._sketchTool.place(e)}pickFeature(e){return this._sketchTool.pickFeature(e)}};(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0,nonNullable:!0})],ct.prototype,"analysis",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"effectiveDisplayUnits",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"error",null),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"flatProfiles",null),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"indicatorRelativePosition",void 0),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"indicatorPoints",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"progress",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"results",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"statistics",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],ct.prototype,"updating",null),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"sketchGraphic",null),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"toolState",null),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"_controller",void 0),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"_visualization",void 0),(0,n.Cg)([(0,a.MZ)()],ct.prototype,"_sketchTool",void 0),ct=(0,n.Cg)([(0,a.$K)("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],ct);const ut=ct,pt=new s.A},73812(e,t,i){i.d(t,{t:()=>o});var n=i(80575),s=i(67488);function o(e,t){const i=(0,s.Vp)(t);if(null==i)return;const n=Array.isArray(e)?Array.isArray(e[0])?e:[e.map(e=>e.pos)]:"polygon"===e.type?e.rings:e.paths;for(const e of n)0!==e.length&&a(e,i)}function a(e,t){const i=e.length>1&&function(e){const t=e.length,i=3===e[0].length;
1return e[0][0]===e[t-1][0]&&e[0][1]===e[t-1][1]&&(!i||e[0][2]===e[t-1][2])}(e),[s,o]=t.valid,a=new n.hr(s,o),r=o-s,l=.5*r;e[0][0]=a.normalize(e[0][0]);for(let t=1;t<e.length;t++){const i=e[t-1][0];let n=a.normalize(e[t][0]);const s=n-i;s>l?n-=r:s<-l&&(n+=r),e[t][0]=n}i&&(e[e.length-1][0]=e[0][0])}}}]);

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.