v-ol-map 1.14.11 → 1.14.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/ol-map.umd.js CHANGED
@@ -274,4 +274,4 @@ yyyy`,c*10],["week",c*14],["week",c*21],["month",c*31],["week",c*42],["month",c*
274
274
 
275
275
  See the Apache Version 2.0 License for specific language governing permissions
276
276
  and limitations under the License.
277
- ***************************************************************************** */var O7=function(t,e){return O7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},O7(t,e)};function i9e(t,e){O7(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Pl=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},GV=function(t,e){return Object.keys(e).forEach(function(n){Pl(e[n])&&Pl(t[n])?GV(t[n],e[n]):t[n]=e[n]}),t},F7=function(t,e){for(var n=arguments,i=[],r=2;r<arguments.length;r++)i[r-2]=n[r];return function(){for(var a=arguments,s=[],o=0;o<arguments.length;o++)s[o]=a[o];return t.apply(e,i.concat(Array.prototype.slice.call(s)))}},jV=function(t,e){for(var n=0,i,r=t.length;n<r;n++)if(t[n].index===e.index){i=n;break}return i===void 0?t.push(e):t[i]=e,t},UV=function(){function t(e){return e?(e^Math.random()*16>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}return t()};function qV(t,e){t.forEach(function(n){!e[n]||(e[n]=e[n].bind(e))})}function N7(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function H3(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,button:e.pointerEvent.button,buttons:e.pointerEvent.buttons,clientX:e.pointerEvent.clientX,clientY:e.pointerEvent.clientY,zrX:e.pointerEvent.offsetX,zrY:e.pointerEvent.offsetY,movementX:e.pointerEvent.movementX,movementY:e.pointerEvent.movementY,relatedTarget:e.pointerEvent.relatedTarget,screenX:e.pointerEvent.screenX,screenY:e.pointerEvent.screenY,view:window});return n.zrX=e.pointerEvent.offsetX,n.zrY=e.pointerEvent.offsetY,n.event=n,n}function r9e(t,e){for(var n=t.split("."),i=e.split("."),r=0;r<3;r++){var a=Number(n[r]),s=Number(i[r]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}var a9e=function(t){return!t.UTF8Encoding},VV=function(t,e,n){for(var i=[],r=[e[0],e[1]],a=r[0],s=r[1],o=0;o<t.length;o+=2){var l=t.charCodeAt(o)-64,h=t.charCodeAt(o+1)-64;l=l>>1^-(l&1),h=h>>1^-(h&1),l+=a,h+=s,a=l,s=h,i.push([l/n,h/n])}return i},s9e=function(t){if(a9e(t))return t;var e=t.UTF8Scale;e==null&&(e=1024);for(var n=t.features,i=0;i<n.length;i++)for(var r=n[i],a=r.geometry,s=[a.coordinates,a.encodeOffsets],o=s[0],l=s[1],h=0;h<o.length;h++){var u=o[h];if(a.type==="Polygon")o[h]=VV(u,l[h],e);else if(a.type==="MultiPolygon")for(var c=0;c<u.length;c++){var f=u[c];u[c]=VV(f,l[h][c],e)}}return t.UTF8Encoding=!1,t};function o9e(t){var e=s9e(t),n=Il.util.map(Il.util.filter(e.features,function(i){return i.geometry&&i.properties&&i.geometry.coordinates.length>0}),function(i){var r=i.properties,a=i.geometry,s=a.coordinates,o=[];return a.type==="Polygon"&&o.push(s[0]),a.type==="MultiPolygon"&&Il.util.each(s,function(l){l[0]&&o.push(l[0])}),{properties:r,type:"Feature",geometry:{type:"Polygon",coordinates:o}}});return{type:"FeatureCollection",crs:{},features:n}}var l9e=function(t,e,n){return e.center=n.dataToPoint(e.coordinates),e},h9e=function(t,e,n){return Pl(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(i,r){var a=n.dataToPoint(t.series[r].coordinates);return i.left=a[0]-parseFloat(i.width)/2,i.top=a[1]-parseFloat(i.height)/2,i})),e},u9e=function(t,e,n){return Pl(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(i,r){var a=n.dataToPoint(t.series[r].coordinates);return i.left=a[0]-parseFloat(i.width)/2,i.top=a[1]-parseFloat(i.height)/2,i})),e},c9e=Object.freeze({pie:l9e,bar:h9e,line:u9e}),f9e={forcedRerender:!1,forcedPrecomposeRerender:!1,hideOnZooming:!1,hideOnMoving:!1,hideOnRotating:!1,convertTypes:["pie","line","bar"],insertFirst:!1,stopEvent:!1,polyfillEvents:r9e(qb,"6.1.1")<=0},d9e=function(t){i9e(e,t);function e(n,i,r){var a=this,s=Object.assign(f9e,i);return a=t.call(this,s)||this,a._options=s,a._chartOptions=n,a.set("chartOptions",n),a.$chart=null,a.$container=void 0,a._isRegistered=!1,a._initEvent=!1,a._incremental=[],a._coordinateSystem=null,a.coordinateSystemId="",a.prevVisibleState="",qV(["redraw","onResize","onZoomEnd","onCenterChange","onDragRotateEnd","onMoveStart","onMoveEnd","mouseDown","mouseUp","onClick","mouseMove"],a),r&&a.setMap(r),a}return e.prototype.appendTo=function(n,i){i===void 0&&(i=!1),this.setMap(n,i)},e.prototype.getMap=function(){return this._map},e.prototype.setMap=function(n,i){var r=this;if(i===void 0&&(i=!1),n&&(i||n instanceof Gs))this._map=n,this._map.once("postrender",function(){r.handleMapChanged()}),this._map.renderSync();else throw new Error("not ol map object")},e.prototype.getChartOptions=function(){return this.get("chartOptions")},e.prototype.setChartOptions=function(n){return n===void 0&&(n={}),this._chartOptions=n,this.set("chartOptions",n),this.clearAndRedraw(),this},e.prototype.appendData=function(n,i){return i===void 0&&(i=!0),n&&(i&&(this._incremental=jV(this._incremental,{index:this._incremental.length,data:n.data,seriesIndex:n.seriesIndex})),this.$chart.appendData({data:n.data.copyWithin(),seriesIndex:n.seriesIndex})),this},e.prototype.clear=function(n){n||(this._incremental=[]),this.$chart&&this.$chart.clear()},e.prototype.remove=function(){this.clear(),this.$chart&&this.$chart.dispose(),this._initEvent&&this.$container&&(this.$container&&N7(this.$container),this.unBindEvent()),delete this.$chart,delete this._map},e.prototype.show=function(){this.setVisible(!0)},e.prototype.innerShow=function(){this.$container&&(this.$container.style.display=this.prevVisibleState,this.prevVisibleState="")},e.prototype.hide=function(){this.setVisible(!1)},e.prototype.innerHide=function(){this.$container&&(this.prevVisibleState=this.$container.style.display,this.$container.style.display="none")},e.prototype.isVisible=function(){return this.$container&&this.$container.style.display!=="none"},e.prototype.showLoading=function(){this.$chart&&this.$chart.showLoading()},e.prototype.hideLoading=function(){this.$chart&&this.$chart.hideLoading()},e.prototype.setZIndex=function(n){this.$container&&(typeof n=="number"&&(n=String(n)),this.$container.style.zIndex=n)},e.prototype.getZIndex=function(){return this.$container&&this.$container.style.zIndex},e.prototype.setVisible=function(n){n?(this.$container&&(this.$container.style.display=""),this._chartOptions=this.getChartOptions(),this.clearAndRedraw()):(this.$container&&(this.$container.style.display="none"),this.clear(!0),this._chartOptions={},this.clearAndRedraw())},e.prototype.render=function(){!this.$chart&&this.$container?(this.$chart=Il.init(this.$container),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1)),this.dispatchEvent({type:"load",source:this,value:this.$chart})):this.isVisible()&&this.redraw()},e.prototype.redraw=function(){this.clearAndRedraw()},e.prototype.updateViewSize=function(n){!this.$container||(this.$container.style.width=n[0]+"px",this.$container.style.height=n[1]+"px",this.$container.setAttribute("width",String(n[0])),this.$container.setAttribute("height",String(n[1])))},e.prototype.onResize=function(n){var i=this.getMap();if(i){var r=i.getSize();this.updateViewSize(r),this.clearAndRedraw(),n&&this.dispatchEvent({type:"change:size",source:this,value:r})}},e.prototype.onZoomEnd=function(){this._options.hideOnZooming&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"zoomend",source:this,value:n.getView().getZoom()}))},e.prototype.onDragRotateEnd=function(){this._options.hideOnRotating&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:rotation",source:this,value:n.getView().getRotation()}))},e.prototype.onMoveStart=function(){this._options.hideOnMoving&&this.innerHide();var n=this.getMap();n&&n.getView()&&this.dispatchEvent({type:"movestart",source:this,value:n.getView().getCenter()})},e.prototype.onMoveEnd=function(){this._options.hideOnMoving&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"moveend",source:this,value:n.getView().getCenter()}))},e.prototype.onClick=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("click",n))},e.prototype.mouseDown=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mousedown",n))},e.prototype.mouseUp=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mouseup",n))},e.prototype.mouseMove=function(n){if(this.$chart)for(var i=n.originalEvent.target;i;){if(i.className==="ol-overlaycontainer-stopevent"){this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mousemove",n));return}i=i.parentElement}},e.prototype.onCenterChange=function(){var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:center",source:this,value:n.getView().getCenter()}))},e.prototype.handleMapChanged=function(){var n=this.getMap();if(this._initEvent&&this.$container&&(this.$container&&N7(this.$container),this.unBindEvent()),this.$container||(this.createLayerContainer(),this.onResize(!1)),n){var i=this._options.stopEvent?n.getOverlayContainerStopEvent():n.getOverlayContainer();this._options.insertFirst?i.insertBefore(this.$container,i.childNodes[0]||null):i.appendChild(this.$container),this.render(),this.bindEvent(n)}},e.prototype.createLayerContainer=function(){this.$container=document.createElement("div"),this.$container.style.position="absolute",this.$container.style.top="0px",this.$container.style.left="0px",this.$container.style.right="0px",this.$container.style.bottom="0px",this.$container.style.pointerEvents="auto"},e.prototype.bindEvent=function(n){var i=n.getView();this._options.forcedPrecomposeRerender&&n.on("precompose",this.redraw),n.on("change:size",this.onResize),i.on("change:resolution",this.onZoomEnd),i.on("change:center",this.onCenterChange),i.on("change:rotation",this.onDragRotateEnd),n.on("movestart",this.onMoveStart),n.on("moveend",this.onMoveEnd),this._options.polyfillEvents&&(n.on("pointerdown",this.mouseDown),n.on("pointerup",this.mouseUp),n.on("pointermove",this.mouseMove),n.on("click",this.onClick)),this._initEvent=!0},e.prototype.unBindEvent=function(){var n=this.getMap();if(!!n){var i=n.getView();!i||(n.un("precompose",this.redraw),n.un("change:size",this.onResize),i.un("change:resolution",this.onZoomEnd),i.un("change:center",this.onCenterChange),i.un("change:rotation",this.onDragRotateEnd),n.un("movestart",this.onMoveStart),n.un("moveend",this.onMoveEnd),this._options.polyfillEvents&&(n.un("pointerdown",this.mouseDown),n.un("pointerup",this.mouseUp),n.un("pointermove",this.mouseMove),n.un("click",this.onClick)),this._initEvent=!1)}},e.prototype.clearAndRedraw=function(){if(!(!this.$chart||!this.isVisible())){if(this._options.forcedRerender&&this.$chart.clear(),this.$chart.resize(),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1),this._incremental&&this._incremental.length>0))for(var n=0;n<this._incremental.length;n++)this.appendData(this._incremental[n],!1);this.dispatchEvent({type:"redraw",source:this})}},e.prototype.registerMap=function(){if(this._isRegistered||(this.coordinateSystemId="openlayers_"+UV(),Il.registerCoordinateSystem(this.coordinateSystemId,this.getCoordinateSystem(this._options)),this._isRegistered=!0),this._chartOptions){var n=this._chartOptions.series;if(n&&Pl(n)){var i=this._options.convertTypes;if(i)for(var r=n.length-1;r>=0;r--)i.indexOf(n[r].type)>-1||(n[r].coordinateSystem=this.coordinateSystemId),n[r].animation=!1}}},e.prototype.convertData=function(n){var i=n.series;if(i&&i.length>0){if(!this._coordinateSystem){var r=this.getCoordinateSystem(this._options);this._coordinateSystem=new r(this.getMap())}if(i&&Pl(i)){var a=this._options.convertTypes;if(a)for(var s=i.length-1;s>=0;s--)a.indexOf(i[s].type)>-1&&i[s]&&i[s].hasOwnProperty("coordinates")&&(i[s]=c9e[i[s].type](n,i[s],this._coordinateSystem))}}return n},e.prototype.getCoordinateSystem=function(n){var i=this.getMap(),r=this.coordinateSystemId,a=function(s){this.map=s,this._mapOffset=[0,0],this.dimensions=["lng","lat"],this.projCode=a.getProjectionCode(this.map)};return a.dimensions=a.prototype.dimensions||["lng","lat"],a.prototype.getZoom=function(){return this.map.getView().getZoom()},a.prototype.setZoom=function(s){return this.map.getView().setZoom(s)},a.prototype.getViewRectAfterRoam=function(){return this.getViewRect().clone()},a.prototype.setMapOffset=function(s){this._mapOffset=s},a.prototype.dataToPoint=function(s){var o;if(s&&Array.isArray(s)&&s.length>0){o=s.map(function(f){var d=0;return typeof f=="string"?d=Number(f):d=f,d});var l=n&&n.source||"EPSG:4326",h=n&&n.destination||this.projCode,u=this.map.getPixelFromCoordinate(xr(o,l,h)),c=this._mapOffset;return[u[0]-c[0],u[1]-c[1]]}return[0,0]},a.prototype.pointToData=function(s){var o=this._mapOffset;return this.map.getCoordinateFromPixel([s[0]+o[0],s[1]+o[1]])},a.prototype.getViewRect=function(){var s=this.map.getSize();return new Il.graphic.BoundingRect(0,0,s[0],s[1])},a.prototype.getRoamTransform=function(){return Il.matrix.create()},a.prototype.prepareCustoms=function(){var s=this.getViewRect();return{coordSys:{type:r,x:s.x,y:s.y,width:s.width,height:s.height},api:{coord:F7(this.dataToPoint,this),size:F7(a.dataToCoordsSize,this)}}},a.create=function(s){s.eachSeries(function(o){o.get("coordinateSystem")===r&&(o.coordinateSystem=new a(i))})},a.getProjectionCode=function(s){var o="";return s?o=s.getView()&&s.getView().getProjection().getCode():o="EPSG:3857",o},a.dataToCoordsSize=function(s,o){var l=this;return o===void 0&&(o=[0,0]),[0,1].map(function(h){var u=o[h],c=[],f=[],d=s[h]/2;c[h]=u-d,f[h]=u+d,c[1-h]=o[1-h],f[1-h]=o[1-h];var g=l.dataToPoint(c)[h]-l.dataToPoint(f)[h];return Math.abs(g)},this)},a},e.prototype.dispatchEvent=function(n){return t.prototype.dispatchEvent.call(this,n)},e.prototype.set=function(n,i,r){return t.prototype.set.call(this,n,i,r)},e.prototype.get=function(n){return t.prototype.get.call(this,n)},e.prototype.unset=function(n,i){return t.prototype.unset.call(this,n,i)},e.prototype.on=function(n,i){return t.prototype.on.call(this,n,i)},e.prototype.un=function(n,i){return t.prototype.un.call(this,n,i)},e.formatGeoJSON=o9e,e.bind=F7,e.merge=GV,e.uuid=UV,e.bindAll=qV,e.arrayAdd=jV,e.removeNode=N7,e.isObject=Pl,e}(Oi);const g9e={name:"v-echarts",extends:or,inject:["VMap"],render(t,e){return null},props:{layerId:{type:String,default(){return`draw-layer-${$e()}`}},options:{type:Object}},data(){return{layer:null}},computed:{map(){return this.VMap.map},map3d(){return this.VMap.map3d}},watch:{visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){this.layer=new d9e(this.options),this.zIndex&&this.layer.setZIndex(this.zIndex),this.layer.appendTo(this.map)},dispose(){this.layer.remove()}}};let v9e,p9e;const $V={};var HV=qn(g9e,v9e,p9e,!1,m9e,null,null,null);function m9e(t){for(let e in $V)this[e]=$V[e]}HV.options.__file="src/components/layers/echarts/index.vue";const cg=function(){return HV.exports}();cg.install=t=>{t.component(cg.name,cg)};function y9e(t,e){let n;return e.getLayers().forEach(i=>{i&&i.get("id")===t&&(n=i)}),n}const Ob=class{constructor(e,n,i,r,a,s,o,l,h){!n||n.length<1||(this.id=h.id,this.changeCarRotate=h.changeCarRotate,this.centerAtCar=h.centerAtCar,this._moving=!0,this._ismove=!1,this._map=e,this._labelShow=s,this._timeContentClass=o,this._vacuate=r,this._wholePathInfo=n,this._timeOverlayList=[],r?(this._pathInfo=i,this._convertPaths(i)):(this._pathInfo=n,this._convertPaths(n)),this._vacuatePath=i,this._path=[],this._passPath=[],this._pointIndexDistance=20,this._tracePoints=[],this._tracePointsModePlay=a,this._traceTimedivDom=e.traceTimedivDom,this._tracePointsFromTime=[],this._traceEnd=!1,this.traceLayer=new Jt({source:new si,zIndex:99}),this.traceLayer.set("isTrack",!0),e.addLayer(this.traceLayer),this.tracePassLayer=new Jt({source:new si,zIndex:100}),this.tracePassLayer.set("isTrack",!0),e.addLayer(this.tracePassLayer),this.arrowsLayer=new Jt({source:new si,zIndex:101}),this.arrowsLayer.set("isTrack",!0),e.addLayer(this.arrowsLayer),this.carLayer=new Jt({source:new si,zIndex:102}),this.carLayer.set("isTrack",!0),e.addLayer(this.carLayer),this.traceNodes=[],this.traceLineList=[],this.carMarker=null,this._carInfoWin=null,this._pointIndex=0,this._traceIndex=0,this._speedUp=1,this._intervalTraceFlag=null,this._intervalTimeFlag=null,this._opts={carIcon:{src:"",scale:1},speed:0,defaultContent:"",startIcon:{src:"",scale:1},endIcon:{src:"",scale:1},passFlag:!0,showInfoWin:!1,arrowPixel:50,tracePlay:!1},this._setOptions(h),this._initFlag=1,this._showTracePoint=l)}};let wt=Ob;Ze(wt,"track",Ob),wt.prototype._setOptions=function(t){if(!!t)for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this._opts[e]=t[e])},wt.prototype.getSpeed=function(){return this._opts.speed},wt.prototype.getSpeedUp=function(){return this._speedUp},wt.prototype.getPaths=function(){return this._pathInfo},wt.prototype.getTraceIndex=function(){return this._pointIndex},wt.prototype.setTraceIndex=function(t){this._pointIndex=t;const e=this._path[t];this.carMarker.setPosition(e)},wt.prototype.getPercentnum=function(){const t=this._tracePoints,e=this.carMarker.getPosition();for(let n=0;n<t.length;n++)if(e.toString()===t[n].coordinate.toString())return parseFloat((n/t.length).toFixed(2))},wt.prototype.setPercentnum=function(t){const e=this._tracePoints,n=this._tracePointsFromTime,i=Math.round(e.length*t),r=e[i].coordinate;this.carMarker.setPosition(r);for(let a=0;a<n.length;a++){const s=n[a].temBreakPointsFromTime;for(let o=0;o<s.length;o++)s[o].coordinate.toString()===r.toString()&&(this._traceIndex=o,this._pointIndex=a)}},wt.prototype._showTimePopup=function(t){const e=this;e._traceTime=e._pathInfo[0].time,e._fromPause&&(e._traceTime=e._traceTimedivDom.innerText);const n=e._pathInfo[e._pathInfo.length-1].time,i=new Date(n).getTime();i>t.maxEndTime&&(t.maxEndTime=i),e._intervalTimeFlag=setInterval(function(){if(!e._traceEnd&&!e._fromPause&&!e._fromStop){if(e._traceTime=new Date(e._traceTime).getTime()+1e3*e._speedUp,t.maxEndTime<e._traceTime){e._traceEnd=!0,e._traceTimedivDom.innerText=n;return}e._traceTime%1e3===0&&(e._traceTime=w9e(new Date(e._traceTime)),e._traceTimedivDom.innerText=e._traceTime)}},1e3)},wt.prototype._setTraceTime=function(t){const e=this,n=e._tracePointsFromTime;if(e._traceTimedivDom.innerText=t,e._traceTime=t,e._opts.speed===0){let i=Number.MAX_VALUE;const r=new Date(e._traceTimedivDom.innerText).getTime();if(r>0||!isNaN(r))for(let a=0;a<n.length;a++){const s=n[a].temBreakPointsFromTime;for(let o=0;o<s.length;o++)Math.abs(r-s[o].thisTimeSecond)<i&&(i=Math.abs(r-s[o].thisTimeSecond),e._pointIndex=a,e._traceIndex=o)}e._fromStop&&(e._pointIndex=0,e._traceIndex=0),(e._traceTimedivDom.innerText===""||e._fromPause||e._fromStop)&&e._showTimePopup(e._map)}},wt.prototype._convertPaths=function(t){this._path=[];for(let e=0;e<t.length;e++)this._path.push([t[e].longitude,t[e].latitude])},wt.prototype.start=function(){this._moving=!0;const t=this,e=t.getTracePoints(1);t._tracePoints=e.breakPoints,t._tracePointsFromTime=e.breakPointsFromTime,!(t._path.length<1)&&(t._tracePointsModePlay==="skip"?t.tracePointsPlay():t._tracePointsModePlay==="animation"&&t.timePointsPlay())},wt.prototype.tracePointsPlay=function(){const t=this,e=t._pathInfo,n=t._passPath;if(n.length===0&&t.tracePassLayer.getSource().clear(),!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop||t._pointIndex>=e.length)return;if(t._pointIndex+=t._speedUp,t._pointIndex>=e.length&&(t._pointIndex=e.length-1),t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._pointIndex===1&&n.push([e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude]),n.push([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const s=new pn({geometry:new Zt([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});s.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(s)}t._opts.showInfoWin&&(t._carInfoWin.getElement().innerText=e[t._pointIndex].info);const i=t._map.getView().calculateExtent(),r=t.carMarker.getPosition();!Qi(i,r)&&t.centerAtCar&&t._map.getView().animate({center:r})},1e3);else if(t._fromPause){if(!t._fromStop){if(t._pointIndex++,t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const i=new pn({geometry:new Zt([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});i.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(i)}t._ismove=!1}}else return;this._fromPause=!1,this._fromStop=!1},wt.prototype.timePointsPlay=function(){const t=this,e=t._tracePoints,n=t._tracePointsFromTime,i=t._passPath;if(i.length===0&&t.tracePassLayer.getSource().clear(),t._opts.speed===0){let r=Number.MAX_VALUE;const a=new Date(t._traceTimedivDom.innerText).getTime();if(a>0||!isNaN(a))for(let s=0;s<n.length;s++){const o=n[s].temBreakPointsFromTime;for(let l=0;l<o.length;l++)Math.abs(a-o[l].thisTimeSecond)<r&&(r=Math.abs(a-o[l].thisTimeSecond),t._pointIndex=s,t._traceIndex=l)}t._fromStop&&(t._pointIndex=0,t._traceIndex=0),(t._traceTimedivDom.innerText===""||t._fromPause||t._fromStop)&&t._showTimePopup(t._map)}if(!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop)return;const r=t._opts.speed*1e3/3600;if(t._pointIndex>=n.length)return;const a=n[t._pointIndex].temBreakPointsFromTime,s=n[t._pointIndex].differenceTime,o=n[t._pointIndex].length;let l=0;if(r===0?l=(o/s/50).toFixed(2)*10*t._speedUp:l=(r/50).toFixed(2)*10,t._fromPause||t._fromStop||t._pointIndex>=e.length-1||t._pointIndex>=n.length)return;if(t._traceIndex+=l,t._traceIndex=Math.round(t._traceIndex),t._traceIndex>=a.length){t._traceIndex=a.length-1,t._pointIndex++;const f=a.slice(0,t._traceIndex);for(let p=0;p<f.length;p++)i.push(f[p].coordinate);if(t._opts.passFlag){const p=new pn({geometry:new Zt(i)});p.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}const d=YV(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.carMarker.setPosition(a[t._traceIndex].coordinate),t.changeCarRotate&&t.carMarker.setRotateAngle(d);const g=t._troughPointIndex(a[t._traceIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0))),t._traceIndex=0}else{const f=a.slice(Math.round(t._traceIndex-l),t._traceIndex);for(let p=0;p<f.length;p++)i.push(f[p].coordinate);if(t._opts.passFlag){const p=new pn({geometry:new Zt(i)});p.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}t.carMarker.setPosition(a[t._traceIndex].coordinate);const d=YV(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.changeCarRotate&&t.carMarker.setRotateAngle(d);const g=t._troughPointIndex(e[t._pointIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0)))}const h=t._map.getView().calculateExtent(),u=t.carMarker.getPosition();!Qi(h,u)&&t.centerAtCar&&t._map.getView().animate({center:u})},200);else if(t._fromPause)t._fromStop||(t._traceIndex++,t._ismove=!1);else return;this._fromPause=!1,this._fromStop=!1},wt.prototype.setSpeed=function(t){this._opts.speed=t},wt.prototype.setSpeedUp=function(t){this._speedUp=t},wt.prototype.stop=function(){this._moving=!1,this._ismove=!1,this._pointIndex=0,this._traceIndex=0,this._fromStop=!0,this._passPath=[],this.tracePassLayer.getSource().clear(),this.carMarker.setPosition([this._pathInfo[0].longitude,this._pathInfo[0].latitude]),clearInterval(this._intervalTraceFlag),clearInterval(this._intervalTimeFlag)},wt.prototype.pause=function(){this._moving=!1,this._ismove=!0,this._fromPause=!0,clearInterval(this._intervalTimeFlag)},wt.prototype._addMarker=function(){const t=this;this.carMarker&&(this.carLayer.getSource().getFeatures().length>0&&this.carLayer.getSource().removeFeature(this.carMarker),clearInterval(this._intervalTraceFlag));const e=b9e(this._path[0],this._opts);this.carLayer.getSource().addFeature(e),this.carMarker=e,e.on=function(n,i){if(n==="move"){const r=setInterval(function(){if(!t._moving)return;const a=e.getPosition(),s=t._pathInfo;for(let o=0;o<s.length;o++)a.toString()===s[o].longitude+","+s[o].latitude&&(i(o),o===s.length-1&&clearInterval(r))},200)}}},wt.prototype._addInfoWin=function(){const t=this;if(!t._opts.showInfoWin)return;const e=t.carMarker.getPosition();if(t._carInfoWin){t._carInfoWin.setPosition(e);return}const n=document.createElement("div");n.className="carOverlay-class",n.innerText="";const i=new im({element:document.getElementById(t._opts.overlay.element.toString()),position:e,stopEvent:!0,offset:[10,0]});t._carInfoWin=i,t._map.addOverlay(i)},wt.prototype.getArrowPoints=function(t){const e=this._pathInfo,n=[];for(let i=0;i<e.length-1;i++){const r=[e[i].longitude,e[i].latitude],a=[e[i+1].longitude,e[i+1].latitude],s=this._map.getPixelFromCoordinate(r),o=this._map.getPixelFromCoordinate(a),h=ZV([s,o]),u=Math.floor(h/t),c=this.getRotationFromPixel(s,o);for(let f=1;f<u+1;f++){const d=[s[0]+t*f*Math.cos(c),s[1]+t*f*Math.sin(c)],g=this._map.getCoordinateFromPixel(d);n.push({rotate:c,coordinate:g})}}return n},wt.prototype.getTracePoints=function(t){const e=this._pathInfo,n=[],i=[];for(let r=0;r<e.length-1;r++){const a=[],s=[e[r].longitude,e[r].latitude],o=[e[r+1].longitude,e[r+1].latitude],l=e[r].time,h=e[r+1].time,u=new Date(l).getTime(),c=new Date(h).getTime(),f=c-u;if(f===0)continue;const d=i0(s),g=i0(o),v=ZV([d,g]),m=Math.floor(v/t),y=this.getRotationFromPixel(d,g),_=this.getAngleFromPixel(d,g);for(let w=0;w<m+1;w++){const S=[d[0]+w*t*Math.cos(y),d[1]+w*t*Math.sin(y)],b=Xp(S),x=u+Math.round(f/m)*w;n.push({rotate:_,coordinate:b,thisTimeSecond:x}),a.push({rotate:_,coordinate:b,thisTimeSecond:x})}v%t!==0&&(n.push({rotate:_,coordinate:o,thisTimeSecond:c}),a.push({rotate:_,coordinate:o,thisTimeSecond:c})),i.push({length:v,differenceTime:f/1e3,initTime:l,targetTime:h,temBreakPointsFromTime:a})}return{breakPoints:n,breakPointsFromTime:i}},wt.prototype.getRotationFromPixel=function(t,e){if(!t)return!1;t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),r=Math.sqrt(n*n+i*i),a=Math.asin(i/r);let s=0;return e.y<t.y&&e.x===t.x?s=Math.PI*2/3:e.y>t.y&&e.x===t.x?s=Math.PI/2:e.y===t.y&&e.x<t.x?s=Math.PI:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=a:e.y>t.y&&e.x<t.x?s=Math.PI-a:e.y<t.y&&e.x<t.x?s=Math.PI+a:e.y<t.y&&e.x>t.x&&(s=Math.PI*2-a),s},wt.prototype.getAngleFromPixel=function(t,e){t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),r=Math.sqrt(n*n+i*i),a=Math.round(Math.asin(i/r)/Math.PI*180);let s=0;return e.y<t.y&&e.x===t.x?s=270:e.y>t.y&&e.x===t.x?s=90:e.y===t.y&&e.x<t.x?s=180:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=360-a:e.y>t.y&&e.x<t.x?s=180+a:e.y<t.y&&e.x<t.x?s=180-a:e.y<t.y&&e.x>t.x&&(s=a),s},wt.prototype._troughPointIndex=function(t){const e=this._pointIndexDistance,n=this._path;for(let i=0;i<n.length;i++){const r=n[i];if(e0(r,t)<e)return i}return-1},wt.prototype._traceLineSytle=function(t){const e=this._opts,n=e.lineWidth?e.lineWidth:5,i=e.lineColor?e.lineColor:"blue";return{route:new ft({stroke:new Dt({width:n,color:i})}),node:new ft({image:new ai({radius:5,stroke:new Dt({color:"white",width:0}),fill:new xt({color:"green"})})}),start:new ft({image:new xi(this._opts.startIcon),text:new nr({font:"13px Microsoft Yahei",fill:new xt({color:"#aa3300"}),stroke:new Dt({color:"#fff",width:2}),textAlign:"left"})}),end:new ft({image:new xi(this._opts.endIcon),text:new nr({font:"13px Microsoft Yahei",fill:new xt({color:"#aa3300"}),stroke:new Dt({color:"#fff",width:2}),textAlign:"left"})})}[t]},wt.prototype._initLinesAndMarkers=function(){const t=this,e=t._pathInfo,n=t._wholePathInfo;if(t._convertPaths(e),t._initFlag===1){t.traceNodes=[];for(const i in n){const r=Number(i),a=[n[r].longitude,n[r].latitude],s=n[r].id;if(r>0&&r<n.length-1){const o=new pn({geometry:new Kt(a)});o.set("id",s),o.set("number",parseInt(r)+1),t._showTracePoint&&t.traceNodes.push(o),o.set("type","node"),o.on("mouseover",function(l){t._map.getInfoWindowById(l.coordinate.toString())&&t._map.getInfoWindowById(l.coordinate.toString()).setPosition(l.coordinate)}),o.on("mouseout",function(l){t._map.getInfoWindowById(this.getPosition().toString())&&t._map.getInfoWindowById(this.getPosition().toString()).setPosition(void 0)})}else if(r===0){const o=new pn({geometry:new Kt([n[r].longitude,n[r].latitude])});o.set("type","start"),o.set("id",s),o.set("number",parseInt(r)+1),t.traceNodes.push(o)}else if(r===n.length-1){const o=new pn({geometry:new Kt([n[r].longitude,n[r].latitude+1e-8])});o.set("type","end"),o.set("id",s),o.set("number",parseInt(r)+1),t.traceNodes.push(o)}}for(let i=0;i<t._pathInfo.length-1;i++){const r=[t._pathInfo[i].longitude,t._pathInfo[i].latitude],a=[t._pathInfo[i+1].longitude,t._pathInfo[i+1].latitude],s=new pn({geometry:new Zt([r,a])});s.setStyle(t._traceLineSytle("route")),t.traceLayer.getSource().addFeature(s),t.traceLineList.push(s)}for(let i=0;i<t.traceNodes.length;i++){const r=t.traceNodes[i],a=t._traceLineSytle(r.get("type"));if(r.setStyle(a),r.getGeometry().getType()==="Point")for(let s=0;s<e.length;s++)r.get("id")===e[s].id&&t.traceLayer.getSource().addFeature(r)}}},wt.prototype.setTraceLineColor=function(t){const e=this;e._opts.lineColor=t;const n=e.traceLineList;for(let i=0;i<n.length;i++)n[i].setStrokeColor(t);e.traceLayer.refresh()},wt.prototype.setTraceLineWidth=function(t){const e=this;e._opts.lineWidth=t;const n=e.traceLineList;for(let i=0;i<n.length;i++)n[i].setStrokeWeight(t);e.traceLayer.refresh()},wt.prototype._creatTimeOverlays=function(){const t=this,e=t._wholePathInfo,n=t._vacuatePath;if(t._timeOverlayList=[],t._labelShow){const i=[];for(let r=0;r<e.length;r++)for(let a=0;a<n.length;a++)if(n[a].longitude===e[r].longitude&&n[a].latitude===e[r].latitude){const s=[e[r].longitude,e[r].latitude];i.push({position:s,text:e[r].time})}typeof t.textLayer=="undefined"?(t.textLayer=S9e(t._map,i,10),t.textLayer.set("id","lushuText"+new Date().getTime()),t._map.addLayer(t.textLayer)):typeof y9e(t.textLayer.get("id"),t._map)=="undefined"&&t._map.addLayer(t.textLayer)}},wt.prototype.createArrows=function(){const t=this,e=t.getArrowPoints(t._opts.arrowPixel);for(let n=0;n<e.length;n++){const i=e[n].coordinate,r=e[n].rotate,a=new pn({geometry:new Kt(i)});a.setStyle(new ft({image:new xi({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",rotation:r,scale:.5})})),t.arrowsLayer.getSource().addFeature(a)}},wt.prototype.windowAddMouseWheel=function(){const t=this,e=function(n){n=n||window.event,n.wheelDelta?(n.wheelDelta>0&&t.arrowsLayer.getSource().clear(),n.wheelDelta<0&&t.arrowsLayer.getSource().clear()):n.detail&&(n.detail>0&&t.arrowsLayer.getSource().clear(),n.detail<0&&t.arrowsLayer.getSource().clear())};document.addEventListener&&document.addEventListener("DOMMouseScroll",e,!1),window.onmousewheel=document.onmousewheel=e},wt.prototype.dispose=function(){this._intervalTimeFlag&&(clearInterval(this._intervalTimeFlag),this._intervalTimeFlag=null),this._intervalTraceFlag&&(clearInterval(this._intervalTraceFlag),this._intervalTraceFlag=null);const e=this._map.getLayers().getArray().filter(n=>n.get("isTrack")&&n.get("isTrack")===!0);e&&e.length>0&&e.forEach(n=>{n.getSource().clear(),this._map.removeLayer(n)})};function B7(t,e,n,i,r){i==="distance"?WV(t,e,n,r):i==="track"&&_9e(t,e,n,r)}function WV(t,e,n,i){const r=[];e.forEach(function(s,o){r.push(s)});let a=!0;for(let s=0;s<r.length-1;s++)if(W3(t,r[s],r[s+1])<n&&r.length>=3){a=!1,s+1<r.length-1||s===0?r.splice(s+1,1):r.splice(s,1);break}a?i(e):WV(t,r,n,i)}function _9e(t,e,n,i){const r=e;r.forEach(function(o,l){o.id=l});const a=G7(t,r,[],0,r.length-1,n);a.push(r[0]),r.length>1&&a.push(r[r.length-1]);const s=a.sort(function(o,l){return o.id<l.id?-1:o.id>l.id?1:0});i(s)}const G7=function(t,e,n,i,r,a){if(i<r){let s=0,o=0;const l=e[i],h=e[r];for(let u=i+1;u<r;u++){const c=x9e(t,l,h,e[u]);c>s&&(s=c,o=u)}s>=a&&(n.push(e[o]),G7(t,e,n,i,o,a),G7(t,e,n,o,r,a))}return n},x9e=function(t,e,n,i){const r=Math.abs(W3(t,e,n)),a=Math.abs(W3(t,e,i)),s=Math.abs(W3(t,n,i)),o=(r+a+s)/2;return Math.sqrt(Math.abs(o*(o-r)*(o-a)*(o-s)))*2/r},W3=function(t,e,n){const i=e.latitude,r=n.latitude,a=e.longitude,s=n.longitude,o=t.getPixelFromCoordinate([a,i]),l=t.getPixelFromCoordinate([s,r]);return Math.sqrt(Math.pow(l[0]-o[0],2)+Math.pow(l[1]-o[1],2))};var ZV=function(t){let e=0;for(let n=0,i=t.length-1;n<i;++n)t[n+1]&&(e+=Math.sqrt(Math.pow(t[n+1][0]-t[n][0],2)+Math.pow(t[n+1][1]-t[n][1],2)));return e};function w9e(t){let e=t.getHours(),n=t.getMinutes(),i=t.getSeconds();const r=t.getFullYear();let a=t.getMonth(),s=t.getDate();return e<10&&(e="0"+e),n<10&&(n="0"+n),i<10&&(i="0"+i),a=a+1,a<10&&(a="0"+a),s<10&&(s="0"+s),r+"-"+a+"-"+s+" "+e+":"+n+":"+i}function b9e(t,e){const n=new pn({geometry:new Kt(t)});return n.setStyle(new ft({image:new xi(e.carIcon)})),n}function S9e(t,e,n){const i=[],r=new Jt({source:new si});return t.getView().getZoom()>=n&&XV(t,e,n,i,r),t.on("moveend",function(a){t.getView().getZoom()>=n?XV(t,e,n,i,r):r.getSource().clear()}),r}function XV(t,e,n,i,r){i=[],r.getSource().clear();for(let u=0;u<e.length;u++){const c=e[u],f=t.getPixelFromCoordinate(c.position);if(!Qi(t.getView().calculateExtent(),c.position))continue;const d=/[\u4e00-\u9fa5]/g,g=c.text.match(d)?c.text.match(d).length:0,p=c.text.length-g,v=g*15+p*8,m=f[0]+10,y=f[0]+v+20,_=f[1]-32,w=f[1]-12,S=[m,parseInt((_+w)/2)],b={x:m,y:_},x={x:y,y:w},T=f[0]-v-20,C=f[0]-10,A=f[1]-32,M=f[1]-12,E=[C,parseInt((A+M)/2)],R={x:T,y:A},P={x:C,y:M},I=f[0]-v-20,L=f[0]-10,D=f[1]+12,F=f[1]+32,G=[L,parseInt((D+F)/2)],B={x:I,y:D},z={x:L,y:F},k=f[0]+10,O=f[0]+v+20,N=f[1]+12,U=f[1]+32,j=[k,parseInt((N+U)/2)],q={x:k,y:N},V={x:O,y:U},$=new fg(b,x),Z=new fg(R,P),K=new fg(B,z),J=new fg(q,V);let Q="rightTop",ee=!0;for(let ie=0;ie<4;ie++){for(let se=0;se<i.length;se++){const fe=i[se];if(ie===0){if(ee=fe.intersects($),!ee)break}else if(ie===1){if(ee=fe.intersects(Z),!ee)break}else if(ie===2){if(ee=fe.intersects(K),!ee)break}else if(ie===3&&(ee=fe.intersects(J),!ee))break}if(ee){ie===0?Q="rightTop":ie===1?Q="leftTop":ie===2?Q="leftBom":ie===3&&(Q="rightBom");break}}var a,s,o,l,h;if(ee)Q==="rightTop"?(i.push($),h=S,a=m,s=_,o=y,l=w):Q==="leftTop"?(i.push(Z),h=E,a=T,s=A,o=C,l=M):Q==="rightBom"?(i.push(J),h=j,a=k,s=N,o=O,l=U):Q==="leftBom"&&(i.push(K),h=G,a=I,s=D,o=L,l=F);else continue;const te=t.getCoordinateFromPixel([a,s]),ae=t.getCoordinateFromPixel([o,s]),ye=t.getCoordinateFromPixel([o,l]),oe=t.getCoordinateFromPixel([a,l]),ge=new pn({geometry:new Bi([te,ae,ye,oe])});r.getSource().addFeature(ge),h=t.getCoordinateFromPixel(h);const _e=new pn({geometry:new Zt([c.position,h])});r.getSource().addFeature(_e),r.setStyle(new ft({fill:new xt({color:"rgb(26,58,91)"}),stroke:new Dt({color:"rgb(26,58,91)"}),text:new nr({font:"16px sans-serif",text:c.text,fill:new xt({color:"#000"}),offsetX:0,offsetY:1})}))}}function fg(t,e){this.min=t,this.max=e}fg.prototype.intersects=function(t){const e=this.min,n=this.max,i=t.min,r=t.max;return r.x<=e.x||i.x>=n.x||r.y<=e.y||i.y>=n.y};function YV(t,e){const n=xh(t),i=xh(e);return V0(n,i)}const T9e=function(t){let{map:e,paths:n,id:i,opts:r,vacuate:a,smokeMode:s,tracePointsModePlay:o,vacuateDistance:l,labelShow:h,labelStyle:u,showTracePoint:c}=t;r.id=i||$e(),r.changeCarRotate=t.changeCarRotate,r.centerAtCar=t.centerAtCar;let f=n,d,g=e.getView().getZoom();return a?B7(e,n,l,s,function(p){f=p,d=new wt(e,n,f,a,o,h,u,c,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d=new wt(e,n,f,a,o,h,u,c,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()),d.setPaths=function(p){n=p,d.arrowsLayer.getSource().clear();for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d.traceLayer.getSource().clear(),d.tracePassLayer.getSource().clear(),d.stop(),g=e.getView().getZoom(),a?B7(e,n,l,s,function(v){f=v,d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d._pathInfo=n,d._vacuatePath=n,d._wholePathInfo=n,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows())},d.clearPaths=function(){d._path=[],n=[],d.arrowsLayer.getSource().clear(),d.tracePassLayer.getSource().clear();for(let p=0;p<d._timeOverlayList.length;p++)e.removeOverlay(d._timeOverlayList[p]);d.traceLayer.getSource().clear(),this.carLayer.getFeatures().length>0&&this.carLayer.removeFeature(this.carMarker),typeof this.textLayer!="undefined"&&e.removeLayer(this.textLayer)},e.getView().on("change:resolution",function(){if(n.length!==0&&(g=e.getView().getZoom(),d.arrowsLayer.getSource().clear(),Math.round(g)===g))if(d._initFlag=2,d.createArrows(),a)B7(e,n,l,s,function(p){f=p;for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()});else{for(let p=0;p<d._timeOverlayList.length;p++)e.removeOverlay(d._timeOverlayList[p]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()}}),d},C9e={name:"v-track",render(t,e){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${$e()}`}},paths:{type:Array,default(){return[]}},tracePointsModePlay:{type:String,default:"animation"},smokeMode:{type:String,default:"distance"},vacuate:{type:Boolean,default:!1},vacuateDistance:{type:[Number,void 0],default:10},labelShow:{type:Boolean,default:!1},showTracePoint:{type:Boolean,default:!0},changeCarRotate:{type:Boolean,default:!1},centerAtCar:{type:Boolean,default:!1},options:{type:Object,default(){return{}}},autoPlay:{type:Boolean,default:!1},labelStyle:{type:String,default:"timeContentClass"}},data(){return{track:null}},computed:{map(){return this.VMap.map}},watch:{paths:{handler(t){this.init(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.track.dispose(),this.track=null},methods:{init(t){if(t&&t.length>0||this.paths&&this.paths.length>0){const e=Je(De({},this.$props),{map:this.map,paths:t||this.paths,opts:this.options});this.track=T9e(e),this.$emit("onLoad",this.track),this.autoPlay&&this.start()}},start(){this.track.start()},pause(){this.track.pause()},stop(){this.track.stop()},dispose(){this.track.dispose()}}};let A9e,M9e;const KV={};var JV=qn(C9e,A9e,M9e,!1,E9e,null,null,null);function E9e(t){for(let e in KV)this[e]=KV[e]}JV.options.__file="src/components/track/index.vue";const dg=function(){return JV.exports}();dg.install=t=>{t.component(dg.name,dg)};var QV={exports:{}};(function(t){(function(){function e(o,l){var h=o.x-l.x,u=o.y-l.y;return h*h+u*u}function n(o,l,h){var u=l.x,c=l.y,f=h.x-u,d=h.y-c;if(f!==0||d!==0){var g=((o.x-u)*f+(o.y-c)*d)/(f*f+d*d);g>1?(u=h.x,c=h.y):g>0&&(u+=f*g,c+=d*g)}return f=o.x-u,d=o.y-c,f*f+d*d}function i(o,l){for(var h=o[0],u=[h],c,f=1,d=o.length;f<d;f++)c=o[f],e(c,h)>l&&(u.push(c),h=c);return h!==c&&u.push(c),u}function r(o,l,h,u,c){for(var f=u,d,g=l+1;g<h;g++){var p=n(o[g],o[l],o[h]);p>f&&(d=g,f=p)}f>u&&(d-l>1&&r(o,l,d,u,c),c.push(o[d]),h-d>1&&r(o,d,h,u,c))}function a(o,l){var h=o.length-1,u=[o[0]];return r(o,0,h,l,u),u.push(o[h]),u}function s(o,l,h){if(o.length<=2)return o;var u=l!==void 0?l*l:1;return o=h?o:i(o,u),o=a(o,u),o}t.exports=s,t.exports.default=s})()})(QV);const R9e=QV.exports;class Z3{constructor(e,n){Ze(this,"min",{x:0,y:0});Ze(this,"max",{x:0,y:0});this.min=e,this.max=n}intersects(e){const n=this.min,i=this.max,r=e.min,a=e.max;return a.x<=n.x||r.x>=i.x||a.y<=n.y||r.y>=i.y}}class I9e extends Jt{constructor(n){var a,s;const i=Object.assign({},n);delete i.map;super(i);Ze(this,"map",null);Ze(this,"pointsArr",[]);Ze(this,"zoom",1);Ze(this,"textBounds",[]);Ze(this,"styleOptions",{fillColor:"rgb(26,58,91)",strokeColor:"rgb(26,58,91)",textColor:"white",fontCss:"bolder 15px sans-serif",boxWidth:50});Ze(this,"textViewCom",[]);this.map=n.map?n.map:this.map,this.pointsArr=n.pointsArr?n.pointsArr:this.pointsArr,this.zoom=n.zoom?n.zoom:this.zoom,this.styleOptions=n.styleOptions?n.styleOptions:this.styleOptions,((a=this.map)==null?void 0:a.getView().getZoom())>=this.zoom&&this.drawText();const r=this;(s=this.map)==null||s.on("moveend",o=>{var l;((l=r.map)==null?void 0:l.getView().getZoom())>=r.zoom?(r.drawText(),r.keepVisible()):r.clear()})}getLayerStatesArray(n){}getLayersArray(n){}getSourceState(){}drawText(){var s;const n=this.styleOptions;this.getSource().clear();const r=document.createElement("canvas").getContext("2d");n.fontCss&&(r.font=n.fontCss);const a=[];(s=this.map)==null||s.once("postrender",()=>{this.pointsArr.forEach(o=>{var u,c,f,d,g,p,v;const l=i0(o.position,"EPSG:3857"),h=(u=this.map)==null?void 0:u.getPixelFromCoordinate(l);if(Qi((c=this.map)==null?void 0:c.getView().calculateExtent(),l)){o.text=o.text||"";let m=n.boxWidth||Math.ceil(r.measureText(o.text).width);m+=30;const y=h[0]+10,_=h[0]+m,w=h[1]-40,S=h[1]-10,b=[y,Number(((w+S)/2).toFixed(0))],x={x:y,y:w},T={x:_,y:S},C=new Z3(x,T),A=h[0]-m,M=h[0]-10,E=h[1]-40,R=h[1]-10,P=[M,Number(((E+R)/2).toFixed(0))],I={x:A,y:E},L={x:M,y:R},D=new Z3(I,L),F=h[0]-m,G=h[0]-10,B=h[1]+10,z=h[1]+40,k=[G,Number(((B+z)/2).toFixed(0))],O={x:F,y:B},N={x:G,y:z},U=new Z3(O,N),j=h[0]+10,q=h[0]+m,V=h[1]+10,$=h[1]+40,Z=[j,Number(((V+$)/2).toFixed(0))],K={x:j,y:V},J={x:q,y:$},Q=new Z3(K,J),ee={bound:C,minx:y,miny:w,maxx:_,maxy:S,polylineCenter:b},te={bound:D,minx:A,miny:E,maxx:M,maxy:R,polylineCenter:P},ae={bound:U,minx:F,miny:B,maxx:G,maxy:z,polylineCenter:k},ye={bound:Q,minx:j,miny:V,maxx:q,maxy:$,polylineCenter:Z},oe=new Map([["rightTopBounds",ee],["leftTopBounds",te],["leftBomBounds",ae],["rightBomBounds",ye]]);let ge=!0,_e=0,ie=0,se=0,fe=0,W=[0,0],X="";for(const[Pe,Re]of oe){for(let Ie=0;Ie<this.textBounds.length&&(ge=this.textBounds[Ie].intersects(Re.bound),!!ge);Ie++);ge&&(X=Pe)}if(!ge)return;for(const[Pe,Re]of oe)Pe===X&&(this.textBounds.push(Re.bound),W=Re.polylineCenter,_e=Re.minx,ie=Re.miny,se=Re.maxx,fe=Re.maxy);const ne=xr((f=this.map)==null?void 0:f.getCoordinateFromPixel([_e,ie]),"EPSG:3857","EPSG:4326"),he=xr((d=this.map)==null?void 0:d.getCoordinateFromPixel([se,ie]),"EPSG:3857","EPSG:4326"),le=xr((g=this.map)==null?void 0:g.getCoordinateFromPixel([se,fe]),"EPSG:3857","EPSG:4326"),ue=xr((p=this.map)==null?void 0:p.getCoordinateFromPixel([_e,fe]),"EPSG:3857","EPSG:4326"),ce=new Bi({path:[ne,he,le,ue],strokeColor:n.strokeColor,fillColor:n.fillColor});ce.getStyle().setText(new Text({font:n.fontCss,fill:new xt({color:n.textColor}),offsetY:.5,text:o.text})),this.addFeature(ce);const pe=xr((v=this.map)==null?void 0:v.getCoordinateFromPixel(W),"EPSG:3857","EPSG:4326"),xe=new Zt({path:[o.position,pe],strokeColor:n.strokeColor});this.addFeature(xe),a.push({textBack:ce,polyline:xe,text:o.text})}this.set("textComponent",a)})})}keepVisible(){var n;if(this.textViewCom=this.get("invisible"),this.textViewCom instanceof Array)for(let i=((n=this.textViewCom)==null?void 0:n.length)-1;i>=0;i--){const r=this.textViewCom[i];this.textVisibility(r.text,!1)}}textVisibility(n,i){var o,l,h,u,c;const r=this.getObjectByText(n);this.textViewCom=this.get("invisible");let a=!1,s=0;if(this.textViewCom instanceof Array)for(let f=((o=this.textViewCom)==null?void 0:o.length)-1;f>=0;f--){const d=this.textViewCom[f];n===d.text&&(a=!0,s=f)}if(r.length>0)for(let f=r.length-1;f>=0;f--){const d=r[f];if(!i)this.textViewCom instanceof Array?!a&&this.textViewCom.push(d):this.set("invisible",[d]),(l=d.textBack)==null||l.setVisible(i),(h=d.polyline)==null||h.setVisible(i);else if(this.textViewCom instanceof Array&&a){this.textViewCom.splice(s,1);const g=this.getObjectByText(d.text);for(let p=g.length-1;p>=0;p--)(u=g[p].textBack)==null||u.setVisible(i),(c=g[p].polyline)==null||c.setVisible(i)}}else i?a&&this.textViewCom.splice(s,1):this.textViewCom instanceof Array?!a&&this.textViewCom.push({text:n}):this.set("invisible",[{text:n}])}getObjectByText(n){const i=this.get("textComponent"),r=[];for(let a=(i==null?void 0:i.length)-1;a>=0;a--){const s=i[a];s.text===n&&r.push(s)}return r}}class P9e{constructor(e){Ze(this,"_operators");Ze(this,"_carIcon");Ze(this,"_direction");Ze(this,"_map");Ze(this,"_status");Ze(this,"_pathInfo");Ze(this,"_bubble");Ze(this,"_moving");Ze(this,"_tracePointsModePlay");Ze(this,"_lineLayer");Ze(this,"_movePath");Ze(this,"_originPath");Ze(this,"_revealLayer");Ze(this,"_showTracePoint");Ze(this,"_nodesLayer");Ze(this,"_moveNodes");Ze(this,"_timeStep");Ze(this,"_speed");Ze(this,"_speedUp");Ze(this,"_nowTime");Ze(this,"_moveIdx");Ze(this,"_animateLayer");Ze(this,"_animateLine");Ze(this,"_group");Ze(this,"_tracekEvent");Ze(this,"_simplifyEvent");Ze(this,"_eventType");Ze(this,"_animateStart");Ze(this,"_textLayer");Ze(this,"_moveListener");Ze(this,"_step");Ze(this,"_viewCode");Ze(this,"_defaultStyles");Ze(this,"_nodesCollection");Ze(this,"_nodeInfos");var f;e=e||{};const n=e.bubble!==void 0?e.bubble:!1,i=e.showTracePoint?e.showTracePoint:!1,r=e.tracePointsModePlay?e.tracePointsModePlay:"animation",a=e.mapObj!==void 0?e.mapObj:null,s=e.path!==void 0?e.path:[],o=e.options||{},l=Date.now();!e.path||e.path.length<1,this._operators={carIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAVCAYAAADfLRcdAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkQ0RkExMTQ2Rjc4NzExRTQ4QkI3QTA2OTk3QzQ4M0IzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkQ0RkExMTQ3Rjc4NzExRTQ4QkI3QTA2OTk3QzQ4M0IzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDRGQTExNDRGNzg3MTFFNDhCQjdBMDY5OTdDNDgzQjMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDRGQTExNDVGNzg3MTFFNDhCQjdBMDY5OTdDNDgzQjMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz62sMp6AAAFiklEQVR42tRXW2wUVRj+zpmZvc4uS2mhhQK21FLshoKGWkBMSAwQSVBf0QfiJciDLya+8KAx8RJfeJV440GJaDAmGGKUmAASI+GhDQ1a7t1Kb1tot7s7uzvX4z8zC+12bdHVkDjJn5md/c853/nO918GeEDXkfe2f5+9+KzxxeuQap2D/RPn5BO7Aowxns/n9Ju958Q8PjL5yIxz4+KZk86spRLG5Y1T/Zfbf31sz7HN/xqsuIo4THwgStgr8lBtDcwxwQxa0rKB4WkFBcOGpgNSwIFusYoJjv0ATOQYdm9lWBQX4Iz2I8iDxhsGMDSm4mx/FJ3LR/HWi4ASokEmmeYj4UG6K/Tock9jSjxRjG/PRCrADn4SHVi8ttTOGM0sHAguIRKyCSlgF4HsOPDxKY7T4zvQ3NqFYmYSsbp6BEKhe0Bt08LR41/CsSzse34fZEWBbdPGtCxKWhoxeQiNketIhHOYyEgYGAqgc/UU3n5VgbA5iBQyAccWYLKCYLOCnLmLNrhNJHte5h7Ys/ubIlsPjGp3F/3tViOefEVCOCJjSYKjqZ6jdTnwdI+Fp5IppCaAvmsKxiZlondGCYQLJ34S2Ngp0LMBqFMFHmmxUb+U4+DhNpz4WYIlhWgTAWKIAHGOyVQKR98dx45uYoXTKZGRA/S0BT1n+6cd74G8qNlRO76WmNXLHI/R8nXom7U4eqENJdNAUSczdJR0HW/s1HDwhavehMIDx2BbtChj4Ip7hvDeuyYp7pHSe9l//8yBNTh/MwhOALnrf/fu2GhWBnDms+IMWMk1eOM8IxVYsV2QMl9F+Wyg7tV3hTxZZdw5BHZLlzEjdJpEJn0FVeaZEvYtEPF/yyECMivm9+6hDdoOLJKKSTIxPLNh0USXLnN6XiCqluiQE9Ok5dXTfO5/wxN2lb9D7LYtz9ectjat1wioQSdhklmkTdN7NuguB6O4cInhdobPM9oNnAFg1UtSlUc2J+5FuEuw+yyIBTVUqBnsyiYNsUiUpOOza7msEmg3KCUKxOvDAvUJZ/4JBKUlnmdVYHXzL9KnEEioVs1gFbmIjofbEVdjPleOQ8zaHruCIIxO3C/du/nNgDz3tUWpIzAnATNKZ6SFKi3/7UuYXgA9vqkbBun/xuAgbo0OwyESbLKcJhauT+765FIFVuaiapi7e/CAv2hNpUchEhxkclliWcGa1lY82rXBA/Hdt8cxli5XgXnHc28vVWCDgWqhu+kpk5eRiNYG1rTCsOjohRtYrgQoZVmZKciyjKYlDejZOHyfyk+5kM67CllcZeWBvrlAGU2aL0Vq1uwfo1EPbIlqrmGY0F0z3WfK41oOHQ8tlA1cGFE6BFVUeaxcVj2IB4O4NqLWDPb8RZU2WyKAZZBkJQJsUoAVs5Po7lwoGxAeaR01Fp/aXAhWEf5d7Y4X/XPBnusLVOjdomZGzwvPzKJvRsH/bZXcGj8z/sPjEeSKBWJU98B6DNN9enwMmzflEJDn32hxiMOciJKWUovkXw43qrN7g53dWbx/pB/hsIS6ONBRz9DSBGxoc+u1QCot0HtNxshtmbojp6I3OHmaoWudg571lOpiDpKtDhoaOVqWljB+I0xlWYFpu5o1vPSlpdM49OYcRnkchdQUrHLBVBq2UOgpDu9Cwe+6Dsf765Jap9fPubRJ1MgEK7uuj04xfN6XBFOXUe9WBAuGPS3fY5vQ3kmPeRVq6YqVVG4l74Qc26Tw0NCcyCC54g4a4yZ+H4njythibGm5gndeo+ChVtM2yl0XrRmKUC1vYDD4Hmjmc6Ju1W5eUz+rUT9bmK+f/ZH62eycfrbsQRL1+9le6mebqZ/dT6xF3XMmm/KlyWNelvMbGPK3pfpieNvtyP/yS+GBXf/FN9ifAgwAIOzB+qcKmLcAAAAASUVORK5CYII=",speed:1e3,timeStep:1,startIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADb0lEQVRYR8WWW4jcZBzFz8lukn1Si5fOjKK20NmEKtoFL+C1IBX0RQQFQeoiIipeHnxQCioURPBJhQo+yFJFEfRFKIKIN1wKFZGqtJPZbgtFTWa7i1LFy+bbyZHsztJ1MpkkI9I85vufc375/798CXGWL57lfFQDENgw/g4Qt0loQroE5CKl410r+WphPJkF55erPFQ5AMFuGO8RiU+TuCwvQNAioWdDuz0DQmVACgE2aeu5E8Y9QODGMoZpjaSP6fx2d8jwzyLNcADBrht/lsC1RUYD1g//ZS/f+itPnB6mHQpQj71XCT45QnhPooOhHdwEIsnzyAXYrMktluExgmODxJIiED8D2JFXszaO5P7Ibb9TGaAee28QfLhfKGhJ1L0du/15ura2R+xpgHsJnpMJkuZCN5isBiCMNYy/mPr3CeNEnOq4R4/0G9bi5jWEdYhgpquJzPaOO390EMTAEVwgr+kYtrMC7Qud4PG8p6nH3rsE7+tfT5A82HHaM6UB6sa/mcKX2fZjd+S03s4DqMXetAVmgkTtiezgpdIANTO505L12QDBQ6HTejMfwN9tAfsz4FUBGtp6KYx7csAI3gudINPi9bpa7L1mgU9kRmDhzs5466PSHUgLG8v+HIhtG0WC1JWuPuW2v+836+2bHwA4/9bAJPYvmxa48EclgLrx9lB8cUAXTgt6/m/b7F8/5WrGu4XC+wQvzLRf+DByW3dVew0BXKQtm8fMxE8ExgceRFAXwGEIDZL1vIAE3es6ztzXlQFWxxB7MwCn88RF9wV9EjnBrmF1Q78F6WaUcU4MO2qHmXexcv2Cc+zQyABrXfD3AXis6Gmzs9cHkRvcU6Qr/B+4WN75MpwHcF6R2Zl1LcM220Ie/7FIUwiQGtTiyUctWK8Xma2vJ9QLHTvYW6a+FAAE1o33DcGpQlOpHTrBFSBWCmuB8j+ljdifEpRCDIVOqJ0dO/iiTHhaU64DPbd67L9C4Kk8c0FvRU7wQNnwygDQ5RONeOI7kM0BJ95J4yRXLrH9+/8HkJ6QcfOqMVjfErQ2Bq1QN5yyg4NVwqt3oOdeM/5zlnBmlwsvh27rmarhIwOsvhWxf4DEHQA+De3W7SDSb0Plq9Im3Oi+9jPqzBqbu5bYiion9wQjA6zqtd0Bj8Sjho8+gv+S2Kf9B1+VRDBEEbAnAAAAAElFTkSuQmCC",endIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADdElEQVRYR8WWXYjcVBiG3zfJGb1oq4todXZnVOpsMlbRLtQK1p+CVNAbERQEqUVEVPy58EIpqFAQwasqVOhFWdrSIuiNUAQR/3ApVIr0hzozu93KJtktsgWRxeLmJPlKho52JzOTZIo2t+d7v/c5b76cHOIqP7zK/igEIADPlNWGyJBHQY4DHANlUcBZI4p/MubDqRqwXGRTuQAEUM0x9TIMvkXg1r4GIosA3rE9PUlA8oBkAsyO4Dq9Sh0GuTlPw3aN4Os1UfBUeQEXsjQDAZKdtypqCuR9WY3S63JcLelH1v2BPwdpBwI0q+pjgG8UN+8o5Ijt6gcJxP169AVorsXtKKkZkGYvsQDnKDIPYEO/mrYuxnOOHxwsDNCoqj0EX0oJRc4jlmec+fD7ZK09I6vVdgA7Aa7prhfBdN0L7EIAApjNqlokOHK5UCCBBU7U3OB0d8NWRW0U4CjIVKomsL7mBr/2guj5ChqjGKdZaqV3I7vrnn6t324aFXWI5LM9UnvB8fRkboDpivVQTOPHbgEh22xXHxgAsJ1kykgQ76i74Ye5AZqj1haYxncpQSwvOr7e2w+gVVXbBNyXSq4owGwZVW2V5nq8gs/qnk5HfKmwVVWfCPh6Krk4esL2o69yJ5AUNiqlaRK1FSIRgfBexw9OdjdL5gamOkWw1DW4emRZj9z8O/4qCGDtII0P0iJJTrb31JLe1znlZsashyPyc5A3pgcQXzpe8GShzzApPnsT1i5fo3ySVk+xSCTEcYBlArf0NYhlk+3rnwsDJIJWRU0KmRwyQz0i8k3d01sHiQf+C9rDaKqzA4/aAd2NWO4f9/XRoQESYbOidoN8dYgIvnDc4OksXeZ9oDGKG2iqMwCvz2r277osW6Gu3bEAL0uTCXAphVdAfprVrLPOOH7f9sOdeepzASR3wWZVHSM4kaNpy3aDuwiEOWrzX0pnymoiMnGs199uxcETx1vqfvhDHvOkJlcCnWbNMbULBt/s11xE9tc9/Xxe88IAv92Ga/+OSidIjHebCDDHC8Hdznks/WcA7cNpVN0jBn4BaayIPowfqC+ER4qYF07gn1dRsd4Fjcun/CPHDd4uaj40QPJVtKqlwwAeB+Rb29WPEYj+N4DEKLmMBqvUlBh6651zODeM+dAJdMxOA6X1QDCs+RUDXIlxR3sRcjswMD6XvKYAAAAASUVORK5CYII=",showInfoWin:!1,arrowPixel:.2,textStyle:{}};for(const d of Object.keys(this._operators))o[d]&&(this._operators[d]=o[d]);const h=new xt({color:"rgba(255,255,255,0.4)"}),u=new Dt({color:"#3399CC",width:1.25});this._defaultStyles=[new ft({image:new ai({fill:h,stroke:u,radius:5}),fill:h,stroke:u})],this._nodesCollection=null,this._nodeInfos=[];const c=new xi({src:this._operators.carIcon,scale:1,anchor:[.5,.5],offset:[0,0]});c.load(),this._carIcon=new ft({image:c}),this._direction=0,a&&(this._map=a),this._viewCode=(f=this._map)==null?void 0:f.getView().getProjection().getCode(),this._status="stop",this._pathInfo=s,this._bubble=n,this._moving=!1,this._tracePointsModePlay=r,this._lineLayer=new Jt({source:new si({features:[],strategy:T0}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._lineLayer.set("projection",this._viewCode,!0),this._lineLayer.set("track-type","trackPath"),this._movePath=[],this._originPath=null,this._revealLayer=new Jt({source:new si({features:[],strategy:T0}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._revealLayer.set("projection",this._viewCode,!0),this._revealLayer.set("track-type","trackReveal"),this._showTracePoint=i,this._nodesLayer=new Jt({source:new si({features:[],strategy:T0}),style:null,properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._nodesLayer.set("projection",this._viewCode,!0),this._nodesLayer.set("track-type","trackNodes"),this._nodesLayer.setVisible(this._showTracePoint),this._moveNodes=[],this._speed=this._operators.speed,this._timeStep=this._operators.timeStep,this._speedUp=1,this._nowTime=null,this._moveIdx=1,this._animateLayer=new Jt({source:new si({features:[],strategy:T0}),style:new ft({stroke:new Dt({color:"red",width:2})}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._animateLayer.set("projection",this._viewCode,!0),this._animateLayer.set("track-type","trackAnimate"),this._animateLine=new Wn({geometry:new Zt([])}),this._group=new Xc({layers:[this._lineLayer,this._revealLayer,this._nodesLayer,this._animateLayer],zIndex:99,properties:{type:"vzTrackPath",vzTime:l}}),a==null||a.addLayer(this._group),this._tracekEvent=a==null?void 0:a.on(["singleclick","pointermove"],d=>{this.eventListener(d)}),this._eventType=["nodeClick","nodeMouseover","nodeMouseout","pathClick","pathMouseover","pathMouseout","move"],this._simplifyEvent=a==null?void 0:a.getView().on("change:resolution",d=>{Number.isInteger(d.target.getZoom())&&this.simplifyOpera(d)}),this.initLinesAndMarkers()}simplifyOpera(e){var u,c;let n=[];const i=e.target.getProjection().getCode(),r=this._viewCode!==i,a=e.target.getResolution();n=this._nodesCollection.map(f=>{var g;if(r&&f.get("isSimplify")===!1){const p=(g=f.getGeometry())==null?void 0:g.transform(this._viewCode,i);p instanceof Kt&&f.setGeometry(p)}const d=f.getGeometry().getCoordinates();return{x:d[0]/a,y:d[1]/a,idx:f.get("node_idx")}}),r&&(this._viewCode=i);const s=R9e(n,2,!1),o=[],l=[];s.forEach(f=>{o.push([f.x*a,f.y*a]),l.push(f.idx)}),this._originPath instanceof Zt&&this._originPath.setCoordinates(o),!this._moving&&this._status!=="moving"&&this._moveListener!==null&&this._tracePointsModePlay==="animation"&&this._originPath instanceof Zt&&((u=this._animateLine.getGeometry())==null||u.setCoordinates(o.slice(0,l.indexOf(this._moveIdx)+1).concat([this._animateStart.getGeometry().getCoordinates()]))),(c=this._nodesLayer.getSource())==null||c.clear(),new Promise((f,d)=>{var g;this._nodeInfos=[],this._nodesLayer.getVisible()&&((g=this._nodesCollection)==null||g.forEach((p,v)=>{p.set("isSimplify",!1),p.setStyle(null),l.includes(v+1)&&(p.set("isSimplify",!0),p.setStyle(this._defaultStyles),this._nodeInfos.push(p))})),f(this._nodeInfos)}).then(f=>{var d;(d=this._nodesLayer.getSource())==null||d.addFeatures(f)})}eventListener(e){var i,r,a,s,o,l,h,u,c;if((i=this._map)==null?void 0:i.hasFeatureAtPixel(e.pixel,{layerFilter:function(f){return f instanceof Jt&&(f.get("track-type")==="trackPath"||f.get("track-type")==="trackNodes")},hitTolerance:0})){this._moveNodes=((r=this._map)==null?void 0:r.getFeaturesAtPixel(e.pixel,{layerFilter:function(g){return g instanceof Jt&&g.get("track-type")==="trackNodes"},hitTolerance:0}))||[],this._movePath=((a=this._map)==null?void 0:a.getFeaturesAtPixel(e.pixel,{layerFilter:function(g){return g instanceof Jt&&g.get("track-type")==="trackPath"},hitTolerance:0}))||[];const f=this._moveNodes.map(g=>g.getProperties()),d=this._movePath.map(g=>g);switch(e.type){case"singleclick":f.length>=1&&((s=this._map)==null||s.dispatchEvent({type:"nodeClick",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})),d.length>=1&&((o=this._map)==null||o.dispatchEvent({type:"pathClick",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));break;case"pointermove":f.length>=1&&((l=this._map)==null||l.dispatchEvent({type:"nodeMouseover",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})),d.length>=1&&((h=this._map)==null||h.dispatchEvent({type:"pathMouseover",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));break}}else{const f=this._moveNodes.map(g=>g.getProperties());this._moveNodes.length>0&&this._moveNodes.splice(0,this._moveNodes.length),e.type==="pointermove"&&f.length>0&&((u=this._map)==null||u.dispatchEvent({type:"nodeMouseout",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));const d=this._movePath.map(g=>g);this._movePath.length>0&&this._movePath.splice(0,this._movePath.length),e.type==="pointermove"&&d.length>0&&((c=this._map)==null||c.dispatchEvent({type:"pathMouseout",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}))}}initLinesAndMarkers(){var l,h,u,c,f,d;const e=(l=this._pathInfo)==null?void 0:l.map(g=>[g.longitude,g.latitude]),n=[],i=[];let r=0;for(const g of e){const p=new Wn({geometry:new Kt(i0(g,this._viewCode))});let v=null;if(this._pathInfo&&(v=this._pathInfo[r]),v&&(v.node_idx=r+1,v.isSimplify=!1,p.setProperties(v,!0),p.setId("tackNode-"+v.node_idx)),r===0){const m=p.clone();this._animateStart=p.clone(),this._animateStart.setId("moveCarFeature"),m.setStyle(new ft({image:new xi({src:this._operators.startIcon,anchor:[.5,1]}),text:new nr({text:""})})),(h=this._revealLayer.getSource())==null||h.addFeature(m)}else if(this._pathInfo&&r===this._pathInfo.length-1){const m=p.clone();m.setStyle(new ft({image:new xi({src:this._operators.endIcon,anchor:[.5,1]}),text:new nr({text:""})})),(u=this._revealLayer.getSource())==null||u.addFeature(m)}i.push(p),r++}const a=new Zt(e);this._originPath=a.transform("EPSG:4326",this._viewCode);const s=new Wn({geometry:this._originPath}),o=new ft({image:new xi({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",anchor:[.75,.5],scale:.7,rotateWithView:!1})});s.set("arrow",[new ft({stroke:new Dt({color:"rgba(0, 0, 255, 0.6)",width:10})}),o]),s.set("mainView",(c=this._map)==null?void 0:c.getView()),s.setStyle(L9e),n.push(s),(f=this._lineLayer.getSource())==null||f.addFeatures(n),this._nodesCollection=i,(d=this._animateLayer.getSource())==null||d.addFeature(this._animateLine),s.get("mainView")!==void 0&&s.get("mainView").dispatchEvent("change:resolution")}labelVisible(e){var n,i;if(e&&this._textLayer===0){const r=(n=this._pathInfo)==null?void 0:n.map(a=>({position:[a.longitude,a.latitude],text:a.gnssTime}));this._textLayer=new I9e({map:this._map,pointsArr:r,zoom:12}),this._textLayer.set("id","lushuText"+new Date().getTime()),this._group.getLayers().push(this._textLayer)}else(i=this._textLayer)==null||i.setVisible(e)}start(e){var n,i;this._pathInfo&&this._pathInfo.length<1||((this._moving||this._status==="pause")&&this.stop(),this._moveIdx=e||1,this._moving=!0,this._status="moving",this._nowTime=Date.now(),this._tracePointsModePlay==="skip"?(this._moveListener=this._lineLayer.on("postrender",r=>{this.tracePointsPlay(r)}),(n=this._map)==null||n.render()):this._tracePointsModePlay==="animation"&&(this._step=0,this._moveListener=this._lineLayer.on("postrender",r=>{this.animationPlay(r)}),(i=this._map)==null||i.render()))}stop(e){var i,r,a,s;this._moveIdx=1,this._status="stop",this._moving=!1,this._step=0,this._moveListener!==null&&(mr(this._moveListener),this._moveListener=null);const n=(i=this._animateLayer.getSource())==null?void 0:i.getFeatureById("moveCarFeature");n&&((r=this._animateLayer.getSource())==null||r.removeFeature(n)),(a=this._animateLine.getGeometry())==null||a.setCoordinates([]),this._originPath instanceof Zt&&((s=this._animateStart.getGeometry())==null||s.setCoordinates(this._originPath.getFirstCoordinate()))}pause(){this._status="pause",this._moving=!1}resume(){this._status="moving",this._moving=!0}tracePointsPlay(e){var a,s,o,l,h;const n=e.frameState,i=this._nodesCollection.map(u=>u.getGeometry().getCoordinates()),r=(n.time-this._nowTime)/1e3%60;if(this._moving&&(this._moveIdx===1||r>=this._timeStep)){this._nowTime=n.time;let u=this._moveIdx===1?this._speedUp:this._moveIdx+this._speedUp,c=null;const f=this._animateLine.getGeometry();if(i&&this._moveIdx===i.length){this.stop(!0);return}if(u>=i.length&&this._moveIdx<i.length){u=i.length;let v=null;i&&(v=new Wn(new Kt(i[u-1]))),c=v;const m=i[u-1][0]-i[u-2][0],y=i[u-1][1]-i[u-2][1],_=Math.atan2(y,m);this._direction!==_&&(this._direction=_),this._carIcon.getImage().setRotation(-this._direction+2*Math.PI);for(let w=i.length-this._moveIdx;w>0;--w)u!==0&&u-w<=i.length-1&&(f==null||f.appendCoordinate(i[u-w]))}else if(u<i.length&&this._moveIdx<i.length){let v=null;if(i&&(v=new Wn(new Kt(i[u-1]))),c=v,i&&u!==i.length-1){const m=i[u][0]-i[u-1][0],y=i[u][1]-i[u-1][1],_=Math.atan2(y,m);this._direction!==_&&(this._direction=_),this._carIcon.getImage().setRotation(-this._direction+2*Math.PI)}for(let m=this._speedUp;m>0;--m)u!==0&&u-m<=i.length-1&&(f==null||f.appendCoordinate(i[u-m]))}this._animateStart.setStyle(this._carIcon),this._animateStart.getGeometry().setCoordinates((a=c==null?void 0:c.getGeometry())==null?void 0:a.getCoordinates());const d=(s=this._animateLayer.getSource())==null?void 0:s.getFeatureById("moveCarFeature");(!d||d.length<=0)&&((o=this._animateLayer.getSource())==null||o.addFeature(this._animateStart)),this._moveIdx=u;const g=(l=this._map)==null?void 0:l.getView().getProjection().getCode(),p={index:this._moveIdx,status:this._status,position:i[u-1],lngLat:Xp(this._animateStart.getGeometry().getCoordinates(),g),passNode:this._nodesCollection[u-1],length:f==null?void 0:f.getLength()};this._animateLayer.dispatchEvent({type:"move",target:p,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})}(h=this._map)==null||h.render()}animationPlay(e){var i,r,a,s;let n=0;if(this._nowTime=e.frameState.time,this._originPath instanceof Zt&&this._moving&&this._step!==void 0&&this._step<=1){const o=this._originPath.clone();o.transform(this._viewCode,"EPSG:3857");const l=o.getLength(),h=this._animateLine.getGeometry(),u=this._originPath.clone();if(u instanceof Zt&&this._step!==0){const m={geometry:{coordinates:u.getCoordinates(),type:"LineString"},properties:{},type:"Feature"};n=l*this._step;const y=GJ(m,0,n/1e3,{units:"kilometers"});u.setCoordinates(y.geometry.coordinates),u.transform("EPSG:4326",this._viewCode);const _=u.getCoordinates();h==null||h.setCoordinates(_);let w=0,S=0;if(_.length>2){const x=_[_.length-2],T=_[_.length-1];w=x[0]-T[0],S=x[1]-T[1];const C=Math.atan2(S,w);this._direction!==C&&(this._direction=C),this._carIcon.getImage().setRotation(-this._direction+Math.PI)}this._animateStart.setStyle(this._carIcon),this._animateStart.getGeometry().setCoordinates(u.getLastCoordinate());const b=(i=this._animateLayer.getSource())==null?void 0:i.getFeatureById("moveCarFeature");(!b||b.length<=0)&&((r=this._animateLayer.getSource())==null||r.addFeature(this._animateStart))}const c=h==null?void 0:h.getLength();let f=0,d=0;const g=new Zt([]);this._originPath.forEachSegment(function(m,y){g.setCoordinates([m,y]),d<=c&&(d+=g.getLength(),f++)}),this._moveIdx=this._nodeInfos[f-1].get("node_idx"),this._step+=5*1e-7*this._speed;const p=(a=this._map)==null?void 0:a.getView().getProjection().getCode(),v={index:this._moveIdx,status:this._status,speed:this._speed,position:this._animateStart.getGeometry().getCoordinates(),lngLat:Xp(this._animateStart.getGeometry().getCoordinates(),p),passNode:this._nodesCollection[this._moveIdx-1],length:c};this._animateLayer.dispatchEvent({type:"move",target:v,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})}if(this._moving&&this._step&&this._step>=1){this.stop(!0);return}(s=this._map)==null||s.render()}setFitView(e){var n;this._originPath!==null&&this._originPath instanceof Zt&&e&&((n=this._map)==null||n.getView().fit(this._originPath))}getPaths(){return this._pathInfo}setPaths(e){this.clearPaths(),this._pathInfo=e,this.initLinesAndMarkers()}clearPaths(){this._moving&&this.stop(),this._group.getLayersArray().forEach(e=>{e instanceof Jt&&e.getSource().clear()})}destroy(){var e;this._moving&&this.stop(),this.clearPaths(),mr(this._tracekEvent),(e=this._map)==null||e.getView().removeEventListener("change:resolution",this._simplifyEvent.listener)}getSpeed(){return this._speed}setSpeed(e){this._speed=e}getSpeedUp(){return this._speedUp}setSpeedUp(e){this._speedUp=e,this._speed=this._speed*e}getPercentnum(){return typeof this._step=="number"?this._step.toPrecision(3):0}setPercentnum(e){typeof e=="number"&&e<=1&&e>=0&&(this._step=e)}setTraceLineStyle(e){var a;e=e||{};const n=e.lineColor?e.lineColor:"rgba(0, 0, 255, 0.6)",i=e.lineWidth?e.lineWidth:10,r=(a=this._lineLayer.getSource())==null?void 0:a.getFeatures();r==null||r.forEach(s=>{s.get("arrow")[0].setStroke(new Dt({color:n,width:i}))}),this._lineLayer.changed()}setPassLineStyle(e){e=e||{};const n=e.lineColor?e.lineColor:"red",i=e.lineWidth?e.lineWidth:2,r=new ft({stroke:new Dt({color:n,width:i})});this._animateLayer.setStyle(r),this._animateLayer.changed()}setTraceNodeStyle(e){var l;e=e||{};const n=e.fillColor?e.fillColor:"rgba(255,255,255,0.4)",i=e.lineColor?e.lineColor:"#3399CC",r=e.lineWidth?e.lineWidth:1.25,a=e.size?e.size:5,s=new xt({color:n}),o=new Dt({color:i,width:r});this._defaultStyles=[new ft({image:new ai({fill:s,stroke:o,radius:a}),fill:s,stroke:o})],(l=this._nodesLayer.getSource())==null||l.getFeatures().forEach(h=>{h.setStyle(this._defaultStyles),h.changed()})}getEvents(){return this._eventType}on(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.on(e,n):(r=this._map)==null?void 0:r.on(e,n)}once(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.once(e,n):(r=this._map)==null?void 0:r.once(e,n)}un(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.un(e,n):(r=this._map)==null?void 0:r.un(e,n)}}function L9e(t,e){const n=t.get("arrow"),i=t.get("mainView"),r=[n[0]],a=t.getGeometry();if(a&&a instanceof Zt){const s=a.getLength(),o=200*e/s;for(let l=0;l<=1;l+=o){const h=a.getCoordinateAt(l);if(Qi(i.calculateExtent(),h)){const c=a.getCoordinateAt(l+5e-5),f=c[0]-h[0],d=c[1]-h[1],g=Math.atan2(d,f);if(l!==0){const p=n[1].clone();p.setGeometry(new Kt(h)),p.getImage().setRotation(-g+2*Math.PI),r.push(p)}}}}return r}const z9e={name:"v-path",render(){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${$e()}`}},bubble:{type:Boolean,default:!0},showTracePoint:{type:Boolean,default:!0},tracePointsModePlay:{type:String},path:{type:Array},options:{type:Object},autoPlay:{type:Boolean,default:!1}},data(){return{pathObj:null}},computed:{map(){return this.VMap.map}},methods:{init(t){var e,n,i,r,a,s,o;if(t&&t.length>0||this.path&&this.path.length>0){const l=Je(De({},this.$props),{mapObj:this.map,path:t||this.path,options:this.options}),h=new P9e(l);h.setTraceLineStyle({lineColor:((e=l.options)==null?void 0:e.lineColor)||"rgba(0, 0, 255, 0.6)",lineWidth:((n=l.options)==null?void 0:n.lineWidth)||10}),h.setPassLineStyle({lineColor:((i=l.options)==null?void 0:i.passlineColor)||"red",lineWidth:((r=l.options)==null?void 0:r.passlineWidth)||2}),h.setTraceNodeStyle({lineColor:((a=l.options)==null?void 0:a.nodeStrokeColor)||"#3399CC",lineWidth:((s=l.options)==null?void 0:s.nodeStrokeWidth)||1.25,fillColor:((o=l.options)==null?void 0:o.nodeFillColor)||"rgba(255,255,255,0.4)"}),this.pathObj=h,this.pathObj.getEvents().forEach(u=>{this.pathObj.on(u,c=>{this.$emit(u,c)})}),this.$emit("load",this.pathObj),this.autoPlay&&this.start()}},start(t){this.pathObj.start(t)},pause(){this.pathObj.pause()},resume(){this.pathObj.resume()},stop(t){this.pathObj.stop(t)},destroy(){this.pathObj.destroy()}},mounted(){this.init()},beforeDestroy(){this.pathObj.destroy(),this.pathObj=null}};let D9e,k9e;const e$={};var t$=qn(z9e,D9e,k9e,!1,O9e,null,null,null);function O9e(t){for(let e in e$)this[e]=e$[e]}t$.options.__file="src/components/path/index.vue";const gg=function(){return t$.exports}();gg.install=t=>{t.component(gg.name,gg)};const n$=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],j7=1,vg=8;class U7{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(r!==j7)throw new Error(`Got v${r} data when expected v${j7}.`);const a=n$[i&15];if(!a)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new U7(o,s,a,e)}constructor(e,n=64,i=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=n$.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-o%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,vg,e),this.coords=new this.ArrayType(this.data,vg+o+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(vg+s+o+l),this.ids=new this.IndexArrayType(this.data,vg,e),this.coords=new this.ArrayType(this.data,vg+o+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(j7<<4)+a]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=n,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return q7(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:s,nodeSize:o}=this,l=[0,a.length-1,0],h=[];for(;l.length;){const u=l.pop()||0,c=l.pop()||0,f=l.pop()||0;if(c-f<=o){for(let v=f;v<=c;v++){const m=s[2*v],y=s[2*v+1];m>=e&&m<=i&&y>=n&&y<=r&&h.push(a[v])}continue}const d=f+c>>1,g=s[2*d],p=s[2*d+1];g>=e&&g<=i&&p>=n&&p<=r&&h.push(a[d]),(u===0?e<=g:n<=p)&&(l.push(f),l.push(d-1),l.push(1-u)),(u===0?i>=g:r>=p)&&(l.push(d+1),l.push(c),l.push(1-u))}return h}within(e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:a,nodeSize:s}=this,o=[0,r.length-1,0],l=[],h=i*i;for(;o.length;){const u=o.pop()||0,c=o.pop()||0,f=o.pop()||0;if(c-f<=s){for(let v=f;v<=c;v++)r$(a[2*v],a[2*v+1],e,n)<=h&&l.push(r[v]);continue}const d=f+c>>1,g=a[2*d],p=a[2*d+1];r$(g,p,e,n)<=h&&l.push(r[d]),(u===0?e-i<=g:n-i<=p)&&(o.push(f),o.push(d-1),o.push(1-u)),(u===0?e+i>=g:n+i>=p)&&(o.push(d+1),o.push(c),o.push(1-u))}return l}}function q7(t,e,n,i,r,a){if(r-i<=n)return;const s=i+r>>1;i$(t,e,s,i,r,a),q7(t,e,n,i,s-1,1-a),q7(t,e,n,s+1,r,1-a)}function i$(t,e,n,i,r,a){for(;r>i;){if(r-i>600){const h=r-i+1,u=n-i+1,c=Math.log(h),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(h-f)/h)*(u-h/2<0?-1:1),g=Math.max(i,Math.floor(n-u*f/h+d)),p=Math.min(r,Math.floor(n+(h-u)*f/h+d));i$(t,e,n,g,p,a)}const s=e[2*n+a];let o=i,l=r;for(pg(t,e,i,n),e[2*r+a]>s&&pg(t,e,i,r);o<l;){for(pg(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?pg(t,e,i,l):(l++,pg(t,e,l,r)),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function pg(t,e,n,i){V7(t,n,i),V7(e,2*n,2*i),V7(e,2*n+1,2*i+1)}function V7(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function r$(t,e,n,i){const r=t-n,a=e-i;return r*r+a*a}const F9e={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},a$=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),Ll=2,So=3,$7=4,To=5,s$=6;class o${constructor(e){this.options=Object.assign(Object.create(F9e),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:i,maxZoom:r}=this.options,a=`prepare ${e.length} points`;this.points=e;const s=[];for(let l=0;l<e.length;l++){const h=e[l];if(!h.geometry)continue;const[u,c]=h.geometry.coordinates,f=a$(X3(u)),d=a$(Y3(c));s.push(f,d,1/0,l,-1,1),this.options.reduce&&s.push(0)}let o=this.trees[r+1]=this._createTree(s);for(let l=r;l>=i;l--){const h=+Date.now();o=this.trees[l]=this._createTree(this._cluster(o,l))}return this}getClusters(e,n){let i=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let a=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,a=180;else if(i>a){const c=this.getClusters([i,r,180,s],n),f=this.getClusters([-180,r,a,s],n);return c.concat(f)}const o=this.trees[this._limitZoom(n)],l=o.range(X3(i),Y3(s),X3(a),Y3(r)),h=o.data,u=[];for(const c of l){const f=this.stride*c;u.push(h[f+To]>1?l$(h,f,this.clusterProps):this.points[h[f+So]])}return u}getChildren(e){const n=this._getOriginId(e),i=this._getOriginZoom(e),r="No cluster with the specified id.",a=this.trees[i];if(!a)throw new Error(r);const s=a.data;if(n*this.stride>=s.length)throw new Error(r);const o=this.options.radius/(this.options.extent*Math.pow(2,i-1)),l=s[n*this.stride],h=s[n*this.stride+1],u=a.within(l,h,o),c=[];for(const f of u){const d=f*this.stride;s[d+$7]===e&&c.push(s[d+To]>1?l$(s,d,this.clusterProps):this.points[s[d+So]])}if(c.length===0)throw new Error(r);return c}getLeaves(e,n,i){n=n||10,i=i||0;const r=[];return this._appendLeaves(r,e,n,i,0),r}getTile(e,n,i){const r=this.trees[this._limitZoom(e)],a=Math.pow(2,e),{extent:s,radius:o}=this.options,l=o/s,h=(i-l)/a,u=(i+1+l)/a,c={features:[]};return this._addTileFeatures(r.range((n-l)/a,h,(n+1+l)/a,u),r.data,n,i,a,c),n===0&&this._addTileFeatures(r.range(1-l/a,h,1,u),r.data,a,i,a,c),n===a-1&&this._addTileFeatures(r.range(0,h,l/a,u),r.data,-1,i,a,c),c.features.length?c:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const i=this.getChildren(e);if(n++,i.length!==1)break;e=i[0].properties.cluster_id}return n}_appendLeaves(e,n,i,r,a){const s=this.getChildren(n);for(const o of s){const l=o.properties;if(l&&l.cluster?a+l.point_count<=r?a+=l.point_count:a=this._appendLeaves(e,l.cluster_id,i,r,a):a<r?a++:e.push(o),e.length===i)break}return a}_createTree(e){const n=new U7(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<e.length;i+=this.stride)n.add(e[i],e[i+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,i,r,a,s){for(const o of e){const l=o*this.stride,h=n[l+To]>1;let u,c,f;if(h)u=h$(n,l,this.clusterProps),c=n[l],f=n[l+1];else{const p=this.points[n[l+So]];u=p.properties;const[v,m]=p.geometry.coordinates;c=X3(v),f=Y3(m)}const d={type:1,geometry:[[Math.round(this.options.extent*(c*a-i)),Math.round(this.options.extent*(f*a-r))]],tags:u};let g;h||this.options.generateId?g=n[l+So]:g=this.points[n[l+So]].id,g!==void 0&&(d.id=g),s.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:i,extent:r,reduce:a,minPoints:s}=this.options,o=i/(r*Math.pow(2,n)),l=e.data,h=[],u=this.stride;for(let c=0;c<l.length;c+=u){if(l[c+Ll]<=n)continue;l[c+Ll]=n;const f=l[c],d=l[c+1],g=e.within(l[c],l[c+1],o),p=l[c+To];let v=p;for(const m of g){const y=m*u;l[y+Ll]>n&&(v+=l[y+To])}if(v>p&&v>=s){let m=f*p,y=d*p,_,w=-1;const S=((c/u|0)<<5)+(n+1)+this.points.length;for(const b of g){const x=b*u;if(l[x+Ll]<=n)continue;l[x+Ll]=n;const T=l[x+To];m+=l[x]*T,y+=l[x+1]*T,l[x+$7]=S,a&&(_||(_=this._map(l,c,!0),w=this.clusterProps.length,this.clusterProps.push(_)),a(_,this._map(l,x)))}l[c+$7]=S,h.push(m/v,y/v,1/0,S,-1,v),a&&h.push(w)}else{for(let m=0;m<u;m++)h.push(l[c+m]);if(v>1)for(const m of g){const y=m*u;if(!(l[y+Ll]<=n)){l[y+Ll]=n;for(let _=0;_<u;_++)h.push(l[y+_])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,i){if(e[n+To]>1){const s=this.clusterProps[e[n+s$]];return i?Object.assign({},s):s}const r=this.points[e[n+So]].properties,a=this.options.map(r);return i&&a===r?Object.assign({},a):a}}function l$(t,e,n){return{type:"Feature",id:t[e+So],properties:h$(t,e,n),geometry:{type:"Point",coordinates:[N9e(t[e]),B9e(t[e+1])]}}}function h$(t,e,n){const i=t[e+To],r=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+s$],s=a===-1?{}:Object.assign({},n[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+So],point_count:i,point_count_abbreviated:r})}function X3(t){return t/360+.5}function Y3(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function N9e(t){return(t-.5)*360}function B9e(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var u$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default")],2)},G9e=[];u$._withStripped=!0;const j9e={name:"v-super-cluster",extends:or,inject:["VMap"],props:{layerId:{type:String,default(){return`cluster-layer-${$e()}`}},features:{type:Array,default(){return[]}},FeatureStyle:{type:[Array,void 0],default(){}},cluster:{type:Object},overlay:{type:Object}},data(){return{layer:null,clusters:null,featureChildren:[],featureCluster:!1,total:0,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{cluster:{handler(t){if(t){this.clusters=new o$(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const e=this.map.getView().calculateExtent(this.map.getSize()),n=this.clusters.getClusters(e,this.map.getView().getZoom()),i={type:"FeatureCollection",features:n},r=this.layer.getSource();r&&(r.clear(),r.addFeatures(new Ko().readFeatures(i).map(a=>{const s=a.get("properties");if(s&&typeof s=="object")for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.set(o,s[o]);return a})))}},immediate:!1,deep:!0},features:{handler(){this.dispose(),this.init()},immediate:!1,deep:!0},visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.dispose()},methods:{getGeoFeatures(){return this.features.map(t=>{const e=Hs(t.coordinates,t.convert);return{type:"Feature",geometry:{type:"Point",coordinates:e},properties:t}})},styleFunction(t,e){const n=e.get("cluster")||0,i=e.get("point_count_abbreviated")||0;let r=t[i];if(n){if(!r){let a={};a={image:new ai({radius:4,fill:new xt({color:"blue"})}),text:new nr({font:"16px sans-serif",text:i.toString()})},rt(this.cluster,"style")?(r=an(this.cluster.style),r.getText().setText(i.toString())):r=new ft(a),t[i]=r}}else{const a=e.get("style");r=an(a)}return r},init(){this.clusters=new o$(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const t=this.map.getView().calculateExtent(this.map.getSize()),e=this.clusters.getClusters(t,this.map.getView().getZoom()),n={type:"FeatureCollection",features:e},i={};this.layer=new Jt(Je(De({},this.$props),{source:new si({features:new Ko().readFeatures(n).map(r=>{const a=r.get("properties");if(a&&typeof a=="object")for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&r.set(s,a[s]);return r})}),style:r=>this.styleFunction(i,r)})),this.layer.set("cluster",!0),this.layer.set("id",this.layerId),this.layer.set("type","vector"),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.map.on("movestart",r=>{this.$emit("movestart")}),this.map.on("precompose",()=>{const r=this.map.getView().calculateExtent(this.map.getSize()),a=this.clusters.getClusters(r,this.map.getView().getZoom()),s={type:"FeatureCollection",features:a},o=this.layer.getSource();o&&(o.clear(),o.addFeatures(new Ko().readFeatures(s).map(l=>{const h=l.get("properties");if(h&&typeof h=="object")for(const u in h)Object.prototype.hasOwnProperty.call(h,u)&&l.set(u,h[u]);return l}))),this.$emit("precompose")}),this.eventList.forEach(r=>{this.eventRender.push(this.map.on(r,a=>this.eventHandler(r,a)))})},zoomEnd(t){const e=this.map.getView().calculateExtent(this.map.getSize()),n=this.clusters.getClusters(e,this.map.getView().getZoom()),i={type:"FeatureCollection",features:n},r=this.layer.getSource();r&&(r.clear(),r.addFeatures(new Ko().readFeatures(i).map(a=>{const s=a.get("properties");if(s&&typeof s=="object")for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.set(o,s[o]);return a}))),this.$emit("moveend"),t.map.once("moveend",a=>{this.zoomEnd(a)})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.layer)==null?void 0:i.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},getLeaves(t,e){return this.clusters.getLeaves(t,e)},dispose(){this.eventRender.forEach(e=>{mr(e)});const t=this.layer.getSource();t&&t.clear(),this.map.removeLayer(this.layer)}}},c$={};var f$=qn(j9e,u$,G9e,!1,U9e,null,null,null);function U9e(t){for(let e in c$)this[e]=c$[e]}f$.options.__file="src/components/layers/cluster/index.vue";const mg=function(){return f$.exports}();mg.install=t=>{t.component(mg.name,mg)};const d$="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCB2LGcsYj0wLGs9MDtjb25zdCBaPW5ldyBPZmZzY3JlZW5DYW52YXMoMjU2LDI1NiksYz1aLmdldENvbnRleHQoIjJkIik7c2VsZi5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7aWYoIWcmJnkoZS5kYXRhLndpZHRoLGUuZGF0YS5oZWlnaHQpLGUuZGF0YS5tc2c9PT0iaW5pdFRpbGUiKXtjb25zdCBpPWUuZGF0YTtIKGkuanNvbixpLmNvbCxpLnJvdyxpLnRyYWZmaWMsaS56b29tKX1lbHNlIGUuZGF0YS5tc2c9PT0idXBkYXRlQ2FudmFzIiYmKGcuY2xlYXJSZWN0KDAsMCx2LndpZHRoLHYuaGVpZ2h0KSxiPTAsZS5kYXRhLnVwZGF0ZUluZm8mJkooZS5kYXRhLnVwZGF0ZUluZm8pKX07ZnVuY3Rpb24geShlLGkpe3Y9bmV3IE9mZnNjcmVlbkNhbnZhcyhlLGkpLGc9di5nZXRDb250ZXh0KCIyZCIpfWZ1bmN0aW9uIEgoZSxpLGwsdCxJKXtjLmNsZWFyUmVjdCgwLDAsMjU2LDI1Nik7bGV0IGg9MTA7Y29uc3QgdT10LmNlbnRlcixvPXQuem9vbVVuaXRzLHg9LXVbMF0vbyxUPXVbMV0vbyxNPVt4LFRdLHc9MTgwLGQ9OTA7bGV0IHM9bnVsbCxuPW51bGw7aWYodC50aWxlVHlwZT09PSJiZDA5IilzPWkqdC50aWxlU2l6ZStNWzBdLG49KC0xLWwpKnQudGlsZVNpemUrTVsxXSxzPXQuc2l6ZVswXS8yK3Msbj10LnNpemVbMV0vMituO2Vsc2UgaWYodC50aWxlVHlwZT09PSJXR1M4NCIpe2NvbnN0IHo9TWF0aC5QSSo2Mzc4MTM3O3M9KGkqdC50aWxlU2l6ZSpvLXopL28rTVswXSxuPU1bMV0tKHotbCp0LnRpbGVTaXplKm8pL28scz10LnNpemVbMF0vMitzLG49dC5zaXplWzFdLzIrbn1lbHNlIHM9KGkqdC50aWxlU2l6ZSpvLXcpL28rTVswXSxuPU1bMV0tKGQtbCp0LnRpbGVTaXplKm8pL28scz10LnNpemVbMF0vMitzLG49dC5zaXplWzFdLzIrbjtpZihlJiZlLnRyYWZmaWMpe2NvbnN0IHo9ZS5wcmVjaXNpb258fDE7aD1oKno7Y29uc3QgQz1lLnRyYWZmaWM7Zm9yKGxldCBQPTAsbT1DLmxlbmd0aDtQPG07UCsrKXtjb25zdCBTPUNbUF0sUj1TWzFdLEI9dC5hcnJGZWF0dXJlU3R5bGVzW1NbM11dO2xldCBHPVJbMF0vaCxPPVJbMV0vaDtjLmJlZ2luUGF0aCgpLGMubW92ZVRvKEcsTyk7Zm9yKGxldCBXPTIsYT1SLmxlbmd0aDtXPGE7Vys9MilHKz1SW1ddL2gsTys9UltXKzFdL2gsYy5saW5lVG8oRyxPKTtjLnN0cm9rZVN0eWxlPUJbMV0sU1szXT49MTUmJlNbM108PTE5JiYoYy5zdHJva2VTdHlsZT0icmdiYSgxODYsIDAsIDAsIDEpIiksYy5saW5lV2lkdGg9QlsyXSxjLmxpbmVDYXA9WChCWzNdKSxjLmxpbmVKb2luPVkoQls0XSksYy5zdHJva2UoKX19aWYoZy5kcmF3SW1hZ2UoWixzLG4pLCsrYixiPT09ayl7Yj0wLGs9MDtjb25zdCB6PXYudHJhbnNmZXJUb0ltYWdlQml0bWFwKCk7cG9zdE1lc3NhZ2Uoe2ltYWdlQml0bWFwOnosbXNnOiJpbml0VGlsZSIsY2FudmFzUG9pbnQ6W3Msbl0sem9vbTpJLHg6aSx5Omx9KX19ZnVuY3Rpb24gSihlKXtsZXQgaSxsO2NvbnN0IHQ9ZS5zaXplO2UudGlsZVR5cGU9PT0iYmQwOSI/KGk9TWF0aC5yb3VuZChlLm1hcFpvb20rMSksZS56b29tVW5pdHM9TWF0aC5wb3coMiwxOC1pKSxsPWUuem9vbVVuaXRzKjI1Nik6ZS50aWxlVHlwZT09PSJXR1M4NCI/KGk9TWF0aC5yb3VuZChlLm1hcFpvb20pLGUuem9vbVVuaXRzPTIqTWF0aC5QSSo2Mzc4MTM3LzI1Ni9NYXRoLnBvdygyLGkpLGw9ZS56b29tVW5pdHMqMjU2KTooaT1NYXRoLnJvdW5kKGUubWFwWm9vbSksZS56b29tVW5pdHM9TWF0aC5wb3coMiwyLWkpKi4zNTE1NjI1LGw9MjU2KmUuem9vbVVuaXRzKTtjb25zdCBJPWUuY2VudGVyLGg9e3g6SVswXSx5OklbMV19O2xldCB1LG8seCxULE0sdztjb25zdCBkPWUuem9vbVVuaXRzLHM9ZC9lLnJlc29sdXRpb247bGV0IG49dFswXS9zLHo9dFsxXS9zO2lmKGUudGlsZVR5cGU9PT0iYmQwOSIpe3U9TWF0aC5jZWlsKGgueC9sKSxvPU1hdGguY2VpbChoLnkvbCk7Y29uc3QgbT1bdSxvLChoLngtdSpsKS9sKmUudGlsZVNpemUsKGgueS1vKmwpL2wqZS50aWxlU2l6ZV07eD1tWzBdLU1hdGguY2VpbCgobi8yLW1bMl0pL2UudGlsZVNpemUpLFQ9bVsxXS1NYXRoLmNlaWwoKHovMi1tWzNdKS9lLnRpbGVTaXplKSxNPW1bMF0rTWF0aC5jZWlsKChuLzIrbVsyXSkvZS50aWxlU2l6ZSksdz1tWzFdK01hdGguY2VpbCgoei8yK21bM10pL2UudGlsZVNpemUpfWVsc2UgZS50aWxlVHlwZT09PSJXR1M4NCI/KG49dFswXSx6PXRbMV0sdT1NYXRoLmNlaWwoTWF0aC5yb3VuZCgoaC54KzIwMDM3NTA4MzRlLTIpL2wpKSxvPU1hdGguY2VpbChNYXRoLnJvdW5kKCgyMDAzNzUwODM0ZS0yLWgueSkvbCkpLHg9dS1NYXRoLmNlaWwobi8yL2UudGlsZVNpemUpLE09dStNYXRoLmNlaWwobi8yL2UudGlsZVNpemUpLFQ9by1NYXRoLmNlaWwoei8yL2UudGlsZVNpemUpLHc9bytNYXRoLmNlaWwoei8yL2UudGlsZVNpemUpKToobj10WzBdLHo9dFsxXSx1PU1hdGguY2VpbChNYXRoLnJvdW5kKChoLngrMTgwKS9sKSksbz1NYXRoLmNlaWwoTWF0aC5yb3VuZCgoOTAtaC55KS9sKSkseD11LU1hdGguY2VpbChuLzIvZS50aWxlU2l6ZSksTT11K01hdGguY2VpbChuLzIvZS50aWxlU2l6ZSksVD1vLU1hdGguY2VpbCh6LzIvZS50aWxlU2l6ZSksdz1vK01hdGguY2VpbCh6LzIvZS50aWxlU2l6ZSkpO2NvbnN0IEM9W107Zm9yKGxldCBtPXg7bTw9TTttKyspZm9yKGxldCBTPVQ7Uzw9dztTKyspQy5wdXNoKFttLFNdKTtrPUMubGVuZ3RoO2NvbnN0IFA9ZS5kZXZpY2VQaXhlbFJhdGlvO2cudHJhbnNsYXRlKHRbMF0qUCooMS1zKS8yLHRbMV0qUCooMS1zKS8yKSxnLnNjYWxlKGUucmF0aW8qcyxlLnJhdGlvKnMpLHBvc3RNZXNzYWdlKHt0aWxlc09yZGVyOkMsem9vbVVuaXRzOmQsbXNnOiJ1cGRhdGVDYW52YXMifSl9ZnVuY3Rpb24gWChlKXtyZXR1cm5bImJ1dHQiLCJzcXVhcmUiLCJyb3VuZCJdW2VdfWZ1bmN0aW9uIFkoZSl7cmV0dXJuWyJtaXRlciIsImJldmVsIiwicm91bmQiXVtlXX19KSgpOwo=",g$=typeof window!="undefined"&&window.Blob&&new Blob([atob(d$)],{type:"text/javascript;charset=utf-8"});function q9e(){const t=g$&&(window.URL||window.webkitURL).createObjectURL(g$);try{return t?new Worker(t):new Worker("data:application/javascript;base64,"+d$)}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}function hn(t){t=t||{},this.options=t,this.analysis=t.analysis==="official"?t.analysis:"private",this.needWorker=t.needWorker!==void 0?t.needWorker:!1,t.colors=t.colors||["rgba(0,192,73,0.99609375)","rgba(242,48,48,0.99609375)","rgba(255,159,25,0.99609375)"];const e=t.colors;this.map=t.map,this.canvas=null,this.tileType=t.tileType;const n=this.map.getSize(),i=this.map.getView().calculateExtent(n),r=new I2({extent:i,source:new a2({canvasFunction:this.canvasFunction.bind(this),ratio:1,projection:"EPSG:4326"})});this.layer=r,t.map.on(["precompose"],s=>{const o=s.target.getSize(),l=s.target.getView().calculateExtent(o);r.setExtent(l)},!1),this.parseColors(e),this.tileSize=256;const a=1;this.ratio=a,this.drawTogether=!1,this.cache={},this._loadCount={},t.getTileUrl&&(this.getTileUrl=t.getTileUrl),t.needWorker&&(this.worker=new q9e,this.worker.onmessage=s=>{if(s.data.msg==="initTile")this.canvaslayer.canvas.getContext("2d").drawImage(s.data.imageBitmap,0,0),window.BMap&&(window.BMap=null);else if(s.data.msg==="updateCanvas"){const o=s.data.tilesOrder;this.zoomUnits=s.data.zoomUnits,this.tilesOrder=s.data.tilesOrder,this._loadCount={},this.canvaslayer.canvas.getContext("2d").clearRect(0,0,this.canvaslayer.canvas.width,this.canvaslayer.canvas.height);for(let l=0;l<o.length;l++){const h=o[l][0],u=o[l][1],c=Math.round(t.map.getView().getZoom());this._loadCount[h+"_"+u+"_"+c]=!1,this.showTile(h,u,c)}}},this.worker.onerror=s=>{})}hn.prototype.canvasFunction=function(t,e,n,i,r){let a=this.canvas;return a||(a=document.createElement("canvas"),this.canvas=a),a.width=i[0],a.height=i[1],this.update({resolution:e,canvas:a}),a},hn.prototype.parseColors=function(t){this.arrFeatureStyles=[[2,t[0]||"rgba(79,210,125,1)",2,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",3,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",3,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",5,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",6,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",2,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",3,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",3,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",5,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",6,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",2,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",3,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",3,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",5,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",6,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",2,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",3,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",3,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",5,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",6,2,0,[],0,0],[2,"rgba(255,255,255,1)",4,0,0,[],0,0],[2,"rgba(255,255,255,1)",5.5,0,0,[],0,0],[2,"rgba(255,255,255,1)",7,0,0,[],0,0],[2,"rgba(255,255,255,1)",8.5,0,0,[],0,0],[2,"rgba(255,255,255,1)",10,0,0,[],0,0]]},hn.prototype.setColors=function(t){this.parseColors(t)},hn.prototype.initialize=function(t){const e=this;this._initialize||(this.canvaslayer=new CanvasLayer({map:t,update:function(){e.update(this)}}),this._initialize=!0)},hn.prototype.clearCache=function(t){this.cache={}},hn.prototype.setMap=function(t){t?(this.map=t,this._initialize?this.canvaslayer.show():this.initialize(t)):this.canvaslayer.hide()},hn.prototype.draw=function(t){t=t||{},t.clearCache&&this.clearCache(),t.drawTogether&&(this.drawTogether=!0),this.update()},hn.prototype.clear=function(){const e=this.canvaslayer.canvas.getContext("2d"),n=e.canvas.width,i=e.canvas.height;e.canvas.width=n,e.canvas.height=i},hn.prototype.update=function(t){const e=this.map;t?this.canvaslayer=t:t=this.canvaslayer;const i=t.canvas.getContext("2d");this.drawTogether||this.clear();const r=[];if(this.needWorker){const a=this.map.getSize(),s={mapZoom:Math.round(e.getView().getZoom()),tileType:this.tileType,zoomUnits:this.zoomUnits,center:this.map.getView().getCenter(),resolution:this.canvaslayer.resolution,tileSize:this.tileSize,size:a,devicePixelRatio:this.ratio,ratio:this.ratio};this.worker.postMessage({msg:"updateCanvas",width:a[0],height:a[1],updateInfo:s})}else{const a=this.map;let s,o;this.tileType==="bd09"?(s=Math.round(a.getView().getZoom()+1),this.zoomUnits=Math.pow(2,18-s),o=this.zoomUnits*256):this.tileType==="WGS84"?(s=Math.round(a.getView().getZoom()),this.zoomUnits=2*Math.PI*6378137/256/Math.pow(2,s),o=this.zoomUnits*256):(s=Math.round(a.getView().getZoom()),this.zoomUnits=Math.pow(2,2-s)*.3515625,o=256*this.zoomUnits);const l=a.getView().getCenter(),h={x:l[0],y:l[1]};let u,c,f,d,g,p;const m=this.zoomUnits/this.canvaslayer.resolution;let y=a.getSize()[0]/m,_=a.getSize()[1]/m;if(this.tileType==="bd09"){u=Math.ceil(h.x/o),c=Math.ceil(h.y/o);const S=[u,c,(h.x-u*o)/o*this.tileSize,(h.y-c*o)/o*this.tileSize];f=S[0]-Math.ceil((y/2-S[2])/this.tileSize),d=S[1]-Math.ceil((_/2-S[3])/this.tileSize),g=S[0]+Math.ceil((y/2+S[2])/this.tileSize),p=S[1]+Math.ceil((_/2+S[3])/this.tileSize)}else this.tileType==="WGS84"?(y=a.getSize()[0],_=a.getSize()[1],u=Math.ceil(Math.round((h.x+2003750834e-2)/o)),c=Math.ceil(Math.round((2003750834e-2-h.y)/o)),f=u-Math.ceil(y/2/this.tileSize),g=u+Math.ceil(y/2/this.tileSize),d=c-Math.ceil(_/2/this.tileSize),p=c+Math.ceil(_/2/this.tileSize)):(y=a.getSize()[0],_=a.getSize()[1],u=Math.ceil(Math.round((h.x+180)/o)),c=Math.ceil(Math.round((90-h.y)/o)),f=u-Math.ceil(y/2/this.tileSize),g=u+Math.ceil(y/2/this.tileSize),d=c-Math.ceil(_/2/this.tileSize),p=c+Math.ceil(_/2/this.tileSize));for(let S=f;S<=g;S++)for(let b=d;b<=p;b++)r.push([S,b]);this.tilesOrder=r,this._loadCount={};const w=a.getSize();i.translate(w[0]*devicePixelRatio*(1-m)/2,w[1]*devicePixelRatio*(1-m)/2),i.scale(this.ratio*m,this.ratio*m);for(let S=0;S<r.length;S++){const b=r[S][0],x=r[S][1],T=s;this._loadCount[b+"_"+x+"_"+T]=!1,this.showTile(b,x,T)}}},hn.prototype.lngLatToMerc=function(t){if(t==null)return{x:0,y:0};if(t.lng>180||t.lng<-180||t.lat>90||t.lat<-90)return{x:0,y:0};if(this.tileType==="WGS84"){const e={};e.lng=t.lng*Math.PI/180*6378137;const i=t.lat*Math.PI/180;return e.lat=6378137/2*Math.log((1+Math.sin(i))/(1-Math.sin(i))),{x:Number(e.lng.toFixed(2)),y:Number(e.lat.toFixed(2))}}},hn.prototype.isAllLoaded=function(){let t=!0;for(const e in this._loadCount)if(!this._loadCount[e]){t=!1;break}return t},hn.prototype.showTile=function(t,e,n){this._parseDataAndDraw(t,e,n)},hn.prototype.drawCurrentData=function(){this.clear();let t;this.tileType==="bd09"?t=Math.round(this.map.getZoom()+1):this.tileType==="WGS84"?t=Math.round(this.map.getZoom()):t=Math.round(this.map.getView().getZoom());for(let e=0;e<this.tilesOrder.length;e++){const n=this.tilesOrder[e][0],i=this.tilesOrder[e][1],r=this.cache[this.getCacheKey(n,i,t)];r&&this._drawFeatures(r,n,i,t)}this.drawTogether=!1},hn.prototype.getCacheKey=function(t,e,n){return t+"_"+e+"_"+n},hn.prototype.getTileKey=function(t,e){const n=t.style||"default";return"BMAP_CUSTOM_LAYER_1_"+n+"_"+t.col+"_"+t.row+"_"+t.zoom+"_"+t.zoom},hn.prototype._parseDataAndDraw=function(t,e,n){const i=this,r=this.getCacheKey(t,e,n),a=(Math.random()*1e5).toFixed(0);let s="_cbk"+a;window.BMap||(window.BMap={});let o="";const l=this.analysis;if(l==="private")o=this.getTileUrl(t,e,n,"BMap."+s),window.BMap[s]=h;else{const u="cbk"+this.getTileKey({col:t,row:e,zoom:n});o=this.getTileUrl(t,e,n,"BMap."+u),s=u,window.BMap[s]=h}function h(u){i._loadCount[t+"_"+e+"_"+n]=!0;const c=l==="private"?u.result&&u.result.trafficData:u.content&&u.content.tf;c?i.cache[r]={traffic:c,precision:u.precision||1}:i.cache[r]=null,i.drawTogether?i.isAllLoaded()&&i.drawCurrentData():i._drawFeatures(i.cache[r],t,e,n),delete window.BMap[s]}i.cache[r]!==void 0&&i.cache[r]!==null?(i._loadCount[t+"_"+e+"_"+n]=!0,i.drawTogether?i.isAllLoaded()&&i.drawCurrentData():i._drawFeatures(i.cache[r],t,e,n)):typeof window.BMap[s]=="function"&&this.request(o)},hn.prototype.getTileUrl=function(t,e,n,i){return(this.options.trafficURL||"http://its.map.baidu.com:8002/traffic/?qt=vtraffic")+"&x="+t+"&y="+e+"&z="+n+"&fn="+i+(this.analysis==="private"?"&t="+new Date().getTime():"")},hn.prototype._drawFeatures=function(t,e,n,i){if(this.needWorker){const r=this.map.getSize(),a={center:this.map.getView().getCenter(),zoomUnits:this.zoomUnits,tileType:this.tileType,tileSize:this.tileSize,size:r,arrFeatureStyles:this.arrFeatureStyles};this.worker.postMessage({msg:"initTile",json:t,col:e,row:n,width:r[0],height:r[1],traffic:a,zoom:i})}else{const r=this.map,s=this.canvaslayer.canvas.getContext("2d"),o=this.getLineCap,l=this.getLineJoin;let h=10;const u=r.getView().getCenter(),c=this.zoomUnits,f=-u[0]/c,d=u[1]/c,g=[f,d];let p=null,v=null;if(this.tileType==="bd09")p=e*this.tileSize+g[0],v=(-1-n)*this.tileSize+g[1],p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v;else if(this.tileType==="WGS84"){const m=Math.PI*6378137;p=(e*this.tileSize*c-m)/c+g[0],v=g[1]-(m-n*this.tileSize*c)/c,p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v}else p=(e*this.tileSize*c-180)/c+g[0],v=g[1]-(90-n*this.tileSize*c)/c,p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v;if(s.save(),s.translate(p,v),t&&t.traffic){const m=t.precision||1;h=h*m;const y=t.traffic;for(let _=0,w=y.length;_<w;_++){const S=y[_],b=S[1],x=this.arrFeatureStyles[S[3]];let T=b[0]/h,C=b[1]/h;s.beginPath(),s.moveTo(T,C);for(let A=2,M=b.length;A<M;A+=2)T+=b[A]/h,C+=b[A+1]/h,s.lineTo(T,C);s.strokeStyle=x[1],S[3]>=15&&S[3]<=19&&(s.strokeStyle="rgba(186, 0, 0, 1)"),s.lineWidth=x[2],s.lineCap=o(x[3]),s.lineJoin=l(x[4]),s.stroke()}}s.restore()}},hn.prototype.request=function(t,e){if(e)if(this.analysis==="private"){const i=(Math.random()*1e5).toFixed(0),r="_cbk"+i;window.BMap._rd[r]=function(a){e&&e(a),delete window.BMap._rd[r]},t+="&callback=BMap._rd._cbk"+i}else{const i=/(\w+|[\u4e00-\u9fa5]+)=(\w+|[\u4e00-\u9fa5]+)/gi,r={};t.replace(i,(s,o,l)=>{r[o]=l});const a=r.fn;window.BMap[a]=function(s){e&&e(s),delete window.BMap[a]},t+="&callback=BMap."+a}let n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.src=t,n.addEventListener?n.addEventListener("load",function(i){const r=i.target;r.parentNode.removeChild(r)},!1):n.attachEvent&&n.attachEvent("onreadystatechange",function(i){const r=window.event.srcElement;r&&(r.readyState==="loaded"||r.readyState==="complete")&&r.parentNode.removeChild(r)}),setTimeout(function(){document.getElementsByTagName("head")[0].appendChild(n),n=null},1)},hn.prototype.getRGBA=function(t){t=t>>>0;const e=t>>24&255,n=t>>16&255,i=t>>8&255,r=(t&255)/256;return"rgba("+e+","+n+","+i+","+r+")"},hn.prototype.getLineCap=function(t){return["butt","square","round"][t]},hn.prototype.getLineJoin=function(t){return["miter","bevel","round"][t]},hn.prototype.workerTerminate=function(){this.worker&&this.worker.terminate()};const V9e={name:"v-traffic",render(){return null},extends:or,inject:["VMap"],props:{layerId:{type:String,default(){return`traffic-layer-${$e()}`}},timeout:{type:Number},url:{type:String,require:!0},tileType:{type:String},clearCache:{type:Boolean,default:!0},colors:{type:Array,default(){return["rgba(0,192,73,0.99609375)","rgba(242,48,48,0.99609375)","rgba(255,159,25,0.99609375)"]}},needWorker:{type:Boolean,default:!1}},data(){return{timer:null,trafficLayer:null,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){this.trafficLayer.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.trafficLayer.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.trafficLayer.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.trafficLayer.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.trafficLayer.layer.setExtent(t)},immediate:!1,deep:!0},colors:{handler(t){this.trafficLayer.setColors(t)},immediate:!1,deep:!0}},methods:{init(){const t={map:this.map,trafficURL:this.url,tileType:this.tileType,colors:this.colors,needWorker:this.needWorker};this.trafficLayer=typeof BDTrafficLayer=="undefined"?new hn(t):new BDTrafficLayer(t),this.trafficLayer.layer.set("id",this.layerId),this.trafficLayer.layer.set("type","traffic"),this.trafficLayer.layer.set("users",!0),this.zIndex&&this.trafficLayer.layer.setZIndex(this.zIndex),this.trafficLayer.layer.setVisible(this.visible),this.map.addLayer(this.trafficLayer.layer),this.timeout&&(this.timer=setInterval(()=>{this.trafficLayer.layer&&this.trafficLayer.layer.getVisible()&&this.trafficLayer.draw({clearCache:this.clearCache})},this.timeout)),this.eventList.forEach(e=>{this.eventRender.push(this.map.on(e,n=>this.eventHandler(e,n)))})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i,r;if((n==null?void 0:n.get("id"))===((r=(i=this.trafficLayer)==null?void 0:i.layer)==null?void 0:r.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},dispose(){this.eventRender.forEach(t=>{mr(t)}),this.timer&&(clearInterval(this.timer),this.timer=null),this.trafficLayer&&(this.trafficLayer.layer.getSource().clear(),this.map.removeLayer(this.trafficLayer.layer),this.trafficLayer.workerTerminate())}},mounted(){this.init()},update(){this.trafficLayer&&this.dispose(),this.init()},beforeDestroy(){this.dispose()}};let $9e,H9e;const v$={};var p$=qn(V9e,$9e,H9e,!1,W9e,null,null,null);function W9e(t){for(let e in v$)this[e]=v$[e]}p$.options.__file="src/components/layers/traffic/index.vue";const yg=function(){return p$.exports}();yg.install=function(t){t.component(yg.name,yg)};const H7="http://www.w3.org/2001/XMLSchema-instance";function ut(t,e){return x$().createElementNS(t,e)}function _g(t,e){return m$(t,e,[]).join("")}function m$(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?n.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(t.nodeValue);else{let i;for(i=t.firstChild;i;i=i.nextSibling)m$(i,e,n)}return n}function ic(t){return"documentElement"in t}function Z9e(t,e,n){return t.getAttributeNS(e,n)||""}function rc(t){return new DOMParser().parseFromString(t,"application/xml")}function y$(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);if(r!==void 0){const a=i[i.length-1];mi(a,r)}}}function st(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);r!==void 0&&i[i.length-1].push(r)}}function We(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);r!==void 0&&(i[i.length-1]=r)}}function aa(t,e,n){return function(i,r){const a=t.call(n!==void 0?n:this,i,r);if(a!==void 0){const s=r[r.length-1],o=e!==void 0?e:i.localName;s[o]=a}}}function me(t,e){return function(n,i,r){t.call(e!==void 0?e:this,n,i,r),r[r.length-1].node.appendChild(n)}}function dr(t,e){return function(n,i,r){const s=i[i.length-1].node;let o=t;o===void 0&&(o=r);const l=e!==void 0?e:s.namespaceURI;return ut(l,o)}}const _$=dr();function zl(t,e,n,i){let r;for(r=e.firstElementChild;r;r=r.nextElementSibling){const a=t[r.namespaceURI];if(a!==void 0){const s=a[r.localName];s!==void 0&&s.call(i,r,n)}}}function Vt(t,e,n,i,r){return i.push(t),zl(e,n,i,r),i.pop()}function X9e(t,e,n,i,r,a){const s=(r!==void 0?r:n).length;let o,l;for(let h=0;h<s;++h)o=n[h],o!==void 0&&(l=e.call(a!==void 0?a:this,o,i,r!==void 0?r[h]:void 0),l!==void 0&&t[l.namespaceURI][l.localName].call(a,l,o,i))}function _n(t,e,n,i,r,a,s){return r.push(t),X9e(e,n,i,r,a,s),r.pop()}let W7;function Y9e(){return W7===void 0&&typeof XMLSerializer!="undefined"&&(W7=new XMLSerializer),W7}let Z7;function x$(){return Z7===void 0&&typeof document!="undefined"&&(Z7=document.implementation.createDocument("","",null)),Z7}class K9e extends UC{constructor(){super(),this.xmlSerializer_=Y9e()}getType(){return"xml"}readFeature(e,n){if(!e)return null;if(typeof e=="string"){const i=rc(e);return this.readFeatureFromDocument(i,n)}return ic(e)?this.readFeatureFromDocument(e,n):this.readFeatureFromNode(e,n)}readFeatureFromDocument(e,n){const i=this.readFeaturesFromDocument(e,n);return i.length>0?i[0]:null}readFeatureFromNode(e,n){return null}readFeatures(e,n){if(!e)return[];if(typeof e=="string"){const i=rc(e);return this.readFeaturesFromDocument(i,n)}return ic(e)?this.readFeaturesFromDocument(e,n):this.readFeaturesFromNode(e,n)}readFeaturesFromDocument(e,n){const i=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&mi(i,this.readFeaturesFromNode(r,n));return i}readFeaturesFromNode(e,n){return He()}readGeometry(e,n){if(!e)return null;if(typeof e=="string"){const i=rc(e);return this.readGeometryFromDocument(i,n)}return ic(e)?this.readGeometryFromDocument(e,n):this.readGeometryFromNode(e,n)}readGeometryFromDocument(e,n){return null}readGeometryFromNode(e,n){return null}readProjection(e){if(!e)return null;if(typeof e=="string"){const n=rc(e);return this.readProjectionFromDocument(n)}return ic(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e)}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,n){const i=this.writeFeatureNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(e,n){return null}writeFeatures(e,n){const i=this.writeFeaturesNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(e,n){return null}writeGeometry(e,n){const i=this.writeGeometryNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(e,n){return null}}const w$=K9e,bs="http://www.opengis.net/gml",J9e=/^\s*$/;class xn extends w${constructor(e){super(),e=e||{},this.featureType=e.featureType,this.featureNS=e.featureNS,this.srsName=e.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:st(this.readFeaturesInternal),featureMembers:We(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(e,n){const i=e.localName;let r=null;if(i=="FeatureCollection")r=Vt([],this.FEATURE_COLLECTION_PARSERS,e,n,this);else if(i=="featureMembers"||i=="featureMember"||i=="member"){const a=n[0];let s=a.featureType,o=a.featureNS;const l="p",h="p0";if(!s&&e.childNodes){s=[],o={};for(let f=0,d=e.childNodes.length;f<d;++f){const g=e.childNodes[f];if(g.nodeType===1){const p=g.nodeName.split(":").pop();if(!s.includes(p)){let v="",m=0;const y=g.namespaceURI;for(const _ in o){if(o[_]===y){v=_;break}++m}v||(v=l+m,o[v]=y),s.push(v+":"+p)}}}i!="featureMember"&&(a.featureType=s,a.featureNS=o)}if(typeof o=="string"){const f=o;o={},o[h]=f}const u={},c=Array.isArray(s)?s:[s];for(const f in o){const d={};for(let g=0,p=c.length;g<p;++g)(c[g].includes(":")?c[g].split(":")[0]:h)===f&&(d[c[g].split(":").pop()]=i=="featureMembers"?st(this.readFeatureElement,this):We(this.readFeatureElement,this));u[o[f]]=d}i=="featureMember"||i=="member"?r=Vt(void 0,u,e,n):r=Vt([],u,e,n)}return r===null&&(r=[]),r}readGeometryOrExtent(e,n){const i=n[0];return i.srsName=e.firstElementChild.getAttribute("srsName"),i.srsDimension=e.firstElementChild.getAttribute("srsDimension"),Vt(null,this.GEOMETRY_PARSERS,e,n,this)}readExtentElement(e,n){const i=n[0],r=this.readGeometryOrExtent(e,n);return r?Bm(r,i):void 0}readGeometryElement(e,n){const i=n[0],r=this.readGeometryOrExtent(e,n);return r?uf(r,!1,i):void 0}readFeatureElementInternal(e,n,i){let r;const a={};for(let l=e.firstElementChild;l;l=l.nextElementSibling){let h;const u=l.localName;l.childNodes.length===0||l.childNodes.length===1&&(l.firstChild.nodeType===3||l.firstChild.nodeType===4)?(h=_g(l,!1),J9e.test(h)&&(h=void 0)):(i&&(h=u==="boundedBy"?this.readExtentElement(l,n):this.readGeometryElement(l,n)),h?u!=="boundedBy"&&(r=u):h=this.readFeatureElementInternal(l,n,!1));const c=l.attributes.length;if(c>0&&!(h instanceof Jp)){h={_content_:h};for(let f=0;f<c;f++){const d=l.attributes[f].name;h[d]=l.attributes[f].value}}a[u]?(a[u]instanceof Array||(a[u]=[a[u]]),a[u].push(h)):a[u]=h}if(!i)return a;const s=new Wn(a);r&&s.setGeometryName(r);const o=e.getAttribute("fid")||Z9e(e,this.namespace,"id");return o&&s.setId(o),s}readFeatureElement(e,n){return this.readFeatureElementInternal(e,n,!0)}readPoint(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new Kt(i,"XYZ")}readMultiPoint(e,n){const i=Vt([],this.MULTIPOINT_PARSERS,e,n,this);if(i)return new Kc(i)}readMultiLineString(e,n){const i=Vt([],this.MULTILINESTRING_PARSERS,e,n,this);if(i)return new Yc(i)}readMultiPolygon(e,n){const i=Vt([],this.MULTIPOLYGON_PARSERS,e,n,this);if(i)return new ph(i)}pointMemberParser(e,n){zl(this.POINTMEMBER_PARSERS,e,n,this)}lineStringMemberParser(e,n){zl(this.LINESTRINGMEMBER_PARSERS,e,n,this)}polygonMemberParser(e,n){zl(this.POLYGONMEMBER_PARSERS,e,n,this)}readLineString(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new Zt(i,"XYZ")}readFlatLinearRing(e,n){const i=Vt(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this);if(i)return i}readLinearRing(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new s1(i,"XYZ")}readPolygon(e,n){const i=Vt([null],this.FLAT_LINEAR_RINGS_PARSERS,e,n,this);if(i&&i[0]){const r=i[0],a=[r.length];let s,o;for(s=1,o=i.length;s<o;++s)mi(r,i[s]),a.push(r.length);return new Bi(r,"XYZ",a)}}readFlatCoordinatesFromNode(e,n){return Vt(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this)}readGeometryFromNode(e,n){const i=this.readGeometryElement(e,[this.getReadOptions(e,n||{})]);return i||null}readFeaturesFromNode(e,n){const i={featureType:this.featureType,featureNS:this.featureNS};return i&&Object.assign(i,this.getReadOptions(e,n)),this.readFeaturesInternal(e,[i])||[]}readProjectionFromNode(e){return _t(this.srsName?this.srsName:e.firstElementChild.getAttribute("srsName"))}}xn.prototype.namespace=bs,xn.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:st(xn.prototype.pointMemberParser),pointMembers:st(xn.prototype.pointMemberParser)}},xn.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:st(xn.prototype.lineStringMemberParser),lineStringMembers:st(xn.prototype.lineStringMemberParser)}},xn.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:st(xn.prototype.polygonMemberParser),polygonMembers:st(xn.prototype.polygonMemberParser)}},xn.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:st(xn.prototype.readFlatCoordinatesFromNode)}},xn.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:st(xn.prototype.readLineString)}},xn.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:st(xn.prototype.readPolygon)}},xn.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:We(xn.prototype.readFlatLinearRing)}};const pt=xn;function ac(t){const e=_g(t,!1);return sc(e)}function sc(t){const e=/^\s*(\d+)\s*$/.exec(t);if(e)return parseInt(e[1],10)}function On(t,e){t.appendChild(x$().createTextNode(e))}const Q9e=bs+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",e7e={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class It extends pt{constructor(e){e=e||{},super(e),this.FEATURE_COLLECTION_PARSERS[bs].featureMember=st(this.readFeaturesInternal),this.schemaLocation=e.schemaLocation?e.schemaLocation:Q9e}readFlatCoordinates(e,n){const i=_g(e,!1).replace(/^\s*|\s*$/g,""),a=n[0].srsName;let s="enu";if(a){const h=_t(a);h&&(s=h.getAxisOrientation())}const o=i.trim().split(/\s+/),l=[];for(let h=0,u=o.length;h<u;h++){const c=o[h].split(/,+/),f=parseFloat(c[0]),d=parseFloat(c[1]),g=c.length===3?parseFloat(c[2]):0;s.substr(0,2)==="en"?l.push(f,d,g):l.push(d,f,g)}return l}readBox(e,n){const i=Vt([null],this.BOX_PARSERS_,e,n,this);return _r(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);i&&n[n.length-1].push(i)}outerBoundaryIsParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);if(i){const r=n[n.length-1];r[0]=i}}GEOMETRY_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.multiSurface,s=r.surface,o=r.multiCurve;return Array.isArray(e)?i="Envelope":(i=e.getType(),i==="MultiPolygon"&&a===!0?i="MultiSurface":i==="Polygon"&&s===!0?i="Surface":i==="MultiLineString"&&o===!0&&(i="MultiCurve")),ut("http://www.opengis.net/gml",i)}writeFeatureElement(e,n,i){const r=n.getId();r&&e.setAttribute("fid",r);const a=i[i.length-1],s=a.featureNS,o=n.getGeometryName();a.serializers||(a.serializers={},a.serializers[s]={});const l=[],h=[];if(n.hasProperties()){const c=n.getProperties();for(const f in c){const d=c[f];d!==null&&(l.push(f),h.push(d),f==o||typeof d.getSimplifiedGeometry=="function"?f in a.serializers[s]||(a.serializers[s][f]=me(this.writeGeometryElement,this)):f in a.serializers[s]||(a.serializers[s][f]=me(On)))}}const u=Object.assign({},a);u.node=e,_n(u,a.serializers,dr(void 0,s),h,i,l)}writeCurveOrLineString(e,n,i){const a=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&a&&e.setAttribute("srsName",a),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const s=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(s),this.writeCoordinates_(s,n,i)}else if(e.nodeName==="Curve"){const s=ut(e.namespaceURI,"segments");e.appendChild(s),this.writeCurveSegments_(s,n,i)}}writeLineStringOrCurveMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,n,i))}writeMultiCurveOrLineString(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.curve;s&&e.setAttribute("srsName",s);const l=n.getLineStrings();_n({node:e,hasZ:a,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeGeometryElement(e,n,i){const r=i[i.length-1],a=Object.assign({},r);a.node=e;let s;Array.isArray(n)?s=Bm(n,r):s=uf(n,!0,r),_n(a,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}createCoordinatesNode_(e){const n=ut(e,"coordinates");return n.setAttribute("decimal","."),n.setAttribute("cs",","),n.setAttribute("ts"," "),n}writeCoordinates_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=n.getCoordinates(),l=o.length,h=new Array(l);for(let u=0;u<l;++u){const c=o[u];h[u]=this.getCoords_(c,s,a)}On(e,h.join(" "))}writeCurveSegments_(e,n,i){const r=ut(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,n,i)}writeSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;if(e.nodeName!=="PolygonPatch"&&s&&e.setAttribute("srsName",s),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const o=n.getLinearRings();_n({node:e,hasZ:a,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,o,i,void 0,this)}else if(e.nodeName==="Surface"){const o=ut(e.namespaceURI,"patches");e.appendChild(o),this.writeSurfacePatches_(o,n,i)}}RING_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.node,s=r.exteriorWritten;return s===void 0&&(r.exteriorWritten=!0),ut(a.namespaceURI,s!==void 0?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(e,n,i){const r=ut(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)}writeRing(e,n,i){const r=ut(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,n,i)}getCoords_(e,n,i){let r="enu";n&&(r=_t(n).getAxisOrientation());let a=r.substr(0,2)==="en"?e[0]+","+e[1]:e[1]+","+e[0];if(i){const s=e[2]||0;a+=","+s}return a}writePoint(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;s&&e.setAttribute("srsName",s);const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o);const l=n.getCoordinates(),h=this.getCoords_(l,s,a);On(o,h)}writeMultiPoint(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;s&&e.setAttribute("srsName",s);const o=n.getPoints();_n({node:e,hasZ:a,srsName:s},this.POINTMEMBER_SERIALIZERS,dr("pointMember"),o,i,void 0,this)}writePointMember(e,n,i){const r=ut(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,n,i)}writeLinearRing(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(s),this.writeCoordinates_(s,n,i)}writeMultiSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.surface;s&&e.setAttribute("srsName",s);const l=n.getPolygons();_n({node:e,hasZ:a,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeSurfaceOrPolygonMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))}writeEnvelope(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=["lowerCorner","upperCorner"],o=[n[0]+" "+n[1],n[2]+" "+n[3]];_n({node:e},this.ENVELOPE_SERIALIZERS,_$,o,i,s,this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,n,i){const r=n[n.length-1].node;return ut("http://www.opengis.net/gml",e7e[r.nodeName])}}It.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:We(It.prototype.readFlatCoordinates)}},It.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:It.prototype.innerBoundaryIsParser,outerBoundaryIs:It.prototype.outerBoundaryIsParser}},It.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:st(It.prototype.readFlatCoordinates)}},It.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Box:We(It.prototype.readBox)}},It.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:me(It.prototype.writeCurveOrLineString),MultiCurve:me(It.prototype.writeMultiCurveOrLineString),Point:me(It.prototype.writePoint),MultiPoint:me(It.prototype.writeMultiPoint),LineString:me(It.prototype.writeCurveOrLineString),MultiLineString:me(It.prototype.writeMultiCurveOrLineString),LinearRing:me(It.prototype.writeLinearRing),Polygon:me(It.prototype.writeSurfaceOrPolygon),MultiPolygon:me(It.prototype.writeMultiSurfaceOrPolygon),Surface:me(It.prototype.writeSurfaceOrPolygon),MultiSurface:me(It.prototype.writeMultiSurfaceOrPolygon),Envelope:me(It.prototype.writeEnvelope)}},It.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:me(It.prototype.writeLineStringOrCurveMember),curveMember:me(It.prototype.writeLineStringOrCurveMember)}},It.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:me(It.prototype.writeRing),innerBoundaryIs:me(It.prototype.writeRing)}},It.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:me(It.prototype.writePointMember)}},It.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:me(It.prototype.writeSurfaceOrPolygonMember),polygonMember:me(It.prototype.writeSurfaceOrPolygonMember)}},It.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:me(On),upperCorner:me(On)}};const xg=It,t7e=bs+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",n7e={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class je extends pt{constructor(e){e=e||{},super(e),this.surface_=e.surface!==void 0?e.surface:!1,this.curve_=e.curve!==void 0?e.curve:!1,this.multiCurve_=e.multiCurve!==void 0?e.multiCurve:!0,this.multiSurface_=e.multiSurface!==void 0?e.multiSurface:!0,this.schemaLocation=e.schemaLocation?e.schemaLocation:t7e,this.hasZ=e.hasZ!==void 0?e.hasZ:!1}readMultiCurve(e,n){const i=Vt([],this.MULTICURVE_PARSERS,e,n,this);if(i)return new Yc(i)}readFlatCurveRing(e,n){const i=Vt([],this.MULTICURVE_PARSERS,e,n,this),r=[];for(let a=0,s=i.length;a<s;++a)mi(r,i[a].getFlatCoordinates());return r}readMultiSurface(e,n){const i=Vt([],this.MULTISURFACE_PARSERS,e,n,this);if(i)return new ph(i)}curveMemberParser(e,n){zl(this.CURVEMEMBER_PARSERS,e,n,this)}surfaceMemberParser(e,n){zl(this.SURFACEMEMBER_PARSERS,e,n,this)}readPatch(e,n){return Vt([null],this.PATCHES_PARSERS,e,n,this)}readSegment(e,n){return Vt([],this.SEGMENTS_PARSERS,e,n,this)}readPolygonPatch(e,n){return Vt([null],this.FLAT_LINEAR_RINGS_PARSERS,e,n,this)}readLineStringSegment(e,n){return Vt([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this)}interiorParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);i&&n[n.length-1].push(i)}exteriorParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);if(i){const r=n[n.length-1];r[0]=i}}readSurface(e,n){const i=Vt([null],this.SURFACE_PARSERS,e,n,this);if(i&&i[0]){const r=i[0],a=[r.length];let s,o;for(s=1,o=i.length;s<o;++s)mi(r,i[s]),a.push(r.length);return new Bi(r,"XYZ",a)}}readCurve(e,n){const i=Vt([null],this.CURVE_PARSERS,e,n,this);if(i)return new Zt(i,"XYZ")}readEnvelope(e,n){const i=Vt([null],this.ENVELOPE_PARSERS,e,n,this);return _r(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(e,n){let i=_g(e,!1);const r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,a=[];let s;for(;s=r.exec(i);)a.push(parseFloat(s[1])),i=i.substr(s[0].length);if(i!=="")return;const l=n[0].srsName;let h="enu";if(l&&(h=_t(l).getAxisOrientation()),h==="neu"){let c,f;for(c=0,f=a.length;c<f;c+=3){const d=a[c],g=a[c+1];a[c]=g,a[c+1]=d}}const u=a.length;if(u==2&&a.push(0),u!==0)return a}readFlatPosList(e,n){const i=_g(e,!1).replace(/^\s*|\s*$/g,""),r=n[0],a=r.srsName,s=r.srsDimension;let o="enu";a&&(o=_t(a).getAxisOrientation());const l=i.split(/\s+/);let h=2;e.getAttribute("srsDimension")?h=sc(e.getAttribute("srsDimension")):e.getAttribute("dimension")?h=sc(e.getAttribute("dimension")):e.parentNode.getAttribute("srsDimension")?h=sc(e.parentNode.getAttribute("srsDimension")):s&&(h=sc(s));let u,c,f;const d=[];for(let g=0,p=l.length;g<p;g+=h)u=parseFloat(l[g]),c=parseFloat(l[g+1]),f=h===3?parseFloat(l[g+2]):0,o.substr(0,2)==="en"?d.push(u,c,f):d.push(c,u,f);return d}writePos_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=a?"3":"2";e.setAttribute("srsDimension",s);const o=r.srsName;let l="enu";o&&(l=_t(o).getAxisOrientation());const h=n.getCoordinates();let u;if(l.substr(0,2)==="en"?u=h[0]+" "+h[1]:u=h[1]+" "+h[0],a){const c=h[2]||0;u+=" "+c}On(e,u)}getCoords_(e,n,i){let r="enu";n&&(r=_t(n).getAxisOrientation());let a=r.substr(0,2)==="en"?e[0]+" "+e[1]:e[1]+" "+e[0];if(i){const s=e[2]||0;a+=" "+s}return a}writePosList_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=a?"3":"2";e.setAttribute("srsDimension",s);const o=r.srsName,l=n.getCoordinates(),h=l.length,u=new Array(h);let c;for(let f=0;f<h;++f)c=l[f],u[f]=this.getCoords_(c,o,a);On(e,u.join(" "))}writePoint(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=ut(e.namespaceURI,"pos");e.appendChild(s),this.writePos_(s,n,i)}writeEnvelope(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=["lowerCorner","upperCorner"],o=[n[0]+" "+n[1],n[2]+" "+n[3]];_n({node:e},this.ENVELOPE_SERIALIZERS,_$,o,i,s,this)}writeLinearRing(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=ut(e.namespaceURI,"posList");e.appendChild(s),this.writePosList_(s,n,i)}RING_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.node,s=r.exteriorWritten;return s===void 0&&(r.exteriorWritten=!0),ut(a.namespaceURI,s!==void 0?"interior":"exterior")}writeSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;if(e.nodeName!=="PolygonPatch"&&s&&e.setAttribute("srsName",s),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const o=n.getLinearRings();_n({node:e,hasZ:a,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,o,i,void 0,this)}else if(e.nodeName==="Surface"){const o=ut(e.namespaceURI,"patches");e.appendChild(o),this.writeSurfacePatches_(o,n,i)}}writeCurveOrLineString(e,n,i){const a=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&a&&e.setAttribute("srsName",a),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const s=ut(e.namespaceURI,"posList");e.appendChild(s),this.writePosList_(s,n,i)}else if(e.nodeName==="Curve"){const s=ut(e.namespaceURI,"segments");e.appendChild(s),this.writeCurveSegments_(s,n,i)}}writeMultiSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.surface;s&&e.setAttribute("srsName",s);const l=n.getPolygons();_n({node:e,hasZ:a,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeMultiPoint(e,n,i){const r=i[i.length-1],a=r.srsName,s=r.hasZ;a&&e.setAttribute("srsName",a);const o=n.getPoints();_n({node:e,hasZ:s,srsName:a},this.POINTMEMBER_SERIALIZERS,dr("pointMember"),o,i,void 0,this)}writeMultiCurveOrLineString(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.curve;s&&e.setAttribute("srsName",s);const l=n.getLineStrings();_n({node:e,hasZ:a,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeRing(e,n,i){const r=ut(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,n,i)}writeSurfaceOrPolygonMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))}writePointMember(e,n,i){const r=ut(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,n,i)}writeLineStringOrCurveMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,n,i))}writeSurfacePatches_(e,n,i){const r=ut(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)}writeCurveSegments_(e,n,i){const r=ut(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,n,i)}writeGeometryElement(e,n,i){const r=i[i.length-1],a=Object.assign({},r);a.node=e;let s;Array.isArray(n)?s=Bm(n,r):s=uf(n,!0,r),_n(a,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}writeFeatureElement(e,n,i){const r=n.getId();r&&e.setAttribute("fid",r);const a=i[i.length-1],s=a.featureNS,o=n.getGeometryName();a.serializers||(a.serializers={},a.serializers[s]={});const l=[],h=[];if(n.hasProperties()){const c=n.getProperties();for(const f in c){const d=c[f];d!==null&&(l.push(f),h.push(d),f==o||typeof d.getSimplifiedGeometry=="function"?f in a.serializers[s]||(a.serializers[s][f]=me(this.writeGeometryElement,this)):f in a.serializers[s]||(a.serializers[s][f]=me(On)))}}const u=Object.assign({},a);u.node=e,_n(u,a.serializers,dr(void 0,s),h,i,l)}writeFeatureMembers_(e,n,i){const r=i[i.length-1],a=r.featureType,s=r.featureNS,o={};o[s]={},o[s][a]=me(this.writeFeatureElement,this);const l=Object.assign({},r);l.node=e,_n(l,o,dr(a,s),n,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,n,i){const r=n[n.length-1].node;return ut(this.namespace,n7e[r.nodeName])}GEOMETRY_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.multiSurface,s=r.surface,o=r.curve,l=r.multiCurve;return Array.isArray(e)?i="Envelope":(i=e.getType(),i==="MultiPolygon"&&a===!0?i="MultiSurface":i==="Polygon"&&s===!0?i="Surface":i==="LineString"&&o===!0?i="Curve":i==="MultiLineString"&&l===!0&&(i="MultiCurve")),ut(this.namespace,i)}writeGeometryNode(e,n){n=this.adaptOptions(n);const i=ut(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return n&&Object.assign(r,n),this.writeGeometryElement(i,e,[r]),i}writeFeaturesNode(e,n){n=this.adaptOptions(n);const i=ut(this.namespace,"featureMembers");i.setAttributeNS(H7,"xsi:schemaLocation",this.schemaLocation);const r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return n&&Object.assign(r,n),this.writeFeatureMembers_(i,e,[r]),i}}je.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:We(je.prototype.readFlatPos),posList:We(je.prototype.readFlatPosList),coordinates:We(xg.prototype.readFlatCoordinates)}},je.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:je.prototype.interiorParser,exterior:je.prototype.exteriorParser}},je.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Surface:We(je.prototype.readSurface),MultiSurface:We(je.prototype.readMultiSurface),Curve:We(je.prototype.readCurve),MultiCurve:We(je.prototype.readMultiCurve),Envelope:We(je.prototype.readEnvelope)}},je.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:st(je.prototype.curveMemberParser),curveMembers:st(je.prototype.curveMemberParser)}},je.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:st(je.prototype.surfaceMemberParser),surfaceMembers:st(je.prototype.surfaceMemberParser)}},je.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:st(pt.prototype.readLineString),Curve:st(je.prototype.readCurve)}},je.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:st(pt.prototype.readPolygon),Surface:st(je.prototype.readSurface)}},je.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:We(je.prototype.readPatch)}},je.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:We(je.prototype.readSegment)}},je.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:st(je.prototype.readFlatPosList),upperCorner:st(je.prototype.readFlatPosList)}},je.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:We(je.prototype.readPolygonPatch)}},je.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:y$(je.prototype.readLineStringSegment)}},pt.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:We(pt.prototype.readFlatLinearRing),Ring:We(je.prototype.readFlatCurveRing)}},je.prototype.writeFeatures,je.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:me(je.prototype.writeRing),interior:me(je.prototype.writeRing)}},je.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:me(On),upperCorner:me(On)}},je.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:me(je.prototype.writeSurfaceOrPolygonMember),polygonMember:me(je.prototype.writeSurfaceOrPolygonMember)}},je.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:me(je.prototype.writePointMember)}},je.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:me(je.prototype.writeLineStringOrCurveMember),curveMember:me(je.prototype.writeLineStringOrCurveMember)}},je.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:me(je.prototype.writeCurveOrLineString),MultiCurve:me(je.prototype.writeMultiCurveOrLineString),Point:me(je.prototype.writePoint),MultiPoint:me(je.prototype.writeMultiPoint),LineString:me(je.prototype.writeCurveOrLineString),MultiLineString:me(je.prototype.writeMultiCurveOrLineString),LinearRing:me(je.prototype.writeLinearRing),Polygon:me(je.prototype.writeSurfaceOrPolygon),MultiPolygon:me(je.prototype.writeMultiSurfaceOrPolygon),Surface:me(je.prototype.writeSurfaceOrPolygon),MultiSurface:me(je.prototype.writeMultiSurfaceOrPolygon),Envelope:me(je.prototype.writeEnvelope)}};const yt=je;class Nt extends yt{constructor(e){e=e||{},super(e),this.schemaLocation=e.schemaLocation?e.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}writeGeometryElement(e,n,i){const r=i[i.length-1];i[i.length-1]=Object.assign({multiCurve:!0,multiSurface:!0},r),super.writeGeometryElement(e,n,i)}}Nt.prototype.namespace="http://www.opengis.net/gml/3.2",Nt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:We(yt.prototype.readFlatPos),posList:We(yt.prototype.readFlatPosList),coordinates:We(xg.prototype.readFlatCoordinates)}},Nt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:yt.prototype.interiorParser,exterior:yt.prototype.exteriorParser}},Nt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Surface:We(Nt.prototype.readSurface),MultiSurface:We(yt.prototype.readMultiSurface),Curve:We(Nt.prototype.readCurve),MultiCurve:We(yt.prototype.readMultiCurve),Envelope:We(Nt.prototype.readEnvelope)}},Nt.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:st(yt.prototype.curveMemberParser),curveMembers:st(yt.prototype.curveMemberParser)}},Nt.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:st(yt.prototype.surfaceMemberParser),surfaceMembers:st(yt.prototype.surfaceMemberParser)}},Nt.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:st(pt.prototype.readLineString),Curve:st(yt.prototype.readCurve)}},Nt.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:st(pt.prototype.readPolygon),Surface:st(yt.prototype.readSurface)}},Nt.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:We(yt.prototype.readPatch)}},Nt.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:We(yt.prototype.readSegment)}},Nt.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:st(yt.prototype.readFlatPosList),upperCorner:st(yt.prototype.readFlatPosList)}},Nt.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:We(yt.prototype.readPolygonPatch)}},Nt.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:y$(yt.prototype.readLineStringSegment)}},Nt.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:st(pt.prototype.pointMemberParser),pointMembers:st(pt.prototype.pointMemberParser)}},Nt.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:st(pt.prototype.lineStringMemberParser),lineStringMembers:st(pt.prototype.lineStringMemberParser)}},Nt.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:st(pt.prototype.polygonMemberParser),polygonMembers:st(pt.prototype.polygonMemberParser)}},Nt.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:st(pt.prototype.readFlatCoordinatesFromNode)}},Nt.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:st(pt.prototype.readLineString)}},Nt.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:st(pt.prototype.readPolygon)}},Nt.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:We(pt.prototype.readFlatLinearRing),Ring:We(Nt.prototype.readFlatCurveRing)}},Nt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:me(yt.prototype.writeRing),interior:me(yt.prototype.writeRing)}},Nt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:me(On),upperCorner:me(On)}},Nt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:me(yt.prototype.writeSurfaceOrPolygonMember),polygonMember:me(yt.prototype.writeSurfaceOrPolygonMember)}},Nt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:me(yt.prototype.writePointMember)}},Nt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:me(yt.prototype.writeLineStringOrCurveMember),curveMember:me(yt.prototype.writeLineStringOrCurveMember)}},Nt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:me(yt.prototype.writeCurveOrLineString),MultiCurve:me(yt.prototype.writeMultiCurveOrLineString),Point:me(Nt.prototype.writePoint),MultiPoint:me(yt.prototype.writeMultiPoint),LineString:me(yt.prototype.writeCurveOrLineString),MultiLineString:me(yt.prototype.writeMultiCurveOrLineString),LinearRing:me(yt.prototype.writeLinearRing),Polygon:me(yt.prototype.writeSurfaceOrPolygon),MultiPolygon:me(yt.prototype.writeMultiSurfaceOrPolygon),Surface:me(yt.prototype.writeSurfaceOrPolygon),MultiSurface:me(yt.prototype.writeMultiSurfaceOrPolygon),Envelope:me(yt.prototype.writeEnvelope)}};const X7=Nt;class i7e{constructor(e){this.tagName_=e}getTagName(){return this.tagName_}}const b$=i7e;class r7e extends b${constructor(e,n){super(e),this.conditions=n,tt(this.conditions.length>=2,57)}}const a7e=r7e;class s7e extends a7e{constructor(e){super("And",Array.prototype.slice.call(arguments))}}const o7e=s7e;class l7e extends b${constructor(e,n,i){if(super("BBOX"),this.geometryName=e,this.extent=n,n.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=i}}const h7e=l7e;function u7e(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(o7e,e))}function c7e(t,e,n){return new h7e(t,e,n)}const S$={"http://www.opengis.net/gml":{boundedBy:aa(pt.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:st(pt.prototype.readFeaturesInternal)}},f7e={"http://www.opengis.net/wfs":{totalInserted:aa(ac),totalUpdated:aa(ac),totalDeleted:aa(ac)},"http://www.opengis.net/wfs/2.0":{totalInserted:aa(ac),totalUpdated:aa(ac),totalDeleted:aa(ac)}},d7e={"http://www.opengis.net/wfs":{TransactionSummary:aa(M$,"transactionSummary"),InsertResults:aa(R$,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:aa(M$,"transactionSummary"),InsertResults:aa(R$,"insertIds")}},g7e={"http://www.opengis.net/wfs":{PropertyName:me(On)},"http://www.opengis.net/wfs/2.0":{PropertyName:me(On)}},T$={"http://www.opengis.net/wfs":{Insert:me(I$),Update:me(z$),Delete:me(L$),Property:me(D$),Native:me(k$)},"http://www.opengis.net/wfs/2.0":{Insert:me(I$),Update:me(z$),Delete:me(L$),Property:me(D$),Native:me(k$)}},C$="feature",Y7="http://www.w3.org/2000/xmlns/",K7={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},J7={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Q7={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},A$={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},eb={"2.0.0":X7,"1.1.0":yt,"1.0.0":xg},v7e="1.1.0";class p7e extends w${constructor(e){super(),e=e||{},this.version_=e.version?e.version:v7e,this.featureType_=e.featureType,this.featureNS_=e.featureNS,this.gmlFormat_=e.gmlFormat?e.gmlFormat:new eb[this.version_],this.schemaLocation_=e.schemaLocation?e.schemaLocation:A$[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(e){this.featureType_=e}readFeaturesFromNode(e,n){const i={node:e};Object.assign(i,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(i,this.getReadOptions(e,n||{}));const r=[i];let a;this.version_==="2.0.0"?a=S$:a=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let s=Vt([],a,e,r,this.gmlFormat_);return s||(s=[]),s}readTransactionResponse(e){if(!!e){if(typeof e=="string"){const n=rc(e);return this.readTransactionResponseFromDocument(n)}return ic(e)?this.readTransactionResponseFromDocument(e):this.readTransactionResponseFromNode(e)}}readFeatureCollectionMetadata(e){if(!!e){if(typeof e=="string"){const n=rc(e);return this.readFeatureCollectionMetadataFromDocument(n)}return ic(e)?this.readFeatureCollectionMetadataFromDocument(e):this.readFeatureCollectionMetadataFromNode(e)}}readFeatureCollectionMetadataFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)}readFeatureCollectionMetadataFromNode(e){const n={},i=sc(e.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,Vt(n,S$,e,[],this.gmlFormat_)}readTransactionResponseFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)}readTransactionResponseFromNode(e){return Vt({},d7e,e,[])}writeGetFeature(e){const n=ut(J7[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),e.handle&&n.setAttribute("handle",e.handle),e.outputFormat&&n.setAttribute("outputFormat",e.outputFormat),e.maxFeatures!==void 0&&n.setAttribute("maxFeatures",String(e.maxFeatures)),e.resultType&&n.setAttribute("resultType",e.resultType),e.startIndex!==void 0&&n.setAttribute("startIndex",String(e.startIndex)),e.count!==void 0&&n.setAttribute("count",String(e.count)),e.viewParams!==void 0&&n.setAttribute("viewParams",e.viewParams),n.setAttributeNS(H7,"xsi:schemaLocation",this.schemaLocation_);const i={node:n};if(Object.assign(i,{version:this.version_,srsName:e.srsName,featureNS:e.featureNS?e.featureNS:this.featureNS_,featurePrefix:e.featurePrefix,propertyNames:e.propertyNames?e.propertyNames:[]}),tt(Array.isArray(e.featureTypes),11),typeof e.featureTypes[0]=="string"){let r=e.filter;e.bbox&&(tt(e.geometryName,12),r=this.combineBboxAndFilter(e.geometryName,e.bbox,e.srsName,r)),Object.assign(i,{geometryName:e.geometryName,filter:r}),$$(n,e.featureTypes,[i])}else e.featureTypes.forEach(r=>{const a=this.combineBboxAndFilter(r.geometryName,r.bbox,e.srsName,e.filter);Object.assign(i,{geometryName:r.geometryName,filter:a}),$$(n,[r.name],[i])});return n}combineBboxAndFilter(e,n,i,r){const a=c7e(e,n,i);return r?u7e(r,a):a}writeTransaction(e,n,i,r){const a=[],s=r.version?r.version:this.version_,o=ut(J7[s],"Transaction");o.setAttribute("service","WFS"),o.setAttribute("version",s);let l;r&&(l=r.gmlOptions?r.gmlOptions:{},r.handle&&o.setAttribute("handle",r.handle)),o.setAttributeNS(H7,"xsi:schemaLocation",A$[s]);const h=m7e(o,l,s,r);return e&&K3("Insert",e,a,h),n&&K3("Update",n,a,h),i&&K3("Delete",i,a,h),r.nativeElements&&K3("Native",r.nativeElements,a,h),o}readProjectionFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null}readProjectionFromNode(e){if(e.firstElementChild&&e.firstElementChild.firstElementChild){e=e.firstElementChild.firstElementChild;for(let n=e.firstElementChild;n;n=n.nextElementSibling)if(!(n.childNodes.length===0||n.childNodes.length===1&&n.firstChild.nodeType===3)){const i=[{}];return this.gmlFormat_.readGeometryElement(n,i),_t(i.pop().srsName)}}return null}}function m7e(t,e,n,i){const r=i.featurePrefix?i.featurePrefix:C$;let a;return n==="1.0.0"?a=2:n==="1.1.0"?a=3:n==="2.0.0"&&(a=3.2),Object.assign({node:t},{version:n,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:r,gmlVersion:a,hasZ:i.hasZ,srsName:i.srsName},e)}function K3(t,e,n,i){_n(i,T$,dr(t),e,n)}function M$(t,e){return Vt({},f7e,t,e)}const y7e={"http://www.opengis.net/ogc":{FeatureId:st(function(t,e){return t.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:st(function(t,e){return t.getAttribute("fid")})}};function E$(t,e){zl(y7e,t,e)}const _7e={"http://www.opengis.net/wfs":{Feature:E$},"http://www.opengis.net/wfs/2.0":{Feature:E$}};function R$(t,e){return Vt([],_7e,t,e)}function I$(t,e,n){const i=n[n.length-1],r=i.featureType,a=i.featureNS,s=i.gmlVersion,o=ut(a,r);t.appendChild(o),s===2?xg.prototype.writeFeatureElement(o,e,n):s===3?yt.prototype.writeFeatureElement(o,e,n):X7.prototype.writeFeatureElement(o,e,n)}function P$(t,e,n){const r=n[n.length-1].version,a=K7[r],s=ut(a,"Filter"),o=ut(a,"FeatureId");s.appendChild(o),o.setAttribute("fid",e),t.appendChild(s)}function tb(t,e){t=t||C$;const n=t+":";return e.startsWith(n)?e:n+e}function L$(t,e,n){const i=n[n.length-1];tt(e.getId()!==void 0,26);const r=i.featureType,a=i.featurePrefix,s=i.featureNS,o=tb(a,r);t.setAttribute("typeName",o),t.setAttributeNS(Y7,"xmlns:"+a,s);const l=e.getId();l!==void 0&&P$(t,l,n)}function z$(t,e,n){const i=n[n.length-1];tt(e.getId()!==void 0,27);const r=i.version,a=i.featureType,s=i.featurePrefix,o=i.featureNS,l=tb(s,a),h=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(Y7,"xmlns:"+s,o);const u=e.getId();if(u!==void 0){const c=e.getKeys(),f=[];for(let d=0,g=c.length;d<g;d++){const p=e.get(c[d]);if(p!==void 0){let v=c[d];p&&typeof p.getSimplifiedGeometry=="function"&&(v=h),f.push({name:v,value:p})}}_n({version:r,gmlVersion:i.gmlVersion,node:t,hasZ:i.hasZ,srsName:i.srsName},T$,dr("Property"),f,n),P$(t,u,n)}}function D$(t,e,n){const i=n[n.length-1],r=i.version,a=J7[r],s=ut(a,"Name"),o=i.gmlVersion;if(t.appendChild(s),On(s,e.name),e.value!==void 0&&e.value!==null){const l=ut(a,"Value");t.appendChild(l),e.value&&typeof e.value.getSimplifiedGeometry=="function"?o===2?xg.prototype.writeGeometryElement(l,e.value,n):o===3?yt.prototype.writeGeometryElement(l,e.value,n):X7.prototype.writeGeometryElement(l,e.value,n):On(l,e.value)}}function k$(t,e,n){e.vendorId&&t.setAttribute("vendorId",e.vendorId),e.safeToIgnore!==void 0&&t.setAttribute("safeToIgnore",String(e.safeToIgnore)),e.value!==void 0&&On(t,e.value)}const J3={"http://www.opengis.net/wfs":{Query:me(O$)},"http://www.opengis.net/wfs/2.0":{Query:me(O$)},"http://www.opengis.net/ogc":{During:me(B$),And:me(Q3),Or:me(Q3),Not:me(G$),BBOX:me(F$),Contains:me(Co),Intersects:me(Co),Within:me(Co),DWithin:me(N$),PropertyIsEqualTo:me(zr),PropertyIsNotEqualTo:me(zr),PropertyIsLessThan:me(zr),PropertyIsLessThanOrEqualTo:me(zr),PropertyIsGreaterThan:me(zr),PropertyIsGreaterThanOrEqualTo:me(zr),PropertyIsNull:me(j$),PropertyIsBetween:me(U$),PropertyIsLike:me(q$)},"http://www.opengis.net/fes/2.0":{During:me(B$),And:me(Q3),Or:me(Q3),Not:me(G$),BBOX:me(F$),Contains:me(Co),Disjoint:me(Co),Intersects:me(Co),ResourceId:me(w7e),Within:me(Co),DWithin:me(N$),PropertyIsEqualTo:me(zr),PropertyIsNotEqualTo:me(zr),PropertyIsLessThan:me(zr),PropertyIsLessThanOrEqualTo:me(zr),PropertyIsGreaterThan:me(zr),PropertyIsGreaterThanOrEqualTo:me(zr),PropertyIsNull:me(j$),PropertyIsBetween:me(U$),PropertyIsLike:me(q$)}};function O$(t,e,n){const i=n[n.length-1],r=i.version,a=i.featurePrefix,s=i.featureNS,o=i.propertyNames,l=i.srsName;let h;a?h=tb(a,e):h=e;let u;r==="2.0.0"?u="typeNames":u="typeName",t.setAttribute(u,h),l&&t.setAttribute("srsName",l),s&&t.setAttributeNS(Y7,"xmlns:"+a,s);const c=Object.assign({},i);c.node=t,_n(c,g7e,dr("PropertyName"),o,n);const f=i.filter;if(f){const d=ut(np(r),"Filter");t.appendChild(d),x7e(d,f,n)}}function x7e(t,e,n){const i=n[n.length-1],r={node:t};Object.assign(r,{context:i}),_n(r,J3,dr(e.getTagName()),[e],n)}function F$(t,e,n){const i=n[n.length-1],a=i.context.version;i.srsName=e.srsName;const s=eb[a];oc(a,t,e.geometryName),s.prototype.writeGeometryElement(t,e.extent,n)}function w7e(t,e,n){t.setAttribute("rid",e.rid)}function Co(t,e,n){const i=n[n.length-1],a=i.context.version;i.srsName=e.srsName;const s=eb[a];oc(a,t,e.geometryName),s.prototype.writeGeometryElement(t,e.geometry,n)}function N$(t,e,n){const a=n[n.length-1].context.version;Co(t,e,n);const s=ut(np(a),"Distance");On(s,e.distance.toString()),a==="2.0.0"?s.setAttribute("uom",e.unit):s.setAttribute("units",e.unit),t.appendChild(s)}function B$(t,e,n){const a=n[n.length-1].context.version;ep(Q7[a],"ValueReference",t,e.propertyName);const s=ut(bs,"TimePeriod");t.appendChild(s);const o=ut(bs,"begin");s.appendChild(o),V$(o,e.begin);const l=ut(bs,"end");s.appendChild(l),V$(l,e.end)}function Q3(t,e,n){const r=n[n.length-1].context,a={node:t};Object.assign(a,{context:r});const s=e.conditions;for(let o=0,l=s.length;o<l;++o){const h=s[o];_n(a,J3,dr(h.getTagName()),[h],n)}}function G$(t,e,n){const r=n[n.length-1].context,a={node:t};Object.assign(a,{context:r});const s=e.condition;_n(a,J3,dr(s.getTagName()),[s],n)}function zr(t,e,n){const a=n[n.length-1].context.version;e.matchCase!==void 0&&t.setAttribute("matchCase",e.matchCase.toString()),oc(a,t,e.propertyName),tp(a,t,""+e.expression)}function j$(t,e,n){const a=n[n.length-1].context.version;oc(a,t,e.propertyName)}function U$(t,e,n){const a=n[n.length-1].context.version,s=np(a);oc(a,t,e.propertyName);const o=ut(s,"LowerBoundary");t.appendChild(o),tp(a,o,""+e.lowerBoundary);const l=ut(s,"UpperBoundary");t.appendChild(l),tp(a,l,""+e.upperBoundary)}function q$(t,e,n){const a=n[n.length-1].context.version;t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),e.matchCase!==void 0&&t.setAttribute("matchCase",e.matchCase.toString()),oc(a,t,e.propertyName),tp(a,t,""+e.pattern)}function ep(t,e,n,i){const r=ut(t,e);On(r,i),n.appendChild(r)}function tp(t,e,n){ep(np(t),"Literal",e,n)}function oc(t,e,n){t==="2.0.0"?ep(Q7[t],"ValueReference",e,n):ep(K7[t],"PropertyName",e,n)}function V$(t,e){const n=ut(bs,"TimeInstant");t.appendChild(n);const i=ut(bs,"timePosition");n.appendChild(i),On(i,e)}function $$(t,e,n){const i=n[n.length-1],r=Object.assign({},i);r.node=t,_n(r,J3,dr("Query"),e,n)}function np(t){let e;return t==="2.0.0"?e=Q7[t]:e=K7[t],e}const b7e=p7e,S7e={name:"v-gd-route",render(){return null},extends:or,inject:["VMap"],props:{interval:{type:Number,default:1e4},layerId:{type:String,default(){return`traffic-layer-${$e()}`}},colors:{type:Array,default(){return["#4fd27d","#ffd045","#e80e0e","#b40000","#8f979c"]}},url:String},data(){return{source:null,layer:null,eventList:["singleclick","pointermove"],eventRender:[],timer:null}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){return Be(this,null,function*(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.layer.setVisible(t),this.layer&&this.layer.getVisible()&&(yield this.reload())})},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},methods:{getColor(t){switch(t){case t===1:return this.colors[0];case t===2:return this.colors[1];case t===3:return this.colors[2];case t===4:return this.colors[3];case t===-1:return this.colors[4];default:return this.colors[0]}},getData(){return Be(this,null,function*(){const t=new FormData;t.append("f","geojson"),t.append("returnGeometry",!0);const n=this.map.getView().calculateExtent(this.map.getSize()),i=[[n[0],n[1]],[n[2],n[1]],[n[2],n[3]],[n[0],n[3]],[n[0],n[1]]],r={type:"Polygon",coordinates:[i]};return t.append("geometry",JSON.stringify(r)),fetch(this.url,{method:"POST",body:t}).then(a=>a.json()).then(a=>a)})},init(){return Be(this,null,function*(){if(!this.url)return;this.source=new si;const t=Je(De({},this.$props),{source:this.source,style:e=>{const n=e.get("state"),i=this.getColor(Number(n));return new ft({stroke:new Dt({color:i,width:4})})}});this.layer=new Jt(t),this.layer.set("id",this.layerId),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.eventList.forEach(e=>{this.eventRender.push(this.map.on(e,n=>this.eventHandler(e,n)))}),this.map.getView().once("change:resolution",()=>{this.map.once("moveend",e=>{this.zoomEnd(e)})}),this.layer&&this.layer.getVisible()&&(yield this.reload())})},zoomEnd(t){return Be(this,null,function*(){this.layer&&this.layer.getVisible()&&(yield this.renderRoute()),t.map.once("moveend",e=>{this.zoomEnd(e)})})},renderRoute(){return Be(this,null,function*(){const t=yield this.getData(),{featureCount:e}=t;if(e>0){const n=new Ko().readFeatures(t);this.source&&(this.source.clear(),this.source.addFeatures(n))}})},reload(){return Be(this,null,function*(){yield this.renderRoute(),this.timer=setTimeout(()=>Be(this,null,function*(){this.layer&&this.layer.getVisible()&&(yield this.reload())}),this.interval)})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.layer)==null?void 0:i.get("id")))return e},{})},dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.eventRender.forEach(t=>{mr(t)}),this.map.removeLayer(this.layer)}},mounted(){this.init()},beforeDestroy(){this.dispose()}};let T7e,C7e;const H$={};var W$=qn(S7e,T7e,C7e,!1,A7e,null,null,null);function A7e(t){for(let e in H$)this[e]=H$[e]}W$.options.__file="src/components/layers/gd-route/index.vue";const wg=function(){return W$.exports}();wg.install=function(t){t.component(wg.name,wg)};const M7e={name:"v-wfs",render(){return null},extends:or,inject:["VMap"],components:{},props:{layerId:{type:String,default:`vector-layer-${$e()}`},options:{type:Object,default:()=>({})},layerStyle:{type:Object,default:()=>({})}},data(){return{vectorLayer:null,vectorSource:null,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){this.vectorLayer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.vectorLayer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.vectorLayer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.vectorLayer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.vectorLayer.setExtent(t)},immediate:!1,deep:!0}},methods:{init(){this.vectorSource=new si,this.vectorLayer=new Jt(Je(De({},this.$props),{source:this.vectorSource,style:t=>Bh(t,this.layerStyle,this.map)})),this.vectorLayer.set("id",this.layerId),this.map.addLayer(this.vectorLayer),this.eventList.forEach(t=>{this.eventRender.push(this.map.on(t,e=>this.eventHandler(t,e)))}),this.addFeatures()},addFeatures(){if(!rt(this.options,"featureNS"))throw new Error("featureNS is required");const t=new b7e().writeGetFeature(Je(De({},this.options),{outputFormat:"application/json"}));fetch(this.options.featureNS,{method:"POST",body:new XMLSerializer().serializeToString(t)}).then(function(e){return e.json()}).then(e=>{const n=new Ko().readFeatures(e);this.vectorSource.addFeatures(n)})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.vectorLayer)==null?void 0:i.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)}},created(){},mounted(){this.init()}};let E7e,R7e;const Z$={};var X$=qn(M7e,E7e,R7e,!1,I7e,null,null,null);function I7e(t){for(let e in Z$)this[e]=Z$[e]}X$.options.__file="src/components/layers/wfs/index.vue";const bg=function(){return X$.exports}();bg.install=function(t){t.component(bg.name,bg)};const Y$=[Rf,Ff,Nf,eu,Uf,qf,Zf,Xf,Yf,Kf,Jf,dg,gg,cg,mg,yg,wg,bg],nb=function(t){nb.installed||Y$.forEach(e=>{t.component(e.name,e)})};typeof window!="undefined"&&window.Vue&&nb(window.Vue);const P7e=De({install:nb},Y$);class L7e extends tl{decodeBlock(e){return e}}const z7e=Object.freeze(Object.defineProperty({__proto__:null,default:L7e},Symbol.toStringTag,{value:"Module"})),K$=9,ib=256,rb=257,D7e=12;function k7e(t,e,n){const i=e%8,r=Math.floor(e/8),a=8-i,s=e+n-(r+1)*8;let o=8*(r+2)-(e+n);const l=(r+2)*8-e;if(o=Math.max(0,o),r>=t.length)return rb;let h=t[r]&pr(2,8-i)-1;h<<=n-a;let u=h;if(r+1<t.length){let c=t[r+1]>>>o;c<<=Math.max(0,n-l),u+=c}if(s>8&&r+2<t.length){const c=(r+3)*8-(e+n);u+=t[r+2]>>>c}return u}function ab(t,e){for(let n=e.length-1;n>=0;n--)t.push(e[n]);return t}function O7e(t){const e=new Uint16Array(4093),n=new Uint8Array(4093);for(let g=0;g<=257;g++)e[g]=4096,n[g]=g;let i=258,r=K$,a=0;function s(){i=258,r=K$}function o(g){const p=k7e(g,a,r);return a+=r,p}function l(g,p){return n[i]=p,e[i]=g,i++,i-1}function h(g){const p=[];for(let v=g;v!==4096;v=e[v])p.push(n[v]);return p}const u=[];s();const c=new Uint8Array(t);let f=o(c),d;for(;f!==rb;){if(f===ib){for(s(),f=o(c);f===ib;)f=o(c);if(f===rb)break;if(f>ib)throw new Error(`corrupted code at scanline ${f}`);{const g=h(f);ab(u,g),d=f}}else if(f<i){const g=h(f);ab(u,g),l(d,g[g.length-1]),d=f}else{const g=h(d);if(!g)throw new Error(`Bogus entry. Not in dictionary, ${d} / ${i}, position: ${a}`);ab(u,g),u.push(g[g.length-1]),l(d,g[g.length-1]),d=f}i+1>=pr(2,r)&&(r===D7e?d=void 0:r++),f=o(c)}return new Uint8Array(u)}class F7e extends tl{decodeBlock(e){return O7e(e).buffer}}const N7e=Object.freeze(Object.defineProperty({__proto__:null,default:F7e},Symbol.toStringTag,{value:"Module"})),Sg=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),ip=4017,rp=799,ap=3406,sp=2276,op=1567,lp=3784,lc=5793,hp=2896;function J$(t,e){let n=0;const i=[];let r=16;for(;r>0&&!t[r-1];)--r;i.push({children:[],index:0});let a=i[0],s;for(let o=0;o<r;o++){for(let l=0;l<t[o];l++){for(a=i.pop(),a.children[a.index]=e[n];a.index>0;)a=i.pop();for(a.index++,i.push(a);i.length<=o;)i.push(s={children:[],index:0}),a.children[a.index]=s.children,a=s;n++}o+1<r&&(i.push(s={children:[],index:0}),a.children[a.index]=s.children,a=s)}return i[0].children}function B7e(t,e,n,i,r,a,s,o,l){const{mcusPerLine:h,progressive:u}=n,c=e;let f=e,d=0,g=0;function p(){if(g>0)return g--,d>>g&1;if(d=t[f++],d===255){const N=t[f++];if(N)throw new Error(`unexpected marker: ${(d<<8|N).toString(16)}`)}return g=7,d>>>7}function v(N){let U=N,j;for(;(j=p())!==null;){if(U=U[j],typeof U=="number")return U;if(typeof U!="object")throw new Error("invalid huffman sequence")}return null}function m(N){let U=N,j=0;for(;U>0;){const q=p();if(q===null)return;j=j<<1|q,--U}return j}function y(N){const U=m(N);return U>=1<<N-1?U:U+(-1<<N)+1}function _(N,U){const j=v(N.huffmanTableDC),q=j===0?0:y(j);N.pred+=q,U[0]=N.pred;let V=1;for(;V<64;){const $=v(N.huffmanTableAC),Z=$&15,K=$>>4;if(Z===0){if(K<15)break;V+=16}else{V+=K;const J=Sg[V];U[J]=y(Z),V++}}}function w(N,U){const j=v(N.huffmanTableDC),q=j===0?0:y(j)<<l;N.pred+=q,U[0]=N.pred}function S(N,U){U[0]|=p()<<l}let b=0;function x(N,U){if(b>0){b--;return}let j=a;const q=s;for(;j<=q;){const V=v(N.huffmanTableAC),$=V&15,Z=V>>4;if($===0){if(Z<15){b=m(Z)+(1<<Z)-1;break}j+=16}else{j+=Z;const K=Sg[j];U[K]=y($)*(1<<l),j++}}}let T=0,C;function A(N,U){let j=a;const q=s;let V=0;for(;j<=q;){const $=Sg[j],Z=U[$]<0?-1:1;switch(T){case 0:{const K=v(N.huffmanTableAC),J=K&15;if(V=K>>4,J===0)V<15?(b=m(V)+(1<<V),T=4):(V=16,T=1);else{if(J!==1)throw new Error("invalid ACn encoding");C=y(J),T=V?2:3}continue}case 1:case 2:U[$]?U[$]+=(p()<<l)*Z:(V--,V===0&&(T=T===2?3:0));break;case 3:U[$]?U[$]+=(p()<<l)*Z:(U[$]=C<<l,T=0);break;case 4:U[$]&&(U[$]+=(p()<<l)*Z);break}j++}T===4&&(b--,b===0&&(T=0))}function M(N,U,j,q,V){const $=j/h|0,Z=j%h,K=$*N.v+q,J=Z*N.h+V;U(N,N.blocks[K][J])}function E(N,U,j){const q=j/N.blocksPerLine|0,V=j%N.blocksPerLine;U(N,N.blocks[q][V])}const R=i.length;let P,I,L,D,F,G;u?a===0?G=o===0?w:S:G=o===0?x:A:G=_;let B=0,z,k;R===1?k=i[0].blocksPerLine*i[0].blocksPerColumn:k=h*n.mcusPerColumn;const O=r||k;for(;B<k;){for(I=0;I<R;I++)i[I].pred=0;if(b=0,R===1)for(P=i[0],F=0;F<O;F++)E(P,G,B),B++;else for(F=0;F<O;F++){for(I=0;I<R;I++){P=i[I];const{h:N,v:U}=P;for(L=0;L<U;L++)for(D=0;D<N;D++)M(P,G,B,L,D)}if(B++,B===k)break}if(g=0,z=t[f]<<8|t[f+1],z<65280)throw new Error("marker was not found");if(z>=65488&&z<=65495)f+=2;else break}return f-c}function G7e(t,e){const n=[],{blocksPerLine:i,blocksPerColumn:r}=e,a=i<<3,s=new Int32Array(64),o=new Uint8Array(64);function l(h,u,c){const f=e.quantizationTable;let d,g,p,v,m,y,_,w,S;const b=c;let x;for(x=0;x<64;x++)b[x]=h[x]*f[x];for(x=0;x<8;++x){const T=8*x;if(b[1+T]===0&&b[2+T]===0&&b[3+T]===0&&b[4+T]===0&&b[5+T]===0&&b[6+T]===0&&b[7+T]===0){S=lc*b[0+T]+512>>10,b[0+T]=S,b[1+T]=S,b[2+T]=S,b[3+T]=S,b[4+T]=S,b[5+T]=S,b[6+T]=S,b[7+T]=S;continue}d=lc*b[0+T]+128>>8,g=lc*b[4+T]+128>>8,p=b[2+T],v=b[6+T],m=hp*(b[1+T]-b[7+T])+128>>8,w=hp*(b[1+T]+b[7+T])+128>>8,y=b[3+T]<<4,_=b[5+T]<<4,S=d-g+1>>1,d=d+g+1>>1,g=S,S=p*lp+v*op+128>>8,p=p*op-v*lp+128>>8,v=S,S=m-_+1>>1,m=m+_+1>>1,_=S,S=w+y+1>>1,y=w-y+1>>1,w=S,S=d-v+1>>1,d=d+v+1>>1,v=S,S=g-p+1>>1,g=g+p+1>>1,p=S,S=m*sp+w*ap+2048>>12,m=m*ap-w*sp+2048>>12,w=S,S=y*rp+_*ip+2048>>12,y=y*ip-_*rp+2048>>12,_=S,b[0+T]=d+w,b[7+T]=d-w,b[1+T]=g+_,b[6+T]=g-_,b[2+T]=p+y,b[5+T]=p-y,b[3+T]=v+m,b[4+T]=v-m}for(x=0;x<8;++x){const T=x;if(b[1*8+T]===0&&b[2*8+T]===0&&b[3*8+T]===0&&b[4*8+T]===0&&b[5*8+T]===0&&b[6*8+T]===0&&b[7*8+T]===0){S=lc*c[x+0]+8192>>14,b[0*8+T]=S,b[1*8+T]=S,b[2*8+T]=S,b[3*8+T]=S,b[4*8+T]=S,b[5*8+T]=S,b[6*8+T]=S,b[7*8+T]=S;continue}d=lc*b[0*8+T]+2048>>12,g=lc*b[4*8+T]+2048>>12,p=b[2*8+T],v=b[6*8+T],m=hp*(b[1*8+T]-b[7*8+T])+2048>>12,w=hp*(b[1*8+T]+b[7*8+T])+2048>>12,y=b[3*8+T],_=b[5*8+T],S=d-g+1>>1,d=d+g+1>>1,g=S,S=p*lp+v*op+2048>>12,p=p*op-v*lp+2048>>12,v=S,S=m-_+1>>1,m=m+_+1>>1,_=S,S=w+y+1>>1,y=w-y+1>>1,w=S,S=d-v+1>>1,d=d+v+1>>1,v=S,S=g-p+1>>1,g=g+p+1>>1,p=S,S=m*sp+w*ap+2048>>12,m=m*ap-w*sp+2048>>12,w=S,S=y*rp+_*ip+2048>>12,y=y*ip-_*rp+2048>>12,_=S,b[0*8+T]=d+w,b[7*8+T]=d-w,b[1*8+T]=g+_,b[6*8+T]=g-_,b[2*8+T]=p+y,b[5*8+T]=p-y,b[3*8+T]=v+m,b[4*8+T]=v-m}for(x=0;x<64;++x){const T=128+(b[x]+8>>4);T<0?u[x]=0:T>255?u[x]=255:u[x]=T}}for(let h=0;h<r;h++){const u=h<<3;for(let c=0;c<8;c++)n.push(new Uint8Array(a));for(let c=0;c<i;c++){l(e.blocks[h][c],o,s);let f=0;const d=c<<3;for(let g=0;g<8;g++){const p=n[u+g];for(let v=0;v<8;v++)p[d+v]=o[f++]}}}return n}class j7e{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let n=0;function i(){const o=e[n]<<8|e[n+1];return n+=2,o}function r(){const o=i(),l=e.subarray(n,n+o-2);return n+=l.length,l}function a(o){let l=0,h=0,u,c;for(c in o.components)o.components.hasOwnProperty(c)&&(u=o.components[c],l<u.h&&(l=u.h),h<u.v&&(h=u.v));const f=Math.ceil(o.samplesPerLine/8/l),d=Math.ceil(o.scanLines/8/h);for(c in o.components)if(o.components.hasOwnProperty(c)){u=o.components[c];const g=Math.ceil(Math.ceil(o.samplesPerLine/8)*u.h/l),p=Math.ceil(Math.ceil(o.scanLines/8)*u.v/h),v=f*u.h,m=d*u.v,y=[];for(let _=0;_<m;_++){const w=[];for(let S=0;S<v;S++)w.push(new Int32Array(64));y.push(w)}u.blocksPerLine=g,u.blocksPerColumn=p,u.blocks=y}o.maxH=l,o.maxV=h,o.mcusPerLine=f,o.mcusPerColumn=d}let s=i();if(s!==65496)throw new Error("SOI not found");for(s=i();s!==65497;){switch(s){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const o=r();s===65504&&o[0]===74&&o[1]===70&&o[2]===73&&o[3]===70&&o[4]===0&&(this.jfif={version:{major:o[5],minor:o[6]},densityUnits:o[7],xDensity:o[8]<<8|o[9],yDensity:o[10]<<8|o[11],thumbWidth:o[12],thumbHeight:o[13],thumbData:o.subarray(14,14+3*o[12]*o[13])}),s===65518&&o[0]===65&&o[1]===100&&o[2]===111&&o[3]===98&&o[4]===101&&o[5]===0&&(this.adobe={version:o[6],flags0:o[7]<<8|o[8],flags1:o[9]<<8|o[10],transformCode:o[11]});break}case 65499:{const l=i()+n-2;for(;n<l;){const h=e[n++],u=new Int32Array(64);if(h>>4===0)for(let c=0;c<64;c++){const f=Sg[c];u[f]=e[n++]}else if(h>>4===1)for(let c=0;c<64;c++){const f=Sg[c];u[f]=i()}else throw new Error("DQT: invalid table spec");this.quantizationTables[h&15]=u}break}case 65472:case 65473:case 65474:{i();const o={extended:s===65473,progressive:s===65474,precision:e[n++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},l=e[n++];let h;for(let u=0;u<l;u++){h=e[n];const c=e[n+1]>>4,f=e[n+1]&15,d=e[n+2];o.componentsOrder.push(h),o.components[h]={h:c,v:f,quantizationIdx:d},n+=3}a(o),this.frames.push(o);break}case 65476:{const o=i();for(let l=2;l<o;){const h=e[n++],u=new Uint8Array(16);let c=0;for(let d=0;d<16;d++,n++)u[d]=e[n],c+=u[d];const f=new Uint8Array(c);for(let d=0;d<c;d++,n++)f[d]=e[n];l+=17+c,h>>4===0?this.huffmanTablesDC[h&15]=J$(u,f):this.huffmanTablesAC[h&15]=J$(u,f)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const o=e[n++],l=[],h=this.frames[0];for(let g=0;g<o;g++){const p=h.components[e[n++]],v=e[n++];p.huffmanTableDC=this.huffmanTablesDC[v>>4],p.huffmanTableAC=this.huffmanTablesAC[v&15],l.push(p)}const u=e[n++],c=e[n++],f=e[n++];n+=B7e(e,n,h,l,this.resetInterval,u,c,f>>4,f&15);break}case 65535:e[n]!==255&&n--;break;default:if(e[n-3]===255&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}throw new Error(`unknown JPEG marker ${s.toString(16)}`)}s=i()}}getResult(){const{frames:e}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1;for(let u=0;u<this.frames.length;u++){const c=this.frames[u].components;for(const f of Object.keys(c))c[f].quantizationTable=this.quantizationTables[c[f].quantizationIdx],delete c[f].quantizationIdx}const n=e[0],{components:i,componentsOrder:r}=n,a=[],s=n.samplesPerLine,o=n.scanLines;for(let u=0;u<r.length;u++){const c=i[r[u]];a.push({lines:G7e(n,c),scaleX:c.h/n.maxH,scaleY:c.v/n.maxV})}const l=new Uint8Array(s*o*a.length);let h=0;for(let u=0;u<o;++u)for(let c=0;c<s;++c)for(let f=0;f<a.length;++f){const d=a[f];l[h]=d.lines[0|u*d.scaleY][0|c*d.scaleX],++h}return l}}class U7e extends tl{constructor(e){super(),this.reader=new j7e,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}const q7e=Object.freeze(Object.defineProperty({__proto__:null,default:U7e},Symbol.toStringTag,{value:"Module"}));/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const V7e=4,Q$=0,eH=1,$7e=2;function hc(t){let e=t.length;for(;--e>=0;)t[e]=0}const H7e=0,tH=1,W7e=2,Z7e=3,X7e=258,sb=29,Tg=256,Cg=Tg+1+sb,uc=30,ob=19,nH=2*Cg+1,Dl=15,lb=16,Y7e=7,hb=256,iH=16,rH=17,aH=18,ub=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),up=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),K7e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),sH=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),J7e=512,Ss=new Array((Cg+2)*2);hc(Ss);const Ag=new Array(uc*2);hc(Ag);const Mg=new Array(J7e);hc(Mg);const Eg=new Array(X7e-Z7e+1);hc(Eg);const cb=new Array(sb);hc(cb);const cp=new Array(uc);hc(cp);function fb(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let oH,lH,hH;function db(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const uH=t=>t<256?Mg[t]:Mg[256+(t>>>7)],Rg=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},Ki=(t,e,n)=>{t.bi_valid>lb-n?(t.bi_buf|=e<<t.bi_valid&65535,Rg(t,t.bi_buf),t.bi_buf=e>>lb-t.bi_valid,t.bi_valid+=n-lb):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},ja=(t,e,n)=>{Ki(t,n[e*2],n[e*2+1])},cH=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},Q7e=t=>{t.bi_valid===16?(Rg(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},ebe=(t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,u,c,f,d,g,p=0;for(f=0;f<=Dl;f++)t.bl_count[f]=0;for(n[t.heap[t.heap_max]*2+1]=0,h=t.heap_max+1;h<nH;h++)u=t.heap[h],f=n[n[u*2+1]*2+1]+1,f>l&&(f=l,p++),n[u*2+1]=f,!(u>i)&&(t.bl_count[f]++,d=0,u>=o&&(d=s[u-o]),g=n[u*2],t.opt_len+=g*(f+d),a&&(t.static_len+=g*(r[u*2+1]+d)));if(p!==0){do{for(f=l-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(f=l;f!==0;f--)for(u=t.bl_count[f];u!==0;)c=t.heap[--h],!(c>i)&&(n[c*2+1]!==f&&(t.opt_len+=(f-n[c*2+1])*n[c*2],n[c*2+1]=f),u--)}},fH=(t,e,n)=>{const i=new Array(Dl+1);let r=0,a,s;for(a=1;a<=Dl;a++)r=r+n[a-1]<<1,i[a]=r;for(s=0;s<=e;s++){let o=t[s*2+1];o!==0&&(t[s*2]=cH(i[o]++,o))}},tbe=()=>{let t,e,n,i,r;const a=new Array(Dl+1);for(n=0,i=0;i<sb-1;i++)for(cb[i]=n,t=0;t<1<<ub[i];t++)Eg[n++]=i;for(Eg[n-1]=i,r=0,i=0;i<16;i++)for(cp[i]=r,t=0;t<1<<up[i];t++)Mg[r++]=i;for(r>>=7;i<uc;i++)for(cp[i]=r<<7,t=0;t<1<<up[i]-7;t++)Mg[256+r++]=i;for(e=0;e<=Dl;e++)a[e]=0;for(t=0;t<=143;)Ss[t*2+1]=8,t++,a[8]++;for(;t<=255;)Ss[t*2+1]=9,t++,a[9]++;for(;t<=279;)Ss[t*2+1]=7,t++,a[7]++;for(;t<=287;)Ss[t*2+1]=8,t++,a[8]++;for(fH(Ss,Cg+1,a),t=0;t<uc;t++)Ag[t*2+1]=5,Ag[t*2]=cH(t,5);oH=new fb(Ss,ub,Tg+1,Cg,Dl),lH=new fb(Ag,up,0,uc,Dl),hH=new fb(new Array(0),K7e,0,ob,Y7e)},dH=t=>{let e;for(e=0;e<Cg;e++)t.dyn_ltree[e*2]=0;for(e=0;e<uc;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ob;e++)t.bl_tree[e*2]=0;t.dyn_ltree[hb*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},gH=t=>{t.bi_valid>8?Rg(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},vH=(t,e,n,i)=>{const r=e*2,a=n*2;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]},gb=(t,e,n)=>{const i=t.heap[n];let r=n<<1;for(;r<=t.heap_len&&(r<t.heap_len&&vH(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!vH(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i},pH=(t,e,n)=>{let i,r,a=0,s,o;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+a++]&255,i+=(t.pending_buf[t.sym_buf+a++]&255)<<8,r=t.pending_buf[t.sym_buf+a++],i===0?ja(t,r,e):(s=Eg[r],ja(t,s+Tg+1,e),o=ub[s],o!==0&&(r-=cb[s],Ki(t,r,o)),i--,s=uH(i),ja(t,s,n),o=up[s],o!==0&&(i-=cp[s],Ki(t,i,o)));while(a<t.sym_next);ja(t,hb,e)},vb=(t,e)=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,l=-1,h;for(t.heap_len=0,t.heap_max=nH,s=0;s<a;s++)n[s*2]!==0?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):n[s*2+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=l<2?++l:0,n[h*2]=1,t.depth[h]=0,t.opt_len--,r&&(t.static_len-=i[h*2+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)gb(t,n,s);h=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],gb(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,n[h*2]=n[s*2]+n[o*2],t.depth[h]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,n[s*2+1]=n[o*2+1]=h,t.heap[1]=h++,gb(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],ebe(t,e),fH(n,l,t.bl_count)},mH=(t,e,n)=>{let i,r=-1,a,s=e[0*2+1],o=0,l=7,h=4;for(s===0&&(l=138,h=3),e[(n+1)*2+1]=65535,i=0;i<=n;i++)a=s,s=e[(i+1)*2+1],!(++o<l&&a===s)&&(o<h?t.bl_tree[a*2]+=o:a!==0?(a!==r&&t.bl_tree[a*2]++,t.bl_tree[iH*2]++):o<=10?t.bl_tree[rH*2]++:t.bl_tree[aH*2]++,o=0,r=a,s===0?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4))},yH=(t,e,n)=>{let i,r=-1,a,s=e[0*2+1],o=0,l=7,h=4;for(s===0&&(l=138,h=3),i=0;i<=n;i++)if(a=s,s=e[(i+1)*2+1],!(++o<l&&a===s)){if(o<h)do ja(t,a,t.bl_tree);while(--o!==0);else a!==0?(a!==r&&(ja(t,a,t.bl_tree),o--),ja(t,iH,t.bl_tree),Ki(t,o-3,2)):o<=10?(ja(t,rH,t.bl_tree),Ki(t,o-3,3)):(ja(t,aH,t.bl_tree),Ki(t,o-11,7));o=0,r=a,s===0?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4)}},nbe=t=>{let e;for(mH(t,t.dyn_ltree,t.l_desc.max_code),mH(t,t.dyn_dtree,t.d_desc.max_code),vb(t,t.bl_desc),e=ob-1;e>=3&&t.bl_tree[sH[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},ibe=(t,e,n,i)=>{let r;for(Ki(t,e-257,5),Ki(t,n-1,5),Ki(t,i-4,4),r=0;r<i;r++)Ki(t,t.bl_tree[sH[r]*2+1],3);yH(t,t.dyn_ltree,e-1),yH(t,t.dyn_dtree,n-1)},rbe=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return Q$;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return eH;for(n=32;n<Tg;n++)if(t.dyn_ltree[n*2]!==0)return eH;return Q$};let _H=!1;const abe=t=>{_H||(tbe(),_H=!0),t.l_desc=new db(t.dyn_ltree,oH),t.d_desc=new db(t.dyn_dtree,lH),t.bl_desc=new db(t.bl_tree,hH),t.bi_buf=0,t.bi_valid=0,dH(t)},xH=(t,e,n,i)=>{Ki(t,(H7e<<1)+(i?1:0),3),gH(t),Rg(t,n),Rg(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},sbe=t=>{Ki(t,tH<<1,3),ja(t,hb,Ss),Q7e(t)},obe=(t,e,n,i)=>{let r,a,s=0;t.level>0?(t.strm.data_type===$7e&&(t.strm.data_type=rbe(t)),vb(t,t.l_desc),vb(t,t.d_desc),s=nbe(t),r=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=r&&(r=a)):r=a=n+5,n+4<=r&&e!==-1?xH(t,e,n,i):t.strategy===V7e||a===r?(Ki(t,(tH<<1)+(i?1:0),3),pH(t,Ss,Ag)):(Ki(t,(W7e<<1)+(i?1:0),3),ibe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),pH(t,t.dyn_ltree,t.dyn_dtree)),dH(t),i&&gH(t)},lbe=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(Eg[n]+Tg+1)*2]++,t.dyn_dtree[uH(e)*2]++),t.sym_next===t.sym_end);var hbe=abe,ube=xH,cbe=obe,fbe=lbe,dbe=sbe,gbe={_tr_init:hbe,_tr_stored_block:ube,_tr_flush_block:cbe,_tr_tally:fbe,_tr_align:dbe},Ig=(t,e,n,i)=>{let r=t&65535|0,a=t>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do r=r+e[i++]|0,a=a+r|0;while(--s);r%=65521,a%=65521}return r|a<<16|0};const vbe=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},pbe=new Uint32Array(vbe());var ti=(t,e,n,i)=>{const r=pbe,a=i+n;t^=-1;for(let s=i;s<a;s++)t=t>>>8^r[(t^e[s])&255];return t^-1},cc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pg={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:mbe,_tr_stored_block:pb,_tr_flush_block:ybe,_tr_tally:Ao,_tr_align:_be}=gbe,{Z_NO_FLUSH:Mo,Z_PARTIAL_FLUSH:xbe,Z_FULL_FLUSH:wbe,Z_FINISH:Dr,Z_BLOCK:wH,Z_OK:vi,Z_STREAM_END:bH,Z_STREAM_ERROR:Ua,Z_DATA_ERROR:bbe,Z_BUF_ERROR:mb,Z_DEFAULT_COMPRESSION:Sbe,Z_FILTERED:Tbe,Z_HUFFMAN_ONLY:fp,Z_RLE:Cbe,Z_FIXED:Abe,Z_DEFAULT_STRATEGY:Mbe,Z_UNKNOWN:Ebe,Z_DEFLATED:dp}=Pg,Rbe=9,Ibe=15,Pbe=8,Lbe=29,yb=256+1+Lbe,zbe=30,Dbe=19,kbe=2*yb+1,Obe=15,Pt=3,Eo=258,qa=Eo+Pt+1,Fbe=32,fc=42,_b=57,xb=69,wb=73,bb=91,Sb=103,kl=113,Lg=666,zi=1,dc=2,Ol=3,gc=4,Nbe=3,Fl=(t,e)=>(t.msg=cc[e],e),SH=t=>t*2-(t>4?9:0),Ro=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Bbe=t=>{let e,n,i,r=t.w_size;e=t.hash_size,i=e;do n=t.head[--i],t.head[i]=n>=r?n-r:0;while(--e);e=r,i=e;do n=t.prev[--i],t.prev[i]=n>=r?n-r:0;while(--e)};let Io=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const gr=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},vr=(t,e)=>{ybe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gr(t.strm)},jt=(t,e)=>{t.pending_buf[t.pending++]=e},zg=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Tb=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),r===0?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),t.state.wrap===1?t.adler=Ig(t.adler,e,r,n):t.state.wrap===2&&(t.adler=ti(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},TH=(t,e)=>{let n=t.max_chain_length,i=t.strstart,r,a,s=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-qa?t.strstart-(t.w_size-qa):0,h=t.window,u=t.w_mask,c=t.prev,f=t.strstart+Eo;let d=h[i+s-1],g=h[i+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(r=e,!(h[r+s]!==g||h[r+s-1]!==d||h[r]!==h[i]||h[++r]!==h[i+1])){i+=2,r++;do;while(h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&i<f);if(a=Eo-(f-i),i=f-Eo,a>s){if(t.match_start=e,s=a,a>=o)break;d=h[i+s-1],g=h[i+s]}}while((e=c[e&u])>l&&--n!==0);return s<=t.lookahead?s:t.lookahead},vc=t=>{const e=t.w_size;let n,i,r;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-qa)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Bbe(t),i+=e),t.strm.avail_in===0)break;if(n=Tb(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=Pt)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=Io(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=Io(t,t.ins_h,t.window[r+Pt-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<Pt)););}while(t.lookahead<qa&&t.strm.avail_in!==0)},CH=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,r,a,s=0,o=t.strm.avail_in;do{if(i=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,r=t.strstart-t.block_start,i>r+t.strm.avail_in&&(i=r+t.strm.avail_in),i>a&&(i=a),i<n&&(i===0&&e!==Dr||e===Mo||i!==r+t.strm.avail_in)))break;s=e===Dr&&i===r+t.strm.avail_in?1:0,pb(t,0,0,s),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,gr(t.strm),r&&(r>i&&(r=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,i-=r),i&&(Tb(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(s===0);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?gc:e!==Mo&&e!==Dr&&t.strm.avail_in===0&&t.strstart===t.block_start?dc:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Tb(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,n=a>t.w_size?t.w_size:a,r=t.strstart-t.block_start,(r>=n||(r||e===Dr)&&e!==Mo&&t.strm.avail_in===0&&r<=a)&&(i=r>a?a:r,s=e===Dr&&t.strm.avail_in===0&&i===r?1:0,pb(t,t.block_start,i,s),t.block_start+=i,gr(t.strm)),s?Ol:zi)},Cb=(t,e)=>{let n,i;for(;;){if(t.lookahead<qa){if(vc(t),t.lookahead<qa&&e===Mo)return zi;if(t.lookahead===0)break}if(n=0,t.lookahead>=Pt&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-qa&&(t.match_length=TH(t,n)),t.match_length>=Pt)if(i=Ao(t,t.strstart-t.match_start,t.match_length-Pt),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Pt){t.match_length--;do t.strstart++,t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Io(t,t.ins_h,t.window[t.strstart+1]);else i=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=t.strstart<Pt-1?t.strstart:Pt-1,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},pc=(t,e)=>{let n,i,r;for(;;){if(t.lookahead<qa){if(vc(t),t.lookahead<qa&&e===Mo)return zi;if(t.lookahead===0)break}if(n=0,t.lookahead>=Pt&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Pt-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-qa&&(t.match_length=TH(t,n),t.match_length<=5&&(t.strategy===Tbe||t.match_length===Pt&&t.strstart-t.match_start>4096)&&(t.match_length=Pt-1)),t.prev_length>=Pt&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-Pt,i=Ao(t,t.strstart-1-t.prev_match,t.prev_length-Pt),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=r&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Pt-1,t.strstart++,i&&(vr(t,!1),t.strm.avail_out===0))return zi}else if(t.match_available){if(i=Ao(t,0,t.window[t.strstart-1]),i&&vr(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return zi}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Ao(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Pt-1?t.strstart:Pt-1,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},Gbe=(t,e)=>{let n,i,r,a;const s=t.window;for(;;){if(t.lookahead<=Eo){if(vc(t),t.lookahead<=Eo&&e===Mo)return zi;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Pt&&t.strstart>0&&(r=t.strstart-1,i=s[r],i===s[++r]&&i===s[++r]&&i===s[++r])){a=t.strstart+Eo;do;while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<a);t.match_length=Eo-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Pt?(n=Ao(t,1,t.match_length-Pt),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},jbe=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(vc(t),t.lookahead===0)){if(e===Mo)return zi;break}if(t.match_length=0,n=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc};function Va(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const Dg=[new Va(0,0,0,0,CH),new Va(4,4,8,4,Cb),new Va(4,5,16,8,Cb),new Va(4,6,32,32,Cb),new Va(4,4,16,16,pc),new Va(8,16,32,32,pc),new Va(8,16,128,128,pc),new Va(8,32,128,256,pc),new Va(32,128,258,1024,pc),new Va(32,258,258,4096,pc)],Ube=t=>{t.window_size=2*t.w_size,Ro(t.head),t.max_lazy_match=Dg[t.level].max_lazy,t.good_match=Dg[t.level].good_length,t.nice_match=Dg[t.level].nice_length,t.max_chain_length=Dg[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Pt-1,t.match_available=0,t.ins_h=0};function qbe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dp,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(kbe*2),this.dyn_dtree=new Uint16Array((2*zbe+1)*2),this.bl_tree=new Uint16Array((2*Dbe+1)*2),Ro(this.dyn_ltree),Ro(this.dyn_dtree),Ro(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Obe+1),this.heap=new Uint16Array(2*yb+1),Ro(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*yb+1),Ro(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const kg=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==fc&&e.status!==_b&&e.status!==xb&&e.status!==wb&&e.status!==bb&&e.status!==Sb&&e.status!==kl&&e.status!==Lg?1:0},AH=t=>{if(kg(t))return Fl(t,Ua);t.total_in=t.total_out=0,t.data_type=Ebe;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?_b:e.wrap?fc:kl,t.adler=e.wrap===2?0:1,e.last_flush=-2,mbe(e),vi},MH=t=>{const e=AH(t);return e===vi&&Ube(t.state),e},Vbe=(t,e)=>kg(t)||t.state.wrap!==2?Ua:(t.state.gzhead=e,vi),EH=(t,e,n,i,r,a)=>{if(!t)return Ua;let s=1;if(e===Sbe&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>Rbe||n!==dp||i<8||i>15||e<0||e>9||a<0||a>Abe||i===8&&s!==1)return Fl(t,Ua);i===8&&(i=9);const o=new qbe;return t.state=o,o.strm=t,o.status=fc,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Pt-1)/Pt),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=a,o.method=n,MH(t)},$be=(t,e)=>EH(t,e,dp,Ibe,Pbe,Mbe),Hbe=(t,e)=>{if(kg(t)||e>wH||e<0)return t?Fl(t,Ua):Ua;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===Lg&&e!==Dr)return Fl(t,t.avail_out===0?mb:Ua);const i=n.last_flush;if(n.last_flush=e,n.pending!==0){if(gr(t),t.avail_out===0)return n.last_flush=-1,vi}else if(t.avail_in===0&&SH(e)<=SH(i)&&e!==Dr)return Fl(t,mb);if(n.status===Lg&&t.avail_in!==0)return Fl(t,mb);if(n.status===fc&&n.wrap===0&&(n.status=kl),n.status===fc){let r=dp+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=fp||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,r|=a<<6,n.strstart!==0&&(r|=Fbe),r+=31-r%31,zg(n,r),n.strstart!==0&&(zg(n,t.adler>>>16),zg(n,t.adler&65535)),t.adler=1,n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(n.status===_b){if(t.adler=0,jt(n,31),jt(n,139),jt(n,8),n.gzhead)jt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),jt(n,n.gzhead.time&255),jt(n,n.gzhead.time>>8&255),jt(n,n.gzhead.time>>16&255),jt(n,n.gzhead.time>>24&255),jt(n,n.level===9?2:n.strategy>=fp||n.level<2?4:0),jt(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(jt(n,n.gzhead.extra.length&255),jt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ti(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=xb;else if(jt(n,0),jt(n,0),jt(n,0),jt(n,0),jt(n,0),jt(n,n.level===9?2:n.strategy>=fp||n.level<2?4:0),jt(n,Nbe),n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(n.status===xb){if(n.gzhead.extra){let r=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=o,gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0,a-=o}let s=new Uint8Array(n.gzhead.extra);n.pending_buf.set(s.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=wb}if(n.status===wb){if(n.gzhead.name){let r=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,jt(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=bb}if(n.status===bb){if(n.gzhead.comment){let r=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,jt(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r))}n.status=Sb}if(n.status===Sb){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(gr(t),n.pending!==0))return n.last_flush=-1,vi;jt(n,t.adler&255),jt(n,t.adler>>8&255),t.adler=0}if(n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(t.avail_in!==0||n.lookahead!==0||e!==Mo&&n.status!==Lg){let r=n.level===0?CH(n,e):n.strategy===fp?jbe(n,e):n.strategy===Cbe?Gbe(n,e):Dg[n.level].func(n,e);if((r===Ol||r===gc)&&(n.status=Lg),r===zi||r===Ol)return t.avail_out===0&&(n.last_flush=-1),vi;if(r===dc&&(e===xbe?_be(n):e!==wH&&(pb(n,0,0,!1),e===wbe&&(Ro(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),gr(t),t.avail_out===0))return n.last_flush=-1,vi}return e!==Dr?vi:n.wrap<=0?bH:(n.wrap===2?(jt(n,t.adler&255),jt(n,t.adler>>8&255),jt(n,t.adler>>16&255),jt(n,t.adler>>24&255),jt(n,t.total_in&255),jt(n,t.total_in>>8&255),jt(n,t.total_in>>16&255),jt(n,t.total_in>>24&255)):(zg(n,t.adler>>>16),zg(n,t.adler&65535)),gr(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?vi:bH)},Wbe=t=>{if(kg(t))return Ua;const e=t.state.status;return t.state=null,e===kl?Fl(t,bbe):vi},Zbe=(t,e)=>{let n=e.length;if(kg(t))return Ua;const i=t.state,r=i.wrap;if(r===2||r===1&&i.status!==fc||i.lookahead)return Ua;if(r===1&&(t.adler=Ig(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){r===0&&(Ro(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(e.subarray(n-i.w_size,n),0),e=l,n=i.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,vc(i);i.lookahead>=Pt;){let l=i.strstart,h=i.lookahead-(Pt-1);do i.ins_h=Io(i,i.ins_h,i.window[l+Pt-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--h);i.strstart=l,i.lookahead=Pt-1,vc(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Pt-1,i.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,i.wrap=r,vi};var Xbe=$be,Ybe=EH,Kbe=MH,Jbe=AH,Qbe=Vbe,eSe=Hbe,tSe=Wbe,nSe=Zbe,iSe="pako deflate (from Nodeca project)",Og={deflateInit:Xbe,deflateInit2:Ybe,deflateReset:Kbe,deflateResetKeep:Jbe,deflateSetHeader:Qbe,deflate:eSe,deflateEnd:tSe,deflateSetDictionary:nSe,deflateInfo:iSe};const rSe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var aSe=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)rSe(n,i)&&(t[i]=n[i])}}return t},sSe=t=>{let e=0;for(let i=0,r=t.length;i<r;i++)e+=t[i].length;const n=new Uint8Array(e);for(let i=0,r=0,a=t.length;i<a;i++){let s=t[i];n.set(s,r),r+=s.length}return n},gp={assign:aSe,flattenChunks:sSe};let RH=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){RH=!1}const Fg=new Uint8Array(256);for(let t=0;t<256;t++)Fg[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Fg[254]=Fg[254]=1;var oSe=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,i,r,a,s=t.length,o=0;for(r=0;r<s;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(o),a=0,r=0;a<o;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const lSe=(t,e)=>{if(e<65534&&t.subarray&&RH)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n};var hSe=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,r;const a=new Array(n*2);for(r=0,i=0;i<n;){let s=t[i++];if(s<128){a[r++]=s;continue}let o=Fg[s];if(o>4){a[r++]=65533,i+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&i<n;)s=s<<6|t[i++]&63,o--;if(o>1){a[r++]=65533;continue}s<65536?a[r++]=s:(s-=65536,a[r++]=55296|s>>10&1023,a[r++]=56320|s&1023)}return lSe(a,r)},uSe=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+Fg[t[n]]>e?n:e},Ng={string2buf:oSe,buf2string:hSe,utf8border:uSe};function cSe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var IH=cSe;const PH=Object.prototype.toString,{Z_NO_FLUSH:fSe,Z_SYNC_FLUSH:dSe,Z_FULL_FLUSH:gSe,Z_FINISH:vSe,Z_OK:vp,Z_STREAM_END:pSe,Z_DEFAULT_COMPRESSION:mSe,Z_DEFAULT_STRATEGY:ySe,Z_DEFLATED:_Se}=Pg;function Ab(t){this.options=gp.assign({level:mSe,method:_Se,chunkSize:16384,windowBits:15,memLevel:8,strategy:ySe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new IH,this.strm.avail_out=0;let n=Og.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==vp)throw new Error(cc[n]);if(e.header&&Og.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Ng.string2buf(e.dictionary):PH.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,n=Og.deflateSetDictionary(this.strm,i),n!==vp)throw new Error(cc[n]);this._dict_set=!0}}Ab.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?vSe:fSe,typeof t=="string"?n.input=Ng.string2buf(t):PH.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(a===dSe||a===gSe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Og.deflate(n,a),r===pSe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Og.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===vp;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Ab.prototype.onData=function(t){this.chunks.push(t)},Ab.prototype.onEnd=function(t){t===vp&&(this.result=gp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const pp=16209,xSe=16191;var wSe=function(e,n){let i,r,a,s,o,l,h,u,c,f,d,g,p,v,m,y,_,w,S,b,x,T,C,A;const M=e.state;i=e.next_in,C=e.input,r=i+(e.avail_in-5),a=e.next_out,A=e.output,s=a-(n-e.avail_out),o=a+(e.avail_out-257),l=M.dmax,h=M.wsize,u=M.whave,c=M.wnext,f=M.window,d=M.hold,g=M.bits,p=M.lencode,v=M.distcode,m=(1<<M.lenbits)-1,y=(1<<M.distbits)-1;e:do{g<15&&(d+=C[i++]<<g,g+=8,d+=C[i++]<<g,g+=8),_=p[d&m];t:for(;;){if(w=_>>>24,d>>>=w,g-=w,w=_>>>16&255,w===0)A[a++]=_&65535;else if(w&16){S=_&65535,w&=15,w&&(g<w&&(d+=C[i++]<<g,g+=8),S+=d&(1<<w)-1,d>>>=w,g-=w),g<15&&(d+=C[i++]<<g,g+=8,d+=C[i++]<<g,g+=8),_=v[d&y];n:for(;;){if(w=_>>>24,d>>>=w,g-=w,w=_>>>16&255,w&16){if(b=_&65535,w&=15,g<w&&(d+=C[i++]<<g,g+=8,g<w&&(d+=C[i++]<<g,g+=8)),b+=d&(1<<w)-1,b>l){e.msg="invalid distance too far back",M.mode=pp;break e}if(d>>>=w,g-=w,w=a-s,b>w){if(w=b-w,w>u&&M.sane){e.msg="invalid distance too far back",M.mode=pp;break e}if(x=0,T=f,c===0){if(x+=h-w,w<S){S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}}else if(c<w){if(x+=h+c-w,w-=c,w<S){S-=w;do A[a++]=f[x++];while(--w);if(x=0,c<S){w=c,S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}}}else if(x+=c-w,w<S){S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}for(;S>2;)A[a++]=T[x++],A[a++]=T[x++],A[a++]=T[x++],S-=3;S&&(A[a++]=T[x++],S>1&&(A[a++]=T[x++]))}else{x=a-b;do A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],S-=3;while(S>2);S&&(A[a++]=A[x++],S>1&&(A[a++]=A[x++]))}}else if((w&64)===0){_=v[(_&65535)+(d&(1<<w)-1)];continue n}else{e.msg="invalid distance code",M.mode=pp;break e}break}}else if((w&64)===0){_=p[(_&65535)+(d&(1<<w)-1)];continue t}else if(w&32){M.mode=xSe;break e}else{e.msg="invalid literal/length code",M.mode=pp;break e}break}}while(i<r&&a<o);S=g>>3,i-=S,g-=S<<3,d&=(1<<g)-1,e.next_in=i,e.next_out=a,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=a<o?257+(o-a):257-(a-o),M.hold=d,M.bits=g};const mc=15,LH=852,zH=592,DH=0,Mb=1,kH=2,bSe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),SSe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),TSe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),CSe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Bg=(t,e,n,i,r,a,s,o)=>{const l=o.bits;let h=0,u=0,c=0,f=0,d=0,g=0,p=0,v=0,m=0,y=0,_,w,S,b,x,T=null,C;const A=new Uint16Array(mc+1),M=new Uint16Array(mc+1);let E=null,R,P,I;for(h=0;h<=mc;h++)A[h]=0;for(u=0;u<i;u++)A[e[n+u]]++;for(d=l,f=mc;f>=1&&A[f]===0;f--);if(d>f&&(d=f),f===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,o.bits=1,0;for(c=1;c<f&&A[c]===0;c++);for(d<c&&(d=c),v=1,h=1;h<=mc;h++)if(v<<=1,v-=A[h],v<0)return-1;if(v>0&&(t===DH||f!==1))return-1;for(M[1]=0,h=1;h<mc;h++)M[h+1]=M[h]+A[h];for(u=0;u<i;u++)e[n+u]!==0&&(s[M[e[n+u]]++]=u);if(t===DH?(T=E=s,C=20):t===Mb?(T=bSe,E=SSe,C=257):(T=TSe,E=CSe,C=0),y=0,u=0,h=c,x=a,g=d,p=0,S=-1,m=1<<d,b=m-1,t===Mb&&m>LH||t===kH&&m>zH)return 1;for(;;){R=h-p,s[u]+1<C?(P=0,I=s[u]):s[u]>=C?(P=E[s[u]-C],I=T[s[u]-C]):(P=32+64,I=0),_=1<<h-p,w=1<<g,c=w;do w-=_,r[x+(y>>p)+w]=R<<24|P<<16|I|0;while(w!==0);for(_=1<<h-1;y&_;)_>>=1;if(_!==0?(y&=_-1,y+=_):y=0,u++,--A[h]===0){if(h===f)break;h=e[n+s[u]]}if(h>d&&(y&b)!==S){for(p===0&&(p=d),x+=c,g=h-p,v=1<<g;g+p<f&&(v-=A[g+p],!(v<=0));)g++,v<<=1;if(m+=1<<g,t===Mb&&m>LH||t===kH&&m>zH)return 1;S=y&b,r[S]=d<<24|g<<16|x-a|0}}return y!==0&&(r[x+y]=h-p<<24|64<<16|0),o.bits=d,0};const ASe=0,OH=1,FH=2,{Z_FINISH:NH,Z_BLOCK:MSe,Z_TREES:mp,Z_OK:Nl,Z_STREAM_END:ESe,Z_NEED_DICT:RSe,Z_STREAM_ERROR:kr,Z_DATA_ERROR:BH,Z_MEM_ERROR:GH,Z_BUF_ERROR:ISe,Z_DEFLATED:jH}=Pg,yp=16180,UH=16181,qH=16182,VH=16183,$H=16184,HH=16185,WH=16186,ZH=16187,XH=16188,YH=16189,_p=16190,Ts=16191,Eb=16192,KH=16193,Rb=16194,JH=16195,QH=16196,eW=16197,tW=16198,xp=16199,wp=16200,nW=16201,iW=16202,rW=16203,aW=16204,sW=16205,Ib=16206,oW=16207,lW=16208,un=16209,hW=16210,uW=16211,PSe=852,LSe=592,zSe=15,cW=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function DSe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Bl=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<yp||e.mode>uW?1:0},fW=t=>{if(Bl(t))return kr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=yp,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(PSe),e.distcode=e.distdyn=new Int32Array(LSe),e.sane=1,e.back=-1,Nl},dW=t=>{if(Bl(t))return kr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,fW(t)},gW=(t,e)=>{let n;if(Bl(t))return kr;const i=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kr:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,dW(t))},vW=(t,e)=>{if(!t)return kr;const n=new DSe;t.state=n,n.strm=t,n.window=null,n.mode=yp;const i=gW(t,e);return i!==Nl&&(t.state=null),i},kSe=t=>vW(t,zSe);let pW=!0,Pb,Lb;const OSe=t=>{if(pW){Pb=new Int32Array(512),Lb=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Bg(OH,t.lens,0,288,Pb,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Bg(FH,t.lens,0,32,Lb,0,t.work,{bits:5}),pW=!1}t.lencode=Pb,t.lenbits=9,t.distcode=Lb,t.distbits=5},mW=(t,e,n,i)=>{let r;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(n-i,n-i+r),a.wnext),i-=r,i?(a.window.set(e.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0},FSe=(t,e)=>{let n,i,r,a,s,o,l,h,u,c,f,d,g,p,v=0,m,y,_,w,S,b,x,T;const C=new Uint8Array(4);let A,M;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Bl(t)||!t.output||!t.input&&t.avail_in!==0)return kr;n=t.state,n.mode===Ts&&(n.mode=Eb),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,u=n.bits,c=o,f=l,T=Nl;e:for(;;)switch(n.mode){case yp:if(n.wrap===0){n.mode=Eb;break}for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0),h=0,u=0,n.mode=UH;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=un;break}if((h&15)!==jH){t.msg="unknown compression method",n.mode=un;break}if(h>>>=4,u-=4,x=(h&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){t.msg="invalid window size",n.mode=un;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=h&512?YH:Ts,h=0,u=0;break;case UH:for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.flags=h,(n.flags&255)!==jH){t.msg="unknown compression method",n.mode=un;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=un;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0,n.mode=qH;case qH:for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,n.check=ti(n.check,C,4,0)),h=0,u=0,n.mode=VH;case VH:for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0,n.mode=$H;case $H:if(n.flags&1024){for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0}else n.head&&(n.head.extra=null);n.mode=HH;case HH:if(n.flags&1024&&(d=n.length,d>o&&(d=o),d&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+d),x)),n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=WH;case WH:if(n.flags&2048){if(o===0)break e;d=0;do x=i[a+d++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&d<o);if(n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=ZH;case ZH:if(n.flags&4096){if(o===0)break e;d=0;do x=i[a+d++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&d<o);if(n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,x)break e}else n.head&&(n.head.comment=null);n.mode=XH;case XH:if(n.flags&512){for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&4&&h!==(n.check&65535)){t.msg="header crc mismatch",n.mode=un;break}h=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Ts;break;case YH:for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}t.adler=n.check=cW(h),h=0,u=0,n.mode=_p;case _p:if(n.havedict===0)return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,RSe;t.adler=n.check=1,n.mode=Ts;case Ts:if(e===MSe||e===mp)break e;case Eb:if(n.last){h>>>=u&7,u-=u&7,n.mode=Ib;break}for(;u<3;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}switch(n.last=h&1,h>>>=1,u-=1,h&3){case 0:n.mode=KH;break;case 1:if(OSe(n),n.mode=xp,e===mp){h>>>=2,u-=2;break e}break;case 2:n.mode=QH;break;case 3:t.msg="invalid block type",n.mode=un}h>>>=2,u-=2;break;case KH:for(h>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=un;break}if(n.length=h&65535,h=0,u=0,n.mode=Rb,e===mp)break e;case Rb:n.mode=JH;case JH:if(d=n.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;r.set(i.subarray(a,a+d),s),o-=d,a+=d,l-=d,s+=d,n.length-=d;break}n.mode=Ts;break;case QH:for(;u<14;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.nlen=(h&31)+257,h>>>=5,u-=5,n.ndist=(h&31)+1,h>>>=5,u-=5,n.ncode=(h&15)+4,h>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=un;break}n.have=0,n.mode=eW;case eW:for(;n.have<n.ncode;){for(;u<3;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.lens[E[n.have++]]=h&7,h>>>=3,u-=3}for(;n.have<19;)n.lens[E[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},T=Bg(ASe,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,T){t.msg="invalid code lengths set",n.mode=un;break}n.have=0,n.mode=tW;case tW:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[h&(1<<n.lenbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(_<16)h>>>=m,u-=m,n.lens[n.have++]=_;else{if(_===16){for(M=m+2;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(h>>>=m,u-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=un;break}x=n.lens[n.have-1],d=3+(h&3),h>>>=2,u-=2}else if(_===17){for(M=m+3;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=3+(h&7),h>>>=3,u-=3}else{for(M=m+7;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=11+(h&127),h>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=un;break}for(;d--;)n.lens[n.have++]=x}}if(n.mode===un)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=un;break}if(n.lenbits=9,A={bits:n.lenbits},T=Bg(OH,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,T){t.msg="invalid literal/lengths set",n.mode=un;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},T=Bg(FH,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,T){t.msg="invalid distances set",n.mode=un;break}if(n.mode=xp,e===mp)break e;case xp:n.mode=wp;case wp:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,wSe(t,f),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,u=n.bits,n.mode===Ts&&(n.back=-1);break}for(n.back=0;v=n.lencode[h&(1<<n.lenbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(y&&(y&240)===0){for(w=m,S=y,b=_;v=n.lencode[b+((h&(1<<w+S)-1)>>w)],m=v>>>24,y=v>>>16&255,_=v&65535,!(w+m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=w,u-=w,n.back+=w}if(h>>>=m,u-=m,n.back+=m,n.length=_,y===0){n.mode=sW;break}if(y&32){n.back=-1,n.mode=Ts;break}if(y&64){t.msg="invalid literal/length code",n.mode=un;break}n.extra=y&15,n.mode=nW;case nW:if(n.extra){for(M=n.extra;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=iW;case iW:for(;v=n.distcode[h&(1<<n.distbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if((y&240)===0){for(w=m,S=y,b=_;v=n.distcode[b+((h&(1<<w+S)-1)>>w)],m=v>>>24,y=v>>>16&255,_=v&65535,!(w+m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=w,u-=w,n.back+=w}if(h>>>=m,u-=m,n.back+=m,y&64){t.msg="invalid distance code",n.mode=un;break}n.offset=_,n.extra=y&15,n.mode=rW;case rW:if(n.extra){for(M=n.extra;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=un;break}n.mode=aW;case aW:if(l===0)break e;if(d=f-l,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=un;break}d>n.wnext?(d-=n.wnext,g=n.wsize-d):g=n.wnext-d,d>n.length&&(d=n.length),p=n.window}else p=r,g=s-n.offset,d=n.length;d>l&&(d=l),l-=d,n.length-=d;do r[s++]=p[g++];while(--d);n.length===0&&(n.mode=wp);break;case sW:if(l===0)break e;r[s++]=n.length,l--,n.mode=wp;break;case Ib:if(n.wrap){for(;u<32;){if(o===0)break e;o--,h|=i[a++]<<u,u+=8}if(f-=l,t.total_out+=f,n.total+=f,n.wrap&4&&f&&(t.adler=n.check=n.flags?ti(n.check,r,f,s-f):Ig(n.check,r,f,s-f)),f=l,n.wrap&4&&(n.flags?h:cW(h))!==n.check){t.msg="incorrect data check",n.mode=un;break}h=0,u=0}n.mode=oW;case oW:if(n.wrap&&n.flags){for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&4&&h!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=un;break}h=0,u=0}n.mode=lW;case lW:T=ESe;break e;case un:T=BH;break e;case hW:return GH;case uW:default:return kr}return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,(n.wsize||f!==t.avail_out&&n.mode<un&&(n.mode<Ib||e!==NH))&&mW(t,t.output,t.next_out,f-t.avail_out),c-=t.avail_in,f-=t.avail_out,t.total_in+=c,t.total_out+=f,n.total+=f,n.wrap&4&&f&&(t.adler=n.check=n.flags?ti(n.check,r,f,t.next_out-f):Ig(n.check,r,f,t.next_out-f)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Ts?128:0)+(n.mode===xp||n.mode===Rb?256:0),(c===0&&f===0||e===NH)&&T===Nl&&(T=ISe),T},NSe=t=>{if(Bl(t))return kr;let e=t.state;return e.window&&(e.window=null),t.state=null,Nl},BSe=(t,e)=>{if(Bl(t))return kr;const n=t.state;return(n.wrap&2)===0?kr:(n.head=e,e.done=!1,Nl)},GSe=(t,e)=>{const n=e.length;let i,r,a;return Bl(t)||(i=t.state,i.wrap!==0&&i.mode!==_p)?kr:i.mode===_p&&(r=1,r=Ig(r,e,n,0),r!==i.check)?BH:(a=mW(t,e,n,n),a?(i.mode=hW,GH):(i.havedict=1,Nl))};var jSe=dW,USe=gW,qSe=fW,VSe=kSe,$Se=vW,HSe=FSe,WSe=NSe,ZSe=BSe,XSe=GSe,YSe="pako inflate (from Nodeca project)",Cs={inflateReset:jSe,inflateReset2:USe,inflateResetKeep:qSe,inflateInit:VSe,inflateInit2:$Se,inflate:HSe,inflateEnd:WSe,inflateGetHeader:ZSe,inflateSetDictionary:XSe,inflateInfo:YSe};function KSe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var JSe=KSe;const yW=Object.prototype.toString,{Z_NO_FLUSH:QSe,Z_FINISH:eTe,Z_OK:Gg,Z_STREAM_END:zb,Z_NEED_DICT:Db,Z_STREAM_ERROR:tTe,Z_DATA_ERROR:_W,Z_MEM_ERROR:nTe}=Pg;function jg(t){this.options=gp.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new IH,this.strm.avail_out=0;let n=Cs.inflateInit2(this.strm,e.windowBits);if(n!==Gg)throw new Error(cc[n]);if(this.header=new JSe,Cs.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ng.string2buf(e.dictionary):yW.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Cs.inflateSetDictionary(this.strm,e.dictionary),n!==Gg)))throw new Error(cc[n])}jg.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?eTe:QSe,yW.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=Cs.inflate(n,s),a===Db&&r&&(a=Cs.inflateSetDictionary(n,r),a===Gg?a=Cs.inflate(n,s):a===_W&&(a=Db));n.avail_in>0&&a===zb&&n.state.wrap>0&&t[n.next_in]!==0;)Cs.inflateReset(n),a=Cs.inflate(n,s);switch(a){case tTe:case _W:case Db:case nTe:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||a===zb))if(this.options.to==="string"){let l=Ng.utf8border(n.output,n.next_out),h=n.next_out-l,u=Ng.buf2string(n.output,l);n.next_out=h,n.avail_out=i-h,h&&n.output.set(n.output.subarray(l,l+h),0),this.onData(u)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Gg&&o===0)){if(a===zb)return a=Cs.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},jg.prototype.onData=function(t){this.chunks.push(t)},jg.prototype.onEnd=function(t){t===Gg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=gp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function kb(t,e){const n=new jg(e);if(n.push(t),n.err)throw n.msg||cc[n.err];return n.result}function iTe(t,e){return e=e||{},e.raw=!0,kb(t,e)}var rTe=jg,aTe=kb,sTe=iTe,oTe=kb,lTe=Pg,hTe={Inflate:rTe,inflate:aTe,inflateRaw:sTe,ungzip:oTe,constants:lTe};const{Inflate:aCe,inflate:uTe,inflateRaw:sCe,ungzip:oCe}=hTe;var xW=uTe;class cTe extends tl{decodeBlock(e){return xW(new Uint8Array(e)).buffer}}const fTe=Object.freeze(Object.defineProperty({__proto__:null,default:cTe},Symbol.toStringTag,{value:"Module"}));class dTe extends tl{decodeBlock(e){const n=new DataView(e),i=[];for(let r=0;r<e.byteLength;++r){let a=n.getInt8(r);if(a<0){const s=n.getUint8(r+1);a=-a;for(let o=0;o<=a;++o)i.push(s);r+=1}else{for(let s=0;s<=a;++s)i.push(n.getUint8(r+s+1));r+=a+1}}return new Uint8Array(i).buffer}}const gTe=Object.freeze(Object.defineProperty({__proto__:null,default:dTe},Symbol.toStringTag,{value:"Module"}));var wW={exports:{}};(function(t){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var a={};a.defaultNoDataValue=-34027999387901484e22,a.decode=function(c,f){f=f||{};var d=f.encodedMaskData||f.encodedMaskData===null,g=h(c,f.inputOffset||0,d),p=f.noDataValue!==null?f.noDataValue:a.defaultNoDataValue,v=s(g,f.pixelType||Float32Array,f.encodedMaskData,p,f.returnMask),m={width:g.width,height:g.height,pixelData:v.resultPixels,minValue:v.minValue,maxValue:g.pixels.maxValue,noDataValue:p};return v.resultMask&&(m.maskData=v.resultMask),f.returnEncodedMask&&g.mask&&(m.encodedMaskData=g.mask.bitset?g.mask.bitset:null),f.returnFileInfo&&(m.fileInfo=o(g),f.computeUsedBitDepths&&(m.fileInfo.bitDepths=l(g))),m};var s=function(c,f,d,g,p){var v=0,m=c.pixels.numBlocksX,y=c.pixels.numBlocksY,_=Math.floor(c.width/m),w=Math.floor(c.height/y),S=2*c.maxZError,b=Number.MAX_VALUE,x;d=d||(c.mask?c.mask.bitset:null);var T,C;T=new f(c.width*c.height),p&&d&&(C=new Uint8Array(c.width*c.height));for(var A=new Float32Array(_*w),M,E,R=0;R<=y;R++){var P=R!==y?w:c.height%y;if(P!==0)for(var I=0;I<=m;I++){var L=I!==m?_:c.width%m;if(L!==0){var D=R*c.width*w+I*_,F=c.width-L,G=c.pixels.blocks[v],B,z,k;G.encoding<2?(G.encoding===0?B=G.rawData:(u(G.stuffedData,G.bitsPerPixel,G.numValidPixels,G.offset,S,A,c.pixels.maxValue),B=A),z=0):G.encoding===2?k=0:k=G.offset;var O;if(d)for(E=0;E<P;E++){for(D&7&&(O=d[D>>3],O<<=D&7),M=0;M<L;M++)D&7||(O=d[D>>3]),O&128?(C&&(C[D]=1),x=G.encoding<2?B[z++]:k,b=b>x?x:b,T[D++]=x):(C&&(C[D]=0),T[D++]=g),O<<=1;D+=F}else if(G.encoding<2)for(E=0;E<P;E++){for(M=0;M<L;M++)x=B[z++],b=b>x?x:b,T[D++]=x;D+=F}else for(b=b>k?k:b,E=0;E<P;E++){for(M=0;M<L;M++)T[D++]=k;D+=F}if(G.encoding===1&&z!==G.numValidPixels)throw"Block and Mask do not match";v++}}}return{resultPixels:T,resultMask:C,minValue:b}},o=function(c){return{fileIdentifierString:c.fileIdentifierString,fileVersion:c.fileVersion,imageType:c.imageType,height:c.height,width:c.width,maxZError:c.maxZError,eofOffset:c.eofOffset,mask:c.mask?{numBlocksX:c.mask.numBlocksX,numBlocksY:c.mask.numBlocksY,numBytes:c.mask.numBytes,maxValue:c.mask.maxValue}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,numBytes:c.pixels.numBytes,maxValue:c.pixels.maxValue,noDataValue:c.noDataValue}}},l=function(c){for(var f=c.pixels.numBlocksX*c.pixels.numBlocksY,d={},g=0;g<f;g++){var p=c.pixels.blocks[g];p.encoding===0?d.float32=!0:p.encoding===1?d[p.bitsPerPixel]=!0:d[0]=!0}return Object.keys(d)},h=function(c,f,d){var g={},p=new Uint8Array(c,f,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,p),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;f+=10;var v=new DataView(c,f,24);if(g.fileVersion=v.getInt32(0,!0),g.imageType=v.getInt32(4,!0),g.height=v.getUint32(8,!0),g.width=v.getUint32(12,!0),g.maxZError=v.getFloat64(16,!0),f+=24,!d)if(v=new DataView(c,f,16),g.mask={},g.mask.numBlocksY=v.getUint32(0,!0),g.mask.numBlocksX=v.getUint32(4,!0),g.mask.numBytes=v.getUint32(8,!0),g.mask.maxValue=v.getFloat32(12,!0),f+=16,g.mask.numBytes>0){var m=new Uint8Array(Math.ceil(g.width*g.height/8));v=new DataView(c,f,g.mask.numBytes);var y=v.getInt16(0,!0),_=2,w=0;do{if(y>0)for(;y--;)m[w++]=v.getUint8(_++);else{var S=v.getUint8(_++);for(y=-y;y--;)m[w++]=S}y=v.getInt16(_,!0),_+=2}while(_<g.mask.numBytes);if(y!==-32768||w<m.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=m,f+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));v=new DataView(c,f,16),g.pixels={},g.pixels.numBlocksY=v.getUint32(0,!0),g.pixels.numBlocksX=v.getUint32(4,!0),g.pixels.numBytes=v.getUint32(8,!0),g.pixels.maxValue=v.getFloat32(12,!0),f+=16;var b=g.pixels.numBlocksX,x=g.pixels.numBlocksY,T=b+(g.width%b>0?1:0),C=x+(g.height%x>0?1:0);g.pixels.blocks=new Array(T*C);for(var A=0,M=0;M<C;M++)for(var E=0;E<T;E++){var R=0,P=c.byteLength-f;v=new DataView(c,f,Math.min(10,P));var I={};g.pixels.blocks[A++]=I;var L=v.getUint8(0);if(R++,I.encoding=L&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){f++;continue}if(L!==0&&L!==2){if(L>>=6,I.offsetType=L,L===2)I.offset=v.getInt8(1),R++;else if(L===1)I.offset=v.getInt16(1,!0),R+=2;else if(L===0)I.offset=v.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(I.encoding===1)if(L=v.getUint8(R),R++,I.bitsPerPixel=L&63,L>>=6,I.numValidPixelsType=L,L===2)I.numValidPixels=v.getUint8(R),R++;else if(L===1)I.numValidPixels=v.getUint16(R,!0),R+=2;else if(L===0)I.numValidPixels=v.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(f+=R,I.encoding!==3){var D,F;if(I.encoding===0){var G=(g.pixels.numBytes-1)/4;if(G!==Math.floor(G))throw"uncompressed block has invalid length";D=new ArrayBuffer(G*4),F=new Uint8Array(D),F.set(new Uint8Array(c,f,G*4));var B=new Float32Array(D);I.rawData=B,f+=G*4}else if(I.encoding===1){var z=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),k=Math.ceil(z/4);D=new ArrayBuffer(k*4),F=new Uint8Array(D),F.set(new Uint8Array(c,f,z)),I.stuffedData=new Uint32Array(D),f+=z}}}return g.eofOffset=f,g},u=function(c,f,d,g,p,v,m){var y=(1<<f)-1,_=0,w,S=0,b,x,T=Math.ceil((m-g)/p),C=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*C,w=0;w<d;w++){if(S===0&&(x=c[_++],S=32),S>=f)b=x>>>S-f&y,S-=f;else{var A=f-S;b=(x&y)<<A&y,x=c[_++],S=32-A,b+=x>>>S}v[w]=b<T?g+b*p:m}return v};return a}(),n=function(){var a={unstuff:function(h,u,c,f,d,g,p,v){var m=(1<<c)-1,y=0,_,w=0,S,b,x,T,C=h.length*4-Math.ceil(c*f/8);if(h[h.length-1]<<=8*C,d)for(_=0;_<f;_++)w===0&&(b=h[y++],w=32),w>=c?(S=b>>>w-c&m,w-=c):(x=c-w,S=(b&m)<<x&m,b=h[y++],w=32-x,S+=b>>>w),u[_]=d[S];else for(T=Math.ceil((v-g)/p),_=0;_<f;_++)w===0&&(b=h[y++],w=32),w>=c?(S=b>>>w-c&m,w-=c):(x=c-w,S=(b&m)<<x&m,b=h[y++],w=32-x,S+=b>>>w),u[_]=S<T?g+S*p:v},unstuffLUT:function(h,u,c,f,d,g){var p=(1<<u)-1,v=0,m=0,y=0,_=0,w=0,S,b=[],x=h.length*4-Math.ceil(u*c/8);h[h.length-1]<<=8*x;var T=Math.ceil((g-f)/d);for(m=0;m<c;m++)_===0&&(S=h[v++],_=32),_>=u?(w=S>>>_-u&p,_-=u):(y=u-_,w=(S&p)<<y&p,S=h[v++],_=32-y,w+=S>>>_),b[m]=w<T?f+w*d:g;return b.unshift(f),b},unstuff2:function(h,u,c,f,d,g,p,v){var m=(1<<c)-1,y=0,_,w=0,S=0,b,x,T;if(d)for(_=0;_<f;_++)w===0&&(x=h[y++],w=32,S=0),w>=c?(b=x>>>S&m,w-=c,S+=c):(T=c-w,b=x>>>S&m,x=h[y++],w=32-T,b|=(x&(1<<T)-1)<<c-T,S=T),u[_]=d[b];else{var C=Math.ceil((v-g)/p);for(_=0;_<f;_++)w===0&&(x=h[y++],w=32,S=0),w>=c?(b=x>>>S&m,w-=c,S+=c):(T=c-w,b=x>>>S&m,x=h[y++],w=32-T,b|=(x&(1<<T)-1)<<c-T,S=T),u[_]=b<C?g+b*p:v}return u},unstuffLUT2:function(h,u,c,f,d,g){var p=(1<<u)-1,v=0,m=0,y=0,_=0,w=0,S=0,b,x=[],T=Math.ceil((g-f)/d);for(m=0;m<c;m++)_===0&&(b=h[v++],_=32,S=0),_>=u?(w=b>>>S&p,_-=u,S+=u):(y=u-_,w=b>>>S&p,b=h[v++],_=32-y,w|=(b&(1<<y)-1)<<u-y,S=y),x[m]=w<T?f+w*d:g;return x.unshift(f),x},originalUnstuff:function(h,u,c,f){var d=(1<<c)-1,g=0,p,v=0,m,y,_,w=h.length*4-Math.ceil(c*f/8);for(h[h.length-1]<<=8*w,p=0;p<f;p++)v===0&&(y=h[g++],v=32),v>=c?(m=y>>>v-c&d,v-=c):(_=c-v,m=(y&d)<<_&d,y=h[g++],v=32-_,m+=y>>>v),u[p]=m;return u},originalUnstuff2:function(h,u,c,f){var d=(1<<c)-1,g=0,p,v=0,m=0,y,_,w;for(p=0;p<f;p++)v===0&&(_=h[g++],v=32,m=0),v>=c?(y=_>>>m&d,v-=c,m+=c):(w=c-v,y=_>>>m&d,_=h[g++],v=32-w,y|=(_&(1<<w)-1)<<c-w,m=w),u[p]=y;return u}},s={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(h){for(var u=65535,c=65535,f=h.length,d=Math.floor(f/2),g=0;d;){var p=d>=359?359:d;d-=p;do u+=h[g++]<<8,c+=u+=h[g++];while(--p);u=(u&65535)+(u>>>16),c=(c&65535)+(c>>>16)}return f&1&&(c+=u+=h[g]<<8),u=(u&65535)+(u>>>16),c=(c&65535)+(c>>>16),(c<<16|u)>>>0},readHeaderInfo:function(h,u){var c=u.ptr,f=new Uint8Array(h,c,6),d={};if(d.fileIdentifierString=String.fromCharCode.apply(null,f),d.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+d.fileIdentifierString;c+=6;var g=new DataView(h,c,8),p=g.getInt32(0,!0);d.fileVersion=p,c+=4,p>=3&&(d.checksum=g.getUint32(4,!0),c+=4),g=new DataView(h,c,12),d.height=g.getUint32(0,!0),d.width=g.getUint32(4,!0),c+=8,p>=4?(d.numDims=g.getUint32(8,!0),c+=4):d.numDims=1,g=new DataView(h,c,40),d.numValidPixel=g.getUint32(0,!0),d.microBlockSize=g.getInt32(4,!0),d.blobSize=g.getInt32(8,!0),d.imageType=g.getInt32(12,!0),d.maxZError=g.getFloat64(16,!0),d.zMin=g.getFloat64(24,!0),d.zMax=g.getFloat64(32,!0),c+=40,u.headerInfo=d,u.ptr=c;var v,m;if(p>=3&&(m=p>=4?52:48,v=this.computeChecksumFletcher32(new Uint8Array(h,c-m,d.blobSize-14)),v!==d.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(h,u){var c=u.headerInfo,f=this.getDataTypeArray(c.imageType),d=c.numDims*this.getDataTypeSize(c.imageType),g=this.readSubArray(h,u.ptr,f,d),p=this.readSubArray(h,u.ptr+d,f,d);u.ptr+=2*d;var v,m=!0;for(v=0;v<c.numDims;v++)if(g[v]!==p[v]){m=!1;break}return c.minValues=g,c.maxValues=p,m},readSubArray:function(h,u,c,f){var d;if(c===Uint8Array)d=new Uint8Array(h,u,f);else{var g=new ArrayBuffer(f),p=new Uint8Array(g);p.set(new Uint8Array(h,u,f)),d=new c(g)}return d},readMask:function(h,u){var c=u.ptr,f=u.headerInfo,d=f.width*f.height,g=f.numValidPixel,p=new DataView(h,c,4),v={};if(v.numBytes=p.getUint32(0,!0),c+=4,(g===0||d===g)&&v.numBytes!==0)throw"invalid mask";var m,y;if(g===0)m=new Uint8Array(Math.ceil(d/8)),v.bitset=m,y=new Uint8Array(d),u.pixels.resultMask=y,c+=v.numBytes;else if(v.numBytes>0){m=new Uint8Array(Math.ceil(d/8)),p=new DataView(h,c,v.numBytes);var _=p.getInt16(0,!0),w=2,S=0,b=0;do{if(_>0)for(;_--;)m[S++]=p.getUint8(w++);else for(b=p.getUint8(w++),_=-_;_--;)m[S++]=b;_=p.getInt16(w,!0),w+=2}while(w<v.numBytes);if(_!==-32768||S<m.length)throw"Unexpected end of mask RLE encoding";y=new Uint8Array(d);var x=0,T=0;for(T=0;T<d;T++)T&7?(x=m[T>>3],x<<=T&7):x=m[T>>3],x&128&&(y[T]=1);u.pixels.resultMask=y,v.bitset=m,c+=v.numBytes}return u.ptr=c,u.mask=v,!0},readDataOneSweep:function(h,u,c,f){var d=u.ptr,g=u.headerInfo,p=g.numDims,v=g.width*g.height,m=g.imageType,y=g.numValidPixel*s.getDataTypeSize(m)*p,_,w=u.pixels.resultMask;if(c===Uint8Array)_=new Uint8Array(h,d,y);else{var S=new ArrayBuffer(y),b=new Uint8Array(S);b.set(new Uint8Array(h,d,y)),_=new c(S)}if(_.length===v*p)f?u.pixels.resultPixels=s.swapDimensionOrder(_,v,p,c,!0):u.pixels.resultPixels=_;else{u.pixels.resultPixels=new c(v*p);var x=0,T=0,C=0,A=0;if(p>1){if(f){for(T=0;T<v;T++)if(w[T])for(A=T,C=0;C<p;C++,A+=v)u.pixels.resultPixels[A]=_[x++]}else for(T=0;T<v;T++)if(w[T])for(A=T*p,C=0;C<p;C++)u.pixels.resultPixels[A+C]=_[x++]}else for(T=0;T<v;T++)w[T]&&(u.pixels.resultPixels[T]=_[x++])}return d+=y,u.ptr=d,!0},readHuffmanTree:function(h,u){var c=this.HUFFMAN_LUT_BITS_MAX,f=new DataView(h,u.ptr,16);u.ptr+=16;var d=f.getInt32(0,!0);if(d<2)throw"unsupported Huffman version";var g=f.getInt32(4,!0),p=f.getInt32(8,!0),v=f.getInt32(12,!0);if(p>=v)return!1;var m=new Uint32Array(v-p);s.decodeBits(h,u,m);var y=[],_,w,S,b;for(_=p;_<v;_++)w=_-(_<g?0:g),y[w]={first:m[_-p],second:null};var x=h.byteLength-u.ptr,T=Math.ceil(x/4),C=new ArrayBuffer(T*4),A=new Uint8Array(C);A.set(new Uint8Array(h,u.ptr,x));var M=new Uint32Array(C),E=0,R,P=0;for(R=M[0],_=p;_<v;_++)w=_-(_<g?0:g),b=y[w].first,b>0&&(y[w].second=R<<E>>>32-b,32-E>=b?(E+=b,E===32&&(E=0,P++,R=M[P])):(E+=b-32,P++,R=M[P],y[w].second|=R>>>32-E));var I=0,L=0,D=new o;for(_=0;_<y.length;_++)y[_]!==void 0&&(I=Math.max(I,y[_].first));I>=c?L=c:L=I;var F=[],G,B,z,k,O,N;for(_=p;_<v;_++)if(w=_-(_<g?0:g),b=y[w].first,b>0)if(G=[b,w],b<=L)for(B=y[w].second<<L-b,z=1<<L-b,S=0;S<z;S++)F[B|S]=G;else for(B=y[w].second,N=D,k=b-1;k>=0;k--)O=B>>>k&1,O?(N.right||(N.right=new o),N=N.right):(N.left||(N.left=new o),N=N.left),k===0&&!N.val&&(N.val=G[1]);return{decodeLut:F,numBitsLUTQick:L,numBitsLUT:I,tree:D,stuffedData:M,srcPtr:P,bitPos:E}},readHuffman:function(h,u,c,f){var d=u.headerInfo,g=d.numDims,p=u.headerInfo.height,v=u.headerInfo.width,m=v*p,y=this.readHuffmanTree(h,u),_=y.decodeLut,w=y.tree,S=y.stuffedData,b=y.srcPtr,x=y.bitPos,T=y.numBitsLUTQick,C=y.numBitsLUT,A=u.headerInfo.imageType===0?128:0,M,E,R,P=u.pixels.resultMask,I,L,D,F,G,B,z,k=0;x>0&&(b++,x=0);var O=S[b],N=u.encodeMode===1,U=new c(m*g),j=U,q;if(g<2||N){for(q=0;q<g;q++)if(g>1&&(j=new c(U.buffer,m*q,m),k=0),u.headerInfo.numValidPixel===v*p)for(B=0,F=0;F<p;F++)for(G=0;G<v;G++,B++){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,N?(G>0?R+=k:F>0?R+=j[B-v]:R+=k,R&=255,j[B]=R,k=R):j[B]=R}else for(B=0,F=0;F<p;F++)for(G=0;G<v;G++,B++)if(P[B]){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,N?(G>0&&P[B-1]?R+=k:F>0&&P[B-v]?R+=j[B-v]:R+=k,R&=255,j[B]=R,k=R):j[B]=R}}else for(B=0,F=0;F<p;F++)for(G=0;G<v;G++)if(B=F*v+G,!P||P[B])for(q=0;q<g;q++,B+=m){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,j[B]=R}u.ptr=u.ptr+(b+1)*4+(x>0?4:0),u.pixels.resultPixels=U,g>1&&!f&&(u.pixels.resultPixels=s.swapDimensionOrder(U,m,g,c))},decodeBits:function(h,u,c,f,d){{var g=u.headerInfo,p=g.fileVersion,v=0,m=h.byteLength-u.ptr>=5?5:h.byteLength-u.ptr,y=new DataView(h,u.ptr,m),_=y.getUint8(0);v++;var w=_>>6,S=w===0?4:3-w,b=(_&32)>0,x=_&31,T=0;if(S===1)T=y.getUint8(v),v++;else if(S===2)T=y.getUint16(v,!0),v+=2;else if(S===4)T=y.getUint32(v,!0),v+=4;else throw"Invalid valid pixel count type";var C=2*g.maxZError,A,M,E,R,P,I,L,D,F,G=g.numDims>1?g.maxValues[d]:g.zMax;if(b){for(u.counter.lut++,D=y.getUint8(v),v++,R=Math.ceil((D-1)*x/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),u.ptr+=v,E.set(new Uint8Array(h,u.ptr,R)),L=new Uint32Array(M),u.ptr+=R,F=0;D-1>>>F;)F++;R=Math.ceil(T*F/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),E.set(new Uint8Array(h,u.ptr,R)),A=new Uint32Array(M),u.ptr+=R,p>=3?I=a.unstuffLUT2(L,x,D-1,f,C,G):I=a.unstuffLUT(L,x,D-1,f,C,G),p>=3?a.unstuff2(A,c,F,T,I):a.unstuff(A,c,F,T,I)}else u.counter.bitstuffer++,F=x,u.ptr+=v,F>0&&(R=Math.ceil(T*F/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),E.set(new Uint8Array(h,u.ptr,R)),A=new Uint32Array(M),u.ptr+=R,p>=3?f==null?a.originalUnstuff2(A,c,F,T):a.unstuff2(A,c,F,T,!1,f,C,G):f==null?a.originalUnstuff(A,c,F,T):a.unstuff(A,c,F,T,!1,f,C,G))}},readTiles:function(h,u,c,f){var d=u.headerInfo,g=d.width,p=d.height,v=g*p,m=d.microBlockSize,y=d.imageType,_=s.getDataTypeSize(y),w=Math.ceil(g/m),S=Math.ceil(p/m);u.pixels.numBlocksY=S,u.pixels.numBlocksX=w,u.pixels.ptr=0;var b=0,x=0,T=0,C=0,A=0,M=0,E=0,R=0,P=0,I=0,L=0,D=0,F=0,G=0,B=0,z=0,k,O,N,U,j,q,V=new c(m*m),$=p%m||m,Z=g%m||m,K,J,Q=d.numDims,ee,te=u.pixels.resultMask,ae=u.pixels.resultPixels,ye=d.fileVersion,oe=ye>=5?14:15,ge,_e=d.zMax,ie;for(T=0;T<S;T++)for(A=T!==S-1?m:$,C=0;C<w;C++)for(M=C!==w-1?m:Z,L=T*g*m+C*m,D=g-M,ee=0;ee<Q;ee++){if(Q>1?(ie=ae,L=T*g*m+C*m,ae=new c(u.pixels.resultPixels.buffer,v*ee*_,v),_e=d.maxValues[ee]):ie=null,E=h.byteLength-u.ptr,k=new DataView(h,u.ptr,Math.min(10,E)),O={},z=0,R=k.getUint8(0),z++,ge=d.fileVersion>=5?R&4:0,P=R>>6&255,I=R>>2&oe,I!==(C*m>>3&oe)||ge&&ee===0)throw"integrity issue";if(q=R&3,q>3)throw u.ptr+=z,"Invalid block encoding ("+q+")";if(q===2){if(ge)if(te)for(b=0;b<A;b++)for(x=0;x<M;x++)te[L]&&(ae[L]=ie[L]),L++;else for(b=0;b<A;b++)for(x=0;x<M;x++)ae[L]=ie[L],L++;u.counter.constant++,u.ptr+=z;continue}else if(q===0){if(ge)throw"integrity issue";if(u.counter.uncompressed++,u.ptr+=z,F=A*M*_,G=h.byteLength-u.ptr,F=F<G?F:G,N=new ArrayBuffer(F%_===0?F:F+_-F%_),U=new Uint8Array(N),U.set(new Uint8Array(h,u.ptr,F)),j=new c(N),B=0,te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=j[B++]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L++]=j[B++];L+=D}u.ptr+=B*_}else if(K=s.getDataTypeUsed(ge&&y<6?4:y,P),J=s.getOnePixel(O,z,K,k),z+=s.getDataTypeSize(K),q===3)if(u.ptr+=z,u.counter.constantoffset++,te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=ge?Math.min(_e,ie[L]+J):J),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L]=ge?Math.min(_e,ie[L]+J):J,L++;L+=D}else if(u.ptr+=z,s.decodeBits(h,u,V,J,ee),z=0,ge)if(te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=V[z++]+ie[L]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L]=V[z++]+ie[L],L++;L+=D}else if(te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=V[z++]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L++]=V[z++];L+=D}}Q>1&&!f&&(u.pixels.resultPixels=s.swapDimensionOrder(u.pixels.resultPixels,v,Q,c))},formatFileInfo:function(h){return{fileIdentifierString:h.headerInfo.fileIdentifierString,fileVersion:h.headerInfo.fileVersion,imageType:h.headerInfo.imageType,height:h.headerInfo.height,width:h.headerInfo.width,numValidPixel:h.headerInfo.numValidPixel,microBlockSize:h.headerInfo.microBlockSize,blobSize:h.headerInfo.blobSize,maxZError:h.headerInfo.maxZError,pixelType:s.getPixelType(h.headerInfo.imageType),eofOffset:h.eofOffset,mask:h.mask?{numBytes:h.mask.numBytes}:null,pixels:{numBlocksX:h.pixels.numBlocksX,numBlocksY:h.pixels.numBlocksY,maxValue:h.headerInfo.zMax,minValue:h.headerInfo.zMin,noDataValue:h.noDataValue}}},constructConstantSurface:function(h,u){var c=h.headerInfo.zMax,f=h.headerInfo.zMin,d=h.headerInfo.maxValues,g=h.headerInfo.numDims,p=h.headerInfo.height*h.headerInfo.width,v=0,m=0,y=0,_=h.pixels.resultMask,w=h.pixels.resultPixels;if(_)if(g>1){if(u)for(v=0;v<g;v++)for(y=v*p,c=d[v],m=0;m<p;m++)_[m]&&(w[y+m]=c);else for(m=0;m<p;m++)if(_[m])for(y=m*g,v=0;v<g;v++)w[y+g]=d[v]}else for(m=0;m<p;m++)_[m]&&(w[m]=c);else if(g>1&&f!==c)if(u)for(v=0;v<g;v++)for(y=v*p,c=d[v],m=0;m<p;m++)w[y+m]=c;else for(m=0;m<p;m++)for(y=m*g,v=0;v<g;v++)w[y+v]=d[v];else for(m=0;m<p*g;m++)w[m]=c},getDataTypeArray:function(h){var u;switch(h){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(h){var u;switch(h){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(h,u){if(u==null)return!1;var c;switch(h){case 0:c=u>=-128&&u<=127;break;case 1:c=u>=0&&u<=255;break;case 2:c=u>=-32768&&u<=32767;break;case 3:c=u>=0&&u<=65536;break;case 4:c=u>=-2147483648&&u<=2147483647;break;case 5:c=u>=0&&u<=4294967296;break;case 6:c=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:c=u>=-17976931348623157e292&&u<=17976931348623157e292;break;default:c=!1}return c},getDataTypeSize:function(h){var u=0;switch(h){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=h}return u},getDataTypeUsed:function(h,u){var c=h;switch(h){case 2:case 4:c=h-u;break;case 3:case 5:c=h-2*u;break;case 6:u===0?c=h:u===1?c=2:c=1;break;case 7:u===0?c=h:c=h-2*u+1;break;default:c=h;break}return c},getOnePixel:function(h,u,c,f){var d=0;switch(c){case 0:d=f.getInt8(u);break;case 1:d=f.getUint8(u);break;case 2:d=f.getInt16(u,!0);break;case 3:d=f.getUint16(u,!0);break;case 4:d=f.getInt32(u,!0);break;case 5:d=f.getUInt32(u,!0);break;case 6:d=f.getFloat32(u,!0);break;case 7:d=f.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return d},swapDimensionOrder:function(h,u,c,f,d){var g=0,p=0,v=0,m=0,y=h;if(c>1)if(y=new f(u*c),d)for(g=0;g<u;g++)for(m=g,v=0;v<c;v++,m+=u)y[m]=h[p++];else for(g=0;g<u;g++)for(m=g,v=0;v<c;v++,m+=u)y[p++]=h[m];return y}},o=function(h,u,c){this.val=h,this.left=u,this.right=c},l={decode:function(h,u){u=u||{};var c=u.noDataValue,f=0,d={};d.ptr=u.inputOffset||0,d.pixels={},s.readHeaderInfo(h,d);var g=d.headerInfo,p=g.fileVersion,v=s.getDataTypeArray(g.imageType);if(p>5)throw"unsupported lerc version 2."+p;s.readMask(h,d),g.numValidPixel!==g.width*g.height&&!d.pixels.resultMask&&(d.pixels.resultMask=u.maskData);var m=g.width*g.height;d.pixels.resultPixels=new v(m*g.numDims),d.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var y=!u.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)s.constructConstantSurface(d,y);else if(p>=4&&s.checkMinMaxRanges(h,d))s.constructConstantSurface(d,y);else{var _=new DataView(h,d.ptr,2),w=_.getUint8(0);if(d.ptr++,w)s.readDataOneSweep(h,d,v,y);else if(p>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var S=_.getUint8(1);if(d.ptr++,d.encodeMode=S,S>2||p<4&&S>1)throw"Invalid Huffman flag "+S;S?s.readHuffman(h,d,v,y):s.readTiles(h,d,v,y)}else s.readTiles(h,d,v,y)}d.eofOffset=d.ptr;var b;u.inputOffset?(b=d.headerInfo.blobSize+u.inputOffset-d.ptr,Math.abs(b)>=1&&(d.eofOffset=u.inputOffset+d.headerInfo.blobSize)):(b=d.headerInfo.blobSize-d.ptr,Math.abs(b)>=1&&(d.eofOffset=d.headerInfo.blobSize));var x={width:g.width,height:g.height,pixelData:d.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:d.pixels.resultMask};if(d.pixels.resultMask&&s.isValidPixelValue(g.imageType,c)){var T=d.pixels.resultMask;for(f=0;f<m;f++)T[f]||(x.pixelData[f]=c);x.noDataValue=c}return d.noDataValue=c,u.returnFileInfo&&(x.fileInfo=s.formatFileInfo(d)),x},getBandCount:function(h){var u=0,c=0,f={};for(f.ptr=0,f.pixels={};c<h.byteLength-58;)s.readHeaderInfo(h,f),c+=f.headerInfo.blobSize,u++,f.ptr=c;return u}};return l}(),i=function(){var a=new ArrayBuffer(4),s=new Uint8Array(a),o=new Uint32Array(a);return o[0]=1,s[0]===1}(),r={decode:function(a,s){if(!i)throw"Big endian system is not supported.";s=s||{};var o=s.inputOffset||0,l=new Uint8Array(a,o,10),h=String.fromCharCode.apply(null,l),u,c;if(h.trim()==="CntZImage")u=e,c=1;else if(h.substring(0,5)==="Lerc2")u=n,c=2;else throw"Unexpected file identifier string: "+h;for(var f=0,d=a.byteLength-10,g,p=[],v,m,y={width:0,height:0,pixels:[],pixelType:s.pixelType,mask:null,statistics:[]},_=0;o<d;){var w=u.decode(a,{inputOffset:o,encodedMaskData:g,maskData:m,returnMask:f===0,returnEncodedMask:f===0,returnFileInfo:!0,returnPixelInterleavedDims:s.returnPixelInterleavedDims,pixelType:s.pixelType||null,noDataValue:s.noDataValue||null});o=w.fileInfo.eofOffset,m=w.maskData,f===0&&(g=w.encodedMaskData,y.width=w.width,y.height=w.height,y.dimCount=w.dimCount||1,y.pixelType=w.pixelType||w.fileInfo.pixelType,y.mask=m),c>1&&(m&&p.push(m),w.fileInfo.mask&&w.fileInfo.mask.numBytes>0&&_++),f++,y.pixels.push(w.pixelData),y.statistics.push({minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue,dimStats:w.dimStats})}var S,b,x;if(c>1&&_>1){for(x=y.width*y.height,y.bandMasks=p,m=new Uint8Array(x),m.set(p[0]),S=1;S<p.length;S++)for(v=p[S],b=0;b<x;b++)m[b]=m[b]&v[b];y.maskData=m}return y}};t.exports?t.exports=r:this.Lerc=r})()})(wW);const vTe=wW.exports;class pTe extends tl{constructor(e){super(),this.planarConfiguration=typeof e.PlanarConfiguration!="undefined"?e.PlanarConfiguration:1,this.samplesPerPixel=typeof e.SamplesPerPixel!="undefined"?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[Jae.AddCompression]}decodeBlock(e){switch(this.addCompression){case CM.None:break;case CM.Deflate:e=xW(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return vTe.decode(e,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}const mTe=Object.freeze(Object.defineProperty({__proto__:null,default:pTe},Symbol.toStringTag,{value:"Module"}));class yTe extends tl{constructor(){if(super(),typeof createImageBitmap=="undefined")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document=="undefined"&&typeof OffscreenCanvas=="undefined")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}decode(e,n){return Be(this,null,function*(){const i=new Blob([n]),r=yield createImageBitmap(i);let a;typeof document!="undefined"?(a=document.createElement("canvas"),a.width=r.width,a.height=r.height):a=new OffscreenCanvas(r.width,r.height);const s=a.getContext("2d");return s.drawImage(r,0,0),s.getImageData(0,0,r.width,r.height).data.buffer})}}const _Te=Object.freeze(Object.defineProperty({__proto__:null,default:yTe},Symbol.toStringTag,{value:"Module"}));var xTe=Worker;function wTe(){const t='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new xTe(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}const bTe=Object.freeze(Object.defineProperty({__proto__:null,create:wTe},Symbol.toStringTag,{value:"Module"}));nt.VDraw=Kf,nt.VEcharts=cg,nt.VGDRoute=wg,nt.VGraphic=Yf,nt.VHeatmap=Xf,nt.VImage=qf,nt.VMap=Rf,nt.VMeasure=Jf,nt.VOverlay=Nf,nt.VOverview=Ff,nt.VPath=gg,nt.VRoute=Zf,nt.VSuperCluster=mg,nt.VTile=eu,nt.VTrack=dg,nt.VTraffic=yg,nt.VVector=Uf,nt.VWfs=bg,nt.default=P7e,nt.utils=Jre,Object.defineProperties(nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
277
+ ***************************************************************************** */var O7=function(t,e){return O7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},O7(t,e)};function i9e(t,e){O7(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Pl=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},GV=function(t,e){return Object.keys(e).forEach(function(n){Pl(e[n])&&Pl(t[n])?GV(t[n],e[n]):t[n]=e[n]}),t},F7=function(t,e){for(var n=arguments,i=[],r=2;r<arguments.length;r++)i[r-2]=n[r];return function(){for(var a=arguments,s=[],o=0;o<arguments.length;o++)s[o]=a[o];return t.apply(e,i.concat(Array.prototype.slice.call(s)))}},jV=function(t,e){for(var n=0,i,r=t.length;n<r;n++)if(t[n].index===e.index){i=n;break}return i===void 0?t.push(e):t[i]=e,t},UV=function(){function t(e){return e?(e^Math.random()*16>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}return t()};function qV(t,e){t.forEach(function(n){!e[n]||(e[n]=e[n].bind(e))})}function N7(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function H3(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,button:e.pointerEvent.button,buttons:e.pointerEvent.buttons,clientX:e.pointerEvent.clientX,clientY:e.pointerEvent.clientY,zrX:e.pointerEvent.offsetX,zrY:e.pointerEvent.offsetY,movementX:e.pointerEvent.movementX,movementY:e.pointerEvent.movementY,relatedTarget:e.pointerEvent.relatedTarget,screenX:e.pointerEvent.screenX,screenY:e.pointerEvent.screenY,view:window});return n.zrX=e.pointerEvent.offsetX,n.zrY=e.pointerEvent.offsetY,n.event=n,n}function r9e(t,e){for(var n=t.split("."),i=e.split("."),r=0;r<3;r++){var a=Number(n[r]),s=Number(i[r]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}var a9e=function(t){return!t.UTF8Encoding},VV=function(t,e,n){for(var i=[],r=[e[0],e[1]],a=r[0],s=r[1],o=0;o<t.length;o+=2){var l=t.charCodeAt(o)-64,h=t.charCodeAt(o+1)-64;l=l>>1^-(l&1),h=h>>1^-(h&1),l+=a,h+=s,a=l,s=h,i.push([l/n,h/n])}return i},s9e=function(t){if(a9e(t))return t;var e=t.UTF8Scale;e==null&&(e=1024);for(var n=t.features,i=0;i<n.length;i++)for(var r=n[i],a=r.geometry,s=[a.coordinates,a.encodeOffsets],o=s[0],l=s[1],h=0;h<o.length;h++){var u=o[h];if(a.type==="Polygon")o[h]=VV(u,l[h],e);else if(a.type==="MultiPolygon")for(var c=0;c<u.length;c++){var f=u[c];u[c]=VV(f,l[h][c],e)}}return t.UTF8Encoding=!1,t};function o9e(t){var e=s9e(t),n=Il.util.map(Il.util.filter(e.features,function(i){return i.geometry&&i.properties&&i.geometry.coordinates.length>0}),function(i){var r=i.properties,a=i.geometry,s=a.coordinates,o=[];return a.type==="Polygon"&&o.push(s[0]),a.type==="MultiPolygon"&&Il.util.each(s,function(l){l[0]&&o.push(l[0])}),{properties:r,type:"Feature",geometry:{type:"Polygon",coordinates:o}}});return{type:"FeatureCollection",crs:{},features:n}}var l9e=function(t,e,n){return e.center=n.dataToPoint(e.coordinates),e},h9e=function(t,e,n){return Pl(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(i,r){var a=n.dataToPoint(t.series[r].coordinates);return i.left=a[0]-parseFloat(i.width)/2,i.top=a[1]-parseFloat(i.height)/2,i})),e},u9e=function(t,e,n){return Pl(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(i,r){var a=n.dataToPoint(t.series[r].coordinates);return i.left=a[0]-parseFloat(i.width)/2,i.top=a[1]-parseFloat(i.height)/2,i})),e},c9e=Object.freeze({pie:l9e,bar:h9e,line:u9e}),f9e={forcedRerender:!1,forcedPrecomposeRerender:!1,hideOnZooming:!1,hideOnMoving:!1,hideOnRotating:!1,convertTypes:["pie","line","bar"],insertFirst:!1,stopEvent:!1,polyfillEvents:r9e(qb,"6.1.1")<=0},d9e=function(t){i9e(e,t);function e(n,i,r){var a=this,s=Object.assign(f9e,i);return a=t.call(this,s)||this,a._options=s,a._chartOptions=n,a.set("chartOptions",n),a.$chart=null,a.$container=void 0,a._isRegistered=!1,a._initEvent=!1,a._incremental=[],a._coordinateSystem=null,a.coordinateSystemId="",a.prevVisibleState="",qV(["redraw","onResize","onZoomEnd","onCenterChange","onDragRotateEnd","onMoveStart","onMoveEnd","mouseDown","mouseUp","onClick","mouseMove"],a),r&&a.setMap(r),a}return e.prototype.appendTo=function(n,i){i===void 0&&(i=!1),this.setMap(n,i)},e.prototype.getMap=function(){return this._map},e.prototype.setMap=function(n,i){var r=this;if(i===void 0&&(i=!1),n&&(i||n instanceof Gs))this._map=n,this._map.once("postrender",function(){r.handleMapChanged()}),this._map.renderSync();else throw new Error("not ol map object")},e.prototype.getChartOptions=function(){return this.get("chartOptions")},e.prototype.setChartOptions=function(n){return n===void 0&&(n={}),this._chartOptions=n,this.set("chartOptions",n),this.clearAndRedraw(),this},e.prototype.appendData=function(n,i){return i===void 0&&(i=!0),n&&(i&&(this._incremental=jV(this._incremental,{index:this._incremental.length,data:n.data,seriesIndex:n.seriesIndex})),this.$chart.appendData({data:n.data.copyWithin(),seriesIndex:n.seriesIndex})),this},e.prototype.clear=function(n){n||(this._incremental=[]),this.$chart&&this.$chart.clear()},e.prototype.remove=function(){this.clear(),this.$chart&&this.$chart.dispose(),this._initEvent&&this.$container&&(this.$container&&N7(this.$container),this.unBindEvent()),delete this.$chart,delete this._map},e.prototype.show=function(){this.setVisible(!0)},e.prototype.innerShow=function(){this.$container&&(this.$container.style.display=this.prevVisibleState,this.prevVisibleState="")},e.prototype.hide=function(){this.setVisible(!1)},e.prototype.innerHide=function(){this.$container&&(this.prevVisibleState=this.$container.style.display,this.$container.style.display="none")},e.prototype.isVisible=function(){return this.$container&&this.$container.style.display!=="none"},e.prototype.showLoading=function(){this.$chart&&this.$chart.showLoading()},e.prototype.hideLoading=function(){this.$chart&&this.$chart.hideLoading()},e.prototype.setZIndex=function(n){this.$container&&(typeof n=="number"&&(n=String(n)),this.$container.style.zIndex=n)},e.prototype.getZIndex=function(){return this.$container&&this.$container.style.zIndex},e.prototype.setVisible=function(n){n?(this.$container&&(this.$container.style.display=""),this._chartOptions=this.getChartOptions(),this.clearAndRedraw()):(this.$container&&(this.$container.style.display="none"),this.clear(!0),this._chartOptions={},this.clearAndRedraw())},e.prototype.render=function(){!this.$chart&&this.$container?(this.$chart=Il.init(this.$container),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1)),this.dispatchEvent({type:"load",source:this,value:this.$chart})):this.isVisible()&&this.redraw()},e.prototype.redraw=function(){this.clearAndRedraw()},e.prototype.updateViewSize=function(n){!this.$container||(this.$container.style.width=n[0]+"px",this.$container.style.height=n[1]+"px",this.$container.setAttribute("width",String(n[0])),this.$container.setAttribute("height",String(n[1])))},e.prototype.onResize=function(n){var i=this.getMap();if(i){var r=i.getSize();this.updateViewSize(r),this.clearAndRedraw(),n&&this.dispatchEvent({type:"change:size",source:this,value:r})}},e.prototype.onZoomEnd=function(){this._options.hideOnZooming&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"zoomend",source:this,value:n.getView().getZoom()}))},e.prototype.onDragRotateEnd=function(){this._options.hideOnRotating&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:rotation",source:this,value:n.getView().getRotation()}))},e.prototype.onMoveStart=function(){this._options.hideOnMoving&&this.innerHide();var n=this.getMap();n&&n.getView()&&this.dispatchEvent({type:"movestart",source:this,value:n.getView().getCenter()})},e.prototype.onMoveEnd=function(){this._options.hideOnMoving&&this.innerShow();var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"moveend",source:this,value:n.getView().getCenter()}))},e.prototype.onClick=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("click",n))},e.prototype.mouseDown=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mousedown",n))},e.prototype.mouseUp=function(n){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mouseup",n))},e.prototype.mouseMove=function(n){if(this.$chart)for(var i=n.originalEvent.target;i;){if(i.className==="ol-overlaycontainer-stopevent"){this.$chart.getZr().painter.getViewportRoot().dispatchEvent(H3("mousemove",n));return}i=i.parentElement}},e.prototype.onCenterChange=function(){var n=this.getMap();n&&n.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:center",source:this,value:n.getView().getCenter()}))},e.prototype.handleMapChanged=function(){var n=this.getMap();if(this._initEvent&&this.$container&&(this.$container&&N7(this.$container),this.unBindEvent()),this.$container||(this.createLayerContainer(),this.onResize(!1)),n){var i=this._options.stopEvent?n.getOverlayContainerStopEvent():n.getOverlayContainer();this._options.insertFirst?i.insertBefore(this.$container,i.childNodes[0]||null):i.appendChild(this.$container),this.render(),this.bindEvent(n)}},e.prototype.createLayerContainer=function(){this.$container=document.createElement("div"),this.$container.style.position="absolute",this.$container.style.top="0px",this.$container.style.left="0px",this.$container.style.right="0px",this.$container.style.bottom="0px",this.$container.style.pointerEvents="auto"},e.prototype.bindEvent=function(n){var i=n.getView();this._options.forcedPrecomposeRerender&&n.on("precompose",this.redraw),n.on("change:size",this.onResize),i.on("change:resolution",this.onZoomEnd),i.on("change:center",this.onCenterChange),i.on("change:rotation",this.onDragRotateEnd),n.on("movestart",this.onMoveStart),n.on("moveend",this.onMoveEnd),this._options.polyfillEvents&&(n.on("pointerdown",this.mouseDown),n.on("pointerup",this.mouseUp),n.on("pointermove",this.mouseMove),n.on("click",this.onClick)),this._initEvent=!0},e.prototype.unBindEvent=function(){var n=this.getMap();if(!!n){var i=n.getView();!i||(n.un("precompose",this.redraw),n.un("change:size",this.onResize),i.un("change:resolution",this.onZoomEnd),i.un("change:center",this.onCenterChange),i.un("change:rotation",this.onDragRotateEnd),n.un("movestart",this.onMoveStart),n.un("moveend",this.onMoveEnd),this._options.polyfillEvents&&(n.un("pointerdown",this.mouseDown),n.un("pointerup",this.mouseUp),n.un("pointermove",this.mouseMove),n.un("click",this.onClick)),this._initEvent=!1)}},e.prototype.clearAndRedraw=function(){if(!(!this.$chart||!this.isVisible())){if(this._options.forcedRerender&&this.$chart.clear(),this.$chart.resize(),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1),this._incremental&&this._incremental.length>0))for(var n=0;n<this._incremental.length;n++)this.appendData(this._incremental[n],!1);this.dispatchEvent({type:"redraw",source:this})}},e.prototype.registerMap=function(){if(this._isRegistered||(this.coordinateSystemId="openlayers_"+UV(),Il.registerCoordinateSystem(this.coordinateSystemId,this.getCoordinateSystem(this._options)),this._isRegistered=!0),this._chartOptions){var n=this._chartOptions.series;if(n&&Pl(n)){var i=this._options.convertTypes;if(i)for(var r=n.length-1;r>=0;r--)i.indexOf(n[r].type)>-1||(n[r].coordinateSystem=this.coordinateSystemId),n[r].animation=!1}}},e.prototype.convertData=function(n){var i=n.series;if(i&&i.length>0){if(!this._coordinateSystem){var r=this.getCoordinateSystem(this._options);this._coordinateSystem=new r(this.getMap())}if(i&&Pl(i)){var a=this._options.convertTypes;if(a)for(var s=i.length-1;s>=0;s--)a.indexOf(i[s].type)>-1&&i[s]&&i[s].hasOwnProperty("coordinates")&&(i[s]=c9e[i[s].type](n,i[s],this._coordinateSystem))}}return n},e.prototype.getCoordinateSystem=function(n){var i=this.getMap(),r=this.coordinateSystemId,a=function(s){this.map=s,this._mapOffset=[0,0],this.dimensions=["lng","lat"],this.projCode=a.getProjectionCode(this.map)};return a.dimensions=a.prototype.dimensions||["lng","lat"],a.prototype.getZoom=function(){return this.map.getView().getZoom()},a.prototype.setZoom=function(s){return this.map.getView().setZoom(s)},a.prototype.getViewRectAfterRoam=function(){return this.getViewRect().clone()},a.prototype.setMapOffset=function(s){this._mapOffset=s},a.prototype.dataToPoint=function(s){var o;if(s&&Array.isArray(s)&&s.length>0){o=s.map(function(f){var d=0;return typeof f=="string"?d=Number(f):d=f,d});var l=n&&n.source||"EPSG:4326",h=n&&n.destination||this.projCode,u=this.map.getPixelFromCoordinate(xr(o,l,h)),c=this._mapOffset;return[u[0]-c[0],u[1]-c[1]]}return[0,0]},a.prototype.pointToData=function(s){var o=this._mapOffset;return this.map.getCoordinateFromPixel([s[0]+o[0],s[1]+o[1]])},a.prototype.getViewRect=function(){var s=this.map.getSize();return new Il.graphic.BoundingRect(0,0,s[0],s[1])},a.prototype.getRoamTransform=function(){return Il.matrix.create()},a.prototype.prepareCustoms=function(){var s=this.getViewRect();return{coordSys:{type:r,x:s.x,y:s.y,width:s.width,height:s.height},api:{coord:F7(this.dataToPoint,this),size:F7(a.dataToCoordsSize,this)}}},a.create=function(s){s.eachSeries(function(o){o.get("coordinateSystem")===r&&(o.coordinateSystem=new a(i))})},a.getProjectionCode=function(s){var o="";return s?o=s.getView()&&s.getView().getProjection().getCode():o="EPSG:3857",o},a.dataToCoordsSize=function(s,o){var l=this;return o===void 0&&(o=[0,0]),[0,1].map(function(h){var u=o[h],c=[],f=[],d=s[h]/2;c[h]=u-d,f[h]=u+d,c[1-h]=o[1-h],f[1-h]=o[1-h];var g=l.dataToPoint(c)[h]-l.dataToPoint(f)[h];return Math.abs(g)},this)},a},e.prototype.dispatchEvent=function(n){return t.prototype.dispatchEvent.call(this,n)},e.prototype.set=function(n,i,r){return t.prototype.set.call(this,n,i,r)},e.prototype.get=function(n){return t.prototype.get.call(this,n)},e.prototype.unset=function(n,i){return t.prototype.unset.call(this,n,i)},e.prototype.on=function(n,i){return t.prototype.on.call(this,n,i)},e.prototype.un=function(n,i){return t.prototype.un.call(this,n,i)},e.formatGeoJSON=o9e,e.bind=F7,e.merge=GV,e.uuid=UV,e.bindAll=qV,e.arrayAdd=jV,e.removeNode=N7,e.isObject=Pl,e}(Oi);const g9e={name:"v-echarts",extends:or,inject:["VMap"],render(t,e){return null},props:{layerId:{type:String,default(){return`draw-layer-${$e()}`}},options:{type:Object}},data(){return{layer:null}},computed:{map(){return this.VMap.map},map3d(){return this.VMap.map3d}},watch:{visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){this.layer=new d9e(this.options),this.zIndex&&this.layer.setZIndex(this.zIndex),this.layer.appendTo(this.map)},dispose(){this.layer.remove()}}};let v9e,p9e;const $V={};var HV=qn(g9e,v9e,p9e,!1,m9e,null,null,null);function m9e(t){for(let e in $V)this[e]=$V[e]}HV.options.__file="src/components/layers/echarts/index.vue";const cg=function(){return HV.exports}();cg.install=t=>{t.component(cg.name,cg)};function y9e(t,e){let n;return e.getLayers().forEach(i=>{i&&i.get("id")===t&&(n=i)}),n}const Ob=class{constructor(e,n,i,r,a,s,o,l,h){!n||n.length<1||(this.id=h.id,this.changeCarRotate=h.changeCarRotate,this.centerAtCar=h.centerAtCar,this._moving=!0,this._ismove=!1,this._map=e,this._labelShow=s,this._timeContentClass=o,this._vacuate=r,this._wholePathInfo=n,this._timeOverlayList=[],r?(this._pathInfo=i,this._convertPaths(i)):(this._pathInfo=n,this._convertPaths(n)),this._vacuatePath=i,this._path=[],this._passPath=[],this._pointIndexDistance=20,this._tracePoints=[],this._tracePointsModePlay=a,this._traceTimedivDom=e.traceTimedivDom,this._tracePointsFromTime=[],this._traceEnd=!1,this.traceLayer=new Jt({source:new si,zIndex:99}),this.traceLayer.set("isTrack",!0),e.addLayer(this.traceLayer),this.tracePassLayer=new Jt({source:new si,zIndex:100}),this.tracePassLayer.set("isTrack",!0),e.addLayer(this.tracePassLayer),this.arrowsLayer=new Jt({source:new si,zIndex:101}),this.arrowsLayer.set("isTrack",!0),e.addLayer(this.arrowsLayer),this.carLayer=new Jt({source:new si,zIndex:102}),this.carLayer.set("isTrack",!0),e.addLayer(this.carLayer),this.traceNodes=[],this.traceLineList=[],this.carMarker=null,this._carInfoWin=null,this._pointIndex=0,this._traceIndex=0,this._speedUp=1,this._intervalTraceFlag=null,this._intervalTimeFlag=null,this._opts={carIcon:{src:"",scale:1},speed:0,defaultContent:"",startIcon:{src:"",scale:1},endIcon:{src:"",scale:1},passFlag:!0,showInfoWin:!1,arrowPixel:50,tracePlay:!1},this._setOptions(h),this._initFlag=1,this._showTracePoint=l)}};let wt=Ob;Ze(wt,"track",Ob),wt.prototype._setOptions=function(t){if(!!t)for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this._opts[e]=t[e])},wt.prototype.getSpeed=function(){return this._opts.speed},wt.prototype.getSpeedUp=function(){return this._speedUp},wt.prototype.getPaths=function(){return this._pathInfo},wt.prototype.getTraceIndex=function(){return this._pointIndex},wt.prototype.setTraceIndex=function(t){this._pointIndex=t;const e=this._path[t];this.carMarker.setPosition(e)},wt.prototype.getPercentnum=function(){const t=this._tracePoints,e=this.carMarker.getPosition();for(let n=0;n<t.length;n++)if(e.toString()===t[n].coordinate.toString())return parseFloat((n/t.length).toFixed(2))},wt.prototype.setPercentnum=function(t){const e=this._tracePoints,n=this._tracePointsFromTime,i=Math.round(e.length*t),r=e[i].coordinate;this.carMarker.setPosition(r);for(let a=0;a<n.length;a++){const s=n[a].temBreakPointsFromTime;for(let o=0;o<s.length;o++)s[o].coordinate.toString()===r.toString()&&(this._traceIndex=o,this._pointIndex=a)}},wt.prototype._showTimePopup=function(t){const e=this;e._traceTime=e._pathInfo[0].time,e._fromPause&&(e._traceTime=e._traceTimedivDom.innerText);const n=e._pathInfo[e._pathInfo.length-1].time,i=new Date(n).getTime();i>t.maxEndTime&&(t.maxEndTime=i),e._intervalTimeFlag=setInterval(function(){if(!e._traceEnd&&!e._fromPause&&!e._fromStop){if(e._traceTime=new Date(e._traceTime).getTime()+1e3*e._speedUp,t.maxEndTime<e._traceTime){e._traceEnd=!0,e._traceTimedivDom.innerText=n;return}e._traceTime%1e3===0&&(e._traceTime=w9e(new Date(e._traceTime)),e._traceTimedivDom.innerText=e._traceTime)}},1e3)},wt.prototype._setTraceTime=function(t){const e=this,n=e._tracePointsFromTime;if(e._traceTimedivDom.innerText=t,e._traceTime=t,e._opts.speed===0){let i=Number.MAX_VALUE;const r=new Date(e._traceTimedivDom.innerText).getTime();if(r>0||!isNaN(r))for(let a=0;a<n.length;a++){const s=n[a].temBreakPointsFromTime;for(let o=0;o<s.length;o++)Math.abs(r-s[o].thisTimeSecond)<i&&(i=Math.abs(r-s[o].thisTimeSecond),e._pointIndex=a,e._traceIndex=o)}e._fromStop&&(e._pointIndex=0,e._traceIndex=0),(e._traceTimedivDom.innerText===""||e._fromPause||e._fromStop)&&e._showTimePopup(e._map)}},wt.prototype._convertPaths=function(t){this._path=[];for(let e=0;e<t.length;e++)this._path.push([t[e].longitude,t[e].latitude])},wt.prototype.start=function(){this._moving=!0;const t=this,e=t.getTracePoints(1);t._tracePoints=e.breakPoints,t._tracePointsFromTime=e.breakPointsFromTime,!(t._path.length<1)&&(t._tracePointsModePlay==="skip"?t.tracePointsPlay():t._tracePointsModePlay==="animation"&&t.timePointsPlay())},wt.prototype.tracePointsPlay=function(){const t=this,e=t._pathInfo,n=t._passPath;if(n.length===0&&t.tracePassLayer.getSource().clear(),!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop||t._pointIndex>=e.length)return;if(t._pointIndex+=t._speedUp,t._pointIndex>=e.length&&(t._pointIndex=e.length-1),t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._pointIndex===1&&n.push([e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude]),n.push([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const s=new pn({geometry:new Zt([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});s.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(s)}t._opts.showInfoWin&&(t._carInfoWin.getElement().innerText=e[t._pointIndex].info);const i=t._map.getView().calculateExtent(),r=t.carMarker.getPosition();!Qi(i,r)&&t.centerAtCar&&t._map.getView().animate({center:r})},1e3);else if(t._fromPause){if(!t._fromStop){if(t._pointIndex++,t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const i=new pn({geometry:new Zt([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});i.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(i)}t._ismove=!1}}else return;this._fromPause=!1,this._fromStop=!1},wt.prototype.timePointsPlay=function(){const t=this,e=t._tracePoints,n=t._tracePointsFromTime,i=t._passPath;if(i.length===0&&t.tracePassLayer.getSource().clear(),t._opts.speed===0){let r=Number.MAX_VALUE;const a=new Date(t._traceTimedivDom.innerText).getTime();if(a>0||!isNaN(a))for(let s=0;s<n.length;s++){const o=n[s].temBreakPointsFromTime;for(let l=0;l<o.length;l++)Math.abs(a-o[l].thisTimeSecond)<r&&(r=Math.abs(a-o[l].thisTimeSecond),t._pointIndex=s,t._traceIndex=l)}t._fromStop&&(t._pointIndex=0,t._traceIndex=0),(t._traceTimedivDom.innerText===""||t._fromPause||t._fromStop)&&t._showTimePopup(t._map)}if(!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop)return;const r=t._opts.speed*1e3/3600;if(t._pointIndex>=n.length)return;const a=n[t._pointIndex].temBreakPointsFromTime,s=n[t._pointIndex].differenceTime,o=n[t._pointIndex].length;let l=0;if(r===0?l=(o/s/50).toFixed(2)*10*t._speedUp:l=(r/50).toFixed(2)*10,t._fromPause||t._fromStop||t._pointIndex>=e.length-1||t._pointIndex>=n.length)return;if(t._traceIndex+=l,t._traceIndex=Math.round(t._traceIndex),t._traceIndex>=a.length){t._traceIndex=a.length-1,t._pointIndex++;const f=a.slice(0,t._traceIndex);for(let p=0;p<f.length;p++)i.push(f[p].coordinate);if(t._opts.passFlag){const p=new pn({geometry:new Zt(i)});p.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}const d=YV(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.carMarker.setPosition(a[t._traceIndex].coordinate),t.changeCarRotate&&t.carMarker.setRotateAngle(d);const g=t._troughPointIndex(a[t._traceIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0))),t._traceIndex=0}else{const f=a.slice(Math.round(t._traceIndex-l),t._traceIndex);for(let p=0;p<f.length;p++)i.push(f[p].coordinate);if(t._opts.passFlag){const p=new pn({geometry:new Zt(i)});p.setStyle(new ft({stroke:new Dt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}t.carMarker.setPosition(a[t._traceIndex].coordinate);const d=YV(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.changeCarRotate&&t.carMarker.setRotateAngle(d);const g=t._troughPointIndex(e[t._pointIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0)))}const h=t._map.getView().calculateExtent(),u=t.carMarker.getPosition();!Qi(h,u)&&t.centerAtCar&&t._map.getView().animate({center:u})},200);else if(t._fromPause)t._fromStop||(t._traceIndex++,t._ismove=!1);else return;this._fromPause=!1,this._fromStop=!1},wt.prototype.setSpeed=function(t){this._opts.speed=t},wt.prototype.setSpeedUp=function(t){this._speedUp=t},wt.prototype.stop=function(){this._moving=!1,this._ismove=!1,this._pointIndex=0,this._traceIndex=0,this._fromStop=!0,this._passPath=[],this.tracePassLayer.getSource().clear(),this.carMarker.setPosition([this._pathInfo[0].longitude,this._pathInfo[0].latitude]),clearInterval(this._intervalTraceFlag),clearInterval(this._intervalTimeFlag)},wt.prototype.pause=function(){this._moving=!1,this._ismove=!0,this._fromPause=!0,clearInterval(this._intervalTimeFlag)},wt.prototype._addMarker=function(){const t=this;this.carMarker&&(this.carLayer.getSource().getFeatures().length>0&&this.carLayer.getSource().removeFeature(this.carMarker),clearInterval(this._intervalTraceFlag));const e=b9e(this._path[0],this._opts);this.carLayer.getSource().addFeature(e),this.carMarker=e,e.on=function(n,i){if(n==="move"){const r=setInterval(function(){if(!t._moving)return;const a=e.getPosition(),s=t._pathInfo;for(let o=0;o<s.length;o++)a.toString()===s[o].longitude+","+s[o].latitude&&(i(o),o===s.length-1&&clearInterval(r))},200)}}},wt.prototype._addInfoWin=function(){const t=this;if(!t._opts.showInfoWin)return;const e=t.carMarker.getPosition();if(t._carInfoWin){t._carInfoWin.setPosition(e);return}const n=document.createElement("div");n.className="carOverlay-class",n.innerText="";const i=new im({element:document.getElementById(t._opts.overlay.element.toString()),position:e,stopEvent:!0,offset:[10,0]});t._carInfoWin=i,t._map.addOverlay(i)},wt.prototype.getArrowPoints=function(t){const e=this._pathInfo,n=[];for(let i=0;i<e.length-1;i++){const r=[e[i].longitude,e[i].latitude],a=[e[i+1].longitude,e[i+1].latitude],s=this._map.getPixelFromCoordinate(r),o=this._map.getPixelFromCoordinate(a),h=ZV([s,o]),u=Math.floor(h/t),c=this.getRotationFromPixel(s,o);for(let f=1;f<u+1;f++){const d=[s[0]+t*f*Math.cos(c),s[1]+t*f*Math.sin(c)],g=this._map.getCoordinateFromPixel(d);n.push({rotate:c,coordinate:g})}}return n},wt.prototype.getTracePoints=function(t){const e=this._pathInfo,n=[],i=[];for(let r=0;r<e.length-1;r++){const a=[],s=[e[r].longitude,e[r].latitude],o=[e[r+1].longitude,e[r+1].latitude],l=e[r].time,h=e[r+1].time,u=new Date(l).getTime(),c=new Date(h).getTime(),f=c-u;if(f===0)continue;const d=i0(s),g=i0(o),v=ZV([d,g]),m=Math.floor(v/t),y=this.getRotationFromPixel(d,g),_=this.getAngleFromPixel(d,g);for(let w=0;w<m+1;w++){const S=[d[0]+w*t*Math.cos(y),d[1]+w*t*Math.sin(y)],b=Xp(S),x=u+Math.round(f/m)*w;n.push({rotate:_,coordinate:b,thisTimeSecond:x}),a.push({rotate:_,coordinate:b,thisTimeSecond:x})}v%t!==0&&(n.push({rotate:_,coordinate:o,thisTimeSecond:c}),a.push({rotate:_,coordinate:o,thisTimeSecond:c})),i.push({length:v,differenceTime:f/1e3,initTime:l,targetTime:h,temBreakPointsFromTime:a})}return{breakPoints:n,breakPointsFromTime:i}},wt.prototype.getRotationFromPixel=function(t,e){if(!t)return!1;t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),r=Math.sqrt(n*n+i*i),a=Math.asin(i/r);let s=0;return e.y<t.y&&e.x===t.x?s=Math.PI*2/3:e.y>t.y&&e.x===t.x?s=Math.PI/2:e.y===t.y&&e.x<t.x?s=Math.PI:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=a:e.y>t.y&&e.x<t.x?s=Math.PI-a:e.y<t.y&&e.x<t.x?s=Math.PI+a:e.y<t.y&&e.x>t.x&&(s=Math.PI*2-a),s},wt.prototype.getAngleFromPixel=function(t,e){t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),r=Math.sqrt(n*n+i*i),a=Math.round(Math.asin(i/r)/Math.PI*180);let s=0;return e.y<t.y&&e.x===t.x?s=270:e.y>t.y&&e.x===t.x?s=90:e.y===t.y&&e.x<t.x?s=180:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=360-a:e.y>t.y&&e.x<t.x?s=180+a:e.y<t.y&&e.x<t.x?s=180-a:e.y<t.y&&e.x>t.x&&(s=a),s},wt.prototype._troughPointIndex=function(t){const e=this._pointIndexDistance,n=this._path;for(let i=0;i<n.length;i++){const r=n[i];if(e0(r,t)<e)return i}return-1},wt.prototype._traceLineSytle=function(t){const e=this._opts,n=e.lineWidth?e.lineWidth:5,i=e.lineColor?e.lineColor:"blue";return{route:new ft({stroke:new Dt({width:n,color:i})}),node:new ft({image:new ai({radius:5,stroke:new Dt({color:"white",width:0}),fill:new xt({color:"green"})})}),start:new ft({image:new xi(this._opts.startIcon),text:new nr({font:"13px Microsoft Yahei",fill:new xt({color:"#aa3300"}),stroke:new Dt({color:"#fff",width:2}),textAlign:"left"})}),end:new ft({image:new xi(this._opts.endIcon),text:new nr({font:"13px Microsoft Yahei",fill:new xt({color:"#aa3300"}),stroke:new Dt({color:"#fff",width:2}),textAlign:"left"})})}[t]},wt.prototype._initLinesAndMarkers=function(){const t=this,e=t._pathInfo,n=t._wholePathInfo;if(t._convertPaths(e),t._initFlag===1){t.traceNodes=[];for(const i in n){const r=Number(i),a=[n[r].longitude,n[r].latitude],s=n[r].id;if(r>0&&r<n.length-1){const o=new pn({geometry:new Kt(a)});o.set("id",s),o.set("number",parseInt(r)+1),t._showTracePoint&&t.traceNodes.push(o),o.set("type","node"),o.on("mouseover",function(l){t._map.getInfoWindowById(l.coordinate.toString())&&t._map.getInfoWindowById(l.coordinate.toString()).setPosition(l.coordinate)}),o.on("mouseout",function(l){t._map.getInfoWindowById(this.getPosition().toString())&&t._map.getInfoWindowById(this.getPosition().toString()).setPosition(void 0)})}else if(r===0){const o=new pn({geometry:new Kt([n[r].longitude,n[r].latitude])});o.set("type","start"),o.set("id",s),o.set("number",parseInt(r)+1),t.traceNodes.push(o)}else if(r===n.length-1){const o=new pn({geometry:new Kt([n[r].longitude,n[r].latitude+1e-8])});o.set("type","end"),o.set("id",s),o.set("number",parseInt(r)+1),t.traceNodes.push(o)}}for(let i=0;i<t._pathInfo.length-1;i++){const r=[t._pathInfo[i].longitude,t._pathInfo[i].latitude],a=[t._pathInfo[i+1].longitude,t._pathInfo[i+1].latitude],s=new pn({geometry:new Zt([r,a])});s.setStyle(t._traceLineSytle("route")),t.traceLayer.getSource().addFeature(s),t.traceLineList.push(s)}for(let i=0;i<t.traceNodes.length;i++){const r=t.traceNodes[i],a=t._traceLineSytle(r.get("type"));if(r.setStyle(a),r.getGeometry().getType()==="Point")for(let s=0;s<e.length;s++)r.get("id")===e[s].id&&t.traceLayer.getSource().addFeature(r)}}},wt.prototype.setTraceLineColor=function(t){const e=this;e._opts.lineColor=t;const n=e.traceLineList;for(let i=0;i<n.length;i++)n[i].setStrokeColor(t);e.traceLayer.refresh()},wt.prototype.setTraceLineWidth=function(t){const e=this;e._opts.lineWidth=t;const n=e.traceLineList;for(let i=0;i<n.length;i++)n[i].setStrokeWeight(t);e.traceLayer.refresh()},wt.prototype._creatTimeOverlays=function(){const t=this,e=t._wholePathInfo,n=t._vacuatePath;if(t._timeOverlayList=[],t._labelShow){const i=[];for(let r=0;r<e.length;r++)for(let a=0;a<n.length;a++)if(n[a].longitude===e[r].longitude&&n[a].latitude===e[r].latitude){const s=[e[r].longitude,e[r].latitude];i.push({position:s,text:e[r].time})}typeof t.textLayer=="undefined"?(t.textLayer=S9e(t._map,i,10),t.textLayer.set("id","lushuText"+new Date().getTime()),t._map.addLayer(t.textLayer)):typeof y9e(t.textLayer.get("id"),t._map)=="undefined"&&t._map.addLayer(t.textLayer)}},wt.prototype.createArrows=function(){const t=this,e=t.getArrowPoints(t._opts.arrowPixel);for(let n=0;n<e.length;n++){const i=e[n].coordinate,r=e[n].rotate,a=new pn({geometry:new Kt(i)});a.setStyle(new ft({image:new xi({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",rotation:r,scale:.5})})),t.arrowsLayer.getSource().addFeature(a)}},wt.prototype.windowAddMouseWheel=function(){const t=this,e=function(n){n=n||window.event,n.wheelDelta?(n.wheelDelta>0&&t.arrowsLayer.getSource().clear(),n.wheelDelta<0&&t.arrowsLayer.getSource().clear()):n.detail&&(n.detail>0&&t.arrowsLayer.getSource().clear(),n.detail<0&&t.arrowsLayer.getSource().clear())};document.addEventListener&&document.addEventListener("DOMMouseScroll",e,!1),window.onmousewheel=document.onmousewheel=e},wt.prototype.dispose=function(){this._intervalTimeFlag&&(clearInterval(this._intervalTimeFlag),this._intervalTimeFlag=null),this._intervalTraceFlag&&(clearInterval(this._intervalTraceFlag),this._intervalTraceFlag=null);const e=this._map.getLayers().getArray().filter(n=>n.get("isTrack")&&n.get("isTrack")===!0);e&&e.length>0&&e.forEach(n=>{n.getSource().clear(),this._map.removeLayer(n)})};function B7(t,e,n,i,r){i==="distance"?WV(t,e,n,r):i==="track"&&_9e(t,e,n,r)}function WV(t,e,n,i){const r=[];e.forEach(function(s,o){r.push(s)});let a=!0;for(let s=0;s<r.length-1;s++)if(W3(t,r[s],r[s+1])<n&&r.length>=3){a=!1,s+1<r.length-1||s===0?r.splice(s+1,1):r.splice(s,1);break}a?i(e):WV(t,r,n,i)}function _9e(t,e,n,i){const r=e;r.forEach(function(o,l){o.id=l});const a=G7(t,r,[],0,r.length-1,n);a.push(r[0]),r.length>1&&a.push(r[r.length-1]);const s=a.sort(function(o,l){return o.id<l.id?-1:o.id>l.id?1:0});i(s)}const G7=function(t,e,n,i,r,a){if(i<r){let s=0,o=0;const l=e[i],h=e[r];for(let u=i+1;u<r;u++){const c=x9e(t,l,h,e[u]);c>s&&(s=c,o=u)}s>=a&&(n.push(e[o]),G7(t,e,n,i,o,a),G7(t,e,n,o,r,a))}return n},x9e=function(t,e,n,i){const r=Math.abs(W3(t,e,n)),a=Math.abs(W3(t,e,i)),s=Math.abs(W3(t,n,i)),o=(r+a+s)/2;return Math.sqrt(Math.abs(o*(o-r)*(o-a)*(o-s)))*2/r},W3=function(t,e,n){const i=e.latitude,r=n.latitude,a=e.longitude,s=n.longitude,o=t.getPixelFromCoordinate([a,i]),l=t.getPixelFromCoordinate([s,r]);return Math.sqrt(Math.pow(l[0]-o[0],2)+Math.pow(l[1]-o[1],2))};var ZV=function(t){let e=0;for(let n=0,i=t.length-1;n<i;++n)t[n+1]&&(e+=Math.sqrt(Math.pow(t[n+1][0]-t[n][0],2)+Math.pow(t[n+1][1]-t[n][1],2)));return e};function w9e(t){let e=t.getHours(),n=t.getMinutes(),i=t.getSeconds();const r=t.getFullYear();let a=t.getMonth(),s=t.getDate();return e<10&&(e="0"+e),n<10&&(n="0"+n),i<10&&(i="0"+i),a=a+1,a<10&&(a="0"+a),s<10&&(s="0"+s),r+"-"+a+"-"+s+" "+e+":"+n+":"+i}function b9e(t,e){const n=new pn({geometry:new Kt(t)});return n.setStyle(new ft({image:new xi(e.carIcon)})),n}function S9e(t,e,n){const i=[],r=new Jt({source:new si});return t.getView().getZoom()>=n&&XV(t,e,n,i,r),t.on("moveend",function(a){t.getView().getZoom()>=n?XV(t,e,n,i,r):r.getSource().clear()}),r}function XV(t,e,n,i,r){i=[],r.getSource().clear();for(let u=0;u<e.length;u++){const c=e[u],f=t.getPixelFromCoordinate(c.position);if(!Qi(t.getView().calculateExtent(),c.position))continue;const d=/[\u4e00-\u9fa5]/g,g=c.text.match(d)?c.text.match(d).length:0,p=c.text.length-g,v=g*15+p*8,m=f[0]+10,y=f[0]+v+20,_=f[1]-32,w=f[1]-12,S=[m,parseInt((_+w)/2)],b={x:m,y:_},x={x:y,y:w},T=f[0]-v-20,C=f[0]-10,A=f[1]-32,M=f[1]-12,E=[C,parseInt((A+M)/2)],R={x:T,y:A},P={x:C,y:M},I=f[0]-v-20,L=f[0]-10,D=f[1]+12,F=f[1]+32,G=[L,parseInt((D+F)/2)],B={x:I,y:D},z={x:L,y:F},k=f[0]+10,O=f[0]+v+20,N=f[1]+12,U=f[1]+32,j=[k,parseInt((N+U)/2)],q={x:k,y:N},V={x:O,y:U},$=new fg(b,x),Z=new fg(R,P),K=new fg(B,z),J=new fg(q,V);let Q="rightTop",ee=!0;for(let ie=0;ie<4;ie++){for(let se=0;se<i.length;se++){const fe=i[se];if(ie===0){if(ee=fe.intersects($),!ee)break}else if(ie===1){if(ee=fe.intersects(Z),!ee)break}else if(ie===2){if(ee=fe.intersects(K),!ee)break}else if(ie===3&&(ee=fe.intersects(J),!ee))break}if(ee){ie===0?Q="rightTop":ie===1?Q="leftTop":ie===2?Q="leftBom":ie===3&&(Q="rightBom");break}}var a,s,o,l,h;if(ee)Q==="rightTop"?(i.push($),h=S,a=m,s=_,o=y,l=w):Q==="leftTop"?(i.push(Z),h=E,a=T,s=A,o=C,l=M):Q==="rightBom"?(i.push(J),h=j,a=k,s=N,o=O,l=U):Q==="leftBom"&&(i.push(K),h=G,a=I,s=D,o=L,l=F);else continue;const te=t.getCoordinateFromPixel([a,s]),ae=t.getCoordinateFromPixel([o,s]),ye=t.getCoordinateFromPixel([o,l]),oe=t.getCoordinateFromPixel([a,l]),ge=new pn({geometry:new Bi([te,ae,ye,oe])});r.getSource().addFeature(ge),h=t.getCoordinateFromPixel(h);const _e=new pn({geometry:new Zt([c.position,h])});r.getSource().addFeature(_e),r.setStyle(new ft({fill:new xt({color:"rgb(26,58,91)"}),stroke:new Dt({color:"rgb(26,58,91)"}),text:new nr({font:"16px sans-serif",text:c.text,fill:new xt({color:"#000"}),offsetX:0,offsetY:1})}))}}function fg(t,e){this.min=t,this.max=e}fg.prototype.intersects=function(t){const e=this.min,n=this.max,i=t.min,r=t.max;return r.x<=e.x||i.x>=n.x||r.y<=e.y||i.y>=n.y};function YV(t,e){const n=xh(t),i=xh(e);return V0(n,i)}const T9e=function(t){let{map:e,paths:n,id:i,opts:r,vacuate:a,smokeMode:s,tracePointsModePlay:o,vacuateDistance:l,labelShow:h,labelStyle:u,showTracePoint:c}=t;r.id=i||$e(),r.changeCarRotate=t.changeCarRotate,r.centerAtCar=t.centerAtCar;let f=n,d,g=e.getView().getZoom();return a?B7(e,n,l,s,function(p){f=p,d=new wt(e,n,f,a,o,h,u,c,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d=new wt(e,n,f,a,o,h,u,c,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()),d.setPaths=function(p){n=p,d.arrowsLayer.getSource().clear();for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d.traceLayer.getSource().clear(),d.tracePassLayer.getSource().clear(),d.stop(),g=e.getView().getZoom(),a?B7(e,n,l,s,function(v){f=v,d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d._pathInfo=n,d._vacuatePath=n,d._wholePathInfo=n,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows())},d.clearPaths=function(){d._path=[],n=[],d.arrowsLayer.getSource().clear(),d.tracePassLayer.getSource().clear();for(let p=0;p<d._timeOverlayList.length;p++)e.removeOverlay(d._timeOverlayList[p]);d.traceLayer.getSource().clear(),this.carLayer.getFeatures().length>0&&this.carLayer.removeFeature(this.carMarker),typeof this.textLayer!="undefined"&&e.removeLayer(this.textLayer)},e.getView().on("change:resolution",function(){if(n.length!==0&&(g=e.getView().getZoom(),d.arrowsLayer.getSource().clear(),Math.round(g)===g))if(d._initFlag=2,d.createArrows(),a)B7(e,n,l,s,function(p){f=p;for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()});else{for(let p=0;p<d._timeOverlayList.length;p++)e.removeOverlay(d._timeOverlayList[p]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=n,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()}}),d},C9e={name:"v-track",render(t,e){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${$e()}`}},paths:{type:Array,default(){return[]}},tracePointsModePlay:{type:String,default:"animation"},smokeMode:{type:String,default:"distance"},vacuate:{type:Boolean,default:!1},vacuateDistance:{type:[Number,void 0],default:10},labelShow:{type:Boolean,default:!1},showTracePoint:{type:Boolean,default:!0},changeCarRotate:{type:Boolean,default:!1},centerAtCar:{type:Boolean,default:!1},options:{type:Object,default(){return{}}},autoPlay:{type:Boolean,default:!1},labelStyle:{type:String,default:"timeContentClass"}},data(){return{track:null}},computed:{map(){return this.VMap.map}},watch:{paths:{handler(t){this.init(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.track.dispose(),this.track=null},methods:{init(t){if(t&&t.length>0||this.paths&&this.paths.length>0){const e=Je(De({},this.$props),{map:this.map,paths:t||this.paths,opts:this.options});this.track=T9e(e),this.$emit("onLoad",this.track),this.autoPlay&&this.start()}},start(){this.track.start()},pause(){this.track.pause()},stop(){this.track.stop()},dispose(){this.track.dispose()}}};let A9e,M9e;const KV={};var JV=qn(C9e,A9e,M9e,!1,E9e,null,null,null);function E9e(t){for(let e in KV)this[e]=KV[e]}JV.options.__file="src/components/track/index.vue";const dg=function(){return JV.exports}();dg.install=t=>{t.component(dg.name,dg)};var QV={exports:{}};(function(t){(function(){function e(o,l){var h=o.x-l.x,u=o.y-l.y;return h*h+u*u}function n(o,l,h){var u=l.x,c=l.y,f=h.x-u,d=h.y-c;if(f!==0||d!==0){var g=((o.x-u)*f+(o.y-c)*d)/(f*f+d*d);g>1?(u=h.x,c=h.y):g>0&&(u+=f*g,c+=d*g)}return f=o.x-u,d=o.y-c,f*f+d*d}function i(o,l){for(var h=o[0],u=[h],c,f=1,d=o.length;f<d;f++)c=o[f],e(c,h)>l&&(u.push(c),h=c);return h!==c&&u.push(c),u}function r(o,l,h,u,c){for(var f=u,d,g=l+1;g<h;g++){var p=n(o[g],o[l],o[h]);p>f&&(d=g,f=p)}f>u&&(d-l>1&&r(o,l,d,u,c),c.push(o[d]),h-d>1&&r(o,d,h,u,c))}function a(o,l){var h=o.length-1,u=[o[0]];return r(o,0,h,l,u),u.push(o[h]),u}function s(o,l,h){if(o.length<=2)return o;var u=l!==void 0?l*l:1;return o=h?o:i(o,u),o=a(o,u),o}t.exports=s,t.exports.default=s})()})(QV);const R9e=QV.exports;class Z3{constructor(e,n){Ze(this,"min",{x:0,y:0});Ze(this,"max",{x:0,y:0});this.min=e,this.max=n}intersects(e){const n=this.min,i=this.max,r=e.min,a=e.max;return a.x<=n.x||r.x>=i.x||a.y<=n.y||r.y>=i.y}}class I9e extends Jt{constructor(n){var a,s;const i=Object.assign({},n);delete i.map;super(i);Ze(this,"map",null);Ze(this,"pointsArr",[]);Ze(this,"zoom",1);Ze(this,"textBounds",[]);Ze(this,"styleOptions",{fillColor:"rgb(26,58,91)",strokeColor:"rgb(26,58,91)",textColor:"white",fontCss:"bolder 15px sans-serif",boxWidth:50});Ze(this,"textViewCom",[]);this.map=n.map?n.map:this.map,this.pointsArr=n.pointsArr?n.pointsArr:this.pointsArr,this.zoom=n.zoom?n.zoom:this.zoom,this.styleOptions=n.styleOptions?n.styleOptions:this.styleOptions,((a=this.map)==null?void 0:a.getView().getZoom())>=this.zoom&&this.drawText();const r=this;(s=this.map)==null||s.on("moveend",o=>{var l;((l=r.map)==null?void 0:l.getView().getZoom())>=r.zoom?(r.drawText(),r.keepVisible()):r.clear()})}getLayerStatesArray(n){}getLayersArray(n){}getSourceState(){}drawText(){var s;const n=this.styleOptions;this.getSource().clear();const r=document.createElement("canvas").getContext("2d");n.fontCss&&(r.font=n.fontCss);const a=[];(s=this.map)==null||s.once("postrender",()=>{this.pointsArr.forEach(o=>{var u,c,f,d,g,p,v;const l=i0(o.position,"EPSG:3857"),h=(u=this.map)==null?void 0:u.getPixelFromCoordinate(l);if(Qi((c=this.map)==null?void 0:c.getView().calculateExtent(),l)){o.text=o.text||"";let m=n.boxWidth||Math.ceil(r.measureText(o.text).width);m+=30;const y=h[0]+10,_=h[0]+m,w=h[1]-40,S=h[1]-10,b=[y,Number(((w+S)/2).toFixed(0))],x={x:y,y:w},T={x:_,y:S},C=new Z3(x,T),A=h[0]-m,M=h[0]-10,E=h[1]-40,R=h[1]-10,P=[M,Number(((E+R)/2).toFixed(0))],I={x:A,y:E},L={x:M,y:R},D=new Z3(I,L),F=h[0]-m,G=h[0]-10,B=h[1]+10,z=h[1]+40,k=[G,Number(((B+z)/2).toFixed(0))],O={x:F,y:B},N={x:G,y:z},U=new Z3(O,N),j=h[0]+10,q=h[0]+m,V=h[1]+10,$=h[1]+40,Z=[j,Number(((V+$)/2).toFixed(0))],K={x:j,y:V},J={x:q,y:$},Q=new Z3(K,J),ee={bound:C,minx:y,miny:w,maxx:_,maxy:S,polylineCenter:b},te={bound:D,minx:A,miny:E,maxx:M,maxy:R,polylineCenter:P},ae={bound:U,minx:F,miny:B,maxx:G,maxy:z,polylineCenter:k},ye={bound:Q,minx:j,miny:V,maxx:q,maxy:$,polylineCenter:Z},oe=new Map([["rightTopBounds",ee],["leftTopBounds",te],["leftBomBounds",ae],["rightBomBounds",ye]]);let ge=!0,_e=0,ie=0,se=0,fe=0,W=[0,0],X="";for(const[Pe,Re]of oe){for(let Ie=0;Ie<this.textBounds.length&&(ge=this.textBounds[Ie].intersects(Re.bound),!!ge);Ie++);ge&&(X=Pe)}if(!ge)return;for(const[Pe,Re]of oe)Pe===X&&(this.textBounds.push(Re.bound),W=Re.polylineCenter,_e=Re.minx,ie=Re.miny,se=Re.maxx,fe=Re.maxy);const ne=xr((f=this.map)==null?void 0:f.getCoordinateFromPixel([_e,ie]),"EPSG:3857","EPSG:4326"),he=xr((d=this.map)==null?void 0:d.getCoordinateFromPixel([se,ie]),"EPSG:3857","EPSG:4326"),le=xr((g=this.map)==null?void 0:g.getCoordinateFromPixel([se,fe]),"EPSG:3857","EPSG:4326"),ue=xr((p=this.map)==null?void 0:p.getCoordinateFromPixel([_e,fe]),"EPSG:3857","EPSG:4326"),ce=new Bi({path:[ne,he,le,ue],strokeColor:n.strokeColor,fillColor:n.fillColor});ce.getStyle().setText(new Text({font:n.fontCss,fill:new xt({color:n.textColor}),offsetY:.5,text:o.text})),this.addFeature(ce);const pe=xr((v=this.map)==null?void 0:v.getCoordinateFromPixel(W),"EPSG:3857","EPSG:4326"),xe=new Zt({path:[o.position,pe],strokeColor:n.strokeColor});this.addFeature(xe),a.push({textBack:ce,polyline:xe,text:o.text})}this.set("textComponent",a)})})}keepVisible(){var n;if(this.textViewCom=this.get("invisible"),this.textViewCom instanceof Array)for(let i=((n=this.textViewCom)==null?void 0:n.length)-1;i>=0;i--){const r=this.textViewCom[i];this.textVisibility(r.text,!1)}}textVisibility(n,i){var o,l,h,u,c;const r=this.getObjectByText(n);this.textViewCom=this.get("invisible");let a=!1,s=0;if(this.textViewCom instanceof Array)for(let f=((o=this.textViewCom)==null?void 0:o.length)-1;f>=0;f--){const d=this.textViewCom[f];n===d.text&&(a=!0,s=f)}if(r.length>0)for(let f=r.length-1;f>=0;f--){const d=r[f];if(!i)this.textViewCom instanceof Array?!a&&this.textViewCom.push(d):this.set("invisible",[d]),(l=d.textBack)==null||l.setVisible(i),(h=d.polyline)==null||h.setVisible(i);else if(this.textViewCom instanceof Array&&a){this.textViewCom.splice(s,1);const g=this.getObjectByText(d.text);for(let p=g.length-1;p>=0;p--)(u=g[p].textBack)==null||u.setVisible(i),(c=g[p].polyline)==null||c.setVisible(i)}}else i?a&&this.textViewCom.splice(s,1):this.textViewCom instanceof Array?!a&&this.textViewCom.push({text:n}):this.set("invisible",[{text:n}])}getObjectByText(n){const i=this.get("textComponent"),r=[];for(let a=(i==null?void 0:i.length)-1;a>=0;a--){const s=i[a];s.text===n&&r.push(s)}return r}}class P9e{constructor(e){Ze(this,"_operators");Ze(this,"_carIcon");Ze(this,"_direction");Ze(this,"_map");Ze(this,"_status");Ze(this,"_pathInfo");Ze(this,"_bubble");Ze(this,"_moving");Ze(this,"_tracePointsModePlay");Ze(this,"_lineLayer");Ze(this,"_movePath");Ze(this,"_originPath");Ze(this,"_revealLayer");Ze(this,"_showTracePoint");Ze(this,"_nodesLayer");Ze(this,"_moveNodes");Ze(this,"_timeStep");Ze(this,"_speed");Ze(this,"_speedUp");Ze(this,"_nowTime");Ze(this,"_moveIdx");Ze(this,"_animateLayer");Ze(this,"_animateLine");Ze(this,"_group");Ze(this,"_tracekEvent");Ze(this,"_simplifyEvent");Ze(this,"_eventType");Ze(this,"_animateStart");Ze(this,"_textLayer");Ze(this,"_moveListener");Ze(this,"_step");Ze(this,"_viewCode");Ze(this,"_defaultStyles");Ze(this,"_nodesCollection");Ze(this,"_nodeInfos");var f;e=e||{};const n=e.bubble!==void 0?e.bubble:!1,i=e.showTracePoint?e.showTracePoint:!1,r=e.tracePointsModePlay?e.tracePointsModePlay:"animation",a=e.mapObj!==void 0?e.mapObj:null,s=e.path!==void 0?e.path:[],o=e.options||{},l=Date.now();!e.path||e.path.length<1,this._operators={carIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAVCAYAAADfLRcdAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkQ0RkExMTQ2Rjc4NzExRTQ4QkI3QTA2OTk3QzQ4M0IzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkQ0RkExMTQ3Rjc4NzExRTQ4QkI3QTA2OTk3QzQ4M0IzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RDRGQTExNDRGNzg3MTFFNDhCQjdBMDY5OTdDNDgzQjMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RDRGQTExNDVGNzg3MTFFNDhCQjdBMDY5OTdDNDgzQjMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz62sMp6AAAFiklEQVR42tRXW2wUVRj+zpmZvc4uS2mhhQK21FLshoKGWkBMSAwQSVBf0QfiJciDLya+8KAx8RJfeJV440GJaDAmGGKUmAASI+GhDQ1a7t1Kb1tot7s7uzvX4z8zC+12bdHVkDjJn5md/c853/nO918GeEDXkfe2f5+9+KzxxeuQap2D/RPn5BO7Aowxns/n9Ju958Q8PjL5yIxz4+KZk86spRLG5Y1T/Zfbf31sz7HN/xqsuIo4THwgStgr8lBtDcwxwQxa0rKB4WkFBcOGpgNSwIFusYoJjv0ATOQYdm9lWBQX4Iz2I8iDxhsGMDSm4mx/FJ3LR/HWi4ASokEmmeYj4UG6K/Tock9jSjxRjG/PRCrADn4SHVi8ttTOGM0sHAguIRKyCSlgF4HsOPDxKY7T4zvQ3NqFYmYSsbp6BEKhe0Bt08LR41/CsSzse34fZEWBbdPGtCxKWhoxeQiNketIhHOYyEgYGAqgc/UU3n5VgbA5iBQyAccWYLKCYLOCnLmLNrhNJHte5h7Ys/ubIlsPjGp3F/3tViOefEVCOCJjSYKjqZ6jdTnwdI+Fp5IppCaAvmsKxiZlondGCYQLJ34S2Ngp0LMBqFMFHmmxUb+U4+DhNpz4WYIlhWgTAWKIAHGOyVQKR98dx45uYoXTKZGRA/S0BT1n+6cd74G8qNlRO76WmNXLHI/R8nXom7U4eqENJdNAUSczdJR0HW/s1HDwhavehMIDx2BbtChj4Ip7hvDeuyYp7pHSe9l//8yBNTh/MwhOALnrf/fu2GhWBnDms+IMWMk1eOM8IxVYsV2QMl9F+Wyg7tV3hTxZZdw5BHZLlzEjdJpEJn0FVeaZEvYtEPF/yyECMivm9+6hDdoOLJKKSTIxPLNh0USXLnN6XiCqluiQE9Ok5dXTfO5/wxN2lb9D7LYtz9ectjat1wioQSdhklmkTdN7NuguB6O4cInhdobPM9oNnAFg1UtSlUc2J+5FuEuw+yyIBTVUqBnsyiYNsUiUpOOza7msEmg3KCUKxOvDAvUJZ/4JBKUlnmdVYHXzL9KnEEioVs1gFbmIjofbEVdjPleOQ8zaHruCIIxO3C/du/nNgDz3tUWpIzAnATNKZ6SFKi3/7UuYXgA9vqkbBun/xuAgbo0OwyESbLKcJhauT+765FIFVuaiapi7e/CAv2hNpUchEhxkclliWcGa1lY82rXBA/Hdt8cxli5XgXnHc28vVWCDgWqhu+kpk5eRiNYG1rTCsOjohRtYrgQoZVmZKciyjKYlDejZOHyfyk+5kM67CllcZeWBvrlAGU2aL0Vq1uwfo1EPbIlqrmGY0F0z3WfK41oOHQ8tlA1cGFE6BFVUeaxcVj2IB4O4NqLWDPb8RZU2WyKAZZBkJQJsUoAVs5Po7lwoGxAeaR01Fp/aXAhWEf5d7Y4X/XPBnusLVOjdomZGzwvPzKJvRsH/bZXcGj8z/sPjEeSKBWJU98B6DNN9enwMmzflEJDn32hxiMOciJKWUovkXw43qrN7g53dWbx/pB/hsIS6ONBRz9DSBGxoc+u1QCot0HtNxshtmbojp6I3OHmaoWudg571lOpiDpKtDhoaOVqWljB+I0xlWYFpu5o1vPSlpdM49OYcRnkchdQUrHLBVBq2UOgpDu9Cwe+6Dsf765Jap9fPubRJ1MgEK7uuj04xfN6XBFOXUe9WBAuGPS3fY5vQ3kmPeRVq6YqVVG4l74Qc26Tw0NCcyCC54g4a4yZ+H4njythibGm5gndeo+ChVtM2yl0XrRmKUC1vYDD4Hmjmc6Ju1W5eUz+rUT9bmK+f/ZH62eycfrbsQRL1+9le6mebqZ/dT6xF3XMmm/KlyWNelvMbGPK3pfpieNvtyP/yS+GBXf/FN9ifAgwAIOzB+qcKmLcAAAAASUVORK5CYII=",speed:1e3,timeStep:1,startIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADb0lEQVRYR8WWW4jcZBzFz8lukn1Si5fOjKK20NmEKtoFL+C1IBX0RQQFQeoiIipeHnxQCioURPBJhQo+yFJFEfRFKIKIN1wKFZGqtJPZbgtFTWa7i1LFy+bbyZHsztJ1MpkkI9I85vufc375/798CXGWL57lfFQDENgw/g4Qt0loQroE5CKl410r+WphPJkF55erPFQ5AMFuGO8RiU+TuCwvQNAioWdDuz0DQmVACgE2aeu5E8Y9QODGMoZpjaSP6fx2d8jwzyLNcADBrht/lsC1RUYD1g//ZS/f+itPnB6mHQpQj71XCT45QnhPooOhHdwEIsnzyAXYrMktluExgmODxJIiED8D2JFXszaO5P7Ibb9TGaAee28QfLhfKGhJ1L0du/15ura2R+xpgHsJnpMJkuZCN5isBiCMNYy/mPr3CeNEnOq4R4/0G9bi5jWEdYhgpquJzPaOO390EMTAEVwgr+kYtrMC7Qud4PG8p6nH3rsE7+tfT5A82HHaM6UB6sa/mcKX2fZjd+S03s4DqMXetAVmgkTtiezgpdIANTO505L12QDBQ6HTejMfwN9tAfsz4FUBGtp6KYx7csAI3gudINPi9bpa7L1mgU9kRmDhzs5466PSHUgLG8v+HIhtG0WC1JWuPuW2v+836+2bHwA4/9bAJPYvmxa48EclgLrx9lB8cUAXTgt6/m/b7F8/5WrGu4XC+wQvzLRf+DByW3dVew0BXKQtm8fMxE8ExgceRFAXwGEIDZL1vIAE3es6ztzXlQFWxxB7MwCn88RF9wV9EjnBrmF1Q78F6WaUcU4MO2qHmXexcv2Cc+zQyABrXfD3AXis6Gmzs9cHkRvcU6Qr/B+4WN75MpwHcF6R2Zl1LcM220Ie/7FIUwiQGtTiyUctWK8Xma2vJ9QLHTvYW6a+FAAE1o33DcGpQlOpHTrBFSBWCmuB8j+ljdifEpRCDIVOqJ0dO/iiTHhaU64DPbd67L9C4Kk8c0FvRU7wQNnwygDQ5RONeOI7kM0BJ95J4yRXLrH9+/8HkJ6QcfOqMVjfErQ2Bq1QN5yyg4NVwqt3oOdeM/5zlnBmlwsvh27rmarhIwOsvhWxf4DEHQA+De3W7SDSb0Plq9Im3Oi+9jPqzBqbu5bYiion9wQjA6zqtd0Bj8Sjho8+gv+S2Kf9B1+VRDBEEbAnAAAAAElFTkSuQmCC",endIcon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADdElEQVRYR8WWXYjcVBiG3zfJGb1oq4todXZnVOpsMlbRLtQK1p+CVNAbERQEqUVEVPy58EIpqFAQwasqVOhFWdrSIuiNUAQR/3ApVIr0hzozu93KJtktsgWRxeLmJPlKho52JzOTZIo2t+d7v/c5b76cHOIqP7zK/igEIADPlNWGyJBHQY4DHANlUcBZI4p/MubDqRqwXGRTuQAEUM0x9TIMvkXg1r4GIosA3rE9PUlA8oBkAsyO4Dq9Sh0GuTlPw3aN4Os1UfBUeQEXsjQDAZKdtypqCuR9WY3S63JcLelH1v2BPwdpBwI0q+pjgG8UN+8o5Ijt6gcJxP169AVorsXtKKkZkGYvsQDnKDIPYEO/mrYuxnOOHxwsDNCoqj0EX0oJRc4jlmec+fD7ZK09I6vVdgA7Aa7prhfBdN0L7EIAApjNqlokOHK5UCCBBU7U3OB0d8NWRW0U4CjIVKomsL7mBr/2guj5ChqjGKdZaqV3I7vrnn6t324aFXWI5LM9UnvB8fRkboDpivVQTOPHbgEh22xXHxgAsJ1kykgQ76i74Ye5AZqj1haYxncpQSwvOr7e2w+gVVXbBNyXSq4owGwZVW2V5nq8gs/qnk5HfKmwVVWfCPh6Krk4esL2o69yJ5AUNiqlaRK1FSIRgfBexw9OdjdL5gamOkWw1DW4emRZj9z8O/4qCGDtII0P0iJJTrb31JLe1znlZsashyPyc5A3pgcQXzpe8GShzzApPnsT1i5fo3ySVk+xSCTEcYBlArf0NYhlk+3rnwsDJIJWRU0KmRwyQz0i8k3d01sHiQf+C9rDaKqzA4/aAd2NWO4f9/XRoQESYbOidoN8dYgIvnDc4OksXeZ9oDGKG2iqMwCvz2r277osW6Gu3bEAL0uTCXAphVdAfprVrLPOOH7f9sOdeepzASR3wWZVHSM4kaNpy3aDuwiEOWrzX0pnymoiMnGs199uxcETx1vqfvhDHvOkJlcCnWbNMbULBt/s11xE9tc9/Xxe88IAv92Ga/+OSidIjHebCDDHC8Hdznks/WcA7cNpVN0jBn4BaayIPowfqC+ER4qYF07gn1dRsd4Fjcun/CPHDd4uaj40QPJVtKqlwwAeB+Rb29WPEYj+N4DEKLmMBqvUlBh6651zODeM+dAJdMxOA6X1QDCs+RUDXIlxR3sRcjswMD6XvKYAAAAASUVORK5CYII=",showInfoWin:!1,arrowPixel:.2,textStyle:{}};for(const d of Object.keys(this._operators))o[d]&&(this._operators[d]=o[d]);const h=new xt({color:"rgba(255,255,255,0.4)"}),u=new Dt({color:"#3399CC",width:1.25});this._defaultStyles=[new ft({image:new ai({fill:h,stroke:u,radius:5}),fill:h,stroke:u})],this._nodesCollection=null,this._nodeInfos=[];const c=new xi({src:this._operators.carIcon,scale:1,anchor:[.5,.5],offset:[0,0]});c.load(),this._carIcon=new ft({image:c}),this._direction=0,a&&(this._map=a),this._viewCode=(f=this._map)==null?void 0:f.getView().getProjection().getCode(),this._status="stop",this._pathInfo=s,this._bubble=n,this._moving=!1,this._tracePointsModePlay=r,this._lineLayer=new Jt({source:new si({features:[],strategy:T0}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._lineLayer.set("projection",this._viewCode,!0),this._lineLayer.set("track-type","trackPath"),this._movePath=[],this._originPath=null,this._revealLayer=new Jt({source:new si({features:[],strategy:T0}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._revealLayer.set("projection",this._viewCode,!0),this._revealLayer.set("track-type","trackReveal"),this._showTracePoint=i,this._nodesLayer=new Jt({source:new si({features:[],strategy:T0}),style:null,properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._nodesLayer.set("projection",this._viewCode,!0),this._nodesLayer.set("track-type","trackNodes"),this._nodesLayer.setVisible(this._showTracePoint),this._moveNodes=[],this._speed=this._operators.speed,this._timeStep=this._operators.timeStep,this._speedUp=1,this._nowTime=null,this._moveIdx=1,this._animateLayer=new Jt({source:new si({features:[],strategy:T0}),style:new ft({stroke:new Dt({color:"red",width:2})}),properties:{vzBelong:"vzTrackPath",vzTime:l}}),this._animateLayer.set("projection",this._viewCode,!0),this._animateLayer.set("track-type","trackAnimate"),this._animateLine=new Wn({geometry:new Zt([])}),this._group=new Xc({layers:[this._lineLayer,this._revealLayer,this._nodesLayer,this._animateLayer],zIndex:99,properties:{type:"vzTrackPath",vzTime:l}}),a==null||a.addLayer(this._group),this._tracekEvent=a==null?void 0:a.on(["singleclick","pointermove"],d=>{this.eventListener(d)}),this._eventType=["nodeClick","nodeMouseover","nodeMouseout","pathClick","pathMouseover","pathMouseout","move"],this._simplifyEvent=a==null?void 0:a.getView().on("change:resolution",d=>{Number.isInteger(d.target.getZoom())&&this.simplifyOpera(d)}),this.initLinesAndMarkers()}simplifyOpera(e){var u,c;let n=[];const i=e.target.getProjection().getCode(),r=this._viewCode!==i,a=e.target.getResolution();n=this._nodesCollection.map(f=>{var g;if(r&&f.get("isSimplify")===!1){const p=(g=f.getGeometry())==null?void 0:g.transform(this._viewCode,i);p instanceof Kt&&f.setGeometry(p)}const d=f.getGeometry().getCoordinates();return{x:d[0]/a,y:d[1]/a,idx:f.get("node_idx")}}),r&&(this._viewCode=i);const s=R9e(n,2,!1),o=[],l=[];s.forEach(f=>{o.push([f.x*a,f.y*a]),l.push(f.idx)}),this._originPath instanceof Zt&&this._originPath.setCoordinates(o),!this._moving&&this._status!=="moving"&&this._moveListener!==null&&this._tracePointsModePlay==="animation"&&this._originPath instanceof Zt&&((u=this._animateLine.getGeometry())==null||u.setCoordinates(o.slice(0,l.indexOf(this._moveIdx)+1).concat([this._animateStart.getGeometry().getCoordinates()]))),(c=this._nodesLayer.getSource())==null||c.clear(),new Promise((f,d)=>{var g;this._nodeInfos=[],this._nodesLayer.getVisible()&&((g=this._nodesCollection)==null||g.forEach((p,v)=>{p.set("isSimplify",!1),p.setStyle(null),l.includes(v+1)&&(p.set("isSimplify",!0),p.setStyle(this._defaultStyles),this._nodeInfos.push(p))})),f(this._nodeInfos)}).then(f=>{var d;(d=this._nodesLayer.getSource())==null||d.addFeatures(f)})}eventListener(e){var i,r,a,s,o,l,h,u,c;if((i=this._map)==null?void 0:i.hasFeatureAtPixel(e.pixel,{layerFilter:function(f){return f instanceof Jt&&(f.get("track-type")==="trackPath"||f.get("track-type")==="trackNodes")},hitTolerance:0})){this._moveNodes=((r=this._map)==null?void 0:r.getFeaturesAtPixel(e.pixel,{layerFilter:function(g){return g instanceof Jt&&g.get("track-type")==="trackNodes"},hitTolerance:0}))||[],this._movePath=((a=this._map)==null?void 0:a.getFeaturesAtPixel(e.pixel,{layerFilter:function(g){return g instanceof Jt&&g.get("track-type")==="trackPath"},hitTolerance:0}))||[];const f=this._moveNodes.map(g=>g.getProperties()),d=this._movePath.map(g=>g);switch(e.type){case"singleclick":f.length>=1&&((s=this._map)==null||s.dispatchEvent({type:"nodeClick",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})),d.length>=1&&((o=this._map)==null||o.dispatchEvent({type:"pathClick",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));break;case"pointermove":f.length>=1&&((l=this._map)==null||l.dispatchEvent({type:"nodeMouseover",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})),d.length>=1&&((h=this._map)==null||h.dispatchEvent({type:"pathMouseover",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));break}}else{const f=this._moveNodes.map(g=>g.getProperties());this._moveNodes.length>0&&this._moveNodes.splice(0,this._moveNodes.length),e.type==="pointermove"&&f.length>0&&((u=this._map)==null||u.dispatchEvent({type:"nodeMouseout",target:this._bubble?[f[0]]:f,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}));const d=this._movePath.map(g=>g);this._movePath.length>0&&this._movePath.splice(0,this._movePath.length),e.type==="pointermove"&&d.length>0&&((c=this._map)==null||c.dispatchEvent({type:"pathMouseout",target:this._bubble?[d[0]]:d,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}}))}}initLinesAndMarkers(){var l,h,u,c,f,d;const e=(l=this._pathInfo)==null?void 0:l.map(g=>[g.longitude,g.latitude]),n=[],i=[];let r=0;for(const g of e){const p=new Wn({geometry:new Kt(i0(g,this._viewCode))});let v=null;if(this._pathInfo&&(v=this._pathInfo[r]),v&&(v.node_idx=r+1,v.isSimplify=!1,p.setProperties(v,!0),p.setId("tackNode-"+v.node_idx)),r===0){const m=p.clone();this._animateStart=p.clone(),this._animateStart.setId("moveCarFeature"),m.setStyle(new ft({image:new xi({src:this._operators.startIcon,anchor:[.5,1]}),text:new nr({text:""})})),(h=this._revealLayer.getSource())==null||h.addFeature(m)}else if(this._pathInfo&&r===this._pathInfo.length-1){const m=p.clone();m.setStyle(new ft({image:new xi({src:this._operators.endIcon,anchor:[.5,1]}),text:new nr({text:""})})),(u=this._revealLayer.getSource())==null||u.addFeature(m)}i.push(p),r++}const a=new Zt(e);this._originPath=a.transform("EPSG:4326",this._viewCode);const s=new Wn({geometry:this._originPath}),o=new ft({image:new xi({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",anchor:[.75,.5],scale:.7,rotateWithView:!1})});s.set("arrow",[new ft({stroke:new Dt({color:"rgba(0, 0, 255, 0.6)",width:10})}),o]),s.set("mainView",(c=this._map)==null?void 0:c.getView()),s.setStyle(L9e),n.push(s),(f=this._lineLayer.getSource())==null||f.addFeatures(n),this._nodesCollection=i,(d=this._animateLayer.getSource())==null||d.addFeature(this._animateLine),s.get("mainView")!==void 0&&s.get("mainView").dispatchEvent("change:resolution")}labelVisible(e){var n,i;if(e&&this._textLayer===0){const r=(n=this._pathInfo)==null?void 0:n.map(a=>({position:[a.longitude,a.latitude],text:a.gnssTime}));this._textLayer=new I9e({map:this._map,pointsArr:r,zoom:12}),this._textLayer.set("id","lushuText"+new Date().getTime()),this._group.getLayers().push(this._textLayer)}else(i=this._textLayer)==null||i.setVisible(e)}start(e){var n,i;this._pathInfo&&this._pathInfo.length<1||((this._moving||this._status==="pause")&&this.stop(),this._moveIdx=e||1,this._moving=!0,this._status="moving",this._nowTime=Date.now(),this._tracePointsModePlay==="skip"?(this._moveListener=this._lineLayer.on("postrender",r=>{this.tracePointsPlay(r)}),(n=this._map)==null||n.render()):this._tracePointsModePlay==="animation"&&(this._step=0,this._moveListener=this._lineLayer.on("postrender",r=>{this.animationPlay(r)}),(i=this._map)==null||i.render()))}stop(e){var i,r,a,s;this._moveIdx=1,this._status="stop",this._moving=!1,this._step=0,this._moveListener!==null&&(mr(this._moveListener),this._moveListener=null);const n=(i=this._animateLayer.getSource())==null?void 0:i.getFeatureById("moveCarFeature");n&&((r=this._animateLayer.getSource())==null||r.removeFeature(n)),(a=this._animateLine.getGeometry())==null||a.setCoordinates([]),this._originPath instanceof Zt&&((s=this._animateStart.getGeometry())==null||s.setCoordinates(this._originPath.getFirstCoordinate()))}pause(){this._status="pause",this._moving=!1}resume(){this._status="moving",this._moving=!0}tracePointsPlay(e){var a,s,o,l,h;const n=e.frameState,i=this._nodesCollection.map(u=>u.getGeometry().getCoordinates()),r=(n.time-this._nowTime)/1e3%60;if(this._moving&&(this._moveIdx===1||r>=this._timeStep)){this._nowTime=n.time;let u=this._moveIdx===1?this._speedUp:this._moveIdx+this._speedUp,c=null;const f=this._animateLine.getGeometry();if(i&&this._moveIdx===i.length){this.stop(!0);return}if(u>=i.length&&this._moveIdx<i.length){u=i.length;let v=null;i&&(v=new Wn(new Kt(i[u-1]))),c=v;const m=i[u-1][0]-i[u-2][0],y=i[u-1][1]-i[u-2][1],_=Math.atan2(y,m);this._direction!==_&&(this._direction=_),this._carIcon.getImage().setRotation(-this._direction+2*Math.PI);for(let w=i.length-this._moveIdx;w>0;--w)u!==0&&u-w<=i.length-1&&(f==null||f.appendCoordinate(i[u-w]))}else if(u<i.length&&this._moveIdx<i.length){let v=null;if(i&&(v=new Wn(new Kt(i[u-1]))),c=v,i&&u!==i.length-1){const m=i[u][0]-i[u-1][0],y=i[u][1]-i[u-1][1],_=Math.atan2(y,m);this._direction!==_&&(this._direction=_),this._carIcon.getImage().setRotation(-this._direction+2*Math.PI)}for(let m=this._speedUp;m>0;--m)u!==0&&u-m<=i.length-1&&(f==null||f.appendCoordinate(i[u-m]))}this._animateStart.setStyle(this._carIcon),this._animateStart.getGeometry().setCoordinates((a=c==null?void 0:c.getGeometry())==null?void 0:a.getCoordinates());const d=(s=this._animateLayer.getSource())==null?void 0:s.getFeatureById("moveCarFeature");(!d||d.length<=0)&&((o=this._animateLayer.getSource())==null||o.addFeature(this._animateStart)),this._moveIdx=u;const g=(l=this._map)==null?void 0:l.getView().getProjection().getCode(),p={index:this._moveIdx,status:this._status,position:i[u-1],lngLat:Xp(this._animateStart.getGeometry().getCoordinates(),g),passNode:this._nodesCollection[u-1],length:f==null?void 0:f.getLength()};this._animateLayer.dispatchEvent({type:"move",target:p,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})}(h=this._map)==null||h.render()}animationPlay(e){var i,r,a,s;let n=0;if(this._nowTime=e.frameState.time,this._originPath instanceof Zt&&this._moving&&this._step!==void 0&&this._step<=1){const o=this._originPath.clone();o.transform(this._viewCode,"EPSG:3857");const l=o.getLength(),h=this._animateLine.getGeometry(),u=this._originPath.clone();if(u instanceof Zt&&this._step!==0){const m={geometry:{coordinates:u.getCoordinates(),type:"LineString"},properties:{},type:"Feature"};n=l*this._step;const y=GJ(m,0,n/1e3,{units:"kilometers"});u.setCoordinates(y.geometry.coordinates),u.transform("EPSG:4326",this._viewCode);const _=u.getCoordinates();h==null||h.setCoordinates(_);let w=0,S=0;if(_.length>2){const x=_[_.length-2],T=_[_.length-1];w=x[0]-T[0],S=x[1]-T[1];const C=Math.atan2(S,w);this._direction!==C&&(this._direction=C),this._carIcon.getImage().setRotation(-this._direction+Math.PI)}this._animateStart.setStyle(this._carIcon),this._animateStart.getGeometry().setCoordinates(u.getLastCoordinate());const b=(i=this._animateLayer.getSource())==null?void 0:i.getFeatureById("moveCarFeature");(!b||b.length<=0)&&((r=this._animateLayer.getSource())==null||r.addFeature(this._animateStart))}const c=h==null?void 0:h.getLength();let f=0,d=0;const g=new Zt([]);this._originPath.forEachSegment(function(m,y){g.setCoordinates([m,y]),d<=c&&(d+=g.getLength(),f++)}),this._moveIdx=this._nodeInfos[f-1].get("node_idx"),this._step+=5*1e-7*this._speed;const p=(a=this._map)==null?void 0:a.getView().getProjection().getCode(),v={index:this._moveIdx,status:this._status,speed:this._speed,position:this._animateStart.getGeometry().getCoordinates(),lngLat:Xp(this._animateStart.getGeometry().getCoordinates(),p),passNode:this._nodesCollection[this._moveIdx-1],length:c};this._animateLayer.dispatchEvent({type:"move",target:v,propagationStopped:!1,defaultPrevented:!1,preventDefault:function(){throw new Error("Function not implemented.")},stopPropagation:function(){throw new Error("Function not implemented.")}})}if(this._moving&&this._step&&this._step>=1){this.stop(!0);return}(s=this._map)==null||s.render()}setFitView(e){var n;this._originPath!==null&&this._originPath instanceof Zt&&e&&((n=this._map)==null||n.getView().fit(this._originPath))}getPaths(){return this._pathInfo}setPaths(e){this.clearPaths(),this._pathInfo=e,this.initLinesAndMarkers()}clearPaths(){this._moving&&this.stop(),this._group.getLayersArray().forEach(e=>{e instanceof Jt&&e.getSource().clear()})}destroy(){var e;this._moving&&this.stop(),this.clearPaths(),mr(this._tracekEvent),(e=this._map)==null||e.getView().removeEventListener("change:resolution",this._simplifyEvent.listener)}getSpeed(){return this._speed}setSpeed(e){this._speed=e}getSpeedUp(){return this._speedUp}setSpeedUp(e){this._speedUp=e,this._speed=this._speed*e}getPercentnum(){return typeof this._step=="number"?this._step.toPrecision(3):0}setPercentnum(e){typeof e=="number"&&e<=1&&e>=0&&(this._step=e)}setTraceLineStyle(e){var a;e=e||{};const n=e.lineColor?e.lineColor:"rgba(0, 0, 255, 0.6)",i=e.lineWidth?e.lineWidth:10,r=(a=this._lineLayer.getSource())==null?void 0:a.getFeatures();r==null||r.forEach(s=>{s.get("arrow")[0].setStroke(new Dt({color:n,width:i}))}),this._lineLayer.changed()}setPassLineStyle(e){e=e||{};const n=e.lineColor?e.lineColor:"red",i=e.lineWidth?e.lineWidth:2,r=new ft({stroke:new Dt({color:n,width:i})});this._animateLayer.setStyle(r),this._animateLayer.changed()}setTraceNodeStyle(e){var l;e=e||{};const n=e.fillColor?e.fillColor:"rgba(255,255,255,0.4)",i=e.lineColor?e.lineColor:"#3399CC",r=e.lineWidth?e.lineWidth:1.25,a=e.size?e.size:5,s=new xt({color:n}),o=new Dt({color:i,width:r});this._defaultStyles=[new ft({image:new ai({fill:s,stroke:o,radius:a}),fill:s,stroke:o})],(l=this._nodesLayer.getSource())==null||l.getFeatures().forEach(h=>{h.setStyle(this._defaultStyles),h.changed()})}getEvents(){return this._eventType}on(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.on(e,n):(r=this._map)==null?void 0:r.on(e,n)}once(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.once(e,n):(r=this._map)==null?void 0:r.once(e,n)}un(e,n){var r;if(this._eventType.includes(e))return e==="move"?this._animateLayer.un(e,n):(r=this._map)==null?void 0:r.un(e,n)}}function L9e(t,e){const n=t.get("arrow"),i=t.get("mainView"),r=[n[0]],a=t.getGeometry();if(a&&a instanceof Zt){const s=a.getLength(),o=200*e/s;for(let l=0;l<=1;l+=o){const h=a.getCoordinateAt(l);if(Qi(i.calculateExtent(),h)){const c=a.getCoordinateAt(l+5e-5),f=c[0]-h[0],d=c[1]-h[1],g=Math.atan2(d,f);if(l!==0){const p=n[1].clone();p.setGeometry(new Kt(h)),p.getImage().setRotation(-g+2*Math.PI),r.push(p)}}}}return r}const z9e={name:"v-path",render(){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${$e()}`}},bubble:{type:Boolean,default:!0},showTracePoint:{type:Boolean,default:!0},tracePointsModePlay:{type:String},path:{type:Array},options:{type:Object},autoPlay:{type:Boolean,default:!1}},data(){return{pathObj:null}},computed:{map(){return this.VMap.map}},methods:{init(t){var e,n,i,r,a,s,o;if(t&&t.length>0||this.path&&this.path.length>0){const l=Je(De({},this.$props),{mapObj:this.map,path:t||this.path,options:this.options}),h=new P9e(l);h.setTraceLineStyle({lineColor:((e=l.options)==null?void 0:e.lineColor)||"rgba(0, 0, 255, 0.6)",lineWidth:((n=l.options)==null?void 0:n.lineWidth)||10}),h.setPassLineStyle({lineColor:((i=l.options)==null?void 0:i.passlineColor)||"red",lineWidth:((r=l.options)==null?void 0:r.passlineWidth)||2}),h.setTraceNodeStyle({lineColor:((a=l.options)==null?void 0:a.nodeStrokeColor)||"#3399CC",lineWidth:((s=l.options)==null?void 0:s.nodeStrokeWidth)||1.25,fillColor:((o=l.options)==null?void 0:o.nodeFillColor)||"rgba(255,255,255,0.4)"}),this.pathObj=h,this.pathObj.getEvents().forEach(u=>{this.pathObj.on(u,c=>{this.$emit(u,c)})}),this.$emit("load",this.pathObj),this.autoPlay&&this.start()}},start(t){this.pathObj.start(t)},pause(){this.pathObj.pause()},resume(){this.pathObj.resume()},stop(t){this.pathObj.stop(t)},destroy(){this.pathObj.destroy()}},mounted(){this.init()},beforeDestroy(){this.pathObj.destroy(),this.pathObj=null}};let D9e,k9e;const e$={};var t$=qn(z9e,D9e,k9e,!1,O9e,null,null,null);function O9e(t){for(let e in e$)this[e]=e$[e]}t$.options.__file="src/components/path/index.vue";const gg=function(){return t$.exports}();gg.install=t=>{t.component(gg.name,gg)};const n$=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],j7=1,vg=8;class U7{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(r!==j7)throw new Error(`Got v${r} data when expected v${j7}.`);const a=n$[i&15];if(!a)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new U7(o,s,a,e)}constructor(e,n=64,i=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=n$.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-o%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,vg,e),this.coords=new this.ArrayType(this.data,vg+o+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(vg+s+o+l),this.ids=new this.IndexArrayType(this.data,vg,e),this.coords=new this.ArrayType(this.data,vg+o+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(j7<<4)+a]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=n,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return q7(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:s,nodeSize:o}=this,l=[0,a.length-1,0],h=[];for(;l.length;){const u=l.pop()||0,c=l.pop()||0,f=l.pop()||0;if(c-f<=o){for(let v=f;v<=c;v++){const m=s[2*v],y=s[2*v+1];m>=e&&m<=i&&y>=n&&y<=r&&h.push(a[v])}continue}const d=f+c>>1,g=s[2*d],p=s[2*d+1];g>=e&&g<=i&&p>=n&&p<=r&&h.push(a[d]),(u===0?e<=g:n<=p)&&(l.push(f),l.push(d-1),l.push(1-u)),(u===0?i>=g:r>=p)&&(l.push(d+1),l.push(c),l.push(1-u))}return h}within(e,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:a,nodeSize:s}=this,o=[0,r.length-1,0],l=[],h=i*i;for(;o.length;){const u=o.pop()||0,c=o.pop()||0,f=o.pop()||0;if(c-f<=s){for(let v=f;v<=c;v++)r$(a[2*v],a[2*v+1],e,n)<=h&&l.push(r[v]);continue}const d=f+c>>1,g=a[2*d],p=a[2*d+1];r$(g,p,e,n)<=h&&l.push(r[d]),(u===0?e-i<=g:n-i<=p)&&(o.push(f),o.push(d-1),o.push(1-u)),(u===0?e+i>=g:n+i>=p)&&(o.push(d+1),o.push(c),o.push(1-u))}return l}}function q7(t,e,n,i,r,a){if(r-i<=n)return;const s=i+r>>1;i$(t,e,s,i,r,a),q7(t,e,n,i,s-1,1-a),q7(t,e,n,s+1,r,1-a)}function i$(t,e,n,i,r,a){for(;r>i;){if(r-i>600){const h=r-i+1,u=n-i+1,c=Math.log(h),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(h-f)/h)*(u-h/2<0?-1:1),g=Math.max(i,Math.floor(n-u*f/h+d)),p=Math.min(r,Math.floor(n+(h-u)*f/h+d));i$(t,e,n,g,p,a)}const s=e[2*n+a];let o=i,l=r;for(pg(t,e,i,n),e[2*r+a]>s&&pg(t,e,i,r);o<l;){for(pg(t,e,o,l),o++,l--;e[2*o+a]<s;)o++;for(;e[2*l+a]>s;)l--}e[2*i+a]===s?pg(t,e,i,l):(l++,pg(t,e,l,r)),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function pg(t,e,n,i){V7(t,n,i),V7(e,2*n,2*i),V7(e,2*n+1,2*i+1)}function V7(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function r$(t,e,n,i){const r=t-n,a=e-i;return r*r+a*a}const F9e={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},a$=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),Ll=2,So=3,$7=4,To=5,s$=6;class o${constructor(e){this.options=Object.assign(Object.create(F9e),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:i,maxZoom:r}=this.options,a=`prepare ${e.length} points`;this.points=e;const s=[];for(let l=0;l<e.length;l++){const h=e[l];if(!h.geometry)continue;const[u,c]=h.geometry.coordinates,f=a$(X3(u)),d=a$(Y3(c));s.push(f,d,1/0,l,-1,1),this.options.reduce&&s.push(0)}let o=this.trees[r+1]=this._createTree(s);for(let l=r;l>=i;l--){const h=+Date.now();o=this.trees[l]=this._createTree(this._cluster(o,l))}return this}getClusters(e,n){let i=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let a=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,a=180;else if(i>a){const c=this.getClusters([i,r,180,s],n),f=this.getClusters([-180,r,a,s],n);return c.concat(f)}const o=this.trees[this._limitZoom(n)],l=o.range(X3(i),Y3(s),X3(a),Y3(r)),h=o.data,u=[];for(const c of l){const f=this.stride*c;u.push(h[f+To]>1?l$(h,f,this.clusterProps):this.points[h[f+So]])}return u}getChildren(e){const n=this._getOriginId(e),i=this._getOriginZoom(e),r="No cluster with the specified id.",a=this.trees[i];if(!a)throw new Error(r);const s=a.data;if(n*this.stride>=s.length)throw new Error(r);const o=this.options.radius/(this.options.extent*Math.pow(2,i-1)),l=s[n*this.stride],h=s[n*this.stride+1],u=a.within(l,h,o),c=[];for(const f of u){const d=f*this.stride;s[d+$7]===e&&c.push(s[d+To]>1?l$(s,d,this.clusterProps):this.points[s[d+So]])}if(c.length===0)throw new Error(r);return c}getLeaves(e,n,i){n=n||10,i=i||0;const r=[];return this._appendLeaves(r,e,n,i,0),r}getTile(e,n,i){const r=this.trees[this._limitZoom(e)],a=Math.pow(2,e),{extent:s,radius:o}=this.options,l=o/s,h=(i-l)/a,u=(i+1+l)/a,c={features:[]};return this._addTileFeatures(r.range((n-l)/a,h,(n+1+l)/a,u),r.data,n,i,a,c),n===0&&this._addTileFeatures(r.range(1-l/a,h,1,u),r.data,a,i,a,c),n===a-1&&this._addTileFeatures(r.range(0,h,l/a,u),r.data,-1,i,a,c),c.features.length?c:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const i=this.getChildren(e);if(n++,i.length!==1)break;e=i[0].properties.cluster_id}return n}_appendLeaves(e,n,i,r,a){const s=this.getChildren(n);for(const o of s){const l=o.properties;if(l&&l.cluster?a+l.point_count<=r?a+=l.point_count:a=this._appendLeaves(e,l.cluster_id,i,r,a):a<r?a++:e.push(o),e.length===i)break}return a}_createTree(e){const n=new U7(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<e.length;i+=this.stride)n.add(e[i],e[i+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,i,r,a,s){for(const o of e){const l=o*this.stride,h=n[l+To]>1;let u,c,f;if(h)u=h$(n,l,this.clusterProps),c=n[l],f=n[l+1];else{const p=this.points[n[l+So]];u=p.properties;const[v,m]=p.geometry.coordinates;c=X3(v),f=Y3(m)}const d={type:1,geometry:[[Math.round(this.options.extent*(c*a-i)),Math.round(this.options.extent*(f*a-r))]],tags:u};let g;h||this.options.generateId?g=n[l+So]:g=this.points[n[l+So]].id,g!==void 0&&(d.id=g),s.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:i,extent:r,reduce:a,minPoints:s}=this.options,o=i/(r*Math.pow(2,n)),l=e.data,h=[],u=this.stride;for(let c=0;c<l.length;c+=u){if(l[c+Ll]<=n)continue;l[c+Ll]=n;const f=l[c],d=l[c+1],g=e.within(l[c],l[c+1],o),p=l[c+To];let v=p;for(const m of g){const y=m*u;l[y+Ll]>n&&(v+=l[y+To])}if(v>p&&v>=s){let m=f*p,y=d*p,_,w=-1;const S=((c/u|0)<<5)+(n+1)+this.points.length;for(const b of g){const x=b*u;if(l[x+Ll]<=n)continue;l[x+Ll]=n;const T=l[x+To];m+=l[x]*T,y+=l[x+1]*T,l[x+$7]=S,a&&(_||(_=this._map(l,c,!0),w=this.clusterProps.length,this.clusterProps.push(_)),a(_,this._map(l,x)))}l[c+$7]=S,h.push(m/v,y/v,1/0,S,-1,v),a&&h.push(w)}else{for(let m=0;m<u;m++)h.push(l[c+m]);if(v>1)for(const m of g){const y=m*u;if(!(l[y+Ll]<=n)){l[y+Ll]=n;for(let _=0;_<u;_++)h.push(l[y+_])}}}}return h}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,i){if(e[n+To]>1){const s=this.clusterProps[e[n+s$]];return i?Object.assign({},s):s}const r=this.points[e[n+So]].properties,a=this.options.map(r);return i&&a===r?Object.assign({},a):a}}function l$(t,e,n){return{type:"Feature",id:t[e+So],properties:h$(t,e,n),geometry:{type:"Point",coordinates:[N9e(t[e]),B9e(t[e+1])]}}}function h$(t,e,n){const i=t[e+To],r=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+s$],s=a===-1?{}:Object.assign({},n[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+So],point_count:i,point_count_abbreviated:r})}function X3(t){return t/360+.5}function Y3(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function N9e(t){return(t-.5)*360}function B9e(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var u$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default")],2)},G9e=[];u$._withStripped=!0;const j9e={name:"v-super-cluster",extends:or,inject:["VMap"],props:{layerId:{type:String,default(){return`cluster-layer-${$e()}`}},features:{type:Array,default(){return[]}},FeatureStyle:{type:[Array,void 0],default(){}},cluster:{type:Object},overlay:{type:Object}},data(){return{layer:null,clusters:null,featureChildren:[],featureCluster:!1,total:0,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{cluster:{handler(t){if(t){this.clusters=new o$(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const e=this.map.getView().calculateExtent(this.map.getSize()),n=this.clusters.getClusters(e,this.map.getView().getZoom()),i={type:"FeatureCollection",features:n},r=this.layer.getSource();r&&(r.clear(),r.addFeatures(new Ko().readFeatures(i).map(a=>{const s=a.get("properties");if(s&&typeof s=="object")for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.set(o,s[o]);return a})))}},immediate:!1,deep:!0},features:{handler(){this.dispose(),this.init()},immediate:!1,deep:!0},visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.dispose()},methods:{getGeoFeatures(){return this.features.map(t=>{const e=Hs(t.coordinates,t.convert);return{type:"Feature",geometry:{type:"Point",coordinates:e},properties:t}})},styleFunction(t,e){const n=e.get("cluster")||0,i=e.get("point_count_abbreviated")||0;let r=t[i];if(n){if(!r){let a={};a={image:new ai({radius:4,fill:new xt({color:"blue"})}),text:new nr({font:"16px sans-serif",text:i.toString()})},rt(this.cluster,"style")?(r=an(this.cluster.style),r.getText().setText(i.toString())):r=new ft(a),t[i]=r}}else{const a=e.get("style");r=an(a)}return r},init(){this.clusters=new o$(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const t=this.map.getView().calculateExtent(this.map.getSize()),e=this.clusters.getClusters(t,this.map.getView().getZoom()),n={type:"FeatureCollection",features:e},i={};this.layer=new Jt(Je(De({},this.$props),{source:new si({features:new Ko().readFeatures(n).map(r=>{const a=r.get("properties");if(a&&typeof a=="object")for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&r.set(s,a[s]);return r})}),style:r=>this.styleFunction(i,r)})),this.layer.set("cluster",!0),this.layer.set("id",this.layerId),this.layer.set("type","vector"),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.map.on("movestart",r=>{this.$emit("movestart")}),this.map.on("precompose",()=>{const r=this.map.getView().calculateExtent(this.map.getSize()),a=this.clusters.getClusters(r,this.map.getView().getZoom()),s={type:"FeatureCollection",features:a},o=this.layer.getSource();o&&(o.clear(),o.addFeatures(new Ko().readFeatures(s).map(l=>{const h=l.get("properties");if(h&&typeof h=="object")for(const u in h)Object.prototype.hasOwnProperty.call(h,u)&&l.set(u,h[u]);return l}))),this.$emit("precompose")}),this.eventList.forEach(r=>{this.eventRender.push(this.map.on(r,a=>this.eventHandler(r,a)))})},zoomEnd(t){const e=this.map.getView().calculateExtent(this.map.getSize()),n=this.clusters.getClusters(e,this.map.getView().getZoom()),i={type:"FeatureCollection",features:n},r=this.layer.getSource();r&&(r.clear(),r.addFeatures(new Ko().readFeatures(i).map(a=>{const s=a.get("properties");if(s&&typeof s=="object")for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.set(o,s[o]);return a}))),this.$emit("moveend"),t.map.once("moveend",a=>{this.zoomEnd(a)})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.layer)==null?void 0:i.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},getLeaves(t,e){return this.clusters.getLeaves(t,e)},dispose(){this.eventRender.forEach(e=>{mr(e)});const t=this.layer.getSource();t&&t.clear(),this.map.removeLayer(this.layer)}}},c$={};var f$=qn(j9e,u$,G9e,!1,U9e,null,null,null);function U9e(t){for(let e in c$)this[e]=c$[e]}f$.options.__file="src/components/layers/cluster/index.vue";const mg=function(){return f$.exports}();mg.install=t=>{t.component(mg.name,mg)};const d$="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2xldCB2LGcsYj0wLGs9MDtjb25zdCBaPW5ldyBPZmZzY3JlZW5DYW52YXMoMjU2LDI1NiksYz1aLmdldENvbnRleHQoIjJkIik7c2VsZi5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7aWYoIWcmJnkoZS5kYXRhLndpZHRoLGUuZGF0YS5oZWlnaHQpLGUuZGF0YS5tc2c9PT0iaW5pdFRpbGUiKXtjb25zdCBpPWUuZGF0YTtIKGkuanNvbixpLmNvbCxpLnJvdyxpLnRyYWZmaWMsaS56b29tKX1lbHNlIGUuZGF0YS5tc2c9PT0idXBkYXRlQ2FudmFzIiYmKGcuY2xlYXJSZWN0KDAsMCx2LndpZHRoLHYuaGVpZ2h0KSxiPTAsZS5kYXRhLnVwZGF0ZUluZm8mJkooZS5kYXRhLnVwZGF0ZUluZm8pKX07ZnVuY3Rpb24geShlLGkpe3Y9bmV3IE9mZnNjcmVlbkNhbnZhcyhlLGkpLGc9di5nZXRDb250ZXh0KCIyZCIpfWZ1bmN0aW9uIEgoZSxpLGwsdCxJKXtjLmNsZWFyUmVjdCgwLDAsMjU2LDI1Nik7bGV0IGg9MTA7Y29uc3QgdT10LmNlbnRlcixvPXQuem9vbVVuaXRzLHg9LXVbMF0vbyxUPXVbMV0vbyxNPVt4LFRdLHc9MTgwLGQ9OTA7bGV0IHM9bnVsbCxuPW51bGw7aWYodC50aWxlVHlwZT09PSJiZDA5IilzPWkqdC50aWxlU2l6ZStNWzBdLG49KC0xLWwpKnQudGlsZVNpemUrTVsxXSxzPXQuc2l6ZVswXS8yK3Msbj10LnNpemVbMV0vMituO2Vsc2UgaWYodC50aWxlVHlwZT09PSJXR1M4NCIpe2NvbnN0IHo9TWF0aC5QSSo2Mzc4MTM3O3M9KGkqdC50aWxlU2l6ZSpvLXopL28rTVswXSxuPU1bMV0tKHotbCp0LnRpbGVTaXplKm8pL28scz10LnNpemVbMF0vMitzLG49dC5zaXplWzFdLzIrbn1lbHNlIHM9KGkqdC50aWxlU2l6ZSpvLXcpL28rTVswXSxuPU1bMV0tKGQtbCp0LnRpbGVTaXplKm8pL28scz10LnNpemVbMF0vMitzLG49dC5zaXplWzFdLzIrbjtpZihlJiZlLnRyYWZmaWMpe2NvbnN0IHo9ZS5wcmVjaXNpb258fDE7aD1oKno7Y29uc3QgQz1lLnRyYWZmaWM7Zm9yKGxldCBQPTAsbT1DLmxlbmd0aDtQPG07UCsrKXtjb25zdCBTPUNbUF0sUj1TWzFdLEI9dC5hcnJGZWF0dXJlU3R5bGVzW1NbM11dO2xldCBHPVJbMF0vaCxPPVJbMV0vaDtjLmJlZ2luUGF0aCgpLGMubW92ZVRvKEcsTyk7Zm9yKGxldCBXPTIsYT1SLmxlbmd0aDtXPGE7Vys9MilHKz1SW1ddL2gsTys9UltXKzFdL2gsYy5saW5lVG8oRyxPKTtjLnN0cm9rZVN0eWxlPUJbMV0sU1szXT49MTUmJlNbM108PTE5JiYoYy5zdHJva2VTdHlsZT0icmdiYSgxODYsIDAsIDAsIDEpIiksYy5saW5lV2lkdGg9QlsyXSxjLmxpbmVDYXA9WChCWzNdKSxjLmxpbmVKb2luPVkoQls0XSksYy5zdHJva2UoKX19aWYoZy5kcmF3SW1hZ2UoWixzLG4pLCsrYixiPT09ayl7Yj0wLGs9MDtjb25zdCB6PXYudHJhbnNmZXJUb0ltYWdlQml0bWFwKCk7cG9zdE1lc3NhZ2Uoe2ltYWdlQml0bWFwOnosbXNnOiJpbml0VGlsZSIsY2FudmFzUG9pbnQ6W3Msbl0sem9vbTpJLHg6aSx5Omx9KX19ZnVuY3Rpb24gSihlKXtsZXQgaSxsO2NvbnN0IHQ9ZS5zaXplO2UudGlsZVR5cGU9PT0iYmQwOSI/KGk9TWF0aC5yb3VuZChlLm1hcFpvb20rMSksZS56b29tVW5pdHM9TWF0aC5wb3coMiwxOC1pKSxsPWUuem9vbVVuaXRzKjI1Nik6ZS50aWxlVHlwZT09PSJXR1M4NCI/KGk9TWF0aC5yb3VuZChlLm1hcFpvb20pLGUuem9vbVVuaXRzPTIqTWF0aC5QSSo2Mzc4MTM3LzI1Ni9NYXRoLnBvdygyLGkpLGw9ZS56b29tVW5pdHMqMjU2KTooaT1NYXRoLnJvdW5kKGUubWFwWm9vbSksZS56b29tVW5pdHM9TWF0aC5wb3coMiwyLWkpKi4zNTE1NjI1LGw9MjU2KmUuem9vbVVuaXRzKTtjb25zdCBJPWUuY2VudGVyLGg9e3g6SVswXSx5OklbMV19O2xldCB1LG8seCxULE0sdztjb25zdCBkPWUuem9vbVVuaXRzLHM9ZC9lLnJlc29sdXRpb247bGV0IG49dFswXS9zLHo9dFsxXS9zO2lmKGUudGlsZVR5cGU9PT0iYmQwOSIpe3U9TWF0aC5jZWlsKGgueC9sKSxvPU1hdGguY2VpbChoLnkvbCk7Y29uc3QgbT1bdSxvLChoLngtdSpsKS9sKmUudGlsZVNpemUsKGgueS1vKmwpL2wqZS50aWxlU2l6ZV07eD1tWzBdLU1hdGguY2VpbCgobi8yLW1bMl0pL2UudGlsZVNpemUpLFQ9bVsxXS1NYXRoLmNlaWwoKHovMi1tWzNdKS9lLnRpbGVTaXplKSxNPW1bMF0rTWF0aC5jZWlsKChuLzIrbVsyXSkvZS50aWxlU2l6ZSksdz1tWzFdK01hdGguY2VpbCgoei8yK21bM10pL2UudGlsZVNpemUpfWVsc2UgZS50aWxlVHlwZT09PSJXR1M4NCI/KG49dFswXSx6PXRbMV0sdT1NYXRoLmNlaWwoTWF0aC5yb3VuZCgoaC54KzIwMDM3NTA4MzRlLTIpL2wpKSxvPU1hdGguY2VpbChNYXRoLnJvdW5kKCgyMDAzNzUwODM0ZS0yLWgueSkvbCkpLHg9dS1NYXRoLmNlaWwobi8yL2UudGlsZVNpemUpLE09dStNYXRoLmNlaWwobi8yL2UudGlsZVNpemUpLFQ9by1NYXRoLmNlaWwoei8yL2UudGlsZVNpemUpLHc9bytNYXRoLmNlaWwoei8yL2UudGlsZVNpemUpKToobj10WzBdLHo9dFsxXSx1PU1hdGguY2VpbChNYXRoLnJvdW5kKChoLngrMTgwKS9sKSksbz1NYXRoLmNlaWwoTWF0aC5yb3VuZCgoOTAtaC55KS9sKSkseD11LU1hdGguY2VpbChuLzIvZS50aWxlU2l6ZSksTT11K01hdGguY2VpbChuLzIvZS50aWxlU2l6ZSksVD1vLU1hdGguY2VpbCh6LzIvZS50aWxlU2l6ZSksdz1vK01hdGguY2VpbCh6LzIvZS50aWxlU2l6ZSkpO2NvbnN0IEM9W107Zm9yKGxldCBtPXg7bTw9TTttKyspZm9yKGxldCBTPVQ7Uzw9dztTKyspQy5wdXNoKFttLFNdKTtrPUMubGVuZ3RoO2NvbnN0IFA9ZS5kZXZpY2VQaXhlbFJhdGlvO2cudHJhbnNsYXRlKHRbMF0qUCooMS1zKS8yLHRbMV0qUCooMS1zKS8yKSxnLnNjYWxlKGUucmF0aW8qcyxlLnJhdGlvKnMpLHBvc3RNZXNzYWdlKHt0aWxlc09yZGVyOkMsem9vbVVuaXRzOmQsbXNnOiJ1cGRhdGVDYW52YXMifSl9ZnVuY3Rpb24gWChlKXtyZXR1cm5bImJ1dHQiLCJzcXVhcmUiLCJyb3VuZCJdW2VdfWZ1bmN0aW9uIFkoZSl7cmV0dXJuWyJtaXRlciIsImJldmVsIiwicm91bmQiXVtlXX19KSgpOwo=",g$=typeof window!="undefined"&&window.Blob&&new Blob([atob(d$)],{type:"text/javascript;charset=utf-8"});function q9e(){const t=g$&&(window.URL||window.webkitURL).createObjectURL(g$);try{return t?new Worker(t):new Worker("data:application/javascript;base64,"+d$)}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}function hn(t){t=t||{},this.options=t,this.analysis=t.analysis==="official"?t.analysis:"private",this.needWorker=t.needWorker!==void 0?t.needWorker:!1,t.colors=t.colors||["rgba(0,192,73,0.99609375)","rgba(242,48,48,0.99609375)","rgba(255,159,25,0.99609375)"];const e=t.colors;this.map=t.map,this.canvas=null,this.tileType=t.tileType;const n=this.map.getSize(),i=this.map.getView().calculateExtent(n),r=new I2({extent:i,source:new a2({canvasFunction:this.canvasFunction.bind(this),ratio:1,projection:"EPSG:4326"})});this.layer=r,t.map.on(["precompose"],s=>{const o=s.target.getSize(),l=s.target.getView().calculateExtent(o);r.setExtent(l)},!1),this.parseColors(e),this.tileSize=256;const a=1;this.ratio=a,this.drawTogether=!1,this.cache={},this._loadCount={},t.getTileUrl&&(this.getTileUrl=t.getTileUrl),t.needWorker&&(this.worker=new q9e,this.worker.onmessage=s=>{if(s.data.msg==="initTile")this.canvaslayer.canvas.getContext("2d").drawImage(s.data.imageBitmap,0,0),window.BMap&&(window.BMap=null);else if(s.data.msg==="updateCanvas"){const o=s.data.tilesOrder;this.zoomUnits=s.data.zoomUnits,this.tilesOrder=s.data.tilesOrder,this._loadCount={},this.canvaslayer.canvas.getContext("2d").clearRect(0,0,this.canvaslayer.canvas.width,this.canvaslayer.canvas.height);for(let l=0;l<o.length;l++){const h=o[l][0],u=o[l][1],c=Math.round(t.map.getView().getZoom());this._loadCount[h+"_"+u+"_"+c]=!1,this.showTile(h,u,c)}}},this.worker.onerror=s=>{})}hn.prototype.canvasFunction=function(t,e,n,i,r){let a=this.canvas;return a||(a=document.createElement("canvas"),this.canvas=a),a.width=i[0],a.height=i[1],this.update({resolution:e,canvas:a}),a},hn.prototype.parseColors=function(t){this.arrFeatureStyles=[[2,t[0]||"rgba(79,210,125,1)",2,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",3,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",3,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",5,2,0,[],0,0],[2,t[0]||"rgba(79,210,125,1)",6,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",2,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",3,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",3,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",5,2,0,[],0,0],[2,t[2]||"rgba(255,208,69,1)",6,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",2,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",3,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",3,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",5,2,0,[],0,0],[2,t[1]||"rgba(232,14,14,1)",6,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",2,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",3,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",3,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",5,2,0,[],0,0],[2,t[3]||"rgba(181,0,0,1)",6,2,0,[],0,0],[2,"rgba(255,255,255,1)",4,0,0,[],0,0],[2,"rgba(255,255,255,1)",5.5,0,0,[],0,0],[2,"rgba(255,255,255,1)",7,0,0,[],0,0],[2,"rgba(255,255,255,1)",8.5,0,0,[],0,0],[2,"rgba(255,255,255,1)",10,0,0,[],0,0]]},hn.prototype.setColors=function(t){this.parseColors(t)},hn.prototype.initialize=function(t){const e=this;this._initialize||(this.canvaslayer=new CanvasLayer({map:t,update:function(){e.update(this)}}),this._initialize=!0)},hn.prototype.clearCache=function(t){this.cache={}},hn.prototype.setMap=function(t){t?(this.map=t,this._initialize?this.canvaslayer.show():this.initialize(t)):this.canvaslayer.hide()},hn.prototype.draw=function(t){t=t||{},t.clearCache&&this.clearCache(),t.drawTogether&&(this.drawTogether=!0),this.update()},hn.prototype.clear=function(){const e=this.canvaslayer.canvas.getContext("2d"),n=e.canvas.width,i=e.canvas.height;e.canvas.width=n,e.canvas.height=i},hn.prototype.update=function(t){const e=this.map;t?this.canvaslayer=t:t=this.canvaslayer;const i=t.canvas.getContext("2d");this.drawTogether||this.clear();const r=[];if(this.needWorker){const a=this.map.getSize(),s={mapZoom:Math.round(e.getView().getZoom()),tileType:this.tileType,zoomUnits:this.zoomUnits,center:this.map.getView().getCenter(),resolution:this.canvaslayer.resolution,tileSize:this.tileSize,size:a,devicePixelRatio:this.ratio,ratio:this.ratio};this.worker.postMessage({msg:"updateCanvas",width:a[0],height:a[1],updateInfo:s})}else{const a=this.map;let s,o;this.tileType==="bd09"?(s=Math.round(a.getView().getZoom()+1),this.zoomUnits=Math.pow(2,18-s),o=this.zoomUnits*256):this.tileType==="WGS84"?(s=Math.round(a.getView().getZoom()),this.zoomUnits=2*Math.PI*6378137/256/Math.pow(2,s),o=this.zoomUnits*256):(s=Math.round(a.getView().getZoom()),this.zoomUnits=Math.pow(2,2-s)*.3515625,o=256*this.zoomUnits);const l=a.getView().getCenter(),h={x:l[0],y:l[1]};let u,c,f,d,g,p;const m=this.zoomUnits/this.canvaslayer.resolution;let y=a.getSize()[0]/m,_=a.getSize()[1]/m;if(this.tileType==="bd09"){u=Math.ceil(h.x/o),c=Math.ceil(h.y/o);const S=[u,c,(h.x-u*o)/o*this.tileSize,(h.y-c*o)/o*this.tileSize];f=S[0]-Math.ceil((y/2-S[2])/this.tileSize),d=S[1]-Math.ceil((_/2-S[3])/this.tileSize),g=S[0]+Math.ceil((y/2+S[2])/this.tileSize),p=S[1]+Math.ceil((_/2+S[3])/this.tileSize)}else this.tileType==="WGS84"?(y=a.getSize()[0],_=a.getSize()[1],u=Math.ceil(Math.round((h.x+2003750834e-2)/o)),c=Math.ceil(Math.round((2003750834e-2-h.y)/o)),f=u-Math.ceil(y/2/this.tileSize),g=u+Math.ceil(y/2/this.tileSize),d=c-Math.ceil(_/2/this.tileSize),p=c+Math.ceil(_/2/this.tileSize)):(y=a.getSize()[0],_=a.getSize()[1],u=Math.ceil(Math.round((h.x+180)/o)),c=Math.ceil(Math.round((90-h.y)/o)),f=u-Math.ceil(y/2/this.tileSize),g=u+Math.ceil(y/2/this.tileSize),d=c-Math.ceil(_/2/this.tileSize),p=c+Math.ceil(_/2/this.tileSize));for(let S=f;S<=g;S++)for(let b=d;b<=p;b++)r.push([S,b]);this.tilesOrder=r,this._loadCount={};const w=a.getSize();i.translate(w[0]*devicePixelRatio*(1-m)/2,w[1]*devicePixelRatio*(1-m)/2),i.scale(this.ratio*m,this.ratio*m);for(let S=0;S<r.length;S++){const b=r[S][0],x=r[S][1],T=s;this._loadCount[b+"_"+x+"_"+T]=!1,this.showTile(b,x,T)}}},hn.prototype.lngLatToMerc=function(t){if(t==null)return{x:0,y:0};if(t.lng>180||t.lng<-180||t.lat>90||t.lat<-90)return{x:0,y:0};if(this.tileType==="WGS84"){const e={};e.lng=t.lng*Math.PI/180*6378137;const i=t.lat*Math.PI/180;return e.lat=6378137/2*Math.log((1+Math.sin(i))/(1-Math.sin(i))),{x:Number(e.lng.toFixed(2)),y:Number(e.lat.toFixed(2))}}},hn.prototype.isAllLoaded=function(){let t=!0;for(const e in this._loadCount)if(!this._loadCount[e]){t=!1;break}return t},hn.prototype.showTile=function(t,e,n){this._parseDataAndDraw(t,e,n)},hn.prototype.drawCurrentData=function(){this.clear();let t;this.tileType==="bd09"?t=Math.round(this.map.getZoom()+1):this.tileType==="WGS84"?t=Math.round(this.map.getZoom()):t=Math.round(this.map.getView().getZoom());for(let e=0;e<this.tilesOrder.length;e++){const n=this.tilesOrder[e][0],i=this.tilesOrder[e][1],r=this.cache[this.getCacheKey(n,i,t)];r&&this._drawFeatures(r,n,i,t)}this.drawTogether=!1},hn.prototype.getCacheKey=function(t,e,n){return t+"_"+e+"_"+n},hn.prototype.getTileKey=function(t,e){const n=t.style||"default";return"BMAP_CUSTOM_LAYER_1_"+n+"_"+t.col+"_"+t.row+"_"+t.zoom+"_"+t.zoom},hn.prototype._parseDataAndDraw=function(t,e,n){const i=this,r=this.getCacheKey(t,e,n),a=(Math.random()*1e5).toFixed(0);let s="_cbk"+a;window.BMap||(window.BMap={});let o="";const l=this.analysis;if(l==="private")o=this.getTileUrl(t,e,n,"BMap."+s),window.BMap[s]=h;else{const u="cbk"+this.getTileKey({col:t,row:e,zoom:n});o=this.getTileUrl(t,e,n,"BMap."+u),s=u,window.BMap[s]=h}function h(u){i._loadCount[t+"_"+e+"_"+n]=!0;const c=l==="private"?u.result&&u.result.trafficData:u.content&&u.content.tf;c?i.cache[r]={traffic:c,precision:u.precision||1}:i.cache[r]=null,i.drawTogether?i.isAllLoaded()&&i.drawCurrentData():i._drawFeatures(i.cache[r],t,e,n),delete window.BMap[s]}i.cache[r]!==void 0&&i.cache[r]!==null?(i._loadCount[t+"_"+e+"_"+n]=!0,i.drawTogether?i.isAllLoaded()&&i.drawCurrentData():i._drawFeatures(i.cache[r],t,e,n)):typeof window.BMap[s]=="function"&&this.request(o)},hn.prototype.getTileUrl=function(t,e,n,i){return(this.options.trafficURL||"http://its.map.baidu.com:8002/traffic/?qt=vtraffic")+"&x="+t+"&y="+e+"&z="+n+"&fn="+i+(this.analysis==="private"?"&t="+new Date().getTime():"")},hn.prototype._drawFeatures=function(t,e,n,i){if(this.needWorker){const r=this.map.getSize(),a={center:this.map.getView().getCenter(),zoomUnits:this.zoomUnits,tileType:this.tileType,tileSize:this.tileSize,size:r,arrFeatureStyles:this.arrFeatureStyles};this.worker.postMessage({msg:"initTile",json:t,col:e,row:n,width:r[0],height:r[1],traffic:a,zoom:i})}else{const r=this.map,s=this.canvaslayer.canvas.getContext("2d"),o=this.getLineCap,l=this.getLineJoin;let h=10;const u=r.getView().getCenter(),c=this.zoomUnits,f=-u[0]/c,d=u[1]/c,g=[f,d];let p=null,v=null;if(this.tileType==="bd09")p=e*this.tileSize+g[0],v=(-1-n)*this.tileSize+g[1],p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v;else if(this.tileType==="WGS84"){const m=Math.PI*6378137;p=(e*this.tileSize*c-m)/c+g[0],v=g[1]-(m-n*this.tileSize*c)/c,p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v}else p=(e*this.tileSize*c-180)/c+g[0],v=g[1]-(90-n*this.tileSize*c)/c,p=r.getSize()[0]/2+p,v=r.getSize()[1]/2+v;if(s.save(),s.translate(p,v),t&&t.traffic){const m=t.precision||1;h=h*m;const y=t.traffic;for(let _=0,w=y.length;_<w;_++){const S=y[_],b=S[1],x=this.arrFeatureStyles[S[3]];let T=b[0]/h,C=b[1]/h;s.beginPath(),s.moveTo(T,C);for(let A=2,M=b.length;A<M;A+=2)T+=b[A]/h,C+=b[A+1]/h,s.lineTo(T,C);s.strokeStyle=x[1],S[3]>=15&&S[3]<=19&&(s.strokeStyle="rgba(186, 0, 0, 1)"),s.lineWidth=x[2],s.lineCap=o(x[3]),s.lineJoin=l(x[4]),s.stroke()}}s.restore()}},hn.prototype.request=function(t,e){if(e)if(this.analysis==="private"){const i=(Math.random()*1e5).toFixed(0),r="_cbk"+i;window.BMap._rd[r]=function(a){e&&e(a),delete window.BMap._rd[r]},t+="&callback=BMap._rd._cbk"+i}else{const i=/(\w+|[\u4e00-\u9fa5]+)=(\w+|[\u4e00-\u9fa5]+)/gi,r={};t.replace(i,(s,o,l)=>{r[o]=l});const a=r.fn;window.BMap[a]=function(s){e&&e(s),delete window.BMap[a]},t+="&callback=BMap."+a}let n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.src=t,n.addEventListener?n.addEventListener("load",function(i){const r=i.target;r.parentNode.removeChild(r)},!1):n.attachEvent&&n.attachEvent("onreadystatechange",function(i){const r=window.event.srcElement;r&&(r.readyState==="loaded"||r.readyState==="complete")&&r.parentNode.removeChild(r)}),setTimeout(function(){document.getElementsByTagName("head")[0].appendChild(n),n=null},1)},hn.prototype.getRGBA=function(t){t=t>>>0;const e=t>>24&255,n=t>>16&255,i=t>>8&255,r=(t&255)/256;return"rgba("+e+","+n+","+i+","+r+")"},hn.prototype.getLineCap=function(t){return["butt","square","round"][t]},hn.prototype.getLineJoin=function(t){return["miter","bevel","round"][t]},hn.prototype.workerTerminate=function(){this.worker&&this.worker.terminate()};const V9e={name:"v-traffic",render(){return null},extends:or,inject:["VMap"],props:{layerId:{type:String,default(){return`traffic-layer-${$e()}`}},timeout:{type:Number},url:{type:String,require:!0},tileType:{type:String},clearCache:{type:Boolean,default:!0},colors:{type:Array,default(){return["rgba(0,192,73,0.99609375)","rgba(242,48,48,0.99609375)","rgba(255,159,25,0.99609375)"]}},needWorker:{type:Boolean,default:!1}},data(){return{timer:null,trafficLayer:null,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){this.trafficLayer.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.trafficLayer.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.trafficLayer.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.trafficLayer.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.trafficLayer.layer.setExtent(t)},immediate:!1,deep:!0},colors:{handler(t){this.trafficLayer.setColors(t)},immediate:!1,deep:!0}},methods:{init(){const t={map:this.map,trafficURL:this.url,tileType:this.tileType,colors:this.colors,needWorker:this.needWorker};this.trafficLayer=typeof BDTrafficLayer=="undefined"?new hn(t):new BDTrafficLayer(t),this.trafficLayer.layer.set("id",this.layerId),this.trafficLayer.layer.set("type","traffic"),this.trafficLayer.layer.set("users",!0),this.zIndex&&this.trafficLayer.layer.setZIndex(this.zIndex),this.trafficLayer.layer.setVisible(this.visible),this.map.addLayer(this.trafficLayer.layer),this.timeout&&(this.timer=setInterval(()=>{this.trafficLayer.layer&&this.trafficLayer.layer.getVisible()&&this.trafficLayer.draw({clearCache:this.clearCache})},this.timeout)),this.eventList.forEach(e=>{this.eventRender.push(this.map.on(e,n=>this.eventHandler(e,n)))})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i,r;if((n==null?void 0:n.get("id"))===((r=(i=this.trafficLayer)==null?void 0:i.layer)==null?void 0:r.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},dispose(){this.eventRender.forEach(t=>{mr(t)}),this.timer&&(clearInterval(this.timer),this.timer=null),this.trafficLayer&&(this.trafficLayer.layer.getSource().clear(),this.map.removeLayer(this.trafficLayer.layer),this.trafficLayer.workerTerminate())}},mounted(){this.init()},update(){this.trafficLayer&&this.dispose(),this.init()},beforeDestroy(){this.dispose()}};let $9e,H9e;const v$={};var p$=qn(V9e,$9e,H9e,!1,W9e,null,null,null);function W9e(t){for(let e in v$)this[e]=v$[e]}p$.options.__file="src/components/layers/traffic/index.vue";const yg=function(){return p$.exports}();yg.install=function(t){t.component(yg.name,yg)};const H7="http://www.w3.org/2001/XMLSchema-instance";function ut(t,e){return x$().createElementNS(t,e)}function _g(t,e){return m$(t,e,[]).join("")}function m$(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?n.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(t.nodeValue);else{let i;for(i=t.firstChild;i;i=i.nextSibling)m$(i,e,n)}return n}function ic(t){return"documentElement"in t}function Z9e(t,e,n){return t.getAttributeNS(e,n)||""}function rc(t){return new DOMParser().parseFromString(t,"application/xml")}function y$(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);if(r!==void 0){const a=i[i.length-1];mi(a,r)}}}function st(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);r!==void 0&&i[i.length-1].push(r)}}function We(t,e){return function(n,i){const r=t.call(e!==void 0?e:this,n,i);r!==void 0&&(i[i.length-1]=r)}}function aa(t,e,n){return function(i,r){const a=t.call(n!==void 0?n:this,i,r);if(a!==void 0){const s=r[r.length-1],o=e!==void 0?e:i.localName;s[o]=a}}}function me(t,e){return function(n,i,r){t.call(e!==void 0?e:this,n,i,r),r[r.length-1].node.appendChild(n)}}function dr(t,e){return function(n,i,r){const s=i[i.length-1].node;let o=t;o===void 0&&(o=r);const l=e!==void 0?e:s.namespaceURI;return ut(l,o)}}const _$=dr();function zl(t,e,n,i){let r;for(r=e.firstElementChild;r;r=r.nextElementSibling){const a=t[r.namespaceURI];if(a!==void 0){const s=a[r.localName];s!==void 0&&s.call(i,r,n)}}}function Vt(t,e,n,i,r){return i.push(t),zl(e,n,i,r),i.pop()}function X9e(t,e,n,i,r,a){const s=(r!==void 0?r:n).length;let o,l;for(let h=0;h<s;++h)o=n[h],o!==void 0&&(l=e.call(a!==void 0?a:this,o,i,r!==void 0?r[h]:void 0),l!==void 0&&t[l.namespaceURI][l.localName].call(a,l,o,i))}function _n(t,e,n,i,r,a,s){return r.push(t),X9e(e,n,i,r,a,s),r.pop()}let W7;function Y9e(){return W7===void 0&&typeof XMLSerializer!="undefined"&&(W7=new XMLSerializer),W7}let Z7;function x$(){return Z7===void 0&&typeof document!="undefined"&&(Z7=document.implementation.createDocument("","",null)),Z7}class K9e extends UC{constructor(){super(),this.xmlSerializer_=Y9e()}getType(){return"xml"}readFeature(e,n){if(!e)return null;if(typeof e=="string"){const i=rc(e);return this.readFeatureFromDocument(i,n)}return ic(e)?this.readFeatureFromDocument(e,n):this.readFeatureFromNode(e,n)}readFeatureFromDocument(e,n){const i=this.readFeaturesFromDocument(e,n);return i.length>0?i[0]:null}readFeatureFromNode(e,n){return null}readFeatures(e,n){if(!e)return[];if(typeof e=="string"){const i=rc(e);return this.readFeaturesFromDocument(i,n)}return ic(e)?this.readFeaturesFromDocument(e,n):this.readFeaturesFromNode(e,n)}readFeaturesFromDocument(e,n){const i=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&mi(i,this.readFeaturesFromNode(r,n));return i}readFeaturesFromNode(e,n){return He()}readGeometry(e,n){if(!e)return null;if(typeof e=="string"){const i=rc(e);return this.readGeometryFromDocument(i,n)}return ic(e)?this.readGeometryFromDocument(e,n):this.readGeometryFromNode(e,n)}readGeometryFromDocument(e,n){return null}readGeometryFromNode(e,n){return null}readProjection(e){if(!e)return null;if(typeof e=="string"){const n=rc(e);return this.readProjectionFromDocument(n)}return ic(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e)}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,n){const i=this.writeFeatureNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(e,n){return null}writeFeatures(e,n){const i=this.writeFeaturesNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(e,n){return null}writeGeometry(e,n){const i=this.writeGeometryNode(e,n);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(e,n){return null}}const w$=K9e,bs="http://www.opengis.net/gml",J9e=/^\s*$/;class xn extends w${constructor(e){super(),e=e||{},this.featureType=e.featureType,this.featureNS=e.featureNS,this.srsName=e.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:st(this.readFeaturesInternal),featureMembers:We(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(e,n){const i=e.localName;let r=null;if(i=="FeatureCollection")r=Vt([],this.FEATURE_COLLECTION_PARSERS,e,n,this);else if(i=="featureMembers"||i=="featureMember"||i=="member"){const a=n[0];let s=a.featureType,o=a.featureNS;const l="p",h="p0";if(!s&&e.childNodes){s=[],o={};for(let f=0,d=e.childNodes.length;f<d;++f){const g=e.childNodes[f];if(g.nodeType===1){const p=g.nodeName.split(":").pop();if(!s.includes(p)){let v="",m=0;const y=g.namespaceURI;for(const _ in o){if(o[_]===y){v=_;break}++m}v||(v=l+m,o[v]=y),s.push(v+":"+p)}}}i!="featureMember"&&(a.featureType=s,a.featureNS=o)}if(typeof o=="string"){const f=o;o={},o[h]=f}const u={},c=Array.isArray(s)?s:[s];for(const f in o){const d={};for(let g=0,p=c.length;g<p;++g)(c[g].includes(":")?c[g].split(":")[0]:h)===f&&(d[c[g].split(":").pop()]=i=="featureMembers"?st(this.readFeatureElement,this):We(this.readFeatureElement,this));u[o[f]]=d}i=="featureMember"||i=="member"?r=Vt(void 0,u,e,n):r=Vt([],u,e,n)}return r===null&&(r=[]),r}readGeometryOrExtent(e,n){const i=n[0];return i.srsName=e.firstElementChild.getAttribute("srsName"),i.srsDimension=e.firstElementChild.getAttribute("srsDimension"),Vt(null,this.GEOMETRY_PARSERS,e,n,this)}readExtentElement(e,n){const i=n[0],r=this.readGeometryOrExtent(e,n);return r?Bm(r,i):void 0}readGeometryElement(e,n){const i=n[0],r=this.readGeometryOrExtent(e,n);return r?uf(r,!1,i):void 0}readFeatureElementInternal(e,n,i){let r;const a={};for(let l=e.firstElementChild;l;l=l.nextElementSibling){let h;const u=l.localName;l.childNodes.length===0||l.childNodes.length===1&&(l.firstChild.nodeType===3||l.firstChild.nodeType===4)?(h=_g(l,!1),J9e.test(h)&&(h=void 0)):(i&&(h=u==="boundedBy"?this.readExtentElement(l,n):this.readGeometryElement(l,n)),h?u!=="boundedBy"&&(r=u):h=this.readFeatureElementInternal(l,n,!1));const c=l.attributes.length;if(c>0&&!(h instanceof Jp)){h={_content_:h};for(let f=0;f<c;f++){const d=l.attributes[f].name;h[d]=l.attributes[f].value}}a[u]?(a[u]instanceof Array||(a[u]=[a[u]]),a[u].push(h)):a[u]=h}if(!i)return a;const s=new Wn(a);r&&s.setGeometryName(r);const o=e.getAttribute("fid")||Z9e(e,this.namespace,"id");return o&&s.setId(o),s}readFeatureElement(e,n){return this.readFeatureElementInternal(e,n,!0)}readPoint(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new Kt(i,"XYZ")}readMultiPoint(e,n){const i=Vt([],this.MULTIPOINT_PARSERS,e,n,this);if(i)return new Kc(i)}readMultiLineString(e,n){const i=Vt([],this.MULTILINESTRING_PARSERS,e,n,this);if(i)return new Yc(i)}readMultiPolygon(e,n){const i=Vt([],this.MULTIPOLYGON_PARSERS,e,n,this);if(i)return new ph(i)}pointMemberParser(e,n){zl(this.POINTMEMBER_PARSERS,e,n,this)}lineStringMemberParser(e,n){zl(this.LINESTRINGMEMBER_PARSERS,e,n,this)}polygonMemberParser(e,n){zl(this.POLYGONMEMBER_PARSERS,e,n,this)}readLineString(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new Zt(i,"XYZ")}readFlatLinearRing(e,n){const i=Vt(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this);if(i)return i}readLinearRing(e,n){const i=this.readFlatCoordinatesFromNode(e,n);if(i)return new s1(i,"XYZ")}readPolygon(e,n){const i=Vt([null],this.FLAT_LINEAR_RINGS_PARSERS,e,n,this);if(i&&i[0]){const r=i[0],a=[r.length];let s,o;for(s=1,o=i.length;s<o;++s)mi(r,i[s]),a.push(r.length);return new Bi(r,"XYZ",a)}}readFlatCoordinatesFromNode(e,n){return Vt(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this)}readGeometryFromNode(e,n){const i=this.readGeometryElement(e,[this.getReadOptions(e,n||{})]);return i||null}readFeaturesFromNode(e,n){const i={featureType:this.featureType,featureNS:this.featureNS};return i&&Object.assign(i,this.getReadOptions(e,n)),this.readFeaturesInternal(e,[i])||[]}readProjectionFromNode(e){return _t(this.srsName?this.srsName:e.firstElementChild.getAttribute("srsName"))}}xn.prototype.namespace=bs,xn.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},xn.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:st(xn.prototype.pointMemberParser),pointMembers:st(xn.prototype.pointMemberParser)}},xn.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:st(xn.prototype.lineStringMemberParser),lineStringMembers:st(xn.prototype.lineStringMemberParser)}},xn.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:st(xn.prototype.polygonMemberParser),polygonMembers:st(xn.prototype.polygonMemberParser)}},xn.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:st(xn.prototype.readFlatCoordinatesFromNode)}},xn.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:st(xn.prototype.readLineString)}},xn.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:st(xn.prototype.readPolygon)}},xn.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:We(xn.prototype.readFlatLinearRing)}};const pt=xn;function ac(t){const e=_g(t,!1);return sc(e)}function sc(t){const e=/^\s*(\d+)\s*$/.exec(t);if(e)return parseInt(e[1],10)}function On(t,e){t.appendChild(x$().createTextNode(e))}const Q9e=bs+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",e7e={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class It extends pt{constructor(e){e=e||{},super(e),this.FEATURE_COLLECTION_PARSERS[bs].featureMember=st(this.readFeaturesInternal),this.schemaLocation=e.schemaLocation?e.schemaLocation:Q9e}readFlatCoordinates(e,n){const i=_g(e,!1).replace(/^\s*|\s*$/g,""),a=n[0].srsName;let s="enu";if(a){const h=_t(a);h&&(s=h.getAxisOrientation())}const o=i.trim().split(/\s+/),l=[];for(let h=0,u=o.length;h<u;h++){const c=o[h].split(/,+/),f=parseFloat(c[0]),d=parseFloat(c[1]),g=c.length===3?parseFloat(c[2]):0;s.substr(0,2)==="en"?l.push(f,d,g):l.push(d,f,g)}return l}readBox(e,n){const i=Vt([null],this.BOX_PARSERS_,e,n,this);return _r(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);i&&n[n.length-1].push(i)}outerBoundaryIsParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);if(i){const r=n[n.length-1];r[0]=i}}GEOMETRY_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.multiSurface,s=r.surface,o=r.multiCurve;return Array.isArray(e)?i="Envelope":(i=e.getType(),i==="MultiPolygon"&&a===!0?i="MultiSurface":i==="Polygon"&&s===!0?i="Surface":i==="MultiLineString"&&o===!0&&(i="MultiCurve")),ut("http://www.opengis.net/gml",i)}writeFeatureElement(e,n,i){const r=n.getId();r&&e.setAttribute("fid",r);const a=i[i.length-1],s=a.featureNS,o=n.getGeometryName();a.serializers||(a.serializers={},a.serializers[s]={});const l=[],h=[];if(n.hasProperties()){const c=n.getProperties();for(const f in c){const d=c[f];d!==null&&(l.push(f),h.push(d),f==o||typeof d.getSimplifiedGeometry=="function"?f in a.serializers[s]||(a.serializers[s][f]=me(this.writeGeometryElement,this)):f in a.serializers[s]||(a.serializers[s][f]=me(On)))}}const u=Object.assign({},a);u.node=e,_n(u,a.serializers,dr(void 0,s),h,i,l)}writeCurveOrLineString(e,n,i){const a=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&a&&e.setAttribute("srsName",a),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const s=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(s),this.writeCoordinates_(s,n,i)}else if(e.nodeName==="Curve"){const s=ut(e.namespaceURI,"segments");e.appendChild(s),this.writeCurveSegments_(s,n,i)}}writeLineStringOrCurveMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,n,i))}writeMultiCurveOrLineString(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.curve;s&&e.setAttribute("srsName",s);const l=n.getLineStrings();_n({node:e,hasZ:a,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeGeometryElement(e,n,i){const r=i[i.length-1],a=Object.assign({},r);a.node=e;let s;Array.isArray(n)?s=Bm(n,r):s=uf(n,!0,r),_n(a,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}createCoordinatesNode_(e){const n=ut(e,"coordinates");return n.setAttribute("decimal","."),n.setAttribute("cs",","),n.setAttribute("ts"," "),n}writeCoordinates_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=n.getCoordinates(),l=o.length,h=new Array(l);for(let u=0;u<l;++u){const c=o[u];h[u]=this.getCoords_(c,s,a)}On(e,h.join(" "))}writeCurveSegments_(e,n,i){const r=ut(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,n,i)}writeSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;if(e.nodeName!=="PolygonPatch"&&s&&e.setAttribute("srsName",s),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const o=n.getLinearRings();_n({node:e,hasZ:a,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,o,i,void 0,this)}else if(e.nodeName==="Surface"){const o=ut(e.namespaceURI,"patches");e.appendChild(o),this.writeSurfacePatches_(o,n,i)}}RING_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.node,s=r.exteriorWritten;return s===void 0&&(r.exteriorWritten=!0),ut(a.namespaceURI,s!==void 0?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(e,n,i){const r=ut(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)}writeRing(e,n,i){const r=ut(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,n,i)}getCoords_(e,n,i){let r="enu";n&&(r=_t(n).getAxisOrientation());let a=r.substr(0,2)==="en"?e[0]+","+e[1]:e[1]+","+e[0];if(i){const s=e[2]||0;a+=","+s}return a}writePoint(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;s&&e.setAttribute("srsName",s);const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o);const l=n.getCoordinates(),h=this.getCoords_(l,s,a);On(o,h)}writeMultiPoint(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;s&&e.setAttribute("srsName",s);const o=n.getPoints();_n({node:e,hasZ:a,srsName:s},this.POINTMEMBER_SERIALIZERS,dr("pointMember"),o,i,void 0,this)}writePointMember(e,n,i){const r=ut(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,n,i)}writeLinearRing(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(s),this.writeCoordinates_(s,n,i)}writeMultiSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.surface;s&&e.setAttribute("srsName",s);const l=n.getPolygons();_n({node:e,hasZ:a,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeSurfaceOrPolygonMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))}writeEnvelope(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=["lowerCorner","upperCorner"],o=[n[0]+" "+n[1],n[2]+" "+n[3]];_n({node:e},this.ENVELOPE_SERIALIZERS,_$,o,i,s,this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,n,i){const r=n[n.length-1].node;return ut("http://www.opengis.net/gml",e7e[r.nodeName])}}It.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:We(It.prototype.readFlatCoordinates)}},It.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:It.prototype.innerBoundaryIsParser,outerBoundaryIs:It.prototype.outerBoundaryIsParser}},It.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:st(It.prototype.readFlatCoordinates)}},It.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Box:We(It.prototype.readBox)}},It.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:me(It.prototype.writeCurveOrLineString),MultiCurve:me(It.prototype.writeMultiCurveOrLineString),Point:me(It.prototype.writePoint),MultiPoint:me(It.prototype.writeMultiPoint),LineString:me(It.prototype.writeCurveOrLineString),MultiLineString:me(It.prototype.writeMultiCurveOrLineString),LinearRing:me(It.prototype.writeLinearRing),Polygon:me(It.prototype.writeSurfaceOrPolygon),MultiPolygon:me(It.prototype.writeMultiSurfaceOrPolygon),Surface:me(It.prototype.writeSurfaceOrPolygon),MultiSurface:me(It.prototype.writeMultiSurfaceOrPolygon),Envelope:me(It.prototype.writeEnvelope)}},It.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:me(It.prototype.writeLineStringOrCurveMember),curveMember:me(It.prototype.writeLineStringOrCurveMember)}},It.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:me(It.prototype.writeRing),innerBoundaryIs:me(It.prototype.writeRing)}},It.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:me(It.prototype.writePointMember)}},It.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:me(It.prototype.writeSurfaceOrPolygonMember),polygonMember:me(It.prototype.writeSurfaceOrPolygonMember)}},It.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:me(On),upperCorner:me(On)}};const xg=It,t7e=bs+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",n7e={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class je extends pt{constructor(e){e=e||{},super(e),this.surface_=e.surface!==void 0?e.surface:!1,this.curve_=e.curve!==void 0?e.curve:!1,this.multiCurve_=e.multiCurve!==void 0?e.multiCurve:!0,this.multiSurface_=e.multiSurface!==void 0?e.multiSurface:!0,this.schemaLocation=e.schemaLocation?e.schemaLocation:t7e,this.hasZ=e.hasZ!==void 0?e.hasZ:!1}readMultiCurve(e,n){const i=Vt([],this.MULTICURVE_PARSERS,e,n,this);if(i)return new Yc(i)}readFlatCurveRing(e,n){const i=Vt([],this.MULTICURVE_PARSERS,e,n,this),r=[];for(let a=0,s=i.length;a<s;++a)mi(r,i[a].getFlatCoordinates());return r}readMultiSurface(e,n){const i=Vt([],this.MULTISURFACE_PARSERS,e,n,this);if(i)return new ph(i)}curveMemberParser(e,n){zl(this.CURVEMEMBER_PARSERS,e,n,this)}surfaceMemberParser(e,n){zl(this.SURFACEMEMBER_PARSERS,e,n,this)}readPatch(e,n){return Vt([null],this.PATCHES_PARSERS,e,n,this)}readSegment(e,n){return Vt([],this.SEGMENTS_PARSERS,e,n,this)}readPolygonPatch(e,n){return Vt([null],this.FLAT_LINEAR_RINGS_PARSERS,e,n,this)}readLineStringSegment(e,n){return Vt([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,n,this)}interiorParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);i&&n[n.length-1].push(i)}exteriorParser(e,n){const i=Vt(void 0,this.RING_PARSERS,e,n,this);if(i){const r=n[n.length-1];r[0]=i}}readSurface(e,n){const i=Vt([null],this.SURFACE_PARSERS,e,n,this);if(i&&i[0]){const r=i[0],a=[r.length];let s,o;for(s=1,o=i.length;s<o;++s)mi(r,i[s]),a.push(r.length);return new Bi(r,"XYZ",a)}}readCurve(e,n){const i=Vt([null],this.CURVE_PARSERS,e,n,this);if(i)return new Zt(i,"XYZ")}readEnvelope(e,n){const i=Vt([null],this.ENVELOPE_PARSERS,e,n,this);return _r(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(e,n){let i=_g(e,!1);const r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,a=[];let s;for(;s=r.exec(i);)a.push(parseFloat(s[1])),i=i.substr(s[0].length);if(i!=="")return;const l=n[0].srsName;let h="enu";if(l&&(h=_t(l).getAxisOrientation()),h==="neu"){let c,f;for(c=0,f=a.length;c<f;c+=3){const d=a[c],g=a[c+1];a[c]=g,a[c+1]=d}}const u=a.length;if(u==2&&a.push(0),u!==0)return a}readFlatPosList(e,n){const i=_g(e,!1).replace(/^\s*|\s*$/g,""),r=n[0],a=r.srsName,s=r.srsDimension;let o="enu";a&&(o=_t(a).getAxisOrientation());const l=i.split(/\s+/);let h=2;e.getAttribute("srsDimension")?h=sc(e.getAttribute("srsDimension")):e.getAttribute("dimension")?h=sc(e.getAttribute("dimension")):e.parentNode.getAttribute("srsDimension")?h=sc(e.parentNode.getAttribute("srsDimension")):s&&(h=sc(s));let u,c,f;const d=[];for(let g=0,p=l.length;g<p;g+=h)u=parseFloat(l[g]),c=parseFloat(l[g+1]),f=h===3?parseFloat(l[g+2]):0,o.substr(0,2)==="en"?d.push(u,c,f):d.push(c,u,f);return d}writePos_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=a?"3":"2";e.setAttribute("srsDimension",s);const o=r.srsName;let l="enu";o&&(l=_t(o).getAxisOrientation());const h=n.getCoordinates();let u;if(l.substr(0,2)==="en"?u=h[0]+" "+h[1]:u=h[1]+" "+h[0],a){const c=h[2]||0;u+=" "+c}On(e,u)}getCoords_(e,n,i){let r="enu";n&&(r=_t(n).getAxisOrientation());let a=r.substr(0,2)==="en"?e[0]+" "+e[1]:e[1]+" "+e[0];if(i){const s=e[2]||0;a+=" "+s}return a}writePosList_(e,n,i){const r=i[i.length-1],a=r.hasZ,s=a?"3":"2";e.setAttribute("srsDimension",s);const o=r.srsName,l=n.getCoordinates(),h=l.length,u=new Array(h);let c;for(let f=0;f<h;++f)c=l[f],u[f]=this.getCoords_(c,o,a);On(e,u.join(" "))}writePoint(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=ut(e.namespaceURI,"pos");e.appendChild(s),this.writePos_(s,n,i)}writeEnvelope(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=["lowerCorner","upperCorner"],o=[n[0]+" "+n[1],n[2]+" "+n[3]];_n({node:e},this.ENVELOPE_SERIALIZERS,_$,o,i,s,this)}writeLinearRing(e,n,i){const a=i[i.length-1].srsName;a&&e.setAttribute("srsName",a);const s=ut(e.namespaceURI,"posList");e.appendChild(s),this.writePosList_(s,n,i)}RING_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.node,s=r.exteriorWritten;return s===void 0&&(r.exteriorWritten=!0),ut(a.namespaceURI,s!==void 0?"interior":"exterior")}writeSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName;if(e.nodeName!=="PolygonPatch"&&s&&e.setAttribute("srsName",s),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const o=n.getLinearRings();_n({node:e,hasZ:a,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,o,i,void 0,this)}else if(e.nodeName==="Surface"){const o=ut(e.namespaceURI,"patches");e.appendChild(o),this.writeSurfacePatches_(o,n,i)}}writeCurveOrLineString(e,n,i){const a=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&a&&e.setAttribute("srsName",a),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const s=ut(e.namespaceURI,"posList");e.appendChild(s),this.writePosList_(s,n,i)}else if(e.nodeName==="Curve"){const s=ut(e.namespaceURI,"segments");e.appendChild(s),this.writeCurveSegments_(s,n,i)}}writeMultiSurfaceOrPolygon(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.surface;s&&e.setAttribute("srsName",s);const l=n.getPolygons();_n({node:e,hasZ:a,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeMultiPoint(e,n,i){const r=i[i.length-1],a=r.srsName,s=r.hasZ;a&&e.setAttribute("srsName",a);const o=n.getPoints();_n({node:e,hasZ:s,srsName:a},this.POINTMEMBER_SERIALIZERS,dr("pointMember"),o,i,void 0,this)}writeMultiCurveOrLineString(e,n,i){const r=i[i.length-1],a=r.hasZ,s=r.srsName,o=r.curve;s&&e.setAttribute("srsName",s);const l=n.getLineStrings();_n({node:e,hasZ:a,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,l,i,void 0,this)}writeRing(e,n,i){const r=ut(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,n,i)}writeSurfaceOrPolygonMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))}writePointMember(e,n,i){const r=ut(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,n,i)}writeLineStringOrCurveMember(e,n,i){const r=this.GEOMETRY_NODE_FACTORY_(n,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,n,i))}writeSurfacePatches_(e,n,i){const r=ut(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)}writeCurveSegments_(e,n,i){const r=ut(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,n,i)}writeGeometryElement(e,n,i){const r=i[i.length-1],a=Object.assign({},r);a.node=e;let s;Array.isArray(n)?s=Bm(n,r):s=uf(n,!0,r),_n(a,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}writeFeatureElement(e,n,i){const r=n.getId();r&&e.setAttribute("fid",r);const a=i[i.length-1],s=a.featureNS,o=n.getGeometryName();a.serializers||(a.serializers={},a.serializers[s]={});const l=[],h=[];if(n.hasProperties()){const c=n.getProperties();for(const f in c){const d=c[f];d!==null&&(l.push(f),h.push(d),f==o||typeof d.getSimplifiedGeometry=="function"?f in a.serializers[s]||(a.serializers[s][f]=me(this.writeGeometryElement,this)):f in a.serializers[s]||(a.serializers[s][f]=me(On)))}}const u=Object.assign({},a);u.node=e,_n(u,a.serializers,dr(void 0,s),h,i,l)}writeFeatureMembers_(e,n,i){const r=i[i.length-1],a=r.featureType,s=r.featureNS,o={};o[s]={},o[s][a]=me(this.writeFeatureElement,this);const l=Object.assign({},r);l.node=e,_n(l,o,dr(a,s),n,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,n,i){const r=n[n.length-1].node;return ut(this.namespace,n7e[r.nodeName])}GEOMETRY_NODE_FACTORY_(e,n,i){const r=n[n.length-1],a=r.multiSurface,s=r.surface,o=r.curve,l=r.multiCurve;return Array.isArray(e)?i="Envelope":(i=e.getType(),i==="MultiPolygon"&&a===!0?i="MultiSurface":i==="Polygon"&&s===!0?i="Surface":i==="LineString"&&o===!0?i="Curve":i==="MultiLineString"&&l===!0&&(i="MultiCurve")),ut(this.namespace,i)}writeGeometryNode(e,n){n=this.adaptOptions(n);const i=ut(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return n&&Object.assign(r,n),this.writeGeometryElement(i,e,[r]),i}writeFeaturesNode(e,n){n=this.adaptOptions(n);const i=ut(this.namespace,"featureMembers");i.setAttributeNS(H7,"xsi:schemaLocation",this.schemaLocation);const r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return n&&Object.assign(r,n),this.writeFeatureMembers_(i,e,[r]),i}}je.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:We(je.prototype.readFlatPos),posList:We(je.prototype.readFlatPosList),coordinates:We(xg.prototype.readFlatCoordinates)}},je.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:je.prototype.interiorParser,exterior:je.prototype.exteriorParser}},je.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Surface:We(je.prototype.readSurface),MultiSurface:We(je.prototype.readMultiSurface),Curve:We(je.prototype.readCurve),MultiCurve:We(je.prototype.readMultiCurve),Envelope:We(je.prototype.readEnvelope)}},je.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:st(je.prototype.curveMemberParser),curveMembers:st(je.prototype.curveMemberParser)}},je.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:st(je.prototype.surfaceMemberParser),surfaceMembers:st(je.prototype.surfaceMemberParser)}},je.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:st(pt.prototype.readLineString),Curve:st(je.prototype.readCurve)}},je.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:st(pt.prototype.readPolygon),Surface:st(je.prototype.readSurface)}},je.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:We(je.prototype.readPatch)}},je.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:We(je.prototype.readSegment)}},je.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:st(je.prototype.readFlatPosList),upperCorner:st(je.prototype.readFlatPosList)}},je.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:We(je.prototype.readPolygonPatch)}},je.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:y$(je.prototype.readLineStringSegment)}},pt.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:We(pt.prototype.readFlatLinearRing),Ring:We(je.prototype.readFlatCurveRing)}},je.prototype.writeFeatures,je.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:me(je.prototype.writeRing),interior:me(je.prototype.writeRing)}},je.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:me(On),upperCorner:me(On)}},je.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:me(je.prototype.writeSurfaceOrPolygonMember),polygonMember:me(je.prototype.writeSurfaceOrPolygonMember)}},je.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:me(je.prototype.writePointMember)}},je.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:me(je.prototype.writeLineStringOrCurveMember),curveMember:me(je.prototype.writeLineStringOrCurveMember)}},je.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:me(je.prototype.writeCurveOrLineString),MultiCurve:me(je.prototype.writeMultiCurveOrLineString),Point:me(je.prototype.writePoint),MultiPoint:me(je.prototype.writeMultiPoint),LineString:me(je.prototype.writeCurveOrLineString),MultiLineString:me(je.prototype.writeMultiCurveOrLineString),LinearRing:me(je.prototype.writeLinearRing),Polygon:me(je.prototype.writeSurfaceOrPolygon),MultiPolygon:me(je.prototype.writeMultiSurfaceOrPolygon),Surface:me(je.prototype.writeSurfaceOrPolygon),MultiSurface:me(je.prototype.writeMultiSurfaceOrPolygon),Envelope:me(je.prototype.writeEnvelope)}};const yt=je;class Nt extends yt{constructor(e){e=e||{},super(e),this.schemaLocation=e.schemaLocation?e.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}writeGeometryElement(e,n,i){const r=i[i.length-1];i[i.length-1]=Object.assign({multiCurve:!0,multiSurface:!0},r),super.writeGeometryElement(e,n,i)}}Nt.prototype.namespace="http://www.opengis.net/gml/3.2",Nt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:We(yt.prototype.readFlatPos),posList:We(yt.prototype.readFlatPosList),coordinates:We(xg.prototype.readFlatCoordinates)}},Nt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:yt.prototype.interiorParser,exterior:yt.prototype.exteriorParser}},Nt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:We(pt.prototype.readPoint),MultiPoint:We(pt.prototype.readMultiPoint),LineString:We(pt.prototype.readLineString),MultiLineString:We(pt.prototype.readMultiLineString),LinearRing:We(pt.prototype.readLinearRing),Polygon:We(pt.prototype.readPolygon),MultiPolygon:We(pt.prototype.readMultiPolygon),Surface:We(Nt.prototype.readSurface),MultiSurface:We(yt.prototype.readMultiSurface),Curve:We(Nt.prototype.readCurve),MultiCurve:We(yt.prototype.readMultiCurve),Envelope:We(Nt.prototype.readEnvelope)}},Nt.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:st(yt.prototype.curveMemberParser),curveMembers:st(yt.prototype.curveMemberParser)}},Nt.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:st(yt.prototype.surfaceMemberParser),surfaceMembers:st(yt.prototype.surfaceMemberParser)}},Nt.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:st(pt.prototype.readLineString),Curve:st(yt.prototype.readCurve)}},Nt.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:st(pt.prototype.readPolygon),Surface:st(yt.prototype.readSurface)}},Nt.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:We(yt.prototype.readPatch)}},Nt.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:We(yt.prototype.readSegment)}},Nt.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:st(yt.prototype.readFlatPosList),upperCorner:st(yt.prototype.readFlatPosList)}},Nt.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:We(yt.prototype.readPolygonPatch)}},Nt.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:y$(yt.prototype.readLineStringSegment)}},Nt.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:st(pt.prototype.pointMemberParser),pointMembers:st(pt.prototype.pointMemberParser)}},Nt.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:st(pt.prototype.lineStringMemberParser),lineStringMembers:st(pt.prototype.lineStringMemberParser)}},Nt.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:st(pt.prototype.polygonMemberParser),polygonMembers:st(pt.prototype.polygonMemberParser)}},Nt.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:st(pt.prototype.readFlatCoordinatesFromNode)}},Nt.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:st(pt.prototype.readLineString)}},Nt.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:st(pt.prototype.readPolygon)}},Nt.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:We(pt.prototype.readFlatLinearRing),Ring:We(Nt.prototype.readFlatCurveRing)}},Nt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:me(yt.prototype.writeRing),interior:me(yt.prototype.writeRing)}},Nt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:me(On),upperCorner:me(On)}},Nt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:me(yt.prototype.writeSurfaceOrPolygonMember),polygonMember:me(yt.prototype.writeSurfaceOrPolygonMember)}},Nt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:me(yt.prototype.writePointMember)}},Nt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:me(yt.prototype.writeLineStringOrCurveMember),curveMember:me(yt.prototype.writeLineStringOrCurveMember)}},Nt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:me(yt.prototype.writeCurveOrLineString),MultiCurve:me(yt.prototype.writeMultiCurveOrLineString),Point:me(Nt.prototype.writePoint),MultiPoint:me(yt.prototype.writeMultiPoint),LineString:me(yt.prototype.writeCurveOrLineString),MultiLineString:me(yt.prototype.writeMultiCurveOrLineString),LinearRing:me(yt.prototype.writeLinearRing),Polygon:me(yt.prototype.writeSurfaceOrPolygon),MultiPolygon:me(yt.prototype.writeMultiSurfaceOrPolygon),Surface:me(yt.prototype.writeSurfaceOrPolygon),MultiSurface:me(yt.prototype.writeMultiSurfaceOrPolygon),Envelope:me(yt.prototype.writeEnvelope)}};const X7=Nt;class i7e{constructor(e){this.tagName_=e}getTagName(){return this.tagName_}}const b$=i7e;class r7e extends b${constructor(e,n){super(e),this.conditions=n,tt(this.conditions.length>=2,57)}}const a7e=r7e;class s7e extends a7e{constructor(e){super("And",Array.prototype.slice.call(arguments))}}const o7e=s7e;class l7e extends b${constructor(e,n,i){if(super("BBOX"),this.geometryName=e,this.extent=n,n.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=i}}const h7e=l7e;function u7e(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(o7e,e))}function c7e(t,e,n){return new h7e(t,e,n)}const S$={"http://www.opengis.net/gml":{boundedBy:aa(pt.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:st(pt.prototype.readFeaturesInternal)}},f7e={"http://www.opengis.net/wfs":{totalInserted:aa(ac),totalUpdated:aa(ac),totalDeleted:aa(ac)},"http://www.opengis.net/wfs/2.0":{totalInserted:aa(ac),totalUpdated:aa(ac),totalDeleted:aa(ac)}},d7e={"http://www.opengis.net/wfs":{TransactionSummary:aa(M$,"transactionSummary"),InsertResults:aa(R$,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:aa(M$,"transactionSummary"),InsertResults:aa(R$,"insertIds")}},g7e={"http://www.opengis.net/wfs":{PropertyName:me(On)},"http://www.opengis.net/wfs/2.0":{PropertyName:me(On)}},T$={"http://www.opengis.net/wfs":{Insert:me(I$),Update:me(z$),Delete:me(L$),Property:me(D$),Native:me(k$)},"http://www.opengis.net/wfs/2.0":{Insert:me(I$),Update:me(z$),Delete:me(L$),Property:me(D$),Native:me(k$)}},C$="feature",Y7="http://www.w3.org/2000/xmlns/",K7={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},J7={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Q7={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},A$={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},eb={"2.0.0":X7,"1.1.0":yt,"1.0.0":xg},v7e="1.1.0";class p7e extends w${constructor(e){super(),e=e||{},this.version_=e.version?e.version:v7e,this.featureType_=e.featureType,this.featureNS_=e.featureNS,this.gmlFormat_=e.gmlFormat?e.gmlFormat:new eb[this.version_],this.schemaLocation_=e.schemaLocation?e.schemaLocation:A$[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(e){this.featureType_=e}readFeaturesFromNode(e,n){const i={node:e};Object.assign(i,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(i,this.getReadOptions(e,n||{}));const r=[i];let a;this.version_==="2.0.0"?a=S$:a=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let s=Vt([],a,e,r,this.gmlFormat_);return s||(s=[]),s}readTransactionResponse(e){if(!!e){if(typeof e=="string"){const n=rc(e);return this.readTransactionResponseFromDocument(n)}return ic(e)?this.readTransactionResponseFromDocument(e):this.readTransactionResponseFromNode(e)}}readFeatureCollectionMetadata(e){if(!!e){if(typeof e=="string"){const n=rc(e);return this.readFeatureCollectionMetadataFromDocument(n)}return ic(e)?this.readFeatureCollectionMetadataFromDocument(e):this.readFeatureCollectionMetadataFromNode(e)}}readFeatureCollectionMetadataFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)}readFeatureCollectionMetadataFromNode(e){const n={},i=sc(e.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,Vt(n,S$,e,[],this.gmlFormat_)}readTransactionResponseFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)}readTransactionResponseFromNode(e){return Vt({},d7e,e,[])}writeGetFeature(e){const n=ut(J7[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),e.handle&&n.setAttribute("handle",e.handle),e.outputFormat&&n.setAttribute("outputFormat",e.outputFormat),e.maxFeatures!==void 0&&n.setAttribute("maxFeatures",String(e.maxFeatures)),e.resultType&&n.setAttribute("resultType",e.resultType),e.startIndex!==void 0&&n.setAttribute("startIndex",String(e.startIndex)),e.count!==void 0&&n.setAttribute("count",String(e.count)),e.viewParams!==void 0&&n.setAttribute("viewParams",e.viewParams),n.setAttributeNS(H7,"xsi:schemaLocation",this.schemaLocation_);const i={node:n};if(Object.assign(i,{version:this.version_,srsName:e.srsName,featureNS:e.featureNS?e.featureNS:this.featureNS_,featurePrefix:e.featurePrefix,propertyNames:e.propertyNames?e.propertyNames:[]}),tt(Array.isArray(e.featureTypes),11),typeof e.featureTypes[0]=="string"){let r=e.filter;e.bbox&&(tt(e.geometryName,12),r=this.combineBboxAndFilter(e.geometryName,e.bbox,e.srsName,r)),Object.assign(i,{geometryName:e.geometryName,filter:r}),$$(n,e.featureTypes,[i])}else e.featureTypes.forEach(r=>{const a=this.combineBboxAndFilter(r.geometryName,r.bbox,e.srsName,e.filter);Object.assign(i,{geometryName:r.geometryName,filter:a}),$$(n,[r.name],[i])});return n}combineBboxAndFilter(e,n,i,r){const a=c7e(e,n,i);return r?u7e(r,a):a}writeTransaction(e,n,i,r){const a=[],s=r.version?r.version:this.version_,o=ut(J7[s],"Transaction");o.setAttribute("service","WFS"),o.setAttribute("version",s);let l;r&&(l=r.gmlOptions?r.gmlOptions:{},r.handle&&o.setAttribute("handle",r.handle)),o.setAttributeNS(H7,"xsi:schemaLocation",A$[s]);const h=m7e(o,l,s,r);return e&&K3("Insert",e,a,h),n&&K3("Update",n,a,h),i&&K3("Delete",i,a,h),r.nativeElements&&K3("Native",r.nativeElements,a,h),o}readProjectionFromDocument(e){for(let n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null}readProjectionFromNode(e){if(e.firstElementChild&&e.firstElementChild.firstElementChild){e=e.firstElementChild.firstElementChild;for(let n=e.firstElementChild;n;n=n.nextElementSibling)if(!(n.childNodes.length===0||n.childNodes.length===1&&n.firstChild.nodeType===3)){const i=[{}];return this.gmlFormat_.readGeometryElement(n,i),_t(i.pop().srsName)}}return null}}function m7e(t,e,n,i){const r=i.featurePrefix?i.featurePrefix:C$;let a;return n==="1.0.0"?a=2:n==="1.1.0"?a=3:n==="2.0.0"&&(a=3.2),Object.assign({node:t},{version:n,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:r,gmlVersion:a,hasZ:i.hasZ,srsName:i.srsName},e)}function K3(t,e,n,i){_n(i,T$,dr(t),e,n)}function M$(t,e){return Vt({},f7e,t,e)}const y7e={"http://www.opengis.net/ogc":{FeatureId:st(function(t,e){return t.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:st(function(t,e){return t.getAttribute("fid")})}};function E$(t,e){zl(y7e,t,e)}const _7e={"http://www.opengis.net/wfs":{Feature:E$},"http://www.opengis.net/wfs/2.0":{Feature:E$}};function R$(t,e){return Vt([],_7e,t,e)}function I$(t,e,n){const i=n[n.length-1],r=i.featureType,a=i.featureNS,s=i.gmlVersion,o=ut(a,r);t.appendChild(o),s===2?xg.prototype.writeFeatureElement(o,e,n):s===3?yt.prototype.writeFeatureElement(o,e,n):X7.prototype.writeFeatureElement(o,e,n)}function P$(t,e,n){const r=n[n.length-1].version,a=K7[r],s=ut(a,"Filter"),o=ut(a,"FeatureId");s.appendChild(o),o.setAttribute("fid",e),t.appendChild(s)}function tb(t,e){t=t||C$;const n=t+":";return e.startsWith(n)?e:n+e}function L$(t,e,n){const i=n[n.length-1];tt(e.getId()!==void 0,26);const r=i.featureType,a=i.featurePrefix,s=i.featureNS,o=tb(a,r);t.setAttribute("typeName",o),t.setAttributeNS(Y7,"xmlns:"+a,s);const l=e.getId();l!==void 0&&P$(t,l,n)}function z$(t,e,n){const i=n[n.length-1];tt(e.getId()!==void 0,27);const r=i.version,a=i.featureType,s=i.featurePrefix,o=i.featureNS,l=tb(s,a),h=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(Y7,"xmlns:"+s,o);const u=e.getId();if(u!==void 0){const c=e.getKeys(),f=[];for(let d=0,g=c.length;d<g;d++){const p=e.get(c[d]);if(p!==void 0){let v=c[d];p&&typeof p.getSimplifiedGeometry=="function"&&(v=h),f.push({name:v,value:p})}}_n({version:r,gmlVersion:i.gmlVersion,node:t,hasZ:i.hasZ,srsName:i.srsName},T$,dr("Property"),f,n),P$(t,u,n)}}function D$(t,e,n){const i=n[n.length-1],r=i.version,a=J7[r],s=ut(a,"Name"),o=i.gmlVersion;if(t.appendChild(s),On(s,e.name),e.value!==void 0&&e.value!==null){const l=ut(a,"Value");t.appendChild(l),e.value&&typeof e.value.getSimplifiedGeometry=="function"?o===2?xg.prototype.writeGeometryElement(l,e.value,n):o===3?yt.prototype.writeGeometryElement(l,e.value,n):X7.prototype.writeGeometryElement(l,e.value,n):On(l,e.value)}}function k$(t,e,n){e.vendorId&&t.setAttribute("vendorId",e.vendorId),e.safeToIgnore!==void 0&&t.setAttribute("safeToIgnore",String(e.safeToIgnore)),e.value!==void 0&&On(t,e.value)}const J3={"http://www.opengis.net/wfs":{Query:me(O$)},"http://www.opengis.net/wfs/2.0":{Query:me(O$)},"http://www.opengis.net/ogc":{During:me(B$),And:me(Q3),Or:me(Q3),Not:me(G$),BBOX:me(F$),Contains:me(Co),Intersects:me(Co),Within:me(Co),DWithin:me(N$),PropertyIsEqualTo:me(zr),PropertyIsNotEqualTo:me(zr),PropertyIsLessThan:me(zr),PropertyIsLessThanOrEqualTo:me(zr),PropertyIsGreaterThan:me(zr),PropertyIsGreaterThanOrEqualTo:me(zr),PropertyIsNull:me(j$),PropertyIsBetween:me(U$),PropertyIsLike:me(q$)},"http://www.opengis.net/fes/2.0":{During:me(B$),And:me(Q3),Or:me(Q3),Not:me(G$),BBOX:me(F$),Contains:me(Co),Disjoint:me(Co),Intersects:me(Co),ResourceId:me(w7e),Within:me(Co),DWithin:me(N$),PropertyIsEqualTo:me(zr),PropertyIsNotEqualTo:me(zr),PropertyIsLessThan:me(zr),PropertyIsLessThanOrEqualTo:me(zr),PropertyIsGreaterThan:me(zr),PropertyIsGreaterThanOrEqualTo:me(zr),PropertyIsNull:me(j$),PropertyIsBetween:me(U$),PropertyIsLike:me(q$)}};function O$(t,e,n){const i=n[n.length-1],r=i.version,a=i.featurePrefix,s=i.featureNS,o=i.propertyNames,l=i.srsName;let h;a?h=tb(a,e):h=e;let u;r==="2.0.0"?u="typeNames":u="typeName",t.setAttribute(u,h),l&&t.setAttribute("srsName",l),s&&t.setAttributeNS(Y7,"xmlns:"+a,s);const c=Object.assign({},i);c.node=t,_n(c,g7e,dr("PropertyName"),o,n);const f=i.filter;if(f){const d=ut(np(r),"Filter");t.appendChild(d),x7e(d,f,n)}}function x7e(t,e,n){const i=n[n.length-1],r={node:t};Object.assign(r,{context:i}),_n(r,J3,dr(e.getTagName()),[e],n)}function F$(t,e,n){const i=n[n.length-1],a=i.context.version;i.srsName=e.srsName;const s=eb[a];oc(a,t,e.geometryName),s.prototype.writeGeometryElement(t,e.extent,n)}function w7e(t,e,n){t.setAttribute("rid",e.rid)}function Co(t,e,n){const i=n[n.length-1],a=i.context.version;i.srsName=e.srsName;const s=eb[a];oc(a,t,e.geometryName),s.prototype.writeGeometryElement(t,e.geometry,n)}function N$(t,e,n){const a=n[n.length-1].context.version;Co(t,e,n);const s=ut(np(a),"Distance");On(s,e.distance.toString()),a==="2.0.0"?s.setAttribute("uom",e.unit):s.setAttribute("units",e.unit),t.appendChild(s)}function B$(t,e,n){const a=n[n.length-1].context.version;ep(Q7[a],"ValueReference",t,e.propertyName);const s=ut(bs,"TimePeriod");t.appendChild(s);const o=ut(bs,"begin");s.appendChild(o),V$(o,e.begin);const l=ut(bs,"end");s.appendChild(l),V$(l,e.end)}function Q3(t,e,n){const r=n[n.length-1].context,a={node:t};Object.assign(a,{context:r});const s=e.conditions;for(let o=0,l=s.length;o<l;++o){const h=s[o];_n(a,J3,dr(h.getTagName()),[h],n)}}function G$(t,e,n){const r=n[n.length-1].context,a={node:t};Object.assign(a,{context:r});const s=e.condition;_n(a,J3,dr(s.getTagName()),[s],n)}function zr(t,e,n){const a=n[n.length-1].context.version;e.matchCase!==void 0&&t.setAttribute("matchCase",e.matchCase.toString()),oc(a,t,e.propertyName),tp(a,t,""+e.expression)}function j$(t,e,n){const a=n[n.length-1].context.version;oc(a,t,e.propertyName)}function U$(t,e,n){const a=n[n.length-1].context.version,s=np(a);oc(a,t,e.propertyName);const o=ut(s,"LowerBoundary");t.appendChild(o),tp(a,o,""+e.lowerBoundary);const l=ut(s,"UpperBoundary");t.appendChild(l),tp(a,l,""+e.upperBoundary)}function q$(t,e,n){const a=n[n.length-1].context.version;t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),e.matchCase!==void 0&&t.setAttribute("matchCase",e.matchCase.toString()),oc(a,t,e.propertyName),tp(a,t,""+e.pattern)}function ep(t,e,n,i){const r=ut(t,e);On(r,i),n.appendChild(r)}function tp(t,e,n){ep(np(t),"Literal",e,n)}function oc(t,e,n){t==="2.0.0"?ep(Q7[t],"ValueReference",e,n):ep(K7[t],"PropertyName",e,n)}function V$(t,e){const n=ut(bs,"TimeInstant");t.appendChild(n);const i=ut(bs,"timePosition");n.appendChild(i),On(i,e)}function $$(t,e,n){const i=n[n.length-1],r=Object.assign({},i);r.node=t,_n(r,J3,dr("Query"),e,n)}function np(t){let e;return t==="2.0.0"?e=Q7[t]:e=K7[t],e}const b7e=p7e,S7e={name:"v-gd-route",render(){return null},extends:or,inject:["VMap"],props:{interval:{type:Number,default:1e4},layerId:{type:String,default(){return`traffic-layer-${$e()}`}},colors:{type:Array,default(){return["#4fd27d","#ffd045","#e80e0e","#b40000","#8f979c"]}},url:String},data(){return{source:null,layer:null,eventList:["singleclick","pointermove"],eventRender:[],timer:null}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){return Be(this,null,function*(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.layer.setVisible(t),this.layer&&this.layer.getVisible()&&(yield this.reload())})},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},methods:{getColor(t){switch(t){case t===1:return this.colors[0];case t===2:return this.colors[1];case t===3:return this.colors[2];case t===4:return this.colors[3];case t===-1:return this.colors[4];default:return this.colors[0]}},getData(){return Be(this,null,function*(){const t=new FormData;t.append("f","geojson"),t.append("returnGeometry",!0),t.append("resultRecordCount",5e4);const e=this.map.getView().getZoom();e<12?t.append("where","roadclass in (1,2,3)"):e>=12&&e<17?t.append("where","roadclass in (1,2,3,4)"):e>=17&&t.append("where","roadclass in (1,2,3,5)");const i=this.map.getView().calculateExtent(this.map.getSize()),r=[[i[0],i[1]],[i[2],i[1]],[i[2],i[3]],[i[0],i[3]],[i[0],i[1]]],a={type:"Polygon",coordinates:[r]};return t.append("geometry",JSON.stringify(a)),fetch(this.url,{method:"POST",body:t}).then(s=>s.json()).then(s=>s)})},init(){return Be(this,null,function*(){if(!this.url)return;this.source=new si;const t=Je(De({},this.$props),{source:this.source,style:e=>{const n=e.get("state"),i=this.getColor(Number(n));return new ft({stroke:new Dt({color:i,width:4})})}});this.layer=new Jt(t),this.layer.set("id",this.layerId),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.eventList.forEach(e=>{this.eventRender.push(this.map.on(e,n=>this.eventHandler(e,n)))}),this.map.getView().once("change:resolution",()=>{this.map.once("moveend",e=>{this.zoomEnd(e)})}),this.layer&&this.layer.getVisible()&&(yield this.reload())})},zoomEnd(t){return Be(this,null,function*(){this.layer&&this.layer.getVisible()&&(yield this.renderRoute()),t.map.once("moveend",e=>{this.zoomEnd(e)})})},renderRoute(){return Be(this,null,function*(){const t=yield this.getData(),{featureCount:e}=t;if(e>0){const n=new Ko().readFeatures(t);this.source&&(this.source.clear(),this.source.addFeatures(n))}})},reload(){return Be(this,null,function*(){yield this.renderRoute(),this.timer=setTimeout(()=>Be(this,null,function*(){this.layer&&this.layer.getVisible()&&(yield this.reload())}),this.interval)})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.layer)==null?void 0:i.get("id")))return e},{})},dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.eventRender.forEach(t=>{mr(t)}),this.map.removeLayer(this.layer)}},mounted(){this.init()},beforeDestroy(){this.dispose()}};let T7e,C7e;const H$={};var W$=qn(S7e,T7e,C7e,!1,A7e,null,null,null);function A7e(t){for(let e in H$)this[e]=H$[e]}W$.options.__file="src/components/layers/gd-route/index.vue";const wg=function(){return W$.exports}();wg.install=function(t){t.component(wg.name,wg)};const M7e={name:"v-wfs",render(){return null},extends:or,inject:["VMap"],components:{},props:{layerId:{type:String,default:`vector-layer-${$e()}`},options:{type:Object,default:()=>({})},layerStyle:{type:Object,default:()=>({})}},data(){return{vectorLayer:null,vectorSource:null,eventRender:[],eventList:["singleclick","pointermove"]}},computed:{map(){return this.VMap.map}},watch:{visible:{handler(t){this.vectorLayer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.vectorLayer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.vectorLayer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.vectorLayer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.vectorLayer.setExtent(t)},immediate:!1,deep:!0}},methods:{init(){this.vectorSource=new si,this.vectorLayer=new Jt(Je(De({},this.$props),{source:this.vectorSource,style:t=>Bh(t,this.layerStyle,this.map)})),this.vectorLayer.set("id",this.layerId),this.map.addLayer(this.vectorLayer),this.eventList.forEach(t=>{this.eventRender.push(this.map.on(t,e=>this.eventHandler(t,e)))}),this.addFeatures()},addFeatures(){if(!rt(this.options,"featureNS"))throw new Error("featureNS is required");const t=new b7e().writeGetFeature(Je(De({},this.options),{outputFormat:"application/json"}));fetch(this.options.featureNS,{method:"POST",body:new XMLSerializer().serializeToString(t)}).then(function(e){return e.json()}).then(e=>{const n=new Ko().readFeatures(e);this.vectorSource.addFeatures(n)})},getFeatureAtPixel(t){return this.map.forEachFeatureAtPixel(t,(e,n)=>{var i;if((n==null?void 0:n.get("id"))===((i=this.vectorLayer)==null?void 0:i.get("id")))return e},{})},eventHandler(t,e){const{pixel:n}=e,i=this.getFeatureAtPixel(n);this.$emit(t,e,i)}},created(){},mounted(){this.init()}};let E7e,R7e;const Z$={};var X$=qn(M7e,E7e,R7e,!1,I7e,null,null,null);function I7e(t){for(let e in Z$)this[e]=Z$[e]}X$.options.__file="src/components/layers/wfs/index.vue";const bg=function(){return X$.exports}();bg.install=function(t){t.component(bg.name,bg)};const Y$=[Rf,Ff,Nf,eu,Uf,qf,Zf,Xf,Yf,Kf,Jf,dg,gg,cg,mg,yg,wg,bg],nb=function(t){nb.installed||Y$.forEach(e=>{t.component(e.name,e)})};typeof window!="undefined"&&window.Vue&&nb(window.Vue);const P7e=De({install:nb},Y$);class L7e extends tl{decodeBlock(e){return e}}const z7e=Object.freeze(Object.defineProperty({__proto__:null,default:L7e},Symbol.toStringTag,{value:"Module"})),K$=9,ib=256,rb=257,D7e=12;function k7e(t,e,n){const i=e%8,r=Math.floor(e/8),a=8-i,s=e+n-(r+1)*8;let o=8*(r+2)-(e+n);const l=(r+2)*8-e;if(o=Math.max(0,o),r>=t.length)return rb;let h=t[r]&pr(2,8-i)-1;h<<=n-a;let u=h;if(r+1<t.length){let c=t[r+1]>>>o;c<<=Math.max(0,n-l),u+=c}if(s>8&&r+2<t.length){const c=(r+3)*8-(e+n);u+=t[r+2]>>>c}return u}function ab(t,e){for(let n=e.length-1;n>=0;n--)t.push(e[n]);return t}function O7e(t){const e=new Uint16Array(4093),n=new Uint8Array(4093);for(let g=0;g<=257;g++)e[g]=4096,n[g]=g;let i=258,r=K$,a=0;function s(){i=258,r=K$}function o(g){const p=k7e(g,a,r);return a+=r,p}function l(g,p){return n[i]=p,e[i]=g,i++,i-1}function h(g){const p=[];for(let v=g;v!==4096;v=e[v])p.push(n[v]);return p}const u=[];s();const c=new Uint8Array(t);let f=o(c),d;for(;f!==rb;){if(f===ib){for(s(),f=o(c);f===ib;)f=o(c);if(f===rb)break;if(f>ib)throw new Error(`corrupted code at scanline ${f}`);{const g=h(f);ab(u,g),d=f}}else if(f<i){const g=h(f);ab(u,g),l(d,g[g.length-1]),d=f}else{const g=h(d);if(!g)throw new Error(`Bogus entry. Not in dictionary, ${d} / ${i}, position: ${a}`);ab(u,g),u.push(g[g.length-1]),l(d,g[g.length-1]),d=f}i+1>=pr(2,r)&&(r===D7e?d=void 0:r++),f=o(c)}return new Uint8Array(u)}class F7e extends tl{decodeBlock(e){return O7e(e).buffer}}const N7e=Object.freeze(Object.defineProperty({__proto__:null,default:F7e},Symbol.toStringTag,{value:"Module"})),Sg=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),ip=4017,rp=799,ap=3406,sp=2276,op=1567,lp=3784,lc=5793,hp=2896;function J$(t,e){let n=0;const i=[];let r=16;for(;r>0&&!t[r-1];)--r;i.push({children:[],index:0});let a=i[0],s;for(let o=0;o<r;o++){for(let l=0;l<t[o];l++){for(a=i.pop(),a.children[a.index]=e[n];a.index>0;)a=i.pop();for(a.index++,i.push(a);i.length<=o;)i.push(s={children:[],index:0}),a.children[a.index]=s.children,a=s;n++}o+1<r&&(i.push(s={children:[],index:0}),a.children[a.index]=s.children,a=s)}return i[0].children}function B7e(t,e,n,i,r,a,s,o,l){const{mcusPerLine:h,progressive:u}=n,c=e;let f=e,d=0,g=0;function p(){if(g>0)return g--,d>>g&1;if(d=t[f++],d===255){const N=t[f++];if(N)throw new Error(`unexpected marker: ${(d<<8|N).toString(16)}`)}return g=7,d>>>7}function v(N){let U=N,j;for(;(j=p())!==null;){if(U=U[j],typeof U=="number")return U;if(typeof U!="object")throw new Error("invalid huffman sequence")}return null}function m(N){let U=N,j=0;for(;U>0;){const q=p();if(q===null)return;j=j<<1|q,--U}return j}function y(N){const U=m(N);return U>=1<<N-1?U:U+(-1<<N)+1}function _(N,U){const j=v(N.huffmanTableDC),q=j===0?0:y(j);N.pred+=q,U[0]=N.pred;let V=1;for(;V<64;){const $=v(N.huffmanTableAC),Z=$&15,K=$>>4;if(Z===0){if(K<15)break;V+=16}else{V+=K;const J=Sg[V];U[J]=y(Z),V++}}}function w(N,U){const j=v(N.huffmanTableDC),q=j===0?0:y(j)<<l;N.pred+=q,U[0]=N.pred}function S(N,U){U[0]|=p()<<l}let b=0;function x(N,U){if(b>0){b--;return}let j=a;const q=s;for(;j<=q;){const V=v(N.huffmanTableAC),$=V&15,Z=V>>4;if($===0){if(Z<15){b=m(Z)+(1<<Z)-1;break}j+=16}else{j+=Z;const K=Sg[j];U[K]=y($)*(1<<l),j++}}}let T=0,C;function A(N,U){let j=a;const q=s;let V=0;for(;j<=q;){const $=Sg[j],Z=U[$]<0?-1:1;switch(T){case 0:{const K=v(N.huffmanTableAC),J=K&15;if(V=K>>4,J===0)V<15?(b=m(V)+(1<<V),T=4):(V=16,T=1);else{if(J!==1)throw new Error("invalid ACn encoding");C=y(J),T=V?2:3}continue}case 1:case 2:U[$]?U[$]+=(p()<<l)*Z:(V--,V===0&&(T=T===2?3:0));break;case 3:U[$]?U[$]+=(p()<<l)*Z:(U[$]=C<<l,T=0);break;case 4:U[$]&&(U[$]+=(p()<<l)*Z);break}j++}T===4&&(b--,b===0&&(T=0))}function M(N,U,j,q,V){const $=j/h|0,Z=j%h,K=$*N.v+q,J=Z*N.h+V;U(N,N.blocks[K][J])}function E(N,U,j){const q=j/N.blocksPerLine|0,V=j%N.blocksPerLine;U(N,N.blocks[q][V])}const R=i.length;let P,I,L,D,F,G;u?a===0?G=o===0?w:S:G=o===0?x:A:G=_;let B=0,z,k;R===1?k=i[0].blocksPerLine*i[0].blocksPerColumn:k=h*n.mcusPerColumn;const O=r||k;for(;B<k;){for(I=0;I<R;I++)i[I].pred=0;if(b=0,R===1)for(P=i[0],F=0;F<O;F++)E(P,G,B),B++;else for(F=0;F<O;F++){for(I=0;I<R;I++){P=i[I];const{h:N,v:U}=P;for(L=0;L<U;L++)for(D=0;D<N;D++)M(P,G,B,L,D)}if(B++,B===k)break}if(g=0,z=t[f]<<8|t[f+1],z<65280)throw new Error("marker was not found");if(z>=65488&&z<=65495)f+=2;else break}return f-c}function G7e(t,e){const n=[],{blocksPerLine:i,blocksPerColumn:r}=e,a=i<<3,s=new Int32Array(64),o=new Uint8Array(64);function l(h,u,c){const f=e.quantizationTable;let d,g,p,v,m,y,_,w,S;const b=c;let x;for(x=0;x<64;x++)b[x]=h[x]*f[x];for(x=0;x<8;++x){const T=8*x;if(b[1+T]===0&&b[2+T]===0&&b[3+T]===0&&b[4+T]===0&&b[5+T]===0&&b[6+T]===0&&b[7+T]===0){S=lc*b[0+T]+512>>10,b[0+T]=S,b[1+T]=S,b[2+T]=S,b[3+T]=S,b[4+T]=S,b[5+T]=S,b[6+T]=S,b[7+T]=S;continue}d=lc*b[0+T]+128>>8,g=lc*b[4+T]+128>>8,p=b[2+T],v=b[6+T],m=hp*(b[1+T]-b[7+T])+128>>8,w=hp*(b[1+T]+b[7+T])+128>>8,y=b[3+T]<<4,_=b[5+T]<<4,S=d-g+1>>1,d=d+g+1>>1,g=S,S=p*lp+v*op+128>>8,p=p*op-v*lp+128>>8,v=S,S=m-_+1>>1,m=m+_+1>>1,_=S,S=w+y+1>>1,y=w-y+1>>1,w=S,S=d-v+1>>1,d=d+v+1>>1,v=S,S=g-p+1>>1,g=g+p+1>>1,p=S,S=m*sp+w*ap+2048>>12,m=m*ap-w*sp+2048>>12,w=S,S=y*rp+_*ip+2048>>12,y=y*ip-_*rp+2048>>12,_=S,b[0+T]=d+w,b[7+T]=d-w,b[1+T]=g+_,b[6+T]=g-_,b[2+T]=p+y,b[5+T]=p-y,b[3+T]=v+m,b[4+T]=v-m}for(x=0;x<8;++x){const T=x;if(b[1*8+T]===0&&b[2*8+T]===0&&b[3*8+T]===0&&b[4*8+T]===0&&b[5*8+T]===0&&b[6*8+T]===0&&b[7*8+T]===0){S=lc*c[x+0]+8192>>14,b[0*8+T]=S,b[1*8+T]=S,b[2*8+T]=S,b[3*8+T]=S,b[4*8+T]=S,b[5*8+T]=S,b[6*8+T]=S,b[7*8+T]=S;continue}d=lc*b[0*8+T]+2048>>12,g=lc*b[4*8+T]+2048>>12,p=b[2*8+T],v=b[6*8+T],m=hp*(b[1*8+T]-b[7*8+T])+2048>>12,w=hp*(b[1*8+T]+b[7*8+T])+2048>>12,y=b[3*8+T],_=b[5*8+T],S=d-g+1>>1,d=d+g+1>>1,g=S,S=p*lp+v*op+2048>>12,p=p*op-v*lp+2048>>12,v=S,S=m-_+1>>1,m=m+_+1>>1,_=S,S=w+y+1>>1,y=w-y+1>>1,w=S,S=d-v+1>>1,d=d+v+1>>1,v=S,S=g-p+1>>1,g=g+p+1>>1,p=S,S=m*sp+w*ap+2048>>12,m=m*ap-w*sp+2048>>12,w=S,S=y*rp+_*ip+2048>>12,y=y*ip-_*rp+2048>>12,_=S,b[0*8+T]=d+w,b[7*8+T]=d-w,b[1*8+T]=g+_,b[6*8+T]=g-_,b[2*8+T]=p+y,b[5*8+T]=p-y,b[3*8+T]=v+m,b[4*8+T]=v-m}for(x=0;x<64;++x){const T=128+(b[x]+8>>4);T<0?u[x]=0:T>255?u[x]=255:u[x]=T}}for(let h=0;h<r;h++){const u=h<<3;for(let c=0;c<8;c++)n.push(new Uint8Array(a));for(let c=0;c<i;c++){l(e.blocks[h][c],o,s);let f=0;const d=c<<3;for(let g=0;g<8;g++){const p=n[u+g];for(let v=0;v<8;v++)p[d+v]=o[f++]}}}return n}class j7e{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let n=0;function i(){const o=e[n]<<8|e[n+1];return n+=2,o}function r(){const o=i(),l=e.subarray(n,n+o-2);return n+=l.length,l}function a(o){let l=0,h=0,u,c;for(c in o.components)o.components.hasOwnProperty(c)&&(u=o.components[c],l<u.h&&(l=u.h),h<u.v&&(h=u.v));const f=Math.ceil(o.samplesPerLine/8/l),d=Math.ceil(o.scanLines/8/h);for(c in o.components)if(o.components.hasOwnProperty(c)){u=o.components[c];const g=Math.ceil(Math.ceil(o.samplesPerLine/8)*u.h/l),p=Math.ceil(Math.ceil(o.scanLines/8)*u.v/h),v=f*u.h,m=d*u.v,y=[];for(let _=0;_<m;_++){const w=[];for(let S=0;S<v;S++)w.push(new Int32Array(64));y.push(w)}u.blocksPerLine=g,u.blocksPerColumn=p,u.blocks=y}o.maxH=l,o.maxV=h,o.mcusPerLine=f,o.mcusPerColumn=d}let s=i();if(s!==65496)throw new Error("SOI not found");for(s=i();s!==65497;){switch(s){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const o=r();s===65504&&o[0]===74&&o[1]===70&&o[2]===73&&o[3]===70&&o[4]===0&&(this.jfif={version:{major:o[5],minor:o[6]},densityUnits:o[7],xDensity:o[8]<<8|o[9],yDensity:o[10]<<8|o[11],thumbWidth:o[12],thumbHeight:o[13],thumbData:o.subarray(14,14+3*o[12]*o[13])}),s===65518&&o[0]===65&&o[1]===100&&o[2]===111&&o[3]===98&&o[4]===101&&o[5]===0&&(this.adobe={version:o[6],flags0:o[7]<<8|o[8],flags1:o[9]<<8|o[10],transformCode:o[11]});break}case 65499:{const l=i()+n-2;for(;n<l;){const h=e[n++],u=new Int32Array(64);if(h>>4===0)for(let c=0;c<64;c++){const f=Sg[c];u[f]=e[n++]}else if(h>>4===1)for(let c=0;c<64;c++){const f=Sg[c];u[f]=i()}else throw new Error("DQT: invalid table spec");this.quantizationTables[h&15]=u}break}case 65472:case 65473:case 65474:{i();const o={extended:s===65473,progressive:s===65474,precision:e[n++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},l=e[n++];let h;for(let u=0;u<l;u++){h=e[n];const c=e[n+1]>>4,f=e[n+1]&15,d=e[n+2];o.componentsOrder.push(h),o.components[h]={h:c,v:f,quantizationIdx:d},n+=3}a(o),this.frames.push(o);break}case 65476:{const o=i();for(let l=2;l<o;){const h=e[n++],u=new Uint8Array(16);let c=0;for(let d=0;d<16;d++,n++)u[d]=e[n],c+=u[d];const f=new Uint8Array(c);for(let d=0;d<c;d++,n++)f[d]=e[n];l+=17+c,h>>4===0?this.huffmanTablesDC[h&15]=J$(u,f):this.huffmanTablesAC[h&15]=J$(u,f)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const o=e[n++],l=[],h=this.frames[0];for(let g=0;g<o;g++){const p=h.components[e[n++]],v=e[n++];p.huffmanTableDC=this.huffmanTablesDC[v>>4],p.huffmanTableAC=this.huffmanTablesAC[v&15],l.push(p)}const u=e[n++],c=e[n++],f=e[n++];n+=B7e(e,n,h,l,this.resetInterval,u,c,f>>4,f&15);break}case 65535:e[n]!==255&&n--;break;default:if(e[n-3]===255&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}throw new Error(`unknown JPEG marker ${s.toString(16)}`)}s=i()}}getResult(){const{frames:e}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1;for(let u=0;u<this.frames.length;u++){const c=this.frames[u].components;for(const f of Object.keys(c))c[f].quantizationTable=this.quantizationTables[c[f].quantizationIdx],delete c[f].quantizationIdx}const n=e[0],{components:i,componentsOrder:r}=n,a=[],s=n.samplesPerLine,o=n.scanLines;for(let u=0;u<r.length;u++){const c=i[r[u]];a.push({lines:G7e(n,c),scaleX:c.h/n.maxH,scaleY:c.v/n.maxV})}const l=new Uint8Array(s*o*a.length);let h=0;for(let u=0;u<o;++u)for(let c=0;c<s;++c)for(let f=0;f<a.length;++f){const d=a[f];l[h]=d.lines[0|u*d.scaleY][0|c*d.scaleX],++h}return l}}class U7e extends tl{constructor(e){super(),this.reader=new j7e,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}const q7e=Object.freeze(Object.defineProperty({__proto__:null,default:U7e},Symbol.toStringTag,{value:"Module"}));/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const V7e=4,Q$=0,eH=1,$7e=2;function hc(t){let e=t.length;for(;--e>=0;)t[e]=0}const H7e=0,tH=1,W7e=2,Z7e=3,X7e=258,sb=29,Tg=256,Cg=Tg+1+sb,uc=30,ob=19,nH=2*Cg+1,Dl=15,lb=16,Y7e=7,hb=256,iH=16,rH=17,aH=18,ub=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),up=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),K7e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),sH=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),J7e=512,Ss=new Array((Cg+2)*2);hc(Ss);const Ag=new Array(uc*2);hc(Ag);const Mg=new Array(J7e);hc(Mg);const Eg=new Array(X7e-Z7e+1);hc(Eg);const cb=new Array(sb);hc(cb);const cp=new Array(uc);hc(cp);function fb(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let oH,lH,hH;function db(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const uH=t=>t<256?Mg[t]:Mg[256+(t>>>7)],Rg=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},Ki=(t,e,n)=>{t.bi_valid>lb-n?(t.bi_buf|=e<<t.bi_valid&65535,Rg(t,t.bi_buf),t.bi_buf=e>>lb-t.bi_valid,t.bi_valid+=n-lb):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},ja=(t,e,n)=>{Ki(t,n[e*2],n[e*2+1])},cH=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},Q7e=t=>{t.bi_valid===16?(Rg(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},ebe=(t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,u,c,f,d,g,p=0;for(f=0;f<=Dl;f++)t.bl_count[f]=0;for(n[t.heap[t.heap_max]*2+1]=0,h=t.heap_max+1;h<nH;h++)u=t.heap[h],f=n[n[u*2+1]*2+1]+1,f>l&&(f=l,p++),n[u*2+1]=f,!(u>i)&&(t.bl_count[f]++,d=0,u>=o&&(d=s[u-o]),g=n[u*2],t.opt_len+=g*(f+d),a&&(t.static_len+=g*(r[u*2+1]+d)));if(p!==0){do{for(f=l-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(f=l;f!==0;f--)for(u=t.bl_count[f];u!==0;)c=t.heap[--h],!(c>i)&&(n[c*2+1]!==f&&(t.opt_len+=(f-n[c*2+1])*n[c*2],n[c*2+1]=f),u--)}},fH=(t,e,n)=>{const i=new Array(Dl+1);let r=0,a,s;for(a=1;a<=Dl;a++)r=r+n[a-1]<<1,i[a]=r;for(s=0;s<=e;s++){let o=t[s*2+1];o!==0&&(t[s*2]=cH(i[o]++,o))}},tbe=()=>{let t,e,n,i,r;const a=new Array(Dl+1);for(n=0,i=0;i<sb-1;i++)for(cb[i]=n,t=0;t<1<<ub[i];t++)Eg[n++]=i;for(Eg[n-1]=i,r=0,i=0;i<16;i++)for(cp[i]=r,t=0;t<1<<up[i];t++)Mg[r++]=i;for(r>>=7;i<uc;i++)for(cp[i]=r<<7,t=0;t<1<<up[i]-7;t++)Mg[256+r++]=i;for(e=0;e<=Dl;e++)a[e]=0;for(t=0;t<=143;)Ss[t*2+1]=8,t++,a[8]++;for(;t<=255;)Ss[t*2+1]=9,t++,a[9]++;for(;t<=279;)Ss[t*2+1]=7,t++,a[7]++;for(;t<=287;)Ss[t*2+1]=8,t++,a[8]++;for(fH(Ss,Cg+1,a),t=0;t<uc;t++)Ag[t*2+1]=5,Ag[t*2]=cH(t,5);oH=new fb(Ss,ub,Tg+1,Cg,Dl),lH=new fb(Ag,up,0,uc,Dl),hH=new fb(new Array(0),K7e,0,ob,Y7e)},dH=t=>{let e;for(e=0;e<Cg;e++)t.dyn_ltree[e*2]=0;for(e=0;e<uc;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ob;e++)t.bl_tree[e*2]=0;t.dyn_ltree[hb*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},gH=t=>{t.bi_valid>8?Rg(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},vH=(t,e,n,i)=>{const r=e*2,a=n*2;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]},gb=(t,e,n)=>{const i=t.heap[n];let r=n<<1;for(;r<=t.heap_len&&(r<t.heap_len&&vH(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!vH(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i},pH=(t,e,n)=>{let i,r,a=0,s,o;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+a++]&255,i+=(t.pending_buf[t.sym_buf+a++]&255)<<8,r=t.pending_buf[t.sym_buf+a++],i===0?ja(t,r,e):(s=Eg[r],ja(t,s+Tg+1,e),o=ub[s],o!==0&&(r-=cb[s],Ki(t,r,o)),i--,s=uH(i),ja(t,s,n),o=up[s],o!==0&&(i-=cp[s],Ki(t,i,o)));while(a<t.sym_next);ja(t,hb,e)},vb=(t,e)=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,a=e.stat_desc.elems;let s,o,l=-1,h;for(t.heap_len=0,t.heap_max=nH,s=0;s<a;s++)n[s*2]!==0?(t.heap[++t.heap_len]=l=s,t.depth[s]=0):n[s*2+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=l<2?++l:0,n[h*2]=1,t.depth[h]=0,t.opt_len--,r&&(t.static_len-=i[h*2+1]);for(e.max_code=l,s=t.heap_len>>1;s>=1;s--)gb(t,n,s);h=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],gb(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,n[h*2]=n[s*2]+n[o*2],t.depth[h]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,n[s*2+1]=n[o*2+1]=h,t.heap[1]=h++,gb(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],ebe(t,e),fH(n,l,t.bl_count)},mH=(t,e,n)=>{let i,r=-1,a,s=e[0*2+1],o=0,l=7,h=4;for(s===0&&(l=138,h=3),e[(n+1)*2+1]=65535,i=0;i<=n;i++)a=s,s=e[(i+1)*2+1],!(++o<l&&a===s)&&(o<h?t.bl_tree[a*2]+=o:a!==0?(a!==r&&t.bl_tree[a*2]++,t.bl_tree[iH*2]++):o<=10?t.bl_tree[rH*2]++:t.bl_tree[aH*2]++,o=0,r=a,s===0?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4))},yH=(t,e,n)=>{let i,r=-1,a,s=e[0*2+1],o=0,l=7,h=4;for(s===0&&(l=138,h=3),i=0;i<=n;i++)if(a=s,s=e[(i+1)*2+1],!(++o<l&&a===s)){if(o<h)do ja(t,a,t.bl_tree);while(--o!==0);else a!==0?(a!==r&&(ja(t,a,t.bl_tree),o--),ja(t,iH,t.bl_tree),Ki(t,o-3,2)):o<=10?(ja(t,rH,t.bl_tree),Ki(t,o-3,3)):(ja(t,aH,t.bl_tree),Ki(t,o-11,7));o=0,r=a,s===0?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4)}},nbe=t=>{let e;for(mH(t,t.dyn_ltree,t.l_desc.max_code),mH(t,t.dyn_dtree,t.d_desc.max_code),vb(t,t.bl_desc),e=ob-1;e>=3&&t.bl_tree[sH[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},ibe=(t,e,n,i)=>{let r;for(Ki(t,e-257,5),Ki(t,n-1,5),Ki(t,i-4,4),r=0;r<i;r++)Ki(t,t.bl_tree[sH[r]*2+1],3);yH(t,t.dyn_ltree,e-1),yH(t,t.dyn_dtree,n-1)},rbe=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return Q$;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return eH;for(n=32;n<Tg;n++)if(t.dyn_ltree[n*2]!==0)return eH;return Q$};let _H=!1;const abe=t=>{_H||(tbe(),_H=!0),t.l_desc=new db(t.dyn_ltree,oH),t.d_desc=new db(t.dyn_dtree,lH),t.bl_desc=new db(t.bl_tree,hH),t.bi_buf=0,t.bi_valid=0,dH(t)},xH=(t,e,n,i)=>{Ki(t,(H7e<<1)+(i?1:0),3),gH(t),Rg(t,n),Rg(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},sbe=t=>{Ki(t,tH<<1,3),ja(t,hb,Ss),Q7e(t)},obe=(t,e,n,i)=>{let r,a,s=0;t.level>0?(t.strm.data_type===$7e&&(t.strm.data_type=rbe(t)),vb(t,t.l_desc),vb(t,t.d_desc),s=nbe(t),r=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=r&&(r=a)):r=a=n+5,n+4<=r&&e!==-1?xH(t,e,n,i):t.strategy===V7e||a===r?(Ki(t,(tH<<1)+(i?1:0),3),pH(t,Ss,Ag)):(Ki(t,(W7e<<1)+(i?1:0),3),ibe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),pH(t,t.dyn_ltree,t.dyn_dtree)),dH(t),i&&gH(t)},lbe=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(Eg[n]+Tg+1)*2]++,t.dyn_dtree[uH(e)*2]++),t.sym_next===t.sym_end);var hbe=abe,ube=xH,cbe=obe,fbe=lbe,dbe=sbe,gbe={_tr_init:hbe,_tr_stored_block:ube,_tr_flush_block:cbe,_tr_tally:fbe,_tr_align:dbe},Ig=(t,e,n,i)=>{let r=t&65535|0,a=t>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do r=r+e[i++]|0,a=a+r|0;while(--s);r%=65521,a%=65521}return r|a<<16|0};const vbe=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},pbe=new Uint32Array(vbe());var ti=(t,e,n,i)=>{const r=pbe,a=i+n;t^=-1;for(let s=i;s<a;s++)t=t>>>8^r[(t^e[s])&255];return t^-1},cc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pg={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:mbe,_tr_stored_block:pb,_tr_flush_block:ybe,_tr_tally:Ao,_tr_align:_be}=gbe,{Z_NO_FLUSH:Mo,Z_PARTIAL_FLUSH:xbe,Z_FULL_FLUSH:wbe,Z_FINISH:Dr,Z_BLOCK:wH,Z_OK:vi,Z_STREAM_END:bH,Z_STREAM_ERROR:Ua,Z_DATA_ERROR:bbe,Z_BUF_ERROR:mb,Z_DEFAULT_COMPRESSION:Sbe,Z_FILTERED:Tbe,Z_HUFFMAN_ONLY:fp,Z_RLE:Cbe,Z_FIXED:Abe,Z_DEFAULT_STRATEGY:Mbe,Z_UNKNOWN:Ebe,Z_DEFLATED:dp}=Pg,Rbe=9,Ibe=15,Pbe=8,Lbe=29,yb=256+1+Lbe,zbe=30,Dbe=19,kbe=2*yb+1,Obe=15,Pt=3,Eo=258,qa=Eo+Pt+1,Fbe=32,fc=42,_b=57,xb=69,wb=73,bb=91,Sb=103,kl=113,Lg=666,zi=1,dc=2,Ol=3,gc=4,Nbe=3,Fl=(t,e)=>(t.msg=cc[e],e),SH=t=>t*2-(t>4?9:0),Ro=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Bbe=t=>{let e,n,i,r=t.w_size;e=t.hash_size,i=e;do n=t.head[--i],t.head[i]=n>=r?n-r:0;while(--e);e=r,i=e;do n=t.prev[--i],t.prev[i]=n>=r?n-r:0;while(--e)};let Io=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const gr=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},vr=(t,e)=>{ybe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gr(t.strm)},jt=(t,e)=>{t.pending_buf[t.pending++]=e},zg=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Tb=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),r===0?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),t.state.wrap===1?t.adler=Ig(t.adler,e,r,n):t.state.wrap===2&&(t.adler=ti(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},TH=(t,e)=>{let n=t.max_chain_length,i=t.strstart,r,a,s=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-qa?t.strstart-(t.w_size-qa):0,h=t.window,u=t.w_mask,c=t.prev,f=t.strstart+Eo;let d=h[i+s-1],g=h[i+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(r=e,!(h[r+s]!==g||h[r+s-1]!==d||h[r]!==h[i]||h[++r]!==h[i+1])){i+=2,r++;do;while(h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&h[++i]===h[++r]&&i<f);if(a=Eo-(f-i),i=f-Eo,a>s){if(t.match_start=e,s=a,a>=o)break;d=h[i+s-1],g=h[i+s]}}while((e=c[e&u])>l&&--n!==0);return s<=t.lookahead?s:t.lookahead},vc=t=>{const e=t.w_size;let n,i,r;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-qa)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Bbe(t),i+=e),t.strm.avail_in===0)break;if(n=Tb(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=Pt)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=Io(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=Io(t,t.ins_h,t.window[r+Pt-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<Pt)););}while(t.lookahead<qa&&t.strm.avail_in!==0)},CH=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,r,a,s=0,o=t.strm.avail_in;do{if(i=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,r=t.strstart-t.block_start,i>r+t.strm.avail_in&&(i=r+t.strm.avail_in),i>a&&(i=a),i<n&&(i===0&&e!==Dr||e===Mo||i!==r+t.strm.avail_in)))break;s=e===Dr&&i===r+t.strm.avail_in?1:0,pb(t,0,0,s),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,gr(t.strm),r&&(r>i&&(r=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,i-=r),i&&(Tb(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(s===0);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?gc:e!==Mo&&e!==Dr&&t.strm.avail_in===0&&t.strstart===t.block_start?dc:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Tb(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,n=a>t.w_size?t.w_size:a,r=t.strstart-t.block_start,(r>=n||(r||e===Dr)&&e!==Mo&&t.strm.avail_in===0&&r<=a)&&(i=r>a?a:r,s=e===Dr&&t.strm.avail_in===0&&i===r?1:0,pb(t,t.block_start,i,s),t.block_start+=i,gr(t.strm)),s?Ol:zi)},Cb=(t,e)=>{let n,i;for(;;){if(t.lookahead<qa){if(vc(t),t.lookahead<qa&&e===Mo)return zi;if(t.lookahead===0)break}if(n=0,t.lookahead>=Pt&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-qa&&(t.match_length=TH(t,n)),t.match_length>=Pt)if(i=Ao(t,t.strstart-t.match_start,t.match_length-Pt),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Pt){t.match_length--;do t.strstart++,t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Io(t,t.ins_h,t.window[t.strstart+1]);else i=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=t.strstart<Pt-1?t.strstart:Pt-1,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},pc=(t,e)=>{let n,i,r;for(;;){if(t.lookahead<qa){if(vc(t),t.lookahead<qa&&e===Mo)return zi;if(t.lookahead===0)break}if(n=0,t.lookahead>=Pt&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Pt-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-qa&&(t.match_length=TH(t,n),t.match_length<=5&&(t.strategy===Tbe||t.match_length===Pt&&t.strstart-t.match_start>4096)&&(t.match_length=Pt-1)),t.prev_length>=Pt&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-Pt,i=Ao(t,t.strstart-1-t.prev_match,t.prev_length-Pt),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=r&&(t.ins_h=Io(t,t.ins_h,t.window[t.strstart+Pt-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Pt-1,t.strstart++,i&&(vr(t,!1),t.strm.avail_out===0))return zi}else if(t.match_available){if(i=Ao(t,0,t.window[t.strstart-1]),i&&vr(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return zi}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Ao(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Pt-1?t.strstart:Pt-1,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},Gbe=(t,e)=>{let n,i,r,a;const s=t.window;for(;;){if(t.lookahead<=Eo){if(vc(t),t.lookahead<=Eo&&e===Mo)return zi;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Pt&&t.strstart>0&&(r=t.strstart-1,i=s[r],i===s[++r]&&i===s[++r]&&i===s[++r])){a=t.strstart+Eo;do;while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<a);t.match_length=Eo-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Pt?(n=Ao(t,1,t.match_length-Pt),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc},jbe=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(vc(t),t.lookahead===0)){if(e===Mo)return zi;break}if(t.match_length=0,n=Ao(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(vr(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Dr?(vr(t,!0),t.strm.avail_out===0?Ol:gc):t.sym_next&&(vr(t,!1),t.strm.avail_out===0)?zi:dc};function Va(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const Dg=[new Va(0,0,0,0,CH),new Va(4,4,8,4,Cb),new Va(4,5,16,8,Cb),new Va(4,6,32,32,Cb),new Va(4,4,16,16,pc),new Va(8,16,32,32,pc),new Va(8,16,128,128,pc),new Va(8,32,128,256,pc),new Va(32,128,258,1024,pc),new Va(32,258,258,4096,pc)],Ube=t=>{t.window_size=2*t.w_size,Ro(t.head),t.max_lazy_match=Dg[t.level].max_lazy,t.good_match=Dg[t.level].good_length,t.nice_match=Dg[t.level].nice_length,t.max_chain_length=Dg[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Pt-1,t.match_available=0,t.ins_h=0};function qbe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dp,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(kbe*2),this.dyn_dtree=new Uint16Array((2*zbe+1)*2),this.bl_tree=new Uint16Array((2*Dbe+1)*2),Ro(this.dyn_ltree),Ro(this.dyn_dtree),Ro(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Obe+1),this.heap=new Uint16Array(2*yb+1),Ro(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*yb+1),Ro(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const kg=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==fc&&e.status!==_b&&e.status!==xb&&e.status!==wb&&e.status!==bb&&e.status!==Sb&&e.status!==kl&&e.status!==Lg?1:0},AH=t=>{if(kg(t))return Fl(t,Ua);t.total_in=t.total_out=0,t.data_type=Ebe;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?_b:e.wrap?fc:kl,t.adler=e.wrap===2?0:1,e.last_flush=-2,mbe(e),vi},MH=t=>{const e=AH(t);return e===vi&&Ube(t.state),e},Vbe=(t,e)=>kg(t)||t.state.wrap!==2?Ua:(t.state.gzhead=e,vi),EH=(t,e,n,i,r,a)=>{if(!t)return Ua;let s=1;if(e===Sbe&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>Rbe||n!==dp||i<8||i>15||e<0||e>9||a<0||a>Abe||i===8&&s!==1)return Fl(t,Ua);i===8&&(i=9);const o=new qbe;return t.state=o,o.strm=t,o.status=fc,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Pt-1)/Pt),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=a,o.method=n,MH(t)},$be=(t,e)=>EH(t,e,dp,Ibe,Pbe,Mbe),Hbe=(t,e)=>{if(kg(t)||e>wH||e<0)return t?Fl(t,Ua):Ua;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===Lg&&e!==Dr)return Fl(t,t.avail_out===0?mb:Ua);const i=n.last_flush;if(n.last_flush=e,n.pending!==0){if(gr(t),t.avail_out===0)return n.last_flush=-1,vi}else if(t.avail_in===0&&SH(e)<=SH(i)&&e!==Dr)return Fl(t,mb);if(n.status===Lg&&t.avail_in!==0)return Fl(t,mb);if(n.status===fc&&n.wrap===0&&(n.status=kl),n.status===fc){let r=dp+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=fp||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,r|=a<<6,n.strstart!==0&&(r|=Fbe),r+=31-r%31,zg(n,r),n.strstart!==0&&(zg(n,t.adler>>>16),zg(n,t.adler&65535)),t.adler=1,n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(n.status===_b){if(t.adler=0,jt(n,31),jt(n,139),jt(n,8),n.gzhead)jt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),jt(n,n.gzhead.time&255),jt(n,n.gzhead.time>>8&255),jt(n,n.gzhead.time>>16&255),jt(n,n.gzhead.time>>24&255),jt(n,n.level===9?2:n.strategy>=fp||n.level<2?4:0),jt(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(jt(n,n.gzhead.extra.length&255),jt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=ti(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=xb;else if(jt(n,0),jt(n,0),jt(n,0),jt(n,0),jt(n,0),jt(n,n.level===9?2:n.strategy>=fp||n.level<2?4:0),jt(n,Nbe),n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(n.status===xb){if(n.gzhead.extra){let r=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex+=o,gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0,a-=o}let s=new Uint8Array(n.gzhead.extra);n.pending_buf.set(s.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=wb}if(n.status===wb){if(n.gzhead.name){let r=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,jt(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=bb}if(n.status===bb){if(n.gzhead.comment){let r=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r)),gr(t),n.pending!==0)return n.last_flush=-1,vi;r=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,jt(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>r&&(t.adler=ti(t.adler,n.pending_buf,n.pending-r,r))}n.status=Sb}if(n.status===Sb){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(gr(t),n.pending!==0))return n.last_flush=-1,vi;jt(n,t.adler&255),jt(n,t.adler>>8&255),t.adler=0}if(n.status=kl,gr(t),n.pending!==0)return n.last_flush=-1,vi}if(t.avail_in!==0||n.lookahead!==0||e!==Mo&&n.status!==Lg){let r=n.level===0?CH(n,e):n.strategy===fp?jbe(n,e):n.strategy===Cbe?Gbe(n,e):Dg[n.level].func(n,e);if((r===Ol||r===gc)&&(n.status=Lg),r===zi||r===Ol)return t.avail_out===0&&(n.last_flush=-1),vi;if(r===dc&&(e===xbe?_be(n):e!==wH&&(pb(n,0,0,!1),e===wbe&&(Ro(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),gr(t),t.avail_out===0))return n.last_flush=-1,vi}return e!==Dr?vi:n.wrap<=0?bH:(n.wrap===2?(jt(n,t.adler&255),jt(n,t.adler>>8&255),jt(n,t.adler>>16&255),jt(n,t.adler>>24&255),jt(n,t.total_in&255),jt(n,t.total_in>>8&255),jt(n,t.total_in>>16&255),jt(n,t.total_in>>24&255)):(zg(n,t.adler>>>16),zg(n,t.adler&65535)),gr(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?vi:bH)},Wbe=t=>{if(kg(t))return Ua;const e=t.state.status;return t.state=null,e===kl?Fl(t,bbe):vi},Zbe=(t,e)=>{let n=e.length;if(kg(t))return Ua;const i=t.state,r=i.wrap;if(r===2||r===1&&i.status!==fc||i.lookahead)return Ua;if(r===1&&(t.adler=Ig(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){r===0&&(Ro(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(e.subarray(n-i.w_size,n),0),e=l,n=i.w_size}const a=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,vc(i);i.lookahead>=Pt;){let l=i.strstart,h=i.lookahead-(Pt-1);do i.ins_h=Io(i,i.ins_h,i.window[l+Pt-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--h);i.strstart=l,i.lookahead=Pt-1,vc(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Pt-1,i.match_available=0,t.next_in=s,t.input=o,t.avail_in=a,i.wrap=r,vi};var Xbe=$be,Ybe=EH,Kbe=MH,Jbe=AH,Qbe=Vbe,eSe=Hbe,tSe=Wbe,nSe=Zbe,iSe="pako deflate (from Nodeca project)",Og={deflateInit:Xbe,deflateInit2:Ybe,deflateReset:Kbe,deflateResetKeep:Jbe,deflateSetHeader:Qbe,deflate:eSe,deflateEnd:tSe,deflateSetDictionary:nSe,deflateInfo:iSe};const rSe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var aSe=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)rSe(n,i)&&(t[i]=n[i])}}return t},sSe=t=>{let e=0;for(let i=0,r=t.length;i<r;i++)e+=t[i].length;const n=new Uint8Array(e);for(let i=0,r=0,a=t.length;i<a;i++){let s=t[i];n.set(s,r),r+=s.length}return n},gp={assign:aSe,flattenChunks:sSe};let RH=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){RH=!1}const Fg=new Uint8Array(256);for(let t=0;t<256;t++)Fg[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Fg[254]=Fg[254]=1;var oSe=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,i,r,a,s=t.length,o=0;for(r=0;r<s;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(o),a=0,r=0;a<o;r++)n=t.charCodeAt(r),(n&64512)===55296&&r+1<s&&(i=t.charCodeAt(r+1),(i&64512)===56320&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const lSe=(t,e)=>{if(e<65534&&t.subarray&&RH)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n};var hSe=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,r;const a=new Array(n*2);for(r=0,i=0;i<n;){let s=t[i++];if(s<128){a[r++]=s;continue}let o=Fg[s];if(o>4){a[r++]=65533,i+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&i<n;)s=s<<6|t[i++]&63,o--;if(o>1){a[r++]=65533;continue}s<65536?a[r++]=s:(s-=65536,a[r++]=55296|s>>10&1023,a[r++]=56320|s&1023)}return lSe(a,r)},uSe=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+Fg[t[n]]>e?n:e},Ng={string2buf:oSe,buf2string:hSe,utf8border:uSe};function cSe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var IH=cSe;const PH=Object.prototype.toString,{Z_NO_FLUSH:fSe,Z_SYNC_FLUSH:dSe,Z_FULL_FLUSH:gSe,Z_FINISH:vSe,Z_OK:vp,Z_STREAM_END:pSe,Z_DEFAULT_COMPRESSION:mSe,Z_DEFAULT_STRATEGY:ySe,Z_DEFLATED:_Se}=Pg;function Ab(t){this.options=gp.assign({level:mSe,method:_Se,chunkSize:16384,windowBits:15,memLevel:8,strategy:ySe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new IH,this.strm.avail_out=0;let n=Og.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==vp)throw new Error(cc[n]);if(e.header&&Og.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Ng.string2buf(e.dictionary):PH.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,n=Og.deflateSetDictionary(this.strm,i),n!==vp)throw new Error(cc[n]);this._dict_set=!0}}Ab.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?vSe:fSe,typeof t=="string"?n.input=Ng.string2buf(t):PH.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(a===dSe||a===gSe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Og.deflate(n,a),r===pSe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Og.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===vp;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Ab.prototype.onData=function(t){this.chunks.push(t)},Ab.prototype.onEnd=function(t){t===vp&&(this.result=gp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const pp=16209,xSe=16191;var wSe=function(e,n){let i,r,a,s,o,l,h,u,c,f,d,g,p,v,m,y,_,w,S,b,x,T,C,A;const M=e.state;i=e.next_in,C=e.input,r=i+(e.avail_in-5),a=e.next_out,A=e.output,s=a-(n-e.avail_out),o=a+(e.avail_out-257),l=M.dmax,h=M.wsize,u=M.whave,c=M.wnext,f=M.window,d=M.hold,g=M.bits,p=M.lencode,v=M.distcode,m=(1<<M.lenbits)-1,y=(1<<M.distbits)-1;e:do{g<15&&(d+=C[i++]<<g,g+=8,d+=C[i++]<<g,g+=8),_=p[d&m];t:for(;;){if(w=_>>>24,d>>>=w,g-=w,w=_>>>16&255,w===0)A[a++]=_&65535;else if(w&16){S=_&65535,w&=15,w&&(g<w&&(d+=C[i++]<<g,g+=8),S+=d&(1<<w)-1,d>>>=w,g-=w),g<15&&(d+=C[i++]<<g,g+=8,d+=C[i++]<<g,g+=8),_=v[d&y];n:for(;;){if(w=_>>>24,d>>>=w,g-=w,w=_>>>16&255,w&16){if(b=_&65535,w&=15,g<w&&(d+=C[i++]<<g,g+=8,g<w&&(d+=C[i++]<<g,g+=8)),b+=d&(1<<w)-1,b>l){e.msg="invalid distance too far back",M.mode=pp;break e}if(d>>>=w,g-=w,w=a-s,b>w){if(w=b-w,w>u&&M.sane){e.msg="invalid distance too far back",M.mode=pp;break e}if(x=0,T=f,c===0){if(x+=h-w,w<S){S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}}else if(c<w){if(x+=h+c-w,w-=c,w<S){S-=w;do A[a++]=f[x++];while(--w);if(x=0,c<S){w=c,S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}}}else if(x+=c-w,w<S){S-=w;do A[a++]=f[x++];while(--w);x=a-b,T=A}for(;S>2;)A[a++]=T[x++],A[a++]=T[x++],A[a++]=T[x++],S-=3;S&&(A[a++]=T[x++],S>1&&(A[a++]=T[x++]))}else{x=a-b;do A[a++]=A[x++],A[a++]=A[x++],A[a++]=A[x++],S-=3;while(S>2);S&&(A[a++]=A[x++],S>1&&(A[a++]=A[x++]))}}else if((w&64)===0){_=v[(_&65535)+(d&(1<<w)-1)];continue n}else{e.msg="invalid distance code",M.mode=pp;break e}break}}else if((w&64)===0){_=p[(_&65535)+(d&(1<<w)-1)];continue t}else if(w&32){M.mode=xSe;break e}else{e.msg="invalid literal/length code",M.mode=pp;break e}break}}while(i<r&&a<o);S=g>>3,i-=S,g-=S<<3,d&=(1<<g)-1,e.next_in=i,e.next_out=a,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=a<o?257+(o-a):257-(a-o),M.hold=d,M.bits=g};const mc=15,LH=852,zH=592,DH=0,Mb=1,kH=2,bSe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),SSe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),TSe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),CSe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Bg=(t,e,n,i,r,a,s,o)=>{const l=o.bits;let h=0,u=0,c=0,f=0,d=0,g=0,p=0,v=0,m=0,y=0,_,w,S,b,x,T=null,C;const A=new Uint16Array(mc+1),M=new Uint16Array(mc+1);let E=null,R,P,I;for(h=0;h<=mc;h++)A[h]=0;for(u=0;u<i;u++)A[e[n+u]]++;for(d=l,f=mc;f>=1&&A[f]===0;f--);if(d>f&&(d=f),f===0)return r[a++]=1<<24|64<<16|0,r[a++]=1<<24|64<<16|0,o.bits=1,0;for(c=1;c<f&&A[c]===0;c++);for(d<c&&(d=c),v=1,h=1;h<=mc;h++)if(v<<=1,v-=A[h],v<0)return-1;if(v>0&&(t===DH||f!==1))return-1;for(M[1]=0,h=1;h<mc;h++)M[h+1]=M[h]+A[h];for(u=0;u<i;u++)e[n+u]!==0&&(s[M[e[n+u]]++]=u);if(t===DH?(T=E=s,C=20):t===Mb?(T=bSe,E=SSe,C=257):(T=TSe,E=CSe,C=0),y=0,u=0,h=c,x=a,g=d,p=0,S=-1,m=1<<d,b=m-1,t===Mb&&m>LH||t===kH&&m>zH)return 1;for(;;){R=h-p,s[u]+1<C?(P=0,I=s[u]):s[u]>=C?(P=E[s[u]-C],I=T[s[u]-C]):(P=32+64,I=0),_=1<<h-p,w=1<<g,c=w;do w-=_,r[x+(y>>p)+w]=R<<24|P<<16|I|0;while(w!==0);for(_=1<<h-1;y&_;)_>>=1;if(_!==0?(y&=_-1,y+=_):y=0,u++,--A[h]===0){if(h===f)break;h=e[n+s[u]]}if(h>d&&(y&b)!==S){for(p===0&&(p=d),x+=c,g=h-p,v=1<<g;g+p<f&&(v-=A[g+p],!(v<=0));)g++,v<<=1;if(m+=1<<g,t===Mb&&m>LH||t===kH&&m>zH)return 1;S=y&b,r[S]=d<<24|g<<16|x-a|0}}return y!==0&&(r[x+y]=h-p<<24|64<<16|0),o.bits=d,0};const ASe=0,OH=1,FH=2,{Z_FINISH:NH,Z_BLOCK:MSe,Z_TREES:mp,Z_OK:Nl,Z_STREAM_END:ESe,Z_NEED_DICT:RSe,Z_STREAM_ERROR:kr,Z_DATA_ERROR:BH,Z_MEM_ERROR:GH,Z_BUF_ERROR:ISe,Z_DEFLATED:jH}=Pg,yp=16180,UH=16181,qH=16182,VH=16183,$H=16184,HH=16185,WH=16186,ZH=16187,XH=16188,YH=16189,_p=16190,Ts=16191,Eb=16192,KH=16193,Rb=16194,JH=16195,QH=16196,eW=16197,tW=16198,xp=16199,wp=16200,nW=16201,iW=16202,rW=16203,aW=16204,sW=16205,Ib=16206,oW=16207,lW=16208,un=16209,hW=16210,uW=16211,PSe=852,LSe=592,zSe=15,cW=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function DSe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Bl=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<yp||e.mode>uW?1:0},fW=t=>{if(Bl(t))return kr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=yp,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(PSe),e.distcode=e.distdyn=new Int32Array(LSe),e.sane=1,e.back=-1,Nl},dW=t=>{if(Bl(t))return kr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,fW(t)},gW=(t,e)=>{let n;if(Bl(t))return kr;const i=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kr:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,dW(t))},vW=(t,e)=>{if(!t)return kr;const n=new DSe;t.state=n,n.strm=t,n.window=null,n.mode=yp;const i=gW(t,e);return i!==Nl&&(t.state=null),i},kSe=t=>vW(t,zSe);let pW=!0,Pb,Lb;const OSe=t=>{if(pW){Pb=new Int32Array(512),Lb=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Bg(OH,t.lens,0,288,Pb,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Bg(FH,t.lens,0,32,Lb,0,t.work,{bits:5}),pW=!1}t.lencode=Pb,t.lenbits=9,t.distcode=Lb,t.distbits=5},mW=(t,e,n,i)=>{let r;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(e.subarray(n-i,n-i+r),a.wnext),i-=r,i?(a.window.set(e.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0},FSe=(t,e)=>{let n,i,r,a,s,o,l,h,u,c,f,d,g,p,v=0,m,y,_,w,S,b,x,T;const C=new Uint8Array(4);let A,M;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Bl(t)||!t.output||!t.input&&t.avail_in!==0)return kr;n=t.state,n.mode===Ts&&(n.mode=Eb),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,u=n.bits,c=o,f=l,T=Nl;e:for(;;)switch(n.mode){case yp:if(n.wrap===0){n.mode=Eb;break}for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0),h=0,u=0,n.mode=UH;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=un;break}if((h&15)!==jH){t.msg="unknown compression method",n.mode=un;break}if(h>>>=4,u-=4,x=(h&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){t.msg="invalid window size",n.mode=un;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=h&512?YH:Ts,h=0,u=0;break;case UH:for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.flags=h,(n.flags&255)!==jH){t.msg="unknown compression method",n.mode=un;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=un;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0,n.mode=qH;case qH:for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,C[2]=h>>>16&255,C[3]=h>>>24&255,n.check=ti(n.check,C,4,0)),h=0,u=0,n.mode=VH;case VH:for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0,n.mode=$H;case $H:if(n.flags&1024){for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(C[0]=h&255,C[1]=h>>>8&255,n.check=ti(n.check,C,2,0)),h=0,u=0}else n.head&&(n.head.extra=null);n.mode=HH;case HH:if(n.flags&1024&&(d=n.length,d>o&&(d=o),d&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+d),x)),n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=WH;case WH:if(n.flags&2048){if(o===0)break e;d=0;do x=i[a+d++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&d<o);if(n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=ZH;case ZH:if(n.flags&4096){if(o===0)break e;d=0;do x=i[a+d++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&d<o);if(n.flags&512&&n.wrap&4&&(n.check=ti(n.check,i,d,a)),o-=d,a+=d,x)break e}else n.head&&(n.head.comment=null);n.mode=XH;case XH:if(n.flags&512){for(;u<16;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&4&&h!==(n.check&65535)){t.msg="header crc mismatch",n.mode=un;break}h=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Ts;break;case YH:for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}t.adler=n.check=cW(h),h=0,u=0,n.mode=_p;case _p:if(n.havedict===0)return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,RSe;t.adler=n.check=1,n.mode=Ts;case Ts:if(e===MSe||e===mp)break e;case Eb:if(n.last){h>>>=u&7,u-=u&7,n.mode=Ib;break}for(;u<3;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}switch(n.last=h&1,h>>>=1,u-=1,h&3){case 0:n.mode=KH;break;case 1:if(OSe(n),n.mode=xp,e===mp){h>>>=2,u-=2;break e}break;case 2:n.mode=QH;break;case 3:t.msg="invalid block type",n.mode=un}h>>>=2,u-=2;break;case KH:for(h>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=un;break}if(n.length=h&65535,h=0,u=0,n.mode=Rb,e===mp)break e;case Rb:n.mode=JH;case JH:if(d=n.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;r.set(i.subarray(a,a+d),s),o-=d,a+=d,l-=d,s+=d,n.length-=d;break}n.mode=Ts;break;case QH:for(;u<14;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.nlen=(h&31)+257,h>>>=5,u-=5,n.ndist=(h&31)+1,h>>>=5,u-=5,n.ncode=(h&15)+4,h>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=un;break}n.have=0,n.mode=eW;case eW:for(;n.have<n.ncode;){for(;u<3;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.lens[E[n.have++]]=h&7,h>>>=3,u-=3}for(;n.have<19;)n.lens[E[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},T=Bg(ASe,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,T){t.msg="invalid code lengths set",n.mode=un;break}n.have=0,n.mode=tW;case tW:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[h&(1<<n.lenbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(_<16)h>>>=m,u-=m,n.lens[n.have++]=_;else{if(_===16){for(M=m+2;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(h>>>=m,u-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=un;break}x=n.lens[n.have-1],d=3+(h&3),h>>>=2,u-=2}else if(_===17){for(M=m+3;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=3+(h&7),h>>>=3,u-=3}else{for(M=m+7;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=11+(h&127),h>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=un;break}for(;d--;)n.lens[n.have++]=x}}if(n.mode===un)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=un;break}if(n.lenbits=9,A={bits:n.lenbits},T=Bg(OH,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,T){t.msg="invalid literal/lengths set",n.mode=un;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},T=Bg(FH,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,T){t.msg="invalid distances set",n.mode=un;break}if(n.mode=xp,e===mp)break e;case xp:n.mode=wp;case wp:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,wSe(t,f),s=t.next_out,r=t.output,l=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,h=n.hold,u=n.bits,n.mode===Ts&&(n.back=-1);break}for(n.back=0;v=n.lencode[h&(1<<n.lenbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(y&&(y&240)===0){for(w=m,S=y,b=_;v=n.lencode[b+((h&(1<<w+S)-1)>>w)],m=v>>>24,y=v>>>16&255,_=v&65535,!(w+m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=w,u-=w,n.back+=w}if(h>>>=m,u-=m,n.back+=m,n.length=_,y===0){n.mode=sW;break}if(y&32){n.back=-1,n.mode=Ts;break}if(y&64){t.msg="invalid literal/length code",n.mode=un;break}n.extra=y&15,n.mode=nW;case nW:if(n.extra){for(M=n.extra;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=iW;case iW:for(;v=n.distcode[h&(1<<n.distbits)-1],m=v>>>24,y=v>>>16&255,_=v&65535,!(m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if((y&240)===0){for(w=m,S=y,b=_;v=n.distcode[b+((h&(1<<w+S)-1)>>w)],m=v>>>24,y=v>>>16&255,_=v&65535,!(w+m<=u);){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}h>>>=w,u-=w,n.back+=w}if(h>>>=m,u-=m,n.back+=m,y&64){t.msg="invalid distance code",n.mode=un;break}n.offset=_,n.extra=y&15,n.mode=rW;case rW:if(n.extra){for(M=n.extra;u<M;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=un;break}n.mode=aW;case aW:if(l===0)break e;if(d=f-l,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=un;break}d>n.wnext?(d-=n.wnext,g=n.wsize-d):g=n.wnext-d,d>n.length&&(d=n.length),p=n.window}else p=r,g=s-n.offset,d=n.length;d>l&&(d=l),l-=d,n.length-=d;do r[s++]=p[g++];while(--d);n.length===0&&(n.mode=wp);break;case sW:if(l===0)break e;r[s++]=n.length,l--,n.mode=wp;break;case Ib:if(n.wrap){for(;u<32;){if(o===0)break e;o--,h|=i[a++]<<u,u+=8}if(f-=l,t.total_out+=f,n.total+=f,n.wrap&4&&f&&(t.adler=n.check=n.flags?ti(n.check,r,f,s-f):Ig(n.check,r,f,s-f)),f=l,n.wrap&4&&(n.flags?h:cW(h))!==n.check){t.msg="incorrect data check",n.mode=un;break}h=0,u=0}n.mode=oW;case oW:if(n.wrap&&n.flags){for(;u<32;){if(o===0)break e;o--,h+=i[a++]<<u,u+=8}if(n.wrap&4&&h!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=un;break}h=0,u=0}n.mode=lW;case lW:T=ESe;break e;case un:T=BH;break e;case hW:return GH;case uW:default:return kr}return t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=h,n.bits=u,(n.wsize||f!==t.avail_out&&n.mode<un&&(n.mode<Ib||e!==NH))&&mW(t,t.output,t.next_out,f-t.avail_out),c-=t.avail_in,f-=t.avail_out,t.total_in+=c,t.total_out+=f,n.total+=f,n.wrap&4&&f&&(t.adler=n.check=n.flags?ti(n.check,r,f,t.next_out-f):Ig(n.check,r,f,t.next_out-f)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Ts?128:0)+(n.mode===xp||n.mode===Rb?256:0),(c===0&&f===0||e===NH)&&T===Nl&&(T=ISe),T},NSe=t=>{if(Bl(t))return kr;let e=t.state;return e.window&&(e.window=null),t.state=null,Nl},BSe=(t,e)=>{if(Bl(t))return kr;const n=t.state;return(n.wrap&2)===0?kr:(n.head=e,e.done=!1,Nl)},GSe=(t,e)=>{const n=e.length;let i,r,a;return Bl(t)||(i=t.state,i.wrap!==0&&i.mode!==_p)?kr:i.mode===_p&&(r=1,r=Ig(r,e,n,0),r!==i.check)?BH:(a=mW(t,e,n,n),a?(i.mode=hW,GH):(i.havedict=1,Nl))};var jSe=dW,USe=gW,qSe=fW,VSe=kSe,$Se=vW,HSe=FSe,WSe=NSe,ZSe=BSe,XSe=GSe,YSe="pako inflate (from Nodeca project)",Cs={inflateReset:jSe,inflateReset2:USe,inflateResetKeep:qSe,inflateInit:VSe,inflateInit2:$Se,inflate:HSe,inflateEnd:WSe,inflateGetHeader:ZSe,inflateSetDictionary:XSe,inflateInfo:YSe};function KSe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var JSe=KSe;const yW=Object.prototype.toString,{Z_NO_FLUSH:QSe,Z_FINISH:eTe,Z_OK:Gg,Z_STREAM_END:zb,Z_NEED_DICT:Db,Z_STREAM_ERROR:tTe,Z_DATA_ERROR:_W,Z_MEM_ERROR:nTe}=Pg;function jg(t){this.options=gp.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new IH,this.strm.avail_out=0;let n=Cs.inflateInit2(this.strm,e.windowBits);if(n!==Gg)throw new Error(cc[n]);if(this.header=new JSe,Cs.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ng.string2buf(e.dictionary):yW.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Cs.inflateSetDictionary(this.strm,e.dictionary),n!==Gg)))throw new Error(cc[n])}jg.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,s,o;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?eTe:QSe,yW.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=Cs.inflate(n,s),a===Db&&r&&(a=Cs.inflateSetDictionary(n,r),a===Gg?a=Cs.inflate(n,s):a===_W&&(a=Db));n.avail_in>0&&a===zb&&n.state.wrap>0&&t[n.next_in]!==0;)Cs.inflateReset(n),a=Cs.inflate(n,s);switch(a){case tTe:case _W:case Db:case nTe:return this.onEnd(a),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||a===zb))if(this.options.to==="string"){let l=Ng.utf8border(n.output,n.next_out),h=n.next_out-l,u=Ng.buf2string(n.output,l);n.next_out=h,n.avail_out=i-h,h&&n.output.set(n.output.subarray(l,l+h),0),this.onData(u)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Gg&&o===0)){if(a===zb)return a=Cs.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},jg.prototype.onData=function(t){this.chunks.push(t)},jg.prototype.onEnd=function(t){t===Gg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=gp.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function kb(t,e){const n=new jg(e);if(n.push(t),n.err)throw n.msg||cc[n.err];return n.result}function iTe(t,e){return e=e||{},e.raw=!0,kb(t,e)}var rTe=jg,aTe=kb,sTe=iTe,oTe=kb,lTe=Pg,hTe={Inflate:rTe,inflate:aTe,inflateRaw:sTe,ungzip:oTe,constants:lTe};const{Inflate:aCe,inflate:uTe,inflateRaw:sCe,ungzip:oCe}=hTe;var xW=uTe;class cTe extends tl{decodeBlock(e){return xW(new Uint8Array(e)).buffer}}const fTe=Object.freeze(Object.defineProperty({__proto__:null,default:cTe},Symbol.toStringTag,{value:"Module"}));class dTe extends tl{decodeBlock(e){const n=new DataView(e),i=[];for(let r=0;r<e.byteLength;++r){let a=n.getInt8(r);if(a<0){const s=n.getUint8(r+1);a=-a;for(let o=0;o<=a;++o)i.push(s);r+=1}else{for(let s=0;s<=a;++s)i.push(n.getUint8(r+s+1));r+=a+1}}return new Uint8Array(i).buffer}}const gTe=Object.freeze(Object.defineProperty({__proto__:null,default:dTe},Symbol.toStringTag,{value:"Module"}));var wW={exports:{}};(function(t){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var a={};a.defaultNoDataValue=-34027999387901484e22,a.decode=function(c,f){f=f||{};var d=f.encodedMaskData||f.encodedMaskData===null,g=h(c,f.inputOffset||0,d),p=f.noDataValue!==null?f.noDataValue:a.defaultNoDataValue,v=s(g,f.pixelType||Float32Array,f.encodedMaskData,p,f.returnMask),m={width:g.width,height:g.height,pixelData:v.resultPixels,minValue:v.minValue,maxValue:g.pixels.maxValue,noDataValue:p};return v.resultMask&&(m.maskData=v.resultMask),f.returnEncodedMask&&g.mask&&(m.encodedMaskData=g.mask.bitset?g.mask.bitset:null),f.returnFileInfo&&(m.fileInfo=o(g),f.computeUsedBitDepths&&(m.fileInfo.bitDepths=l(g))),m};var s=function(c,f,d,g,p){var v=0,m=c.pixels.numBlocksX,y=c.pixels.numBlocksY,_=Math.floor(c.width/m),w=Math.floor(c.height/y),S=2*c.maxZError,b=Number.MAX_VALUE,x;d=d||(c.mask?c.mask.bitset:null);var T,C;T=new f(c.width*c.height),p&&d&&(C=new Uint8Array(c.width*c.height));for(var A=new Float32Array(_*w),M,E,R=0;R<=y;R++){var P=R!==y?w:c.height%y;if(P!==0)for(var I=0;I<=m;I++){var L=I!==m?_:c.width%m;if(L!==0){var D=R*c.width*w+I*_,F=c.width-L,G=c.pixels.blocks[v],B,z,k;G.encoding<2?(G.encoding===0?B=G.rawData:(u(G.stuffedData,G.bitsPerPixel,G.numValidPixels,G.offset,S,A,c.pixels.maxValue),B=A),z=0):G.encoding===2?k=0:k=G.offset;var O;if(d)for(E=0;E<P;E++){for(D&7&&(O=d[D>>3],O<<=D&7),M=0;M<L;M++)D&7||(O=d[D>>3]),O&128?(C&&(C[D]=1),x=G.encoding<2?B[z++]:k,b=b>x?x:b,T[D++]=x):(C&&(C[D]=0),T[D++]=g),O<<=1;D+=F}else if(G.encoding<2)for(E=0;E<P;E++){for(M=0;M<L;M++)x=B[z++],b=b>x?x:b,T[D++]=x;D+=F}else for(b=b>k?k:b,E=0;E<P;E++){for(M=0;M<L;M++)T[D++]=k;D+=F}if(G.encoding===1&&z!==G.numValidPixels)throw"Block and Mask do not match";v++}}}return{resultPixels:T,resultMask:C,minValue:b}},o=function(c){return{fileIdentifierString:c.fileIdentifierString,fileVersion:c.fileVersion,imageType:c.imageType,height:c.height,width:c.width,maxZError:c.maxZError,eofOffset:c.eofOffset,mask:c.mask?{numBlocksX:c.mask.numBlocksX,numBlocksY:c.mask.numBlocksY,numBytes:c.mask.numBytes,maxValue:c.mask.maxValue}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,numBytes:c.pixels.numBytes,maxValue:c.pixels.maxValue,noDataValue:c.noDataValue}}},l=function(c){for(var f=c.pixels.numBlocksX*c.pixels.numBlocksY,d={},g=0;g<f;g++){var p=c.pixels.blocks[g];p.encoding===0?d.float32=!0:p.encoding===1?d[p.bitsPerPixel]=!0:d[0]=!0}return Object.keys(d)},h=function(c,f,d){var g={},p=new Uint8Array(c,f,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,p),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;f+=10;var v=new DataView(c,f,24);if(g.fileVersion=v.getInt32(0,!0),g.imageType=v.getInt32(4,!0),g.height=v.getUint32(8,!0),g.width=v.getUint32(12,!0),g.maxZError=v.getFloat64(16,!0),f+=24,!d)if(v=new DataView(c,f,16),g.mask={},g.mask.numBlocksY=v.getUint32(0,!0),g.mask.numBlocksX=v.getUint32(4,!0),g.mask.numBytes=v.getUint32(8,!0),g.mask.maxValue=v.getFloat32(12,!0),f+=16,g.mask.numBytes>0){var m=new Uint8Array(Math.ceil(g.width*g.height/8));v=new DataView(c,f,g.mask.numBytes);var y=v.getInt16(0,!0),_=2,w=0;do{if(y>0)for(;y--;)m[w++]=v.getUint8(_++);else{var S=v.getUint8(_++);for(y=-y;y--;)m[w++]=S}y=v.getInt16(_,!0),_+=2}while(_<g.mask.numBytes);if(y!==-32768||w<m.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=m,f+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));v=new DataView(c,f,16),g.pixels={},g.pixels.numBlocksY=v.getUint32(0,!0),g.pixels.numBlocksX=v.getUint32(4,!0),g.pixels.numBytes=v.getUint32(8,!0),g.pixels.maxValue=v.getFloat32(12,!0),f+=16;var b=g.pixels.numBlocksX,x=g.pixels.numBlocksY,T=b+(g.width%b>0?1:0),C=x+(g.height%x>0?1:0);g.pixels.blocks=new Array(T*C);for(var A=0,M=0;M<C;M++)for(var E=0;E<T;E++){var R=0,P=c.byteLength-f;v=new DataView(c,f,Math.min(10,P));var I={};g.pixels.blocks[A++]=I;var L=v.getUint8(0);if(R++,I.encoding=L&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){f++;continue}if(L!==0&&L!==2){if(L>>=6,I.offsetType=L,L===2)I.offset=v.getInt8(1),R++;else if(L===1)I.offset=v.getInt16(1,!0),R+=2;else if(L===0)I.offset=v.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(I.encoding===1)if(L=v.getUint8(R),R++,I.bitsPerPixel=L&63,L>>=6,I.numValidPixelsType=L,L===2)I.numValidPixels=v.getUint8(R),R++;else if(L===1)I.numValidPixels=v.getUint16(R,!0),R+=2;else if(L===0)I.numValidPixels=v.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(f+=R,I.encoding!==3){var D,F;if(I.encoding===0){var G=(g.pixels.numBytes-1)/4;if(G!==Math.floor(G))throw"uncompressed block has invalid length";D=new ArrayBuffer(G*4),F=new Uint8Array(D),F.set(new Uint8Array(c,f,G*4));var B=new Float32Array(D);I.rawData=B,f+=G*4}else if(I.encoding===1){var z=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),k=Math.ceil(z/4);D=new ArrayBuffer(k*4),F=new Uint8Array(D),F.set(new Uint8Array(c,f,z)),I.stuffedData=new Uint32Array(D),f+=z}}}return g.eofOffset=f,g},u=function(c,f,d,g,p,v,m){var y=(1<<f)-1,_=0,w,S=0,b,x,T=Math.ceil((m-g)/p),C=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*C,w=0;w<d;w++){if(S===0&&(x=c[_++],S=32),S>=f)b=x>>>S-f&y,S-=f;else{var A=f-S;b=(x&y)<<A&y,x=c[_++],S=32-A,b+=x>>>S}v[w]=b<T?g+b*p:m}return v};return a}(),n=function(){var a={unstuff:function(h,u,c,f,d,g,p,v){var m=(1<<c)-1,y=0,_,w=0,S,b,x,T,C=h.length*4-Math.ceil(c*f/8);if(h[h.length-1]<<=8*C,d)for(_=0;_<f;_++)w===0&&(b=h[y++],w=32),w>=c?(S=b>>>w-c&m,w-=c):(x=c-w,S=(b&m)<<x&m,b=h[y++],w=32-x,S+=b>>>w),u[_]=d[S];else for(T=Math.ceil((v-g)/p),_=0;_<f;_++)w===0&&(b=h[y++],w=32),w>=c?(S=b>>>w-c&m,w-=c):(x=c-w,S=(b&m)<<x&m,b=h[y++],w=32-x,S+=b>>>w),u[_]=S<T?g+S*p:v},unstuffLUT:function(h,u,c,f,d,g){var p=(1<<u)-1,v=0,m=0,y=0,_=0,w=0,S,b=[],x=h.length*4-Math.ceil(u*c/8);h[h.length-1]<<=8*x;var T=Math.ceil((g-f)/d);for(m=0;m<c;m++)_===0&&(S=h[v++],_=32),_>=u?(w=S>>>_-u&p,_-=u):(y=u-_,w=(S&p)<<y&p,S=h[v++],_=32-y,w+=S>>>_),b[m]=w<T?f+w*d:g;return b.unshift(f),b},unstuff2:function(h,u,c,f,d,g,p,v){var m=(1<<c)-1,y=0,_,w=0,S=0,b,x,T;if(d)for(_=0;_<f;_++)w===0&&(x=h[y++],w=32,S=0),w>=c?(b=x>>>S&m,w-=c,S+=c):(T=c-w,b=x>>>S&m,x=h[y++],w=32-T,b|=(x&(1<<T)-1)<<c-T,S=T),u[_]=d[b];else{var C=Math.ceil((v-g)/p);for(_=0;_<f;_++)w===0&&(x=h[y++],w=32,S=0),w>=c?(b=x>>>S&m,w-=c,S+=c):(T=c-w,b=x>>>S&m,x=h[y++],w=32-T,b|=(x&(1<<T)-1)<<c-T,S=T),u[_]=b<C?g+b*p:v}return u},unstuffLUT2:function(h,u,c,f,d,g){var p=(1<<u)-1,v=0,m=0,y=0,_=0,w=0,S=0,b,x=[],T=Math.ceil((g-f)/d);for(m=0;m<c;m++)_===0&&(b=h[v++],_=32,S=0),_>=u?(w=b>>>S&p,_-=u,S+=u):(y=u-_,w=b>>>S&p,b=h[v++],_=32-y,w|=(b&(1<<y)-1)<<u-y,S=y),x[m]=w<T?f+w*d:g;return x.unshift(f),x},originalUnstuff:function(h,u,c,f){var d=(1<<c)-1,g=0,p,v=0,m,y,_,w=h.length*4-Math.ceil(c*f/8);for(h[h.length-1]<<=8*w,p=0;p<f;p++)v===0&&(y=h[g++],v=32),v>=c?(m=y>>>v-c&d,v-=c):(_=c-v,m=(y&d)<<_&d,y=h[g++],v=32-_,m+=y>>>v),u[p]=m;return u},originalUnstuff2:function(h,u,c,f){var d=(1<<c)-1,g=0,p,v=0,m=0,y,_,w;for(p=0;p<f;p++)v===0&&(_=h[g++],v=32,m=0),v>=c?(y=_>>>m&d,v-=c,m+=c):(w=c-v,y=_>>>m&d,_=h[g++],v=32-w,y|=(_&(1<<w)-1)<<c-w,m=w),u[p]=y;return u}},s={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(h){for(var u=65535,c=65535,f=h.length,d=Math.floor(f/2),g=0;d;){var p=d>=359?359:d;d-=p;do u+=h[g++]<<8,c+=u+=h[g++];while(--p);u=(u&65535)+(u>>>16),c=(c&65535)+(c>>>16)}return f&1&&(c+=u+=h[g]<<8),u=(u&65535)+(u>>>16),c=(c&65535)+(c>>>16),(c<<16|u)>>>0},readHeaderInfo:function(h,u){var c=u.ptr,f=new Uint8Array(h,c,6),d={};if(d.fileIdentifierString=String.fromCharCode.apply(null,f),d.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+d.fileIdentifierString;c+=6;var g=new DataView(h,c,8),p=g.getInt32(0,!0);d.fileVersion=p,c+=4,p>=3&&(d.checksum=g.getUint32(4,!0),c+=4),g=new DataView(h,c,12),d.height=g.getUint32(0,!0),d.width=g.getUint32(4,!0),c+=8,p>=4?(d.numDims=g.getUint32(8,!0),c+=4):d.numDims=1,g=new DataView(h,c,40),d.numValidPixel=g.getUint32(0,!0),d.microBlockSize=g.getInt32(4,!0),d.blobSize=g.getInt32(8,!0),d.imageType=g.getInt32(12,!0),d.maxZError=g.getFloat64(16,!0),d.zMin=g.getFloat64(24,!0),d.zMax=g.getFloat64(32,!0),c+=40,u.headerInfo=d,u.ptr=c;var v,m;if(p>=3&&(m=p>=4?52:48,v=this.computeChecksumFletcher32(new Uint8Array(h,c-m,d.blobSize-14)),v!==d.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(h,u){var c=u.headerInfo,f=this.getDataTypeArray(c.imageType),d=c.numDims*this.getDataTypeSize(c.imageType),g=this.readSubArray(h,u.ptr,f,d),p=this.readSubArray(h,u.ptr+d,f,d);u.ptr+=2*d;var v,m=!0;for(v=0;v<c.numDims;v++)if(g[v]!==p[v]){m=!1;break}return c.minValues=g,c.maxValues=p,m},readSubArray:function(h,u,c,f){var d;if(c===Uint8Array)d=new Uint8Array(h,u,f);else{var g=new ArrayBuffer(f),p=new Uint8Array(g);p.set(new Uint8Array(h,u,f)),d=new c(g)}return d},readMask:function(h,u){var c=u.ptr,f=u.headerInfo,d=f.width*f.height,g=f.numValidPixel,p=new DataView(h,c,4),v={};if(v.numBytes=p.getUint32(0,!0),c+=4,(g===0||d===g)&&v.numBytes!==0)throw"invalid mask";var m,y;if(g===0)m=new Uint8Array(Math.ceil(d/8)),v.bitset=m,y=new Uint8Array(d),u.pixels.resultMask=y,c+=v.numBytes;else if(v.numBytes>0){m=new Uint8Array(Math.ceil(d/8)),p=new DataView(h,c,v.numBytes);var _=p.getInt16(0,!0),w=2,S=0,b=0;do{if(_>0)for(;_--;)m[S++]=p.getUint8(w++);else for(b=p.getUint8(w++),_=-_;_--;)m[S++]=b;_=p.getInt16(w,!0),w+=2}while(w<v.numBytes);if(_!==-32768||S<m.length)throw"Unexpected end of mask RLE encoding";y=new Uint8Array(d);var x=0,T=0;for(T=0;T<d;T++)T&7?(x=m[T>>3],x<<=T&7):x=m[T>>3],x&128&&(y[T]=1);u.pixels.resultMask=y,v.bitset=m,c+=v.numBytes}return u.ptr=c,u.mask=v,!0},readDataOneSweep:function(h,u,c,f){var d=u.ptr,g=u.headerInfo,p=g.numDims,v=g.width*g.height,m=g.imageType,y=g.numValidPixel*s.getDataTypeSize(m)*p,_,w=u.pixels.resultMask;if(c===Uint8Array)_=new Uint8Array(h,d,y);else{var S=new ArrayBuffer(y),b=new Uint8Array(S);b.set(new Uint8Array(h,d,y)),_=new c(S)}if(_.length===v*p)f?u.pixels.resultPixels=s.swapDimensionOrder(_,v,p,c,!0):u.pixels.resultPixels=_;else{u.pixels.resultPixels=new c(v*p);var x=0,T=0,C=0,A=0;if(p>1){if(f){for(T=0;T<v;T++)if(w[T])for(A=T,C=0;C<p;C++,A+=v)u.pixels.resultPixels[A]=_[x++]}else for(T=0;T<v;T++)if(w[T])for(A=T*p,C=0;C<p;C++)u.pixels.resultPixels[A+C]=_[x++]}else for(T=0;T<v;T++)w[T]&&(u.pixels.resultPixels[T]=_[x++])}return d+=y,u.ptr=d,!0},readHuffmanTree:function(h,u){var c=this.HUFFMAN_LUT_BITS_MAX,f=new DataView(h,u.ptr,16);u.ptr+=16;var d=f.getInt32(0,!0);if(d<2)throw"unsupported Huffman version";var g=f.getInt32(4,!0),p=f.getInt32(8,!0),v=f.getInt32(12,!0);if(p>=v)return!1;var m=new Uint32Array(v-p);s.decodeBits(h,u,m);var y=[],_,w,S,b;for(_=p;_<v;_++)w=_-(_<g?0:g),y[w]={first:m[_-p],second:null};var x=h.byteLength-u.ptr,T=Math.ceil(x/4),C=new ArrayBuffer(T*4),A=new Uint8Array(C);A.set(new Uint8Array(h,u.ptr,x));var M=new Uint32Array(C),E=0,R,P=0;for(R=M[0],_=p;_<v;_++)w=_-(_<g?0:g),b=y[w].first,b>0&&(y[w].second=R<<E>>>32-b,32-E>=b?(E+=b,E===32&&(E=0,P++,R=M[P])):(E+=b-32,P++,R=M[P],y[w].second|=R>>>32-E));var I=0,L=0,D=new o;for(_=0;_<y.length;_++)y[_]!==void 0&&(I=Math.max(I,y[_].first));I>=c?L=c:L=I;var F=[],G,B,z,k,O,N;for(_=p;_<v;_++)if(w=_-(_<g?0:g),b=y[w].first,b>0)if(G=[b,w],b<=L)for(B=y[w].second<<L-b,z=1<<L-b,S=0;S<z;S++)F[B|S]=G;else for(B=y[w].second,N=D,k=b-1;k>=0;k--)O=B>>>k&1,O?(N.right||(N.right=new o),N=N.right):(N.left||(N.left=new o),N=N.left),k===0&&!N.val&&(N.val=G[1]);return{decodeLut:F,numBitsLUTQick:L,numBitsLUT:I,tree:D,stuffedData:M,srcPtr:P,bitPos:E}},readHuffman:function(h,u,c,f){var d=u.headerInfo,g=d.numDims,p=u.headerInfo.height,v=u.headerInfo.width,m=v*p,y=this.readHuffmanTree(h,u),_=y.decodeLut,w=y.tree,S=y.stuffedData,b=y.srcPtr,x=y.bitPos,T=y.numBitsLUTQick,C=y.numBitsLUT,A=u.headerInfo.imageType===0?128:0,M,E,R,P=u.pixels.resultMask,I,L,D,F,G,B,z,k=0;x>0&&(b++,x=0);var O=S[b],N=u.encodeMode===1,U=new c(m*g),j=U,q;if(g<2||N){for(q=0;q<g;q++)if(g>1&&(j=new c(U.buffer,m*q,m),k=0),u.headerInfo.numValidPixel===v*p)for(B=0,F=0;F<p;F++)for(G=0;G<v;G++,B++){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,N?(G>0?R+=k:F>0?R+=j[B-v]:R+=k,R&=255,j[B]=R,k=R):j[B]=R}else for(B=0,F=0;F<p;F++)for(G=0;G<v;G++,B++)if(P[B]){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,N?(G>0&&P[B-1]?R+=k:F>0&&P[B-v]?R+=j[B-v]:R+=k,R&=255,j[B]=R,k=R):j[B]=R}}else for(B=0,F=0;F<p;F++)for(G=0;G<v;G++)if(B=F*v+G,!P||P[B])for(q=0;q<g;q++,B+=m){if(E=0,I=O<<x>>>32-T,L=I,32-x<T&&(I|=S[b+1]>>>64-x-T,L=I),_[L])E=_[L][1],x+=_[L][0];else for(I=O<<x>>>32-C,L=I,32-x<C&&(I|=S[b+1]>>>64-x-C,L=I),M=w,z=0;z<C;z++)if(D=I>>>C-z-1&1,M=D?M.right:M.left,!(M.left||M.right)){E=M.val,x=x+z+1;break}x>=32&&(x-=32,b++,O=S[b]),R=E-A,j[B]=R}u.ptr=u.ptr+(b+1)*4+(x>0?4:0),u.pixels.resultPixels=U,g>1&&!f&&(u.pixels.resultPixels=s.swapDimensionOrder(U,m,g,c))},decodeBits:function(h,u,c,f,d){{var g=u.headerInfo,p=g.fileVersion,v=0,m=h.byteLength-u.ptr>=5?5:h.byteLength-u.ptr,y=new DataView(h,u.ptr,m),_=y.getUint8(0);v++;var w=_>>6,S=w===0?4:3-w,b=(_&32)>0,x=_&31,T=0;if(S===1)T=y.getUint8(v),v++;else if(S===2)T=y.getUint16(v,!0),v+=2;else if(S===4)T=y.getUint32(v,!0),v+=4;else throw"Invalid valid pixel count type";var C=2*g.maxZError,A,M,E,R,P,I,L,D,F,G=g.numDims>1?g.maxValues[d]:g.zMax;if(b){for(u.counter.lut++,D=y.getUint8(v),v++,R=Math.ceil((D-1)*x/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),u.ptr+=v,E.set(new Uint8Array(h,u.ptr,R)),L=new Uint32Array(M),u.ptr+=R,F=0;D-1>>>F;)F++;R=Math.ceil(T*F/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),E.set(new Uint8Array(h,u.ptr,R)),A=new Uint32Array(M),u.ptr+=R,p>=3?I=a.unstuffLUT2(L,x,D-1,f,C,G):I=a.unstuffLUT(L,x,D-1,f,C,G),p>=3?a.unstuff2(A,c,F,T,I):a.unstuff(A,c,F,T,I)}else u.counter.bitstuffer++,F=x,u.ptr+=v,F>0&&(R=Math.ceil(T*F/8),P=Math.ceil(R/4),M=new ArrayBuffer(P*4),E=new Uint8Array(M),E.set(new Uint8Array(h,u.ptr,R)),A=new Uint32Array(M),u.ptr+=R,p>=3?f==null?a.originalUnstuff2(A,c,F,T):a.unstuff2(A,c,F,T,!1,f,C,G):f==null?a.originalUnstuff(A,c,F,T):a.unstuff(A,c,F,T,!1,f,C,G))}},readTiles:function(h,u,c,f){var d=u.headerInfo,g=d.width,p=d.height,v=g*p,m=d.microBlockSize,y=d.imageType,_=s.getDataTypeSize(y),w=Math.ceil(g/m),S=Math.ceil(p/m);u.pixels.numBlocksY=S,u.pixels.numBlocksX=w,u.pixels.ptr=0;var b=0,x=0,T=0,C=0,A=0,M=0,E=0,R=0,P=0,I=0,L=0,D=0,F=0,G=0,B=0,z=0,k,O,N,U,j,q,V=new c(m*m),$=p%m||m,Z=g%m||m,K,J,Q=d.numDims,ee,te=u.pixels.resultMask,ae=u.pixels.resultPixels,ye=d.fileVersion,oe=ye>=5?14:15,ge,_e=d.zMax,ie;for(T=0;T<S;T++)for(A=T!==S-1?m:$,C=0;C<w;C++)for(M=C!==w-1?m:Z,L=T*g*m+C*m,D=g-M,ee=0;ee<Q;ee++){if(Q>1?(ie=ae,L=T*g*m+C*m,ae=new c(u.pixels.resultPixels.buffer,v*ee*_,v),_e=d.maxValues[ee]):ie=null,E=h.byteLength-u.ptr,k=new DataView(h,u.ptr,Math.min(10,E)),O={},z=0,R=k.getUint8(0),z++,ge=d.fileVersion>=5?R&4:0,P=R>>6&255,I=R>>2&oe,I!==(C*m>>3&oe)||ge&&ee===0)throw"integrity issue";if(q=R&3,q>3)throw u.ptr+=z,"Invalid block encoding ("+q+")";if(q===2){if(ge)if(te)for(b=0;b<A;b++)for(x=0;x<M;x++)te[L]&&(ae[L]=ie[L]),L++;else for(b=0;b<A;b++)for(x=0;x<M;x++)ae[L]=ie[L],L++;u.counter.constant++,u.ptr+=z;continue}else if(q===0){if(ge)throw"integrity issue";if(u.counter.uncompressed++,u.ptr+=z,F=A*M*_,G=h.byteLength-u.ptr,F=F<G?F:G,N=new ArrayBuffer(F%_===0?F:F+_-F%_),U=new Uint8Array(N),U.set(new Uint8Array(h,u.ptr,F)),j=new c(N),B=0,te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=j[B++]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L++]=j[B++];L+=D}u.ptr+=B*_}else if(K=s.getDataTypeUsed(ge&&y<6?4:y,P),J=s.getOnePixel(O,z,K,k),z+=s.getDataTypeSize(K),q===3)if(u.ptr+=z,u.counter.constantoffset++,te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=ge?Math.min(_e,ie[L]+J):J),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L]=ge?Math.min(_e,ie[L]+J):J,L++;L+=D}else if(u.ptr+=z,s.decodeBits(h,u,V,J,ee),z=0,ge)if(te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=V[z++]+ie[L]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L]=V[z++]+ie[L],L++;L+=D}else if(te)for(b=0;b<A;b++){for(x=0;x<M;x++)te[L]&&(ae[L]=V[z++]),L++;L+=D}else for(b=0;b<A;b++){for(x=0;x<M;x++)ae[L++]=V[z++];L+=D}}Q>1&&!f&&(u.pixels.resultPixels=s.swapDimensionOrder(u.pixels.resultPixels,v,Q,c))},formatFileInfo:function(h){return{fileIdentifierString:h.headerInfo.fileIdentifierString,fileVersion:h.headerInfo.fileVersion,imageType:h.headerInfo.imageType,height:h.headerInfo.height,width:h.headerInfo.width,numValidPixel:h.headerInfo.numValidPixel,microBlockSize:h.headerInfo.microBlockSize,blobSize:h.headerInfo.blobSize,maxZError:h.headerInfo.maxZError,pixelType:s.getPixelType(h.headerInfo.imageType),eofOffset:h.eofOffset,mask:h.mask?{numBytes:h.mask.numBytes}:null,pixels:{numBlocksX:h.pixels.numBlocksX,numBlocksY:h.pixels.numBlocksY,maxValue:h.headerInfo.zMax,minValue:h.headerInfo.zMin,noDataValue:h.noDataValue}}},constructConstantSurface:function(h,u){var c=h.headerInfo.zMax,f=h.headerInfo.zMin,d=h.headerInfo.maxValues,g=h.headerInfo.numDims,p=h.headerInfo.height*h.headerInfo.width,v=0,m=0,y=0,_=h.pixels.resultMask,w=h.pixels.resultPixels;if(_)if(g>1){if(u)for(v=0;v<g;v++)for(y=v*p,c=d[v],m=0;m<p;m++)_[m]&&(w[y+m]=c);else for(m=0;m<p;m++)if(_[m])for(y=m*g,v=0;v<g;v++)w[y+g]=d[v]}else for(m=0;m<p;m++)_[m]&&(w[m]=c);else if(g>1&&f!==c)if(u)for(v=0;v<g;v++)for(y=v*p,c=d[v],m=0;m<p;m++)w[y+m]=c;else for(m=0;m<p;m++)for(y=m*g,v=0;v<g;v++)w[y+v]=d[v];else for(m=0;m<p*g;m++)w[m]=c},getDataTypeArray:function(h){var u;switch(h){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(h){var u;switch(h){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(h,u){if(u==null)return!1;var c;switch(h){case 0:c=u>=-128&&u<=127;break;case 1:c=u>=0&&u<=255;break;case 2:c=u>=-32768&&u<=32767;break;case 3:c=u>=0&&u<=65536;break;case 4:c=u>=-2147483648&&u<=2147483647;break;case 5:c=u>=0&&u<=4294967296;break;case 6:c=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:c=u>=-17976931348623157e292&&u<=17976931348623157e292;break;default:c=!1}return c},getDataTypeSize:function(h){var u=0;switch(h){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=h}return u},getDataTypeUsed:function(h,u){var c=h;switch(h){case 2:case 4:c=h-u;break;case 3:case 5:c=h-2*u;break;case 6:u===0?c=h:u===1?c=2:c=1;break;case 7:u===0?c=h:c=h-2*u+1;break;default:c=h;break}return c},getOnePixel:function(h,u,c,f){var d=0;switch(c){case 0:d=f.getInt8(u);break;case 1:d=f.getUint8(u);break;case 2:d=f.getInt16(u,!0);break;case 3:d=f.getUint16(u,!0);break;case 4:d=f.getInt32(u,!0);break;case 5:d=f.getUInt32(u,!0);break;case 6:d=f.getFloat32(u,!0);break;case 7:d=f.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return d},swapDimensionOrder:function(h,u,c,f,d){var g=0,p=0,v=0,m=0,y=h;if(c>1)if(y=new f(u*c),d)for(g=0;g<u;g++)for(m=g,v=0;v<c;v++,m+=u)y[m]=h[p++];else for(g=0;g<u;g++)for(m=g,v=0;v<c;v++,m+=u)y[p++]=h[m];return y}},o=function(h,u,c){this.val=h,this.left=u,this.right=c},l={decode:function(h,u){u=u||{};var c=u.noDataValue,f=0,d={};d.ptr=u.inputOffset||0,d.pixels={},s.readHeaderInfo(h,d);var g=d.headerInfo,p=g.fileVersion,v=s.getDataTypeArray(g.imageType);if(p>5)throw"unsupported lerc version 2."+p;s.readMask(h,d),g.numValidPixel!==g.width*g.height&&!d.pixels.resultMask&&(d.pixels.resultMask=u.maskData);var m=g.width*g.height;d.pixels.resultPixels=new v(m*g.numDims),d.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var y=!u.returnPixelInterleavedDims;if(g.numValidPixel!==0)if(g.zMax===g.zMin)s.constructConstantSurface(d,y);else if(p>=4&&s.checkMinMaxRanges(h,d))s.constructConstantSurface(d,y);else{var _=new DataView(h,d.ptr,2),w=_.getUint8(0);if(d.ptr++,w)s.readDataOneSweep(h,d,v,y);else if(p>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var S=_.getUint8(1);if(d.ptr++,d.encodeMode=S,S>2||p<4&&S>1)throw"Invalid Huffman flag "+S;S?s.readHuffman(h,d,v,y):s.readTiles(h,d,v,y)}else s.readTiles(h,d,v,y)}d.eofOffset=d.ptr;var b;u.inputOffset?(b=d.headerInfo.blobSize+u.inputOffset-d.ptr,Math.abs(b)>=1&&(d.eofOffset=u.inputOffset+d.headerInfo.blobSize)):(b=d.headerInfo.blobSize-d.ptr,Math.abs(b)>=1&&(d.eofOffset=d.headerInfo.blobSize));var x={width:g.width,height:g.height,pixelData:d.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:d.pixels.resultMask};if(d.pixels.resultMask&&s.isValidPixelValue(g.imageType,c)){var T=d.pixels.resultMask;for(f=0;f<m;f++)T[f]||(x.pixelData[f]=c);x.noDataValue=c}return d.noDataValue=c,u.returnFileInfo&&(x.fileInfo=s.formatFileInfo(d)),x},getBandCount:function(h){var u=0,c=0,f={};for(f.ptr=0,f.pixels={};c<h.byteLength-58;)s.readHeaderInfo(h,f),c+=f.headerInfo.blobSize,u++,f.ptr=c;return u}};return l}(),i=function(){var a=new ArrayBuffer(4),s=new Uint8Array(a),o=new Uint32Array(a);return o[0]=1,s[0]===1}(),r={decode:function(a,s){if(!i)throw"Big endian system is not supported.";s=s||{};var o=s.inputOffset||0,l=new Uint8Array(a,o,10),h=String.fromCharCode.apply(null,l),u,c;if(h.trim()==="CntZImage")u=e,c=1;else if(h.substring(0,5)==="Lerc2")u=n,c=2;else throw"Unexpected file identifier string: "+h;for(var f=0,d=a.byteLength-10,g,p=[],v,m,y={width:0,height:0,pixels:[],pixelType:s.pixelType,mask:null,statistics:[]},_=0;o<d;){var w=u.decode(a,{inputOffset:o,encodedMaskData:g,maskData:m,returnMask:f===0,returnEncodedMask:f===0,returnFileInfo:!0,returnPixelInterleavedDims:s.returnPixelInterleavedDims,pixelType:s.pixelType||null,noDataValue:s.noDataValue||null});o=w.fileInfo.eofOffset,m=w.maskData,f===0&&(g=w.encodedMaskData,y.width=w.width,y.height=w.height,y.dimCount=w.dimCount||1,y.pixelType=w.pixelType||w.fileInfo.pixelType,y.mask=m),c>1&&(m&&p.push(m),w.fileInfo.mask&&w.fileInfo.mask.numBytes>0&&_++),f++,y.pixels.push(w.pixelData),y.statistics.push({minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue,dimStats:w.dimStats})}var S,b,x;if(c>1&&_>1){for(x=y.width*y.height,y.bandMasks=p,m=new Uint8Array(x),m.set(p[0]),S=1;S<p.length;S++)for(v=p[S],b=0;b<x;b++)m[b]=m[b]&v[b];y.maskData=m}return y}};t.exports?t.exports=r:this.Lerc=r})()})(wW);const vTe=wW.exports;class pTe extends tl{constructor(e){super(),this.planarConfiguration=typeof e.PlanarConfiguration!="undefined"?e.PlanarConfiguration:1,this.samplesPerPixel=typeof e.SamplesPerPixel!="undefined"?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[Jae.AddCompression]}decodeBlock(e){switch(this.addCompression){case CM.None:break;case CM.Deflate:e=xW(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return vTe.decode(e,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}const mTe=Object.freeze(Object.defineProperty({__proto__:null,default:pTe},Symbol.toStringTag,{value:"Module"}));class yTe extends tl{constructor(){if(super(),typeof createImageBitmap=="undefined")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document=="undefined"&&typeof OffscreenCanvas=="undefined")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}decode(e,n){return Be(this,null,function*(){const i=new Blob([n]),r=yield createImageBitmap(i);let a;typeof document!="undefined"?(a=document.createElement("canvas"),a.width=r.width,a.height=r.height):a=new OffscreenCanvas(r.width,r.height);const s=a.getContext("2d");return s.drawImage(r,0,0),s.getImageData(0,0,r.width,r.height).data.buffer})}}const _Te=Object.freeze(Object.defineProperty({__proto__:null,default:yTe},Symbol.toStringTag,{value:"Module"}));var xTe=Worker;function wTe(){const t='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new xTe(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}const bTe=Object.freeze(Object.defineProperty({__proto__:null,create:wTe},Symbol.toStringTag,{value:"Module"}));nt.VDraw=Kf,nt.VEcharts=cg,nt.VGDRoute=wg,nt.VGraphic=Yf,nt.VHeatmap=Xf,nt.VImage=qf,nt.VMap=Rf,nt.VMeasure=Jf,nt.VOverlay=Nf,nt.VOverview=Ff,nt.VPath=gg,nt.VRoute=Zf,nt.VSuperCluster=mg,nt.VTile=eu,nt.VTrack=dg,nt.VTraffic=yg,nt.VVector=Uf,nt.VWfs=bg,nt.default=P7e,nt.utils=Jre,Object.defineProperties(nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});