/*! For license information please see geopackage.min.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("better-sqlite3")}catch(t){}}()):"function"==typeof define&&define.amd?define(["better-sqlite3"],e):"object"==typeof exports?exports.GeoPackage=e(function(){try{return require("better-sqlite3")}catch(t){}}()):t.GeoPackage=e(t["better-sqlite3"])}(self,(function(__WEBPACK_EXTERNAL_MODULE__3730__){return(()=>{var __webpack_modules__={8927:(t,e,n)=>{var r,i=n(3085).Buffer,o=n(4155),a=n(5108),s=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,s,u,l;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){s=t,u=e})),(l=e).Ud=l.Ud||[],l.Ud.push((function(){l.MakeSWCanvasSurface=function(t){var e=t;if("CANVAS"!==e.tagName&&!(e=document.getElementById(t)))throw"Canvas with id "+t+" was not found";return(t=l.MakeSurface(e.width,e.height))&&(t.Hd=e),t},l.MakeCanvasSurface||(l.MakeCanvasSurface=l.MakeSWCanvasSurface),l.MakeSurface=function(t,e){var n={width:t,height:e,colorType:l.ColorType.RGBA_8888,alphaType:l.AlphaType.Unpremul,colorSpace:l.ColorSpace.SRGB},r=t*e*4,i=l._malloc(r);return(n=l.Surface._makeRasterDirect(n,i,4*t))&&(n.Hd=null,n.zf=t,n.wf=e,n.yf=r,n.$e=i,n.getCanvas().clear(l.TRANSPARENT)),n},l.MakeRasterDirectSurface=function(t,e,n){return l.Surface._makeRasterDirect(t,e.byteOffset,n)},l.Surface.prototype.flush=function(t){if(this._flush(),this.Hd){var e=new Uint8ClampedArray(l.HEAPU8.buffer,this.$e,this.yf);e=new ImageData(e,this.zf,this.wf),t?this.Hd.getContext("2d").putImageData(e,0,0,t[0],t[1],t[2]-t[0],t[3]-t[1]):this.Hd.getContext("2d").putImageData(e,0,0)}},l.Surface.prototype.dispose=function(){this.$e&&l._free(this.$e),this.delete()},l.currentContext=l.currentContext||function(){},l.setCurrentContext=l.setCurrentContext||function(){}})),function(t){t.Ud=t.Ud||[],t.Ud.push((function(){function e(t,e,n){return t&&t.hasOwnProperty(e)?t[e]:n}t.GetWebGLContext=function(t,n){if(!t)throw"null canvas passed into makeWebGLContext";var r={alpha:e(n,"alpha",1),depth:e(n,"depth",1),stencil:e(n,"stencil",8),antialias:e(n,"antialias",0),premultipliedAlpha:e(n,"premultipliedAlpha",1),preserveDrawingBuffer:e(n,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:e(n,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:e(n,"failIfMajorPerformanceCaveat",0),enableExtensionsByDefault:e(n,"enableExtensionsByDefault",1),explicitSwapControl:e(n,"explicitSwapControl",0),renderViaOffscreenBackBuffer:e(n,"renderViaOffscreenBackBuffer",0)};if(r.majorVersion=n&&n.majorVersion?n.majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1,r.explicitSwapControl)throw"explicitSwapControl is not supported";return t=function(t,e){t.rf||(t.rf=t.getContext,t.getContext=function(e,n){return"webgl"==e==(n=t.rf(e,n))instanceof WebGLRenderingContext?n:null});var n=1t.version||!e.pf)&&(e.pf=e.getExtension("EXT_disjoint_timer_query")),e.tg=e.getExtension("WEBGL_multi_draw"),(e.getSupportedExtensions()||[]).forEach((function(t){t.includes("lose_context")||t.includes("debug")||e.getExtension(t)}))}}(r),n}(n,e):0}(t,r),t?(je(t),t):0},t.deleteContext=function(t){We===Pe[t]&&(We=null),"object"==typeof JSEvents&&JSEvents.wg(Pe[t].Ce.canvas),Pe[t]&&Pe[t].Ce.canvas&&(Pe[t].Ce.canvas.jf=void 0),Pe[t]=null},t.MakeWebGLCanvasSurface=function(e,n,r){n=n||null;var i=e,o="undefined"!=typeof OffscreenCanvas&&i instanceof OffscreenCanvas;if(!("undefined"!=typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement||o||(i=document.getElementById(e),i)))throw"Canvas with id "+e+" was not found";if(!(e=this.GetWebGLContext(i,r))||0>e)throw"failed to create webgl context: err "+e;return r=this.MakeGrContext(e),(n=this.MakeOnScreenGLSurface(r,i.width,i.height,n))?(n.he=e,n.grContext=r,n.openGLversion=i.jf.version,n):(n=i.cloneNode(!0),i.parentNode.replaceChild(n,i),n.classList.add("ck-replaced"),t.MakeSWCanvasSurface(n))},t.MakeCanvasSurface=t.MakeWebGLCanvasSurface}))}(e),function(t){function e(t,e,n,r,i){for(var o=0;o>>0}function a(t){if(t instanceof Float32Array){for(var e=Math.floor(t.length/4),n=new Uint32Array(e),r=0;rs;s++)t.HEAPF32[o+i]=e[a][s],i++;e=r}else e=X;n.Zd=e}return n}function f(e){if(!e)return X;if(e.length){if(6===e.length||9===e.length)return c(e,"HEAPF32",P),6===e.length&&t.HEAPF32.set(z,6+P/4),P;if(16===e.length){var n=E.toTypedArray();return n[0]=e[0],n[1]=e[1],n[2]=e[3],n[3]=e[4],n[4]=e[5],n[5]=e[7],n[6]=e[12],n[7]=e[13],n[8]=e[15],P}throw"invalid matrix size"}return(n=E.toTypedArray())[0]=e.m11,n[1]=e.m21,n[2]=e.m41,n[3]=e.m12,n[4]=e.m22,n[5]=e.m42,n[6]=e.m14,n[7]=e.m24,n[8]=e.m44,P}function p(e){for(var n=Array(16),r=0;16>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function d(t,e){return c(t,"HEAPF32",e||L)}function y(t,e,n,r){var i=x.toTypedArray();return i[0]=t,i[1]=e,i[2]=n,i[3]=r,L}function m(e){for(var n=new Float32Array(4),r=0;4>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function g(t,e){return c(t,"HEAPF32",e||F)}function _(t,e){return c(t,"HEAPF32",e||q)}function b(){for(var t=0,e=0;e>>0},t.Color4f=function(t,e,n,r){return void 0===r&&(r=1),Float32Array.of(t,e,n,r)},Object.defineProperty(t,"TRANSPARENT",{get:function(){return t.Color4f(0,0,0,0)}}),Object.defineProperty(t,"BLACK",{get:function(){return t.Color4f(0,0,0,1)}}),Object.defineProperty(t,"WHITE",{get:function(){return t.Color4f(1,1,1,1)}}),Object.defineProperty(t,"RED",{get:function(){return t.Color4f(1,0,0,1)}}),Object.defineProperty(t,"GREEN",{get:function(){return t.Color4f(0,1,0,1)}}),Object.defineProperty(t,"BLUE",{get:function(){return t.Color4f(0,0,1,1)}}),Object.defineProperty(t,"YELLOW",{get:function(){return t.Color4f(1,1,0,1)}}),Object.defineProperty(t,"CYAN",{get:function(){return t.Color4f(0,1,1,1)}}),Object.defineProperty(t,"MAGENTA",{get:function(){return t.Color4f(1,0,1,1)}}),t.getColorComponents=function(t){return[Math.floor(255*t[0]),Math.floor(255*t[1]),Math.floor(255*t[2]),t[3]]},t.parseColorString=function(e,n){if((e=e.toLowerCase()).startsWith("#")){switch(n=255,e.length){case 9:n=parseInt(e.slice(7,9),16);case 7:var r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);break;case 5:n=17*parseInt(e.slice(4,5),16);case 4:r=17*parseInt(e.slice(1,2),16),i=17*parseInt(e.slice(2,3),16),o=17*parseInt(e.slice(3,4),16)}return t.Color(r,i,o,n/255)}return e.startsWith("rgba")?(e=(e=e.slice(5,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("rgb")?(e=(e=e.slice(4,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!n||void 0===(e=n[e])?t.BLACK:e},t.multiplyByAlpha=function(t,e){return(t=t.slice())[3]=Math.max(0,Math.min(t[3]*e,1)),t},t.Malloc=function(e,n){var r=t._malloc(n*e.BYTES_PER_ELEMENT);return{_ck:!0,length:n,byteOffset:r,je:null,subarray:function(t,e){return(t=this.toTypedArray().subarray(t,e))._ck=!0,t},toTypedArray:function(){return this.je&&this.je.length||(this.je=new e(t.HEAPU8.buffer,r,n),this.je._ck=!0),this.je}}},t.Free=function(e){t._free(e.byteOffset),e.byteOffset=X,e.toTypedArray=null,e.je=null};var E,w,x,C,M,S,N,O,A,I,P=X,R=X,L=X,F=X,U=X,j=X,G=X,W=X,q=X,H=X,z=Float32Array.of(0,0,1),V={};t.ke=function(){this.ge=[],this.Od=null,Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this.ge.length/4}})},t.ke.prototype.push=function(t,e,n,r){this.Od||this.ge.push(t,e,n,r)},t.ke.prototype.set=function(e,n,r,i,o){0>e||e>=this.ge.length/4||(e*=4,this.Od?(e=this.Od/4+e,t.HEAPF32[e]=n,t.HEAPF32[e+1]=r,t.HEAPF32[e+2]=i,t.HEAPF32[e+3]=o):(this.ge[e]=n,this.ge[e+1]=r,this.ge[e+2]=i,this.ge[e+3]=o))},t.ke.prototype.build=function(){return this.Od?this.Od:this.Od=c(this.ge,"HEAPF32")},t.ke.prototype.delete=function(){this.Od&&(t._free(this.Od),this.Od=null)},t.De=function(){this.Ie=[],this.Od=null,Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this.Ie.length}})},t.De.prototype.push=function(t){this.Od||this.Ie.push(t)},t.De.prototype.set=function(e,n){0>e||e>=this.Ie.length||(e*=4,this.Od?t.HEAPU32[this.Od/4+e]=n:this.Ie[e]=n)},t.De.prototype.build=function(){return this.Od?this.Od:this.Od=c(this.Ie,"HEAPU32")},t.De.prototype.delete=function(){this.Od&&(t._free(this.Od),this.Od=null)},t.RectBuilder=t.ke,t.RSXFormBuilder=t.ke,t.ColorBuilder=t.De;var X=0,Y=!new Function("try {return this===window;}catch(e){ return false;}")();t.onRuntimeInitialized=function(){function e(e,n,r,i,o,a){a||(a=4*i.width,i.colorType===t.ColorType.RGBA_F16?a*=2:i.colorType===t.ColorType.RGBA_F32&&(a*=4));var s=a*i.height,u=o?o.byteOffset:t._malloc(s);if(!e._readPixels(i,u,a,n,r))return o||t._free(u),null;if(o)return o.toTypedArray();switch(i.colorType){case t.ColorType.RGBA_8888:case t.ColorType.RGBA_F16:e=new Uint8Array(t.HEAPU8.buffer,u,s).slice();break;case t.ColorType.RGBA_F32:e=new Float32Array(t.HEAPU8.buffer,u,s).slice();break;default:return null}return t._free(u),e}x=t.Malloc(Float32Array,4),L=x.byteOffset,w=t.Malloc(Float32Array,16),R=w.byteOffset,E=t.Malloc(Float32Array,9),P=E.byteOffset,A=t.Malloc(Float32Array,12),q=A.byteOffset,I=t.Malloc(Float32Array,12),H=I.byteOffset,C=t.Malloc(Float32Array,4),F=C.byteOffset,M=t.Malloc(Float32Array,4),U=M.byteOffset,S=t.Malloc(Float32Array,3),j=S.byteOffset,N=t.Malloc(Float32Array,3),G=N.byteOffset,O=t.Malloc(Int32Array,4),W=O.byteOffset,t.ColorSpace.SRGB=t.ColorSpace._MakeSRGB(),t.ColorSpace.DISPLAY_P3=t.ColorSpace._MakeDisplayP3(),t.ColorSpace.ADOBE_RGB=t.ColorSpace._MakeAdobeRGB(),t.Path.MakeFromCmds=function(e){for(var n=0,r=0;rn;n++)e[n]=t.HEAPF32[P/4+n];return e},t.Canvas.prototype.readPixels=function(t,n,r,i,o){return e(this,t,n,r,i,o)},t.Canvas.prototype.saveLayer=function(t,e,n,r){return e=g(e),this._saveLayer(t||null,e,n||null,r||0)},t.Canvas.prototype.writePixels=function(e,n,r,i,o,a,s,u){if(e.byteLength%(n*r))throw"pixels length must be a multiple of the srcWidth * srcHeight";var h=e.byteLength/(n*r);a=a||t.AlphaType.Unpremul,s=s||t.ColorType.RGBA_8888,u=u||t.ColorSpace.SRGB;var f=h*n;return h=c(e,"HEAPU8"),n=this._writePixels({width:n,height:r,colorType:s,alphaType:a,colorSpace:u},h,f,i,o),l(h,e),n},t.ColorFilter.MakeBlend=function(e,n){return e=d(e),t.ColorFilter._MakeBlend(e,n)},t.ColorFilter.MakeMatrix=function(e){if(!e||20!==e.length)throw"invalid color matrix";var n=c(e,"HEAPF32"),r=t.ColorFilter._makeMatrix(n);return l(n,e),r},t.ContourMeasure.prototype.getPosTan=function(t,e){return this._getPosTan(t,F),t=C.toTypedArray(),e?(e.set(t),e):t.slice()},t.ImageFilter.MakeMatrixTransform=function(e,n,r){return e=f(e),t.ImageFilter._MakeMatrixTransform(e,n,r)},t.Paint.prototype.getColor=function(){return this._getColor(L),m(L)},t.Paint.prototype.setColor=function(t,e){e=e||null,t=d(t),this._setColor(t,e)},t.Paint.prototype.setColorComponents=function(t,e,n,r,i){i=i||null,t=y(t,e,n,r),this._setColor(t,i)},t.Path.prototype.getPoint=function(t,e){return this._getPoint(t,F),t=C.toTypedArray(),e?(e[0]=t[0],e[1]=t[1],e):t.slice(0,2)},t.PictureRecorder.prototype.beginRecording=function(t){return t=g(t),this._beginRecording(t)},t.Surface.prototype.makeImageSnapshot=function(t){return t=c(t,"HEAP32",W),this._makeImageSnapshot(t)},t.Surface.prototype.requestAnimationFrame=function(e,n){this.Ee||(this.Ee=this.getCanvas()),requestAnimationFrame(function(){void 0!==this.he&&t.setCurrentContext(this.he),e(this.Ee),this.flush(n)}.bind(this))},t.Surface.prototype.drawOnce=function(e,n){this.Ee||(this.Ee=this.getCanvas()),requestAnimationFrame(function(){void 0!==this.he&&t.setCurrentContext(this.he),e(this.Ee),this.flush(n),this.dispose()}.bind(this))},t.PathEffect.MakeDash=function(e,n){if(n||(n=0),!e.length||1==e.length%2)throw"Intervals array must have even length";var r=c(e,"HEAPF32");return n=t.PathEffect._MakeDash(r,e.length,n),l(r,e),n},t.Shader.MakeColor=function(e,n){return n=n||null,e=d(e),t.Shader._MakeColor(e,n)},t.Shader.Blend=t.Shader.MakeBlend,t.Shader.Color=t.Shader.MakeColor,t.Shader.Lerp=t.Shader.MakeLerp,t.Shader.MakeLinearGradient=function(e,n,r,i,o,a,s,u){u=u||null;var p=h(r),d=c(i,"HEAPF32");s=s||0,a=f(a);var y=C.toTypedArray();return y.set(e),y.set(n,2),e=t.Shader._MakeLinearGradient(F,p.Zd,p.Je,d,p.count,o,s,a,u),l(p.Zd,r),i&&l(d,i),e},t.Shader.MakeRadialGradient=function(e,n,r,i,o,a,s,u){u=u||null;var p=h(r),d=c(i,"HEAPF32");return s=s||0,a=f(a),e=t.Shader._MakeRadialGradient(e[0],e[1],n,p.Zd,p.Je,d,p.count,o,s,a,u),l(p.Zd,r),i&&l(d,i),e},t.Shader.MakeSweepGradient=function(e,n,r,i,o,a,s,u,p,d){d=d||null;var y=h(r),m=c(i,"HEAPF32");return s=s||0,u=u||0,p=p||360,a=f(a),e=t.Shader._MakeSweepGradient(e,n,y.Zd,y.Je,m,y.count,o,u,p,s,a,d),l(y.Zd,r),i&&l(m,i),e},t.Shader.MakeTwoPointConicalGradient=function(e,n,r,i,o,a,s,u,p,d){d=d||null;var y=h(o),m=c(a,"HEAPF32");p=p||0,u=f(u);var g=C.toTypedArray();return g.set(e),g.set(r,2),e=t.Shader._MakeTwoPointConicalGradient(F,n,i,y.Zd,y.Je,m,y.count,s,p,u,d),l(y.Zd,o),a&&l(m,a),e},t.Vertices.prototype.bounds=function(t){this._bounds(F);var e=C.toTypedArray();return t?(t.set(e),t):e.slice()},t.Ud&&t.Ud.forEach((function(t){t()}))},t.computeTonalColors=function(t){var e=c(t.ambient,"HEAPF32"),n=c(t.spot,"HEAPF32");this._computeTonalColors(e,n);var r={ambient:m(e),spot:m(n)};return l(e,t.ambient),l(n,t.spot),r},t.LTRBRect=function(t,e,n,r){return Float32Array.of(t,e,n,r)},t.XYWHRect=function(t,e,n,r){return Float32Array.of(t,e,t+n,e+r)},t.LTRBiRect=function(t,e,n,r){return Int32Array.of(t,e,n,r)},t.XYWHiRect=function(t,e,n,r){return Int32Array.of(t,e,t+n,e+r)},t.RRectXY=function(t,e,n){return Float32Array.of(t[0],t[1],t[2],t[3],e,n,e,n,e,n,e,n)},t.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeAnimatedImage(n,e.byteLength))?e:null},t.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeImage(n,e.byteLength))?e:null};var Z=null;t.MakeImageFromCanvasImageSource=function(e){var n=e.width,r=e.height;Z||(Z=document.createElement("canvas")),Z.width=n,Z.height=r;var i=Z.getContext("2d");return i.drawImage(e,0,0),e=i.getImageData(0,0,n,r),t.MakeImage({width:n,height:r,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},e.data,4*n)},t.MakeImage=function(e,n,r){var i=t._malloc(n.length);return t.HEAPU8.set(n,i),t._MakeImage(e,i,n.length,r)},t.MakeVertices=function(e,n,r,i,o,s){var u=o&&o.length||0,l=0;if(r&&r.length&&(l|=1),i&&i.length&&(l|=2),void 0===s||s||(l|=4),c(n,"HEAPF32",(e=new t._VerticesBuilder(e,n.length/2,u,l)).positions()),e.texCoords()&&c(r,"HEAPF32",e.texCoords()),e.colors()){if(i.build)throw"Color builder not accepted by MakeVertices, use array of ints";c(a(i),"HEAPU32",e.colors())}return e.indices()&&c(o,"HEAPU16",e.indices()),e.detach()},t.Matrix={},t.Matrix.identity=function(){return n(3)},t.Matrix.invert=function(t){var e=t[0]*t[4]*t[8]+t[1]*t[5]*t[6]+t[2]*t[3]*t[7]-t[2]*t[4]*t[6]-t[1]*t[3]*t[8]-t[0]*t[5]*t[7];return e?[(t[4]*t[8]-t[5]*t[7])/e,(t[2]*t[7]-t[1]*t[8])/e,(t[1]*t[5]-t[2]*t[4])/e,(t[5]*t[6]-t[3]*t[8])/e,(t[0]*t[8]-t[2]*t[6])/e,(t[2]*t[3]-t[0]*t[5])/e,(t[3]*t[7]-t[4]*t[6])/e,(t[1]*t[6]-t[0]*t[7])/e,(t[0]*t[4]-t[1]*t[3])/e]:null},t.Matrix.mapPoints=function(t,e){for(var n=0;ni;i+=5){for(var o=0;4>o;o++)n[r++]=t[i]*e[o]+t[i+1]*e[o+5]+t[i+2]*e[o+10]+t[i+3]*e[o+15];n[r++]=t[i]*e[4]+t[i+1]*e[9]+t[i+2]*e[14]+t[i+3]*e[19]+t[i+4]}return n},t.Ud=t.Ud||[],t.Ud.push((function(){t.Path.prototype.op=function(t,e){return this._op(t,e)?this:null},t.Path.prototype.simplify=function(){return this._simplify()?this:null}})),t.Ud=t.Ud||[],t.Ud.push((function(){t.Canvas.prototype.drawText=function(e,n,r,i,o){var a=k(e),s=t._malloc(a+1);D(e,B,s,a+1),this._drawSimpleText(s,a,n,r,o,i),t._free(s)},t.Font.prototype.getGlyphBounds=function(e,n,r){var i=c(e,"HEAPU16"),o=t._malloc(16*e.length);return this._getGlyphWidthBounds(i,e.length,X,o,n||null),n=new Float32Array(t.HEAPU8.buffer,o,4*e.length),l(i,e),r?(r.set(n),t._free(o),r):(e=Float32Array.from(n),t._free(o),e)},t.Font.prototype.getGlyphIDs=function(e,n,r){n||(n=e.length);var i=k(e)+1,o=t._malloc(i);return D(e,B,o,i),e=t._malloc(2*n),n=this._getGlyphIDs(o,i-1,n,e),t._free(o),0>n?(t._free(e),null):(o=new Uint16Array(t.HEAPU8.buffer,e,n),r?(r.set(o),t._free(e),r):(r=Uint32Array.from(o),t._free(e),r))},t.Font.prototype.getGlyphWidths=function(e,n,r){var i=c(e,"HEAPU16"),o=t._malloc(4*e.length);return this._getGlyphWidthBounds(i,e.length,o,X,n||null),n=new Float32Array(t.HEAPU8.buffer,o,e.length),l(i,e),r?(r.set(n),t._free(o),r):(e=Float32Array.from(n),t._free(o),e)},t.FontMgr.FromData=function(){if(!arguments.length)return null;var e=arguments;if(1===e.length&&Array.isArray(e[0])&&(e=arguments[0]),!e.length)return null;for(var n=[],r=[],i=0;is.length()){if(s.delete(),!(s=n.next())){e=e.substring(0,l);break}i=c/2}s.getPosTan(i,u);var h=u[2],f=u[3];o.push(h,f,u[0]-c/2*h,u[1]-c/2*f),i+=c/2}return e=this.MakeFromRSXform(e,o,r),o.delete(),s&&s.delete(),n.delete(),e}},t.TextBlob.MakeFromRSXform=function(e,n,r){var i=k(e)+1,o=t._malloc(i);return D(e,B,o,i),e=n.build?n.build():c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXform(o,i-1,e,r),t._free(o),r||null},t.TextBlob.MakeFromRSXformGlyphs=function(e,n,r){var i=c(e,"HEAPU16");return n=n.build?n.build():c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXformGlyphs(i,2*e.length,n,r),l(i,e),r||null},t.TextBlob.MakeFromGlyphs=function(e,n){var r=c(e,"HEAPU16");return n=t.TextBlob._MakeFromGlyphs(r,2*e.length,n),l(r,e),n||null},t.TextBlob.MakeFromText=function(e,n){var r=k(e)+1,i=t._malloc(r);return D(e,B,i,r),e=t.TextBlob._MakeFromText(i,r-1,n),t._free(i),e||null},t.MallocGlyphIDs=function(e){return t.Malloc(Uint16Array,e)}})),function(){function e(t){for(var e=0;et||1=t||!t||(this.He=t,this.Jd.setStrokeWidth(t))}}),Object.defineProperty(this,"miterLimit",{enumerable:!0,get:function(){return this.Jd.getStrokeMiter()},set:function(t){0>=t||!t||this.Jd.setStrokeMiter(t)}}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.qe},set:function(t){0>t||!isFinite(t)||(this.qe=t)}}),Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return n(this.Ge)},set:function(t){this.Ge=o(t)}}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.re},set:function(t){isFinite(t)&&(this.re=t)}}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,get:function(){return this.se},set:function(t){isFinite(t)&&(this.se=t)}}),Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return n(this.be)},set:function(t){"string"==typeof t?this.be=o(t):t.oe&&(this.be=t)}}),this.arc=function(t,e,n,r,i,o){d(this.Ld,t,e,n,n,0,r,i,o)},this.arcTo=function(t,e,n,r,i){h(this.Ld,t,e,n,r,i)},this.beginPath=function(){this.Ld.delete(),this.Ld=new t.Path},this.bezierCurveTo=function(t,n,r,i,o,a){var s=this.Ld;e([t,n,r,i,o,a])&&(s.isEmpty()&&s.moveTo(t,n),s.cubicTo(t,n,r,i,o,a))},this.clearRect=function(e,n,r,i){this.Jd.setStyle(t.PaintStyle.Fill),this.Jd.setBlendMode(t.BlendMode.Clear),this.Hd.drawRect(t.XYWHRect(e,n,r,i),this.Jd),this.Jd.setBlendMode(this.Id)},this.clip=function(e,n){"string"==typeof e?(n=e,e=this.Ld):e&&e.Ze&&(e=e.Pd),e||(e=this.Ld),e=e.copy(),n&&"evenodd"===n.toLowerCase()?e.setFillType(t.FillType.EvenOdd):e.setFillType(t.FillType.Winding),this.Hd.clipPath(e,t.ClipOp.Intersect,!0),e.delete()},this.closePath=function(){f(this.Ld)},this.createImageData=function(){if(1===arguments.length){var t=arguments[0];return new l(new Uint8ClampedArray(4*t.width*t.height),t.width,t.height)}if(2===arguments.length){t=arguments[0];var e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}throw"createImageData expects 1 or 2 arguments, got "+arguments.length},this.createLinearGradient=function(t,n,r,i){if(e(arguments)){var o=new c(t,n,r,i);return this.we.push(o),o}},this.createPattern=function(t,e){return t=new g(t,e),this.we.push(t),t},this.createRadialGradient=function(t,n,r,i,o,a){if(e(arguments)){var s=new _(t,n,r,i,o,a);return this.we.push(s),s}},this.drawImage=function(e){var n=this.Ne();if(3===arguments.length||5===arguments.length)var r=t.XYWHRect(arguments[1],arguments[2],arguments[3]||e.width(),arguments[4]||e.height()),i=t.XYWHRect(0,0,e.width(),e.height());else{if(9!==arguments.length)throw"invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;r=t.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),i=t.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4])}this.Hd.drawImageRect(e,i,r,n,!1),n.dispose()},this.ellipse=function(t,e,n,r,i,o,a,s){d(this.Ld,t,e,n,r,i,o,a,s)},this.Ne=function(){var e=this.Jd.copy();if(e.setStyle(t.PaintStyle.Fill),r(this.Wd)){var n=t.multiplyByAlpha(this.Wd,this.de);e.setColor(n)}else n=this.Wd.oe(this.Nd),e.setColor(t.Color(0,0,0,this.de)),e.setShader(n);return e.dispose=function(){this.delete()},e},this.fill=function(e,n){if("string"==typeof e?(n=e,e=this.Ld):e&&e.Ze&&(e=e.Pd),"evenodd"===n)this.Ld.setFillType(t.FillType.EvenOdd);else{if("nonzero"!==n&&n)throw"invalid fill rule";this.Ld.setFillType(t.FillType.Winding)}e||(e=this.Ld),n=this.Ne();var r=this.te(n);r&&(this.Hd.save(),this.le(),this.Hd.drawPath(e,r),this.Hd.restore(),r.dispose()),this.Hd.drawPath(e,n),n.dispose()},this.fillRect=function(e,n,r,i){var o=this.Ne(),a=this.te(o);a&&(this.Hd.save(),this.le(),this.Hd.drawRect(t.XYWHRect(e,n,r,i),a),this.Hd.restore(),a.dispose()),this.Hd.drawRect(t.XYWHRect(e,n,r,i),o),o.dispose()},this.fillText=function(e,n,r){var i=this.Ne();e=t.TextBlob.MakeFromText(e,this.ne);var o=this.te(i);o&&(this.Hd.save(),this.le(),this.Hd.drawTextBlob(e,n,r,o),this.Hd.restore(),o.dispose()),this.Hd.drawTextBlob(e,n,r,i),e.delete(),i.dispose()},this.getImageData=function(e,n,r,i){return(e=this.Hd.readPixels(e,n,{width:r,height:i,colorType:t.ColorType.RGBA_8888,alphaType:t.AlphaType.Unpremul,colorSpace:t.ColorSpace.SRGB}))?new l(new Uint8ClampedArray(e.buffer),r,i):null},this.getLineDash=function(){return this.pe.slice()},this.lf=function(e){var n=t.Matrix.invert(this.Nd);return t.Matrix.mapPoints(n,e),e},this.isPointInPath=function(e,n,r){var i=arguments;if(3===i.length)var o=this.Ld;else{if(4!==i.length)throw"invalid arg count, need 3 or 4, got "+i.length;o=i[0],e=i[1],n=i[2],r=i[3]}return!(!isFinite(e)||!isFinite(n))&&("nonzero"===(r=r||"nonzero")||"evenodd"===r)&&(e=(i=this.lf([e,n]))[0],n=i[1],o.setFillType("nonzero"===r?t.FillType.Winding:t.FillType.EvenOdd),o.contains(e,n))},this.isPointInStroke=function(e,n){var r=arguments;if(2===r.length)var i=this.Ld;else{if(3!==r.length)throw"invalid arg count, need 2 or 3, got "+r.length;i=r[0],e=r[1],n=r[2]}return!(!isFinite(e)||!isFinite(n))&&(e=(r=this.lf([e,n]))[0],n=r[1],(i=i.copy()).setFillType(t.FillType.Winding),i.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Jd.getStrokeCap(),join:this.Jd.getStrokeJoin(),precision:.3}),r=i.contains(e,n),i.delete(),r)},this.lineTo=function(t,e){y(this.Ld,t,e)},this.measureText=function(){throw Error("Clients wishing to properly measure text should use the Paragraph API")},this.moveTo=function(t,n){var r=this.Ld;e([t,n])&&r.moveTo(t,n)},this.putImageData=function(n,r,i,o,a,s,u){if(e([r,i,o,a,s,u]))if(void 0===o)this.Hd.writePixels(n.data,n.width,n.height,r,i);else if(o=o||0,a=a||0,s=s||n.width,u=u||n.height,0>s&&(o+=s,s=Math.abs(s)),0>u&&(a+=u,u=Math.abs(u)),0>o&&(s+=o,o=0),0>a&&(u+=a,a=0),!(0>=s||0>=u)){n=t.MakeImage({width:n.width,height:n.height,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},n.data,4*n.width);var l=t.XYWHRect(o,a,s,u);r=t.XYWHRect(r+o,i+a,s,u),i=t.Matrix.invert(this.Nd),this.Hd.save(),this.Hd.concat(i),this.Hd.drawImageRect(n,l,r,null,!1),this.Hd.restore(),n.delete()}},this.quadraticCurveTo=function(t,n,r,i){var o=this.Ld;e([t,n,r,i])&&(o.isEmpty()&&o.moveTo(t,n),o.quadTo(t,n,r,i))},this.rect=function(n,r,i,o){var a=this.Ld;e(n=t.XYWHRect(n,r,i,o))&&a.addRect(n)},this.resetTransform=function(){this.Ld.transform(this.Nd);var e=t.Matrix.invert(this.Nd);this.Hd.concat(e),this.Nd=this.Hd.getTotalMatrix()},this.restore=function(){var e=this.kf.pop();if(e){var n=t.Matrix.multiply(this.Nd,t.Matrix.invert(e.Cf));this.Ld.transform(n),this.Jd.delete(),this.Jd=e.Zf,this.pe=e.Vf,this.He=e.lg,this.be=e.kg,this.Wd=e.fs,this.re=e.ig,this.se=e.jg,this.qe=e.cg,this.Ge=e.hg,this.de=e.Jf,this.Id=e.Kf,this.Fe=e.Wf,this.Oe=e.If,this.Hd.restore(),this.Nd=this.Hd.getTotalMatrix()}},this.rotate=function(e){if(isFinite(e)){var n=t.Matrix.rotated(-e);this.Ld.transform(n),this.Hd.rotate(e/Math.PI*180,0,0),this.Nd=this.Hd.getTotalMatrix()}},this.save=function(){if(this.Wd.me){var t=this.Wd.me();this.we.push(t)}else t=this.Wd;if(this.be.me){var e=this.be.me();this.we.push(e)}else e=this.be;this.kf.push({Cf:this.Nd.slice(),Vf:this.pe.slice(),lg:this.He,kg:e,fs:t,ig:this.re,jg:this.se,cg:this.qe,hg:this.Ge,Jf:this.de,Wf:this.Fe,Kf:this.Id,Zf:this.Jd.copy(),If:this.Oe}),this.Hd.save()},this.scale=function(n,r){if(e(arguments)){var i=t.Matrix.scaled(1/n,1/r);this.Ld.transform(i),this.Hd.scale(n,r),this.Nd=this.Hd.getTotalMatrix()}},this.setLineDash=function(t){for(var e=0;et[e])return;1==t.length%2&&Array.prototype.push.apply(t,t),this.pe=t},this.setTransform=function(t,n,r,i,o,a){e(arguments)&&(this.resetTransform(),this.transform(t,n,r,i,o,a))},this.le=function(){var e=t.Matrix.invert(this.Nd);this.Hd.concat(e),this.Hd.concat(t.Matrix.translated(this.re,this.se)),this.Hd.concat(this.Nd)},this.te=function(e){var n=t.multiplyByAlpha(this.Ge,this.de);if(!t.getColorComponents(n)[3]||!(this.qe||this.se||this.re))return null;(e=e.copy()).setColor(n);var r=t.MaskFilter.MakeBlur(t.BlurStyle.Normal,this.qe/2,!1);return e.setMaskFilter(r),e.dispose=function(){r.delete(),this.delete()},e},this.af=function(){var e=this.Jd.copy();if(e.setStyle(t.PaintStyle.Stroke),r(this.be)){var n=t.multiplyByAlpha(this.be,this.de);e.setColor(n)}else n=this.be.oe(this.Nd),e.setColor(t.Color(0,0,0,this.de)),e.setShader(n);if(e.setStrokeWidth(this.He),this.pe.length){var i=t.PathEffect.MakeDash(this.pe,this.Fe);e.setPathEffect(i)}return e.dispose=function(){i&&i.delete(),this.delete()},e},this.stroke=function(t){t=t?t.Pd:this.Ld;var e=this.af(),n=this.te(e);n&&(this.Hd.save(),this.le(),this.Hd.drawPath(t,n),this.Hd.restore(),n.dispose()),this.Hd.drawPath(t,e),e.dispose()},this.strokeRect=function(e,n,r,i){var o=this.af(),a=this.te(o);a&&(this.Hd.save(),this.le(),this.Hd.drawRect(t.XYWHRect(e,n,r,i),a),this.Hd.restore(),a.dispose()),this.Hd.drawRect(t.XYWHRect(e,n,r,i),o),o.dispose()},this.strokeText=function(e,n,r){var i=this.af();e=t.TextBlob.MakeFromText(e,this.ne);var o=this.te(i);o&&(this.Hd.save(),this.le(),this.Hd.drawTextBlob(e,n,r,o),this.Hd.restore(),o.dispose()),this.Hd.drawTextBlob(e,n,r,i),e.delete(),i.dispose()},this.translate=function(n,r){if(e(arguments)){var i=t.Matrix.translated(-n,-r);this.Ld.transform(i),this.Hd.translate(n,r),this.Nd=this.Hd.getTotalMatrix()}},this.transform=function(e,n,r,i,o,a){e=[e,r,o,n,i,a,0,0,1],n=t.Matrix.invert(e),this.Ld.transform(n),this.Hd.concat(e),this.Nd=this.Hd.getTotalMatrix()},this.addHitRegion=function(){},this.clearHitRegions=function(){},this.drawFocusIfNeeded=function(){},this.removeHitRegion=function(){},this.scrollPathIntoView=function(){},Object.defineProperty(this,"canvas",{value:null,writable:!1})}function u(e){this.bf=e,this.he=new s(e.getCanvas()),this.Pe=[],this.vf=t.FontMgr.RefDefault(),this.decodeImage=function(e){if(!(e=t.MakeImageFromEncoded(e)))throw"Invalid input";return this.Pe.push(e),e},this.loadFont=function(t,e){if(!(t=this.vf.MakeTypefaceFromData(t)))return null;this.Pe.push(t);var n=(e.style||"normal")+"|"+(e.variant||"normal")+"|"+(e.weight||"normal");e=e.family,T[e]||(T[e]={"*":t}),T[e][n]=t},this.makePath2D=function(t){return t=new m(t),this.Pe.push(t.Pd),t},this.getContext=function(t){return"2d"===t?this.he:null},this.toDataURL=function(e,n){this.bf.flush();var r=this.bf.makeImageSnapshot();if(r){e=e||"image/png";var o=t.ImageFormat.PNG;if("image/jpeg"===e&&(o=t.ImageFormat.JPEG),n=r.encodeToBytes(o,n||.92)){if(r.delete(),e="data:"+e+";base64,",Y)n=i.from(n).toString("base64");else{r=0,o=n.length;for(var a,s="";rt||1t);n++);this.Td.splice(n,0,t),this.Yd.splice(n,0,e)}},this.me=function(){var t=new c(e,n,r,i);return t.Yd=this.Yd.slice(),t.Td=this.Td.slice(),t},this.fe=function(){this.Rd&&(this.Rd.delete(),this.Rd=null)},this.oe=function(o){var a=[e,n,r,i];t.Matrix.mapPoints(o,a),o=a[0];var s=a[1],u=a[2];return a=a[3],this.fe(),this.Rd=t.Shader.MakeLinearGradient([o,s],[u,a],this.Yd,this.Td,t.TileMode.Clamp)}}function h(t,n,r,i,o,a){if(e([n,r,i,o,a])){if(0>a)throw"radii cannot be negative";t.isEmpty()&&t.moveTo(n,r),t.arcToTangent(n,r,i,o,a)}}function f(t){if(!t.isEmpty()){var e=t.getBounds();(e[3]-e[1]||e[2]-e[0])&&t.close()}}function p(e,n,r,i,o,a,s){s=(s-a)/Math.PI*180,a=a/Math.PI*180,n=t.LTRBRect(n-i,r-o,n+i,r+o),1e-5>Math.abs(Math.abs(s)-360)?(r=s/2,e.arcToOval(n,a,r,!1),e.arcToOval(n,a+r,r,!1)):e.arcToOval(n,a,s,!1)}function d(n,r,i,o,a,s,u,l,c){if(e([r,i,o,a,s,u,l])){if(0>o||0>a)throw"radii cannot be negative";var h=2*Math.PI,f=u%h;0>f&&(f+=h);var d=f-u;u=f,l+=d,!c&&l-u>=h?l=u+h:c&&u-l>=h?l=u-h:!c&&u>l?l=u+(h-(u-l)%h):c&&ut||1t);n++);this.Td.splice(n,0,t),this.Yd.splice(n,0,e)}},this.me=function(){var t=new _(e,n,r,i,a,s);return t.Yd=this.Yd.slice(),t.Td=this.Td.slice(),t},this.fe=function(){this.Rd&&(this.Rd.delete(),this.Rd=null)},this.oe=function(o){var u=[e,n,i,a];t.Matrix.mapPoints(o,u);var l=u[0],c=u[1],h=u[2];u=u[3];var f=(Math.abs(o[0])+Math.abs(o[4]))/2;return o=r*f,f*=s,this.fe(),this.Rd=t.Shader.MakeTwoPointConicalGradient([l,c],o,[h,u],f,this.Yd,this.Td,t.TileMode.Clamp)}}t._testing={};var b={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498,1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1,.498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0,.545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1,.078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125,1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486,.988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529,.808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333,.827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678,1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1),peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957,.643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549,1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};t._testing.parseColor=o,t._testing.colorToString=n;var v=/(italic|oblique|normal|)\s*(small-caps|normal|)\s*(bold|bolder|lighter|[1-9]00|normal|)\s*([\d\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)/,T={"Noto Mono":{"*":null},monospace:{"*":null}};t._testing.parseFontString=a,t.MakeCanvas=function(e,n){return(e=t.MakeSurface(e,n))?new u(e):null},t.ImageData=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}if(3===arguments.length){var n=arguments[0];if(n.prototype.constructor!==Uint8ClampedArray)throw"bytes must be given as a Uint8ClampedArray";if(n%4)throw"bytes must be given in a multiple of 4";if(n%(t=arguments[1]))throw"bytes must divide evenly by width";if((e=arguments[2])&&e!==n/(4*t))throw"invalid height given";return new l(n,t,n/(4*t))}throw"invalid number of arguments - takes 2 or 3, saw "+arguments.length}}()}(e);var c,h={};for(c in e)e.hasOwnProperty(c)&&(h[c]=e[c]);var f,p,d,y,m="./this.program";function g(t,e){throw e}f="object"==typeof window,p="function"==typeof importScripts,d="object"==typeof o&&"object"==typeof o.versions&&"string"==typeof o.versions.node,y=!f&&!d&&!p;var _,b,v,T,E,w="";d?(w=p?n(3935).dirname(w)+"/":"//",_=function(t,e){return T||(T=n(5699)),E||(E=n(3935)),t=E.normalize(t),T.readFileSync(t,e?null:"utf8")},v=function(t){return(t=_(t,!0)).buffer||(t=new Uint8Array(t)),I(t.buffer),t},1=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function L(t,e){return t?R(B,t,e):""}function D(t,e,n,r){if(!(0=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++]=a}else{if(2047>=a){if(n+1>=r)break;e[n++]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++]=224|a>>12}else{if(n+3>=r)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63}e[n++]=128|a>>6&63}e[n++]=128|63&a}}return e[n]=0,n-i}function k(t){for(var e=0,n=0;n=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4}return e}var F,U,B,j,G,W,q,H,z,V="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function X(t,e){for(var n=t>>1,r=n+e/2;!(n>=r)&&G[n];)++n;if(32<(n<<=1)-t&&V)return V.decode(B.subarray(t,n));for(n="",r=0;!(r>=e/2);++r){var i=j[t+2*r>>1];if(0==i)break;n+=String.fromCharCode(i)}return n}function Y(t,e,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=e;n=(n-=2)<2*t.length?n/2:t.length;for(var i=0;i>1]=t.charCodeAt(i),e+=2;return j[e>>1]=0,e-r}function Z(t){return 2*t.length}function Q(t,e){for(var n=0,r="";!(n>=e/4);){var i=W[t+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r}function K(t,e,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=e;n=r+n-4;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),W[e>>2]=o,(e+=4)+4>n)break}return W[e>>2]=0,e-r}function J(t){for(var e=0,n=0;n=r&&++n,e+=4}return e}function $(){var t=O.buffer;F=t,e.HEAP8=U=new Int8Array(t),e.HEAP16=j=new Int16Array(t),e.HEAP32=W=new Int32Array(t),e.HEAPU8=B=new Uint8Array(t),e.HEAPU16=G=new Uint16Array(t),e.HEAPU32=q=new Uint32Array(t),e.HEAPF32=H=new Float32Array(t),e.HEAPF64=z=new Float64Array(t)}var tt,et=[],nt=[],rt=[];function it(){var t=e.preRun.shift();et.unshift(t)}var ot=0,at=null,st=null;function ut(t){throw e.onAbort&&e.onAbort(t),C(t),A=!0,t=new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info."),u(t),t}function lt(){return ct.startsWith("data:application/octet-stream;base64,")}e.preloadedImages={},e.preloadedAudios={};var ct="canvaskit.wasm";if(!lt()){var ht=ct;ct=e.locateFile?e.locateFile(ht,w):w+ht}function ft(){var t=ct;try{if(t==ct&&M)return new Uint8Array(M);if(v)return v(t);throw"both async and sync fetching of the wasm failed"}catch(t){ut(t)}}function pt(t){for(;0>2])}var vt={},Tt={},Et={};function wt(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+t:t}function xt(t,e){return t=wt(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function Ct(t){var e=Error,n=xt(t,(function(e){this.name=t,this.message=e,void 0!==(e=Error(e).stack)&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Mt=void 0;function St(t){throw new Mt(t)}function Nt(t,e,n){function r(e){(e=n(e)).length!==t.length&&St("Mismatched type converter count");for(var r=0;ro&&Rt("argTypes array size mismatch! Must at least get return value and 'this' types!");var a=null!==e[1]&&null!==n,s=!1;for(n=1;n>2)+r]);return n}var ce=[],he=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function fe(t){4>1])};case 2:return function(t){return this.fromWireType((n?W:q)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function ye(t,e){var n=Tt[t];return void 0===n&&Rt(e+" has unknown type "+oe(t)),n}function me(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function ge(t,e){switch(e){case 2:return function(t){return this.fromWireType(H[t>>2])};case 3:return function(t){return this.fromWireType(z[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function _e(t,e,n){switch(e){case 0:return n?function(t){return U[t]}:function(t){return B[t]};case 1:return n?function(t){return j[t>>1]}:function(t){return G[t>>1]};case 2:return n?function(t){return W[t>>2]}:function(t){return q[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var be={};function ve(t){var e=be[t];return void 0===e?It(t):e}var Te,Ee=[];function we(t){return t||Rt("Cannot use deleted val. handle = "+t),he[t].value}Te=d?function(){var t=o.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var xe=1,Ce=[],Me=[],Se=[],Ne=[],Oe=[],Ae=[],Ie=[],Pe=[],Re=[],Le=[],De={},ke={},Fe=4;function Ue(t){Ge||(Ge=t)}function Be(t){for(var e=xe++,n=t.length;n>2]=a}}function ze(t,e){if(e){var n=void 0;switch(t){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var r=ln.getParameter(34467);n=r?r.length:0;break;case 33309:if(2>We.version)return void Ue(1282);n=2*(ln.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>We.version)return void Ue(1280);n=33307==t?3:0}if(void 0===n)switch(r=ln.getParameter(t),typeof r){case"number":n=r;break;case"boolean":n=r?1:0;break;case"string":return void Ue(1280);case"object":if(null===r)switch(t){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Ue(1280)}else{if(r instanceof Float32Array||r instanceof Uint32Array||r instanceof Int32Array||r instanceof Array){for(t=0;t>2]=r[t];return}try{n=0|r.name}catch(e){return Ue(1280),void C("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+t+")! (error: "+e+")")}}break;default:return Ue(1280),void C("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+t+") and it returns "+r+" of type "+typeof r+"!")}W[e>>2]=n}else Ue(1281)}function Ve(t){var e=k(t)+1,n=gn(e);return D(t,B,n,e),n}function Xe(t){return 0==(t-=5120)?U:1==t?B:2==t?j:4==t?W:6==t?H:5==t||28922==t||28520==t||30779==t||30782==t?q:G}function Ye(t,e,n,r,i){t=Xe(t);var o=31-Math.clz32(t.BYTES_PER_ELEMENT),a=Fe;return t.subarray(i>>o,i+r*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1)*(1<>o)}function Ze(t){var e=ln.Df,n=e.Ye[t];return 0<=n&&(e.Ye[t]=n=ln.getUniformLocation(e,e.uf[t]+(0un;++un)sn[un]=String.fromCharCode(un);At=sn,Pt=e.BindingError=Ct("BindingError"),qt.prototype.isAliasOf=function(t){if(!(this instanceof qt&&t instanceof qt))return!1;var e=this.Gd.Qd.Kd,n=this.Gd.Md,r=t.Gd.Qd.Kd;for(t=t.Gd.Md;e.ce;)n=e.Me(n),e=e.ce;for(;r.ce;)t=r.Me(t),r=r.ce;return e===r&&n===t},qt.prototype.clone=function(){if(this.Gd.Md||Dt(this),this.Gd.Ke)return this.Gd.count.value+=1,this;var t=Bt,e=Object,n=e.create,r=Object.getPrototypeOf(this),i=this.Gd;return(t=t(n.call(e,r,{Gd:{value:{count:i.count,ze:i.ze,Ke:i.Ke,Md:i.Md,Qd:i.Qd,Xd:i.Xd,ae:i.ae}}}))).Gd.count.value+=1,t.Gd.ze=!1,t},qt.prototype.delete=function(){this.Gd.Md||Dt(this),this.Gd.ze&&!this.Gd.Ke&&Rt("Object already scheduled for deletion"),Ft(this),Ut(this.Gd),this.Gd.Ke||(this.Gd.Xd=void 0,this.Gd.Md=void 0)},qt.prototype.isDeleted=function(){return!this.Gd.Md},qt.prototype.deleteLater=function(){return this.Gd.Md||Dt(this),this.Gd.ze&&!this.Gd.Ke&&Rt("Object already scheduled for deletion"),Gt.push(this),1===Gt.length&&jt&&jt(Wt),this.Gd.ze=!0,this},ee.prototype.Mf=function(t){return this.tf&&(t=this.tf(t)),t},ee.prototype.mf=function(t){this.ee&&this.ee(t)},ee.prototype.argPackAdvance=8,ee.prototype.readValueFromPointer=bt,ee.prototype.deleteObject=function(t){null!==t&&t.delete()},ee.prototype.fromWireType=function(t){function e(){return this.Re?te(this.Kd.Ae,{Qd:this.$f,Md:n,ae:this,Xd:t}):te(this.Kd.Ae,{Qd:this,Md:t})}var n=this.Mf(t);if(!n)return this.mf(t),null;var r=function(t,e){for(void 0===e&&Rt("ptr should not be undefined");t.ce;)e=t.Me(e),t=t.ce;return $t[e]}(this.Kd,n);if(void 0!==r)return 0===r.Gd.count.value?(r.Gd.Md=n,r.Gd.Xd=t,r.clone()):(r=r.clone(),this.mf(t),r);if(r=this.Kd.Lf(n),!(r=Ht[r]))return e.call(this);r=this.Qe?r.Bf:r.pointerType;var i=Jt(n,this.Kd,r.Kd);return null===i?e.call(this):this.Re?te(r.Kd.Ae,{Qd:r,Md:i,ae:this,Xd:t}):te(r.Kd.Ae,{Qd:r,Md:i})},e.getInheritedInstanceCount=function(){return Object.keys($t).length},e.getLiveInheritedInstances=function(){var t,e=[];for(t in $t)$t.hasOwnProperty(t)&&e.push($t[t]);return e},e.flushPendingDeletes=Wt,e.setDelayFunction=function(t){jt=t,Gt.length&&jt&&jt(Wt)},ie=e.UnboundTypeError=Ct("UnboundTypeError"),e.count_emval_handles=function(){for(var t=0,e=5;ecn;++cn)qe.push(Array(cn));var hn=new Float32Array(288);for(cn=0;288>cn;++cn)Ke[cn]=hn.subarray(0,cn+1);var fn=new Int32Array(288);for(cn=0;288>cn;++cn)Je[cn]=fn.subarray(0,cn+1);var pn={F:function(){return 0},xb:function(){},zb:function(){return 0},vb:function(t,e,n,r,i,o){return o<<=12,0!=(16&r)&&0!=t%65536?e=-28:0!=(32&r)?(t=wn(65536,e))?(dn(t,0,e),dt[t]={Yf:t,Xf:e,Af:!0,fd:i,vg:n,flags:r,offset:o},e=t):e=-48:e=-52,e},ub:function(t,e){if(-1==(0|t)||0===e)t=-28;else{var n=dt[t];n&&e===n.Xf&&(dt[t]=null,n.Af&&mn(n.Yf)),t=0}return t},Bb:function(){},wb:function(){},E:function(t){var e=gt[t];delete gt[t];var n=e.ff,r=e.ee,i=e.qf;Nt([t],i.map((function(t){return t.Qf})).concat(i.map((function(t){return t.eg}))),(function(t){var o={};return i.forEach((function(e,n){var r=t[n],a=e.Of,s=e.Pf,u=t[n+i.length],l=e.dg,c=e.fg;o[e.Hf]={read:function(t){return r.fromWireType(a(s,t))},write:function(t,e){var n=[];l(c,t,u.toWireType(n,e)),_t(n)}}})),[{name:e.name,fromWireType:function(t){var e,n={};for(e in o)n[e]=o[e].read(t);return r(t),n},toWireType:function(t,e){for(var i in o)if(!(i in e))throw new TypeError('Missing field: "'+i+'"');var a=n();for(i in o)o[i].write(a,e[i]);return null!==t&&t.push(r,a),a},argPackAdvance:8,readValueFromPointer:bt,$d:r}]}))},nb:function(){},Db:function(t,e,n,r,i){var o=Ot(n);Lt(t,{name:e=It(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var r=U;else if(2===n)r=j;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=W}return this.fromWireType(r[t>>o])},$d:null})},k:function(t,e,n,r,i,o,a,s,u,l,c,h,f){c=It(c),o=re(i,o),s&&(s=re(a,s)),l&&(l=re(u,l)),f=re(h,f);var p=wt(c);Vt(p,(function(){ae("Cannot construct "+c+" due to unbound types",[r])})),Nt([t,e,n],r?[r]:[],(function(e){if(e=e[0],r)var n=e.Kd,i=n.Ae;else i=qt.prototype;e=xt(p,(function(){if(Object.getPrototypeOf(this)!==a)throw new Pt("Use 'new' to construct "+c);if(void 0===u.ie)throw new Pt(c+" has no accessible constructor");var t=u.ie[arguments.length];if(void 0===t)throw new Pt("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.ie).toString()+") parameters instead!");return t.apply(this,arguments)}));var a=Object.create(i,{constructor:{value:e}});e.prototype=a;var u=new Xt(c,e,a,f,n,o,s,l);n=new ee(c,u,!0,!1,!1),i=new ee(c+"*",u,!1,!1,!1);var h=new ee(c+" const*",u,!1,!0,!1);return Ht[t]={pointerType:i,Bf:h},ne(p,e),[n,i,h]}))},f:function(t,e,n,r,i,o,a){var s=le(n,r);e=It(e),o=re(i,o),Nt([],[t],(function(t){function r(){ae("Cannot call "+i+" due to unbound types",s)}var i=(t=t[0]).name+"."+e,u=t.Kd.constructor;return void 0===u[e]?(r.xe=n-1,u[e]=r):(zt(u,e,i),u[e].Sd[n-1]=r),Nt([],s,(function(t){return t=[t[0],null].concat(t.slice(1)),t=ue(i,t,null,o,a),void 0===u[e].Sd?(t.xe=n-1,u[e]=t):u[e].Sd[n-1]=t,[]})),[]}))},t:function(t,e,n,r,i,o){I(0>>s}}var u=e.includes("unsigned");Lt(t,{name:e,fromWireType:o,toWireType:function(t,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+me(n)+'" to '+this.name);if(ni)throw new TypeError('Passing a number "'+me(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+i+"]!");return u?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:_e(e,a,0!==r),$d:null})},s:function(t,e,n){function r(t){var e=q;return new i(F,e[1+(t>>=2)],e[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];Lt(t,{name:n=It(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Sf:!0})},p:function(t,e,n,r,i,o,a,s,u,l,c,h){n=It(n),o=re(i,o),s=re(a,s),l=re(u,l),h=re(c,h),Nt([t],[e],(function(t){return t=t[0],[new ee(n,t.Kd,!1,!1,!0,t,r,o,s,l,h)]}))},J:function(t,e){var n="std::string"===(e=It(e));Lt(t,{name:e,fromWireType:function(t){var e=q[t>>2];if(n)for(var r=t+4,i=0;i<=e;++i){var o=t+4+i;if(i==e||0==B[o]){if(r=L(r,o-r),void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(e),i=0;i>2]=i,n&&r)D(e,B,o+4,i+1);else if(r)for(r=0;r>2],o=a(),u=t+4,l=0;l<=i;++l){var c=t+4+l*e;l!=i&&0!=o[c>>s]||(u=r(u,c-u),void 0===n?n=u:(n+=String.fromCharCode(0),n+=u),u=c+e)}return mn(t),n},toWireType:function(t,r){"string"!=typeof r&&Rt("Cannot pass non-string to C++ string type "+n);var a=o(r),u=gn(4+a+e);return q[u>>2]=a>>s,i(r,u+4,a+e),null!==t&&t.push(mn,u),u},argPackAdvance:8,readValueFromPointer:bt,$d:function(t){mn(t)}})},N:function(t,e,n,r,i,o){gt[t]={name:It(e),ff:re(n,r),ee:re(i,o),qf:[]}},w:function(t,e,n,r,i,o,a,s,u,l){gt[t].qf.push({Hf:It(e),Qf:n,Of:re(r,i),Pf:o,eg:a,dg:re(s,u),fg:l})},Eb:function(t,e){Lt(t,{Uf:!0,name:e=It(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},jb:function(t,e,n,r,i){t=Ee[t],e=we(e),n=ve(n);var o=[];return W[r>>2]=pe(o),t(e,n,o,i)},x:function(t,e,n,r){(t=Ee[t])(e=we(e),n=ve(n),null,r)},_:fe,v:function(t,e){e=function(t,e){for(var n=Array(t),r=0;r>2)+r],"parameter "+r);return n}(t,e);for(var n=e[0],r=n.name+"_$"+e.slice(1).map((function(t){return t.name})).join("_")+"$",i=["retType"],o=[n],a="",s=0;s>2]=28,-1;t=Te()}return W[e>>2]=t/1e3|0,W[e+4>>2]=t%1e3*1e6|0,0},Yc:function(t){ln.activeTexture(t)},Q:function(t,e){ln.attachShader(Me[t],Ae[e])},R:function(t,e,n){ln.bindAttribLocation(Me[t],e,L(n))},S:function(t,e){35051==t?ln.df=e:35052==t&&(ln.ye=e),ln.bindBuffer(t,Ce[e])},$b:function(t,e){ln.bindFramebuffer(t,Se[e])},ac:function(t,e){ln.bindRenderbuffer(t,Ne[e])},Nb:function(t,e){ln.bindSampler(t,Re[e])},T:function(t,e){ln.bindTexture(t,Oe[e])},uc:function(t){ln.bindVertexArray(Ie[t])},xc:function(t){ln.bindVertexArray(Ie[t])},U:function(t,e,n,r){ln.blendColor(t,e,n,r)},V:function(t){ln.blendEquation(t)},W:function(t,e){ln.blendFunc(t,e)},Ub:function(t,e,n,r,i,o,a,s,u,l){ln.blitFramebuffer(t,e,n,r,i,o,a,s,u,l)},X:function(t,e,n,r){2<=We.version?n?ln.bufferData(t,B,r,n,e):ln.bufferData(t,e,r):ln.bufferData(t,n?B.subarray(n,n+e):e,r)},Y:function(t,e,n,r){2<=We.version?ln.bufferSubData(t,e,B,r,n):ln.bufferSubData(t,e,B.subarray(r,r+n))},bc:function(t){return ln.checkFramebufferStatus(t)},Z:function(t){ln.clear(t)},$:function(t,e,n,r){ln.clearColor(t,e,n,r)},aa:function(t){ln.clearStencil(t)},eb:function(t,e,n,r){return ln.clientWaitSync(Le[t],e,(n>>>0)+4294967296*r)},ba:function(t,e,n,r){ln.colorMask(!!t,!!e,!!n,!!r)},ca:function(t){ln.compileShader(Ae[t])},da:function(t,e,n,r,i,o,a,s){2<=We.version?ln.ye?ln.compressedTexImage2D(t,e,n,r,i,o,a,s):ln.compressedTexImage2D(t,e,n,r,i,o,B,s,a):ln.compressedTexImage2D(t,e,n,r,i,o,s?B.subarray(s,s+a):null)},ea:function(t,e,n,r,i,o,a,s,u){2<=We.version?ln.ye?ln.compressedTexSubImage2D(t,e,n,r,i,o,a,s,u):ln.compressedTexSubImage2D(t,e,n,r,i,o,a,B,u,s):ln.compressedTexSubImage2D(t,e,n,r,i,o,a,u?B.subarray(u,u+s):null)},fa:function(t,e,n,r,i,o,a,s){ln.copyTexSubImage2D(t,e,n,r,i,o,a,s)},ga:function(){var t=Be(Me),e=ln.createProgram();return e.name=t,e.Ue=e.Se=e.Te=0,e.hf=1,Me[t]=e,t},ha:function(t){var e=Be(Ae);return Ae[e]=ln.createShader(t),e},ia:function(t){ln.cullFace(t)},ka:function(t,e){for(var n=0;n>2],i=Ce[r];i&&(ln.deleteBuffer(i),i.name=0,Ce[r]=null,r==ln.df&&(ln.df=0),r==ln.ye&&(ln.ye=0))}},cc:function(t,e){for(var n=0;n>2],i=Se[r];i&&(ln.deleteFramebuffer(i),i.name=0,Se[r]=null)}},la:function(t){if(t){var e=Me[t];e?(ln.deleteProgram(e),e.name=0,Me[t]=null):Ue(1281)}},dc:function(t,e){for(var n=0;n>2],i=Ne[r];i&&(ln.deleteRenderbuffer(i),i.name=0,Ne[r]=null)}},Ob:function(t,e){for(var n=0;n>2],i=Re[r];i&&(ln.deleteSampler(i),i.name=0,Re[r]=null)}},ma:function(t){if(t){var e=Ae[t];e?(ln.deleteShader(e),Ae[t]=null):Ue(1281)}},Wb:function(t){if(t){var e=Le[t];e?(ln.deleteSync(e),e.name=0,Le[t]=null):Ue(1281)}},na:function(t,e){for(var n=0;n>2],i=Oe[r];i&&(ln.deleteTexture(i),i.name=0,Oe[r]=null)}},vc:function(t,e){for(var n=0;n>2];ln.deleteVertexArray(Ie[r]),Ie[r]=null}},yc:function(t,e){for(var n=0;n>2];ln.deleteVertexArray(Ie[r]),Ie[r]=null}},oa:function(t){ln.depthMask(!!t)},pa:function(t){ln.disable(t)},qa:function(t){ln.disableVertexAttribArray(t)},ra:function(t,e,n){ln.drawArrays(t,e,n)},sc:function(t,e,n,r){ln.drawArraysInstanced(t,e,n,r)},qc:function(t,e,n,r,i){ln.nf.drawArraysInstancedBaseInstanceWEBGL(t,e,n,r,i)},oc:function(t,e){for(var n=qe[t],r=0;r>2];ln.drawBuffers(n)},sa:function(t,e,n,r){ln.drawElements(t,e,n,r)},tc:function(t,e,n,r,i){ln.drawElementsInstanced(t,e,n,r,i)},rc:function(t,e,n,r,i,o,a){ln.nf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(t,e,n,r,i,o,a)},ic:function(t,e,n,r,i,o){ln.drawElements(t,r,i,o)},ta:function(t){ln.enable(t)},va:function(t){ln.enableVertexAttribArray(t)},Sb:function(t,e){return(t=ln.fenceSync(t,e))?(e=Be(Le),t.name=e,Le[e]=t,e):0},wa:function(){ln.finish()},xa:function(){ln.flush()},ec:function(t,e,n,r){ln.framebufferRenderbuffer(t,e,n,Ne[r])},fc:function(t,e,n,r,i){ln.framebufferTexture2D(t,e,n,Oe[r],i)},ya:function(t){ln.frontFace(t)},za:function(t,e){He(t,e,"createBuffer",Ce)},gc:function(t,e){He(t,e,"createFramebuffer",Se)},hc:function(t,e){He(t,e,"createRenderbuffer",Ne)},Pb:function(t,e){He(t,e,"createSampler",Re)},Aa:function(t,e){He(t,e,"createTexture",Oe)},wc:function(t,e){He(t,e,"createVertexArray",Ie)},zc:function(t,e){He(t,e,"createVertexArray",Ie)},Xb:function(t){ln.generateMipmap(t)},Ba:function(t,e,n){n?W[n>>2]=ln.getBufferParameter(t,e):Ue(1281)},Ca:function(){var t=ln.getError()||Ge;return Ge=0,t},Yb:function(t,e,n,r){((t=ln.getFramebufferAttachmentParameter(t,e,n))instanceof WebGLRenderbuffer||t instanceof WebGLTexture)&&(t=0|t.name),W[r>>2]=t},cb:function(t,e){ze(t,e)},Da:function(t,e,n,r){null===(t=ln.getProgramInfoLog(Me[t]))&&(t="(unknown error)"),e=0>2]=e)},Ea:function(t,e,n){if(n)if(t>=xe)Ue(1281);else if(t=Me[t],35716==e)null===(t=ln.getProgramInfoLog(t))&&(t="(unknown error)"),W[n>>2]=t.length+1;else if(35719==e){if(!t.Ue)for(e=0;e>2]=t.Ue}else if(35722==e){if(!t.Se)for(e=0;e>2]=t.Se}else if(35381==e){if(!t.Te)for(e=0;e>2]=t.Te}else W[n>>2]=ln.getProgramParameter(t,e);else Ue(1281)},Zb:function(t,e,n){n?W[n>>2]=ln.getRenderbufferParameter(t,e):Ue(1281)},Fa:function(t,e,n,r){null===(t=ln.getShaderInfoLog(Ae[t]))&&(t="(unknown error)"),e=0>2]=e)},Kb:function(t,e,n,r){t=ln.getShaderPrecisionFormat(t,e),W[n>>2]=t.rangeMin,W[n+4>>2]=t.rangeMax,W[r>>2]=t.precision},Ga:function(t,e,n){n?35716==e?(null===(t=ln.getShaderInfoLog(Ae[t]))&&(t="(unknown error)"),W[n>>2]=t?t.length+1:0):35720==e?(t=ln.getShaderSource(Ae[t]),W[n>>2]=t?t.length+1:0):W[n>>2]=ln.getShaderParameter(Ae[t],e):Ue(1281)},D:function(t){var e=De[t];if(!e){switch(t){case 7939:e=Ve((e=(e=ln.getSupportedExtensions()||[]).concat(e.map((function(t){return"GL_"+t})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:(e=ln.getParameter(t))||Ue(1280),e=e&&Ve(e);break;case 7938:e=ln.getParameter(7938),e=Ve(e=2<=We.version?"OpenGL ES 3.0 ("+e+")":"OpenGL ES 2.0 ("+e+")");break;case 35724:var n=(e=ln.getParameter(35724)).match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==n&&(3==n[1].length&&(n[1]+="0"),e="OpenGL ES GLSL ES "+n[1]+" ("+e+")"),e=Ve(e);break;default:Ue(1280)}De[t]=e}return e},db:function(t,e){if(2>We.version)return Ue(1282),0;var n=ke[t];return n?0>e||e>=n.length?(Ue(1281),0):n[e]:7939===t?(n=(n=(n=ln.getSupportedExtensions()||[]).concat(n.map((function(t){return"GL_"+t})))).map((function(t){return Ve(t)})),n=ke[t]=n,0>e||e>=n.length?(Ue(1281),0):n[e]):(Ue(1280),0)},Ha:function(t,e){function n(t){return"]"==t.slice(-1)&&t.lastIndexOf("[")}e=L(e);var r,i=(t=Me[t]).Ye,o=t.qg,a=0,s=e,u=n(e);if(!i)for(t.Ye=i={},t.uf={},r=0;r>>0,s=e.slice(0,u)),(o=o[s])&&a>2];ln.invalidateFramebuffer(t,r)},Mb:function(t,e,n,r,i,o,a){for(var s=qe[e],u=0;u>2];ln.invalidateSubFramebuffer(t,s,r,i,o,a)},Tb:function(t){return ln.isSync(Le[t])},Ia:function(t){return(t=Oe[t])?ln.isTexture(t):0},Ja:function(t){ln.lineWidth(t)},Ka:function(t){t=Me[t],ln.linkProgram(t),t.Ye=0,t.qg={}},mc:function(t,e,n,r,i,o){ln.sf.multiDrawArraysInstancedBaseInstanceWEBGL(t,W,e>>2,W,n>>2,W,r>>2,q,i>>2,o)},nc:function(t,e,n,r,i,o,a,s){ln.sf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(t,W,e>>2,n,W,r>>2,W,i>>2,W,o>>2,q,a>>2,s)},La:function(t,e){3317==t&&(Fe=e),ln.pixelStorei(t,e)},pc:function(t){ln.readBuffer(t)},Ma:function(t,e,n,r,i,o,a){if(2<=We.version)if(ln.df)ln.readPixels(t,e,n,r,i,o,a);else{var s=Xe(o);ln.readPixels(t,e,n,r,i,o,s,a>>31-Math.clz32(s.BYTES_PER_ELEMENT))}else(a=Ye(o,i,n,r,a))?ln.readPixels(t,e,n,r,i,o,a):Ue(1280)},_b:function(t,e,n,r){ln.renderbufferStorage(t,e,n,r)},Vb:function(t,e,n,r,i){ln.renderbufferStorageMultisample(t,e,n,r,i)},Qb:function(t,e,n){ln.samplerParameteri(Re[t],e,n)},Rb:function(t,e,n){ln.samplerParameteri(Re[t],e,W[n>>2])},Na:function(t,e,n,r){ln.scissor(t,e,n,r)},Oa:function(t,e,n,r){for(var i="",o=0;o>2]:-1;i+=L(W[n+4*o>>2],0>a?void 0:a)}ln.shaderSource(Ae[t],i)},Pa:function(t,e,n){ln.stencilFunc(t,e,n)},Qa:function(t,e,n,r){ln.stencilFuncSeparate(t,e,n,r)},Ra:function(t){ln.stencilMask(t)},Sa:function(t,e){ln.stencilMaskSeparate(t,e)},Ta:function(t,e,n){ln.stencilOp(t,e,n)},Ua:function(t,e,n,r){ln.stencilOpSeparate(t,e,n,r)},Va:function(t,e,n,r,i,o,a,s,u){if(2<=We.version)if(ln.ye)ln.texImage2D(t,e,n,r,i,o,a,s,u);else if(u){var l=Xe(s);ln.texImage2D(t,e,n,r,i,o,a,s,l,u>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else ln.texImage2D(t,e,n,r,i,o,a,s,null);else ln.texImage2D(t,e,n,r,i,o,a,s,u?Ye(s,a,r,i,u):null)},Wa:function(t,e,n){ln.texParameterf(t,e,n)},Xa:function(t,e,n){ln.texParameterf(t,e,H[n>>2])},Ya:function(t,e,n){ln.texParameteri(t,e,n)},_a:function(t,e,n){ln.texParameteri(t,e,W[n>>2])},jc:function(t,e,n,r,i){ln.texStorage2D(t,e,n,r,i)},$a:function(t,e,n,r,i,o,a,s,u){if(2<=We.version)if(ln.ye)ln.texSubImage2D(t,e,n,r,i,o,a,s,u);else if(u){var l=Xe(s);ln.texSubImage2D(t,e,n,r,i,o,a,s,l,u>>31-Math.clz32(l.BYTES_PER_ELEMENT))}else ln.texSubImage2D(t,e,n,r,i,o,a,s,null);else l=null,u&&(l=Ye(s,a,i,o,u)),ln.texSubImage2D(t,e,n,r,i,o,a,s,l)},ab:function(t,e){ln.uniform1f(Ze(t),e)},bb:function(t,e,n){if(2<=We.version)ln.uniform1fv(Ze(t),H,n>>2,e);else{if(288>=e)for(var r=Ke[e-1],i=0;i>2];else r=H.subarray(n>>2,n+4*e>>2);ln.uniform1fv(Ze(t),r)}},Uc:function(t,e){ln.uniform1i(Ze(t),e)},Vc:function(t,e,n){if(2<=We.version)ln.uniform1iv(Ze(t),W,n>>2,e);else{if(288>=e)for(var r=Je[e-1],i=0;i>2];else r=W.subarray(n>>2,n+4*e>>2);ln.uniform1iv(Ze(t),r)}},Wc:function(t,e,n){ln.uniform2f(Ze(t),e,n)},Xc:function(t,e,n){if(2<=We.version)ln.uniform2fv(Ze(t),H,n>>2,2*e);else{if(144>=e)for(var r=Ke[2*e-1],i=0;i<2*e;i+=2)r[i]=H[n+4*i>>2],r[i+1]=H[n+(4*i+4)>>2];else r=H.subarray(n>>2,n+8*e>>2);ln.uniform2fv(Ze(t),r)}},Tc:function(t,e,n){ln.uniform2i(Ze(t),e,n)},Sc:function(t,e,n){if(2<=We.version)ln.uniform2iv(Ze(t),W,n>>2,2*e);else{if(144>=e)for(var r=Je[2*e-1],i=0;i<2*e;i+=2)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2];else r=W.subarray(n>>2,n+8*e>>2);ln.uniform2iv(Ze(t),r)}},Rc:function(t,e,n,r){ln.uniform3f(Ze(t),e,n,r)},Qc:function(t,e,n){if(2<=We.version)ln.uniform3fv(Ze(t),H,n>>2,3*e);else{if(96>=e)for(var r=Ke[3*e-1],i=0;i<3*e;i+=3)r[i]=H[n+4*i>>2],r[i+1]=H[n+(4*i+4)>>2],r[i+2]=H[n+(4*i+8)>>2];else r=H.subarray(n>>2,n+12*e>>2);ln.uniform3fv(Ze(t),r)}},Pc:function(t,e,n,r){ln.uniform3i(Ze(t),e,n,r)},Oc:function(t,e,n){if(2<=We.version)ln.uniform3iv(Ze(t),W,n>>2,3*e);else{if(96>=e)for(var r=Je[3*e-1],i=0;i<3*e;i+=3)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2];else r=W.subarray(n>>2,n+12*e>>2);ln.uniform3iv(Ze(t),r)}},Nc:function(t,e,n,r,i){ln.uniform4f(Ze(t),e,n,r,i)},Mc:function(t,e,n){if(2<=We.version)ln.uniform4fv(Ze(t),H,n>>2,4*e);else{if(72>=e){var r=Ke[4*e-1],i=H;n>>=2;for(var o=0;o<4*e;o+=4){var a=n+o;r[o]=i[a],r[o+1]=i[a+1],r[o+2]=i[a+2],r[o+3]=i[a+3]}}else r=H.subarray(n>>2,n+16*e>>2);ln.uniform4fv(Ze(t),r)}},Ac:function(t,e,n,r,i){ln.uniform4i(Ze(t),e,n,r,i)},Bc:function(t,e,n){if(2<=We.version)ln.uniform4iv(Ze(t),W,n>>2,4*e);else{if(72>=e)for(var r=Je[4*e-1],i=0;i<4*e;i+=4)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2],r[i+3]=W[n+(4*i+12)>>2];else r=W.subarray(n>>2,n+16*e>>2);ln.uniform4iv(Ze(t),r)}},Cc:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix2fv(Ze(t),!!n,H,r>>2,4*e);else{if(72>=e)for(var i=Ke[4*e-1],o=0;o<4*e;o+=4)i[o]=H[r+4*o>>2],i[o+1]=H[r+(4*o+4)>>2],i[o+2]=H[r+(4*o+8)>>2],i[o+3]=H[r+(4*o+12)>>2];else i=H.subarray(r>>2,r+16*e>>2);ln.uniformMatrix2fv(Ze(t),!!n,i)}},Dc:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix3fv(Ze(t),!!n,H,r>>2,9*e);else{if(32>=e)for(var i=Ke[9*e-1],o=0;o<9*e;o+=9)i[o]=H[r+4*o>>2],i[o+1]=H[r+(4*o+4)>>2],i[o+2]=H[r+(4*o+8)>>2],i[o+3]=H[r+(4*o+12)>>2],i[o+4]=H[r+(4*o+16)>>2],i[o+5]=H[r+(4*o+20)>>2],i[o+6]=H[r+(4*o+24)>>2],i[o+7]=H[r+(4*o+28)>>2],i[o+8]=H[r+(4*o+32)>>2];else i=H.subarray(r>>2,r+36*e>>2);ln.uniformMatrix3fv(Ze(t),!!n,i)}},Ec:function(t,e,n,r){if(2<=We.version)ln.uniformMatrix4fv(Ze(t),!!n,H,r>>2,16*e);else{if(18>=e){var i=Ke[16*e-1],o=H;r>>=2;for(var a=0;a<16*e;a+=16){var s=r+a;i[a]=o[s],i[a+1]=o[s+1],i[a+2]=o[s+2],i[a+3]=o[s+3],i[a+4]=o[s+4],i[a+5]=o[s+5],i[a+6]=o[s+6],i[a+7]=o[s+7],i[a+8]=o[s+8],i[a+9]=o[s+9],i[a+10]=o[s+10],i[a+11]=o[s+11],i[a+12]=o[s+12],i[a+13]=o[s+13],i[a+14]=o[s+14],i[a+15]=o[s+15]}}else i=H.subarray(r>>2,r+64*e>>2);ln.uniformMatrix4fv(Ze(t),!!n,i)}},Fc:function(t){t=Me[t],ln.useProgram(t),ln.Df=t},Gc:function(t,e){ln.vertexAttrib1f(t,e)},Hc:function(t,e){ln.vertexAttrib2f(t,H[e>>2],H[e+4>>2])},Ic:function(t,e){ln.vertexAttrib3f(t,H[e>>2],H[e+4>>2],H[e+8>>2])},Jc:function(t,e){ln.vertexAttrib4f(t,H[e>>2],H[e+4>>2],H[e+8>>2],H[e+12>>2])},kc:function(t,e){ln.vertexAttribDivisor(t,e)},lc:function(t,e,n,r,i){ln.vertexAttribIPointer(t,e,n,r,i)},Kc:function(t,e,n,r,i,o){ln.vertexAttribPointer(t,e,n,!!r,i,o)},Lc:function(t,e,n,r){ln.viewport(t,e,n,r)},fb:function(t,e,n,r){ln.waitSync(Le[t],e,(n>>>0)+4294967296*r)},e:function(t,e){throw En(t,e||1),"longjmp"},ob:function(t){var e=B.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296),0<(r=Math.max(t,r))%65536&&(r+=65536-r%65536);t:{try{O.grow(Math.min(2147483648,r)-F.byteLength+65535>>>16),$();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},Zc:function(){return We?We.Rf:0},P:function(t){return je(t)?0:-5},sb:function(t,e){var n=0;return tn().forEach((function(r,i){var o=e+n;for(i=W[t+4*i>>2]=o,o=0;o>0]=r.charCodeAt(o);U[i>>0]=0,n+=r.length+1})),0},tb:function(t,e){var n=tn();W[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),W[e>>2]=r,0},Fb:function(t){N||(e.onExit&&e.onExit(t),A=!0),g(t,new xn(t))},H:function(){return 0},rb:function(t,e){return t=1==t||2==t?2:ut(),U[e>>0]=t,0},mb:function(t,e,n,r,i,o){return t=mt.Nf(t),e=mt.Ef(t,e,n,r),W[o>>2]=e,0},yb:function(t,e,n,r){return t=mt.Nf(t),e=mt.Ef(t,e,n),W[r>>2]=e,0},lb:function(){},G:function(t,e,n,r){for(var i=0,o=0;o>2],s=W[e+(8*o+4)>>2],u=0;u>2]=i,0},a:function(){return S},_c:function(t,e){ln.bindFramebuffer(t,Se[e])},Za:function(t){ln.clear(t)},Ab:function(t,e,n,r){ln.clearColor(t,e,n,r)},gb:function(t){ln.clearStencil(t)},C:function(t,e){ze(t,e)},i:function(t,e){var n=vn();try{return tt.get(t)(e)}catch(t){if(Tn(n),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},n:function(t,e,n){var r=vn();try{return tt.get(t)(e,n)}catch(t){if(Tn(r),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},g:function(t,e,n,r){var i=vn();try{return tt.get(t)(e,n,r)}catch(t){if(Tn(i),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},z:function(t,e,n,r,i){var o=vn();try{return tt.get(t)(e,n,r,i)}catch(t){if(Tn(o),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Jb:function(t,e,n,r,i,o){var a=vn();try{return tt.get(t)(e,n,r,i,o)}catch(t){if(Tn(a),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},M:function(t,e,n,r,i,o,a){var s=vn();try{return tt.get(t)(e,n,r,i,o,a)}catch(t){if(Tn(s),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},L:function(t,e,n,r,i,o,a,s,u,l){var c=vn();try{return tt.get(t)(e,n,r,i,o,a,s,u,l)}catch(t){if(Tn(c),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},K:function(t){var e=vn();try{tt.get(t)()}catch(t){if(Tn(e),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},j:function(t,e){var n=vn();try{tt.get(t)(e)}catch(t){if(Tn(n),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},q:function(t,e,n){var r=vn();try{tt.get(t)(e,n)}catch(t){if(Tn(r),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},h:function(t,e,n,r){var i=vn();try{tt.get(t)(e,n,r)}catch(t){if(Tn(i),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},o:function(t,e,n,r,i){var o=vn();try{tt.get(t)(e,n,r,i)}catch(t){if(Tn(o),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Ib:function(t,e,n,r,i,o){var a=vn();try{tt.get(t)(e,n,r,i,o)}catch(t){if(Tn(a),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Gb:function(t,e,n,r,i,o,a){var s=vn();try{tt.get(t)(e,n,r,i,o,a)}catch(t){if(Tn(s),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},Hb:function(t,e,n,r,i,o,a,s,u,l){var c=vn();try{tt.get(t)(e,n,r,i,o,a,s,u,l)}catch(t){if(Tn(c),t!==t+0&&"longjmp"!==t)throw t;En(1,0)}},b:function(t){S=t},qb:function(t,e,n,r){return function(t,e,n,r){function i(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0=a(n,t)?0>=a(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=W[r+40>>2];for(var c in r={og:W[r>>2],ng:W[r+4>>2],Ve:W[r+8>>2],Le:W[r+12>>2],Be:W[r+16>>2],Vd:W[r+20>>2],We:W[r+24>>2],Xe:W[r+28>>2],xg:W[r+32>>2],mg:W[r+36>>2],pg:l?L(l):""},n=L(n),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),l[c]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(c in l={"%a":function(t){return h[t.We].substring(0,3)},"%A":function(t){return h[t.We]},"%b":function(t){return f[t.Be].substring(0,3)},"%B":function(t){return f[t.Be]},"%C":function(t){return o((t.Vd+1900)/100|0,2)},"%d":function(t){return o(t.Le,2)},"%e":function(t){return i(t.Le,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return o(t.Ve,2)},"%I":function(t){return 0==(t=t.Ve)?t=12:12t.Ve?"AM":"PM"},"%S":function(t){return o(t.og,2)},"%t":function(){return"\t"},"%u":function(t){return t.We||7},"%U":function(t){var e=new Date(t.Vd+1900,0,1),n=0===e.getDay()?e:an(e,7-e.getDay());return 0>a(n,t=new Date(t.Vd+1900,t.Be,t.Le))?o(Math.ceil((31-n.getDate()+(nn(en(t.getFullYear())?rn:on,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(n,e)?"01":"00"},"%V":function(t){var e=new Date(t.Vd+1901,0,4),n=s(new Date(t.Vd+1900,0,4));e=s(e);var r=an(new Date(t.Vd+1900,0,1),t.Xe);return 0>a(r,n)?"53":0>=a(e,r)?"01":o(Math.ceil((n.getFullYear()a(n,t=new Date(t.Vd+1900,t.Be,t.Le))?o(Math.ceil((31-n.getDate()+(nn(en(t.getFullYear())?rn:on,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(n,e)?"01":"00"},"%y":function(t){return(t.Vd+1900).toString().substring(2)},"%Y":function(t){return t.Vd+1900},"%z":function(t){var e=0<=(t=t.mg);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.pg},"%%":function(){return"%"}})n.includes(c)&&(n=n.replace(new RegExp(c,"g"),l[c](r)));return c=function(t){var e=Array(k(t)+1);return D(t,e,0,e.length),e}(n),c.length>e?0:(U.set(c,t),c.length-1)}(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.$c,$(),tt=e.asm.cd,nt.unshift(e.asm.ad),ot--,e.monitorRunDependencies&&e.monitorRunDependencies(ot),0==ot&&(null!==at&&(clearInterval(at),at=null),st&&(t=st,st=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!M&&(f||p)){if("function"==typeof fetch&&!ct.startsWith("file://"))return fetch(ct,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ct+"'";return t.arrayBuffer()})).catch((function(){return ft()}));if(b)return new Promise((function(t,e){b(ct,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ft()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then(t,(function(t){C("failed to asynchronously prepare wasm: "+t),ut(t)}))}var i={a:pn};if(ot++,e.monitorRunDependencies&&e.monitorRunDependencies(ot),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return C("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||lt()||ct.startsWith("file://")||"function"!=typeof fetch?r(n):fetch(ct,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return C("wasm streaming compile failed: "+t),C("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(u)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.ad).apply(null,arguments)};var dn=e._memset=function(){return(dn=e._memset=e.asm.bd).apply(null,arguments)},yn=e.___errno_location=function(){return(yn=e.___errno_location=e.asm.dd).apply(null,arguments)},mn=e._free=function(){return(mn=e._free=e.asm.ed).apply(null,arguments)},gn=e._malloc=function(){return(gn=e._malloc=e.asm.fd).apply(null,arguments)},_n=e.___getTypeName=function(){return(_n=e.___getTypeName=e.asm.gd).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.hd).apply(null,arguments)};var bn,vn=e.stackSave=function(){return(vn=e.stackSave=e.asm.id).apply(null,arguments)},Tn=e.stackRestore=function(){return(Tn=e.stackRestore=e.asm.jd).apply(null,arguments)},En=e._setThrew=function(){return(En=e._setThrew=e.asm.kd).apply(null,arguments)},wn=e._memalign=function(){return(wn=e._memalign=e.asm.ld).apply(null,arguments)};function xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Cn(){function t(){if(!bn&&(bn=!0,e.calledRun=!0,!A)){if(pt(nt),s(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();rt.unshift(t)}pt(rt)}}if(!(0{let r=n(4472);r="default"in r?r.default:r,t.exports=function(t){const e=JSON.parse(t.tilePieceBoundingBox),n=JSON.parse(t.tileBoundingBox),i=t.height,o=t.width,a=new Uint8ClampedArray(o*i*4),s=new Uint8ClampedArray(t.sourceImageData);let u,l;try{null==r.defs(t.projectionTo)&&r.defs(t.projectionTo,t.projectionToDefinition),null==r.defs(t.projectionFrom)&&r.defs(t.projectionFrom,t.projectionFromDefinition),u=r(t.projectionTo,t.projectionFrom)}catch(e){throw new Error("Error creating projection conversion between "+t.projectionTo+" and "+t.projectionFrom+".")}for(let r=0;r=0&&d=0&&y{"use strict";n.r(e),n.d(e,{TileUtilities:()=>o});var r=n(1375),i=n(5604);class o{static getPiecePosition(t,e,n,o,a,s,u,l,c,h,f,p){let d;try{null==i.Projection.hasProjection(a)&&i.Projection.loadProjection(a,s),null==i.Projection.hasProjection(u)&&i.Projection.loadProjection(u,l),d=i.Projection.getConverter(a,u)}catch(t){throw new Error("Error creating projection conversion between "+a+" and "+u+".")}let y=t.maxLatitude,m=t.minLatitude,g=t.minLongitude-f,_=t.maxLongitude+f;a.toUpperCase()===r.ProjectionConstants.EPSG_3857&&u.toUpperCase()===r.ProjectionConstants.EPSG_4326&&(y=y>r.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE?r.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE:y,m=mr.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE?r.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE:_);const b=i.Projection.convertCoordinates(r.ProjectionConstants.EPSG_4326,a,[-180,0]),v=i.Projection.convertCoordinates(r.ProjectionConstants.EPSG_4326,a,[180,0]);g=gv[0]?v[0]:_;const T=d.inverse([g,m]),E=d.inverse([_,y]),w=isNaN(T[1])?e.minLatitude:T[1],x=isNaN(E[1])?e.maxLatitude:E[1],C=T[0],M=E[0];return{startY:Math.max(0,Math.floor((e.maxLatitude-x)/c)),startX:Math.max(0,Math.floor((C-e.minLongitude)/h)),endY:Math.min(n,n-Math.floor((w-e.minLatitude)/c)),endX:Math.min(o,o-Math.floor((e.maxLongitude-M)/h))}}}},7591:(t,e,n)=>{var r=n(5108);const i=n(2331);function o(t){const e=t.data,n=i(e);this.postMessage(n),this.close()}t.exports=function(t){t.onmessage=o,t.onerror=function(t){r.log("error",t)}}},9705:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);e.default=function(t){for(var e,n,i=r.getCoords(t),o=0,a=1;a0}},8147:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);function i(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;it[1]!=l>t[1]&&t[0]<(u-a)*(t[1]-s)/(l-s)+a&&(r=!r)}return r}e.default=function(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=r.getCoord(t),a=r.getGeom(e),s=a.type,u=e.bbox,l=a.coordinates;if(u&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(o,u))return!1;"Polygon"===s&&(l=[l]);for(var c=!1,h=0;h{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611);function i(t,e,n,r,i){var o=n[0],a=n[1],s=t[0],u=t[1],l=e[0],c=e[1],h=l-s,f=c-u,p=(n[0]-s)*f-(n[1]-u)*h;if(null!==i){if(Math.abs(p)>i)return!1}else if(0!==p)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o0?u<=a&&a=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o<=l:l<=o&&o<=s:f>0?u<=a&&a<=c:c<=a&&a<=u}e.default=function(t,e,n){void 0===n&&(n={});for(var o=r.getCoord(t),a=r.getCoords(e),s=0;se[0]||t[2]e[1]||t[3]{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(611),i=n(4102);e.default=function(t,e,n){void 0===n&&(n={});var o=r.getCoord(t),a=r.getCoord(e),s=i.degreesToRadians(a[1]-o[1]),u=i.degreesToRadians(a[0]-o[0]),l=i.degreesToRadians(o[1]),c=i.degreesToRadians(a[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(l)*Math.cos(c);return i.radiansToLength(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),n.units)}},4102:(t,e)=>{"use strict";function n(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return f(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var o=e.areaFactors[r];if(!o)throw new Error("invalid final units");return t/i*o},e.isNumber=p,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},4170:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(4102),o=n(611),a=r(n(2676));e.default=function(t,e,n){void 0===n&&(n={});var r=o.getGeom(t),s=o.getGeom(e),u=a.default.intersection(r.coordinates,s.coordinates);return 0===u.length?null:1===u.length?i.polygon(u[0],n.properties):i.multiPolygon(u,n.properties)}},611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102);e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(e.length>1&&r.isNumber(e[0])&&r.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.features;r line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var a=n[0][0],s=n[0][1],u=n[1][0],l=n[1][1],c=r[0][0],h=r[0][1],f=r[1][0],p=r[1][1],d=(p-h)*(u-a)-(f-c)*(l-s);if(0===d)return null;var y=((f-c)*(s-h)-(p-h)*(a-c))/d,m=((u-a)*(s-h)-(l-s)*(a-c))/d;if(y>=0&&y<=1&&m>=0&&m<=1){var g=a+y*(u-a),_=s+y*(l-s);return i.point([g,_])}return null}e.default=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=i.feature(t)),"LineString"===e.type&&(e=i.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var c=l(t,e);return c&&r.push(c),i.featureCollection(r)}var h=u.default();return h.load(a.default(e)),s.featureEach(a.default(t),(function(t){s.featureEach(h.search(t),(function(e){var i=l(t,e);if(i){var a=o.getCoords(i).join(",");n[a]||(n[a]=!0,r.push(i))}}))})),i.featureCollection(r)}},4590:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611),o=n(1540);e.default=function(t){if(!t)throw new Error("geojson is required");var e=[];return o.flattenEach(t,(function(t){!function(t,e){var n=[],o=t.geometry;if(null!==o){switch(o.type){case"Polygon":n=i.getCoords(o);break;case"LineString":n=[i.getCoords(o)]}n.forEach((function(n){var i=function(t,e){var n=[];return t.reduce((function(t,i){var o,a,s,u,l,c,h=r.lineString([t,i],e);return h.bbox=(a=i,s=(o=t)[0],u=o[1],[s<(l=a[0])?s:l,u<(c=a[1])?u:c,s>l?s:l,u>c?u:c]),n.push(h),i})),n}(n,t.properties);i.forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),r.featureCollection(e)}},1540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102);function i(t,e,n){if(null!==t)for(var r,o,a,s,u,l,c,h,f=0,p=0,d=t.type,y="FeatureCollection"===d,m="Feature"===d,g=y?t.features.length:1,_=0;_l||p>c||d>h)return u=i,l=n,c=p,h=d,void(a=0);var y=r.lineString([u,i],t.properties);if(!1===e(y,n,o,d,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611);function o(t,e){return void 0===e&&(e={}),s(i.getGeom(t).coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function a(t,e){void 0===e&&(e={});var n=i.getGeom(t).coordinates,o=e.properties?e.properties:"Feature"===t.type?t.properties:{},a=[];return n.forEach((function(t){a.push(s(t,o))})),r.featureCollection(a)}function s(t,e){return t.length>1?r.multiLineString(t,e):r.lineString(t[0],e)}e.default=function(t,e){void 0===e&&(e={});var n=i.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return o(n,e);case"MultiPolygon":return a(n,e);default:throw new Error("invalid poly")}},e.polygonToLine=o,e.multiPolygonToLine=a,e.coordsToLine=s},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(4102),i=n(611);e.default=function(t,e,n){void 0===n&&(n={});var o=i.getCoord(t),a=i.getCoord(e);a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0;var s=function(t,e,n){var i=n=void 0===n?r.earthRadius:Number(n),o=t[1]*Math.PI/180,a=e[1]*Math.PI/180,s=a-o,u=Math.abs(e[0]-t[0])*Math.PI/180;u>Math.PI&&(u-=2*Math.PI);var l=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(l)>1e-11?s/l:Math.cos(o);return Math.sqrt(s*s+c*c*u*u)*i}(o,a);return r.convertLength(s,"meters",n.units)}},8583:(t,e,n)=>{"use strict";var r=n(7418);function i(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i=0;l--)if(c[l]!==h[l])return!1;for(l=c.length-1;l>=0;l--)if(!b(t[s=c[l]],e[s],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function v(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function T(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&g(i,n,"Missing expected exception"+r);var o="string"==typeof r,s=!t&&i&&!n;if((!t&&a.isError(i)&&o&&T(i,n)||s)&&g(i,n,"Got unwanted exception"+r),t&&i&&n&&!T(i,n)||!t&&i)throw i}f.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return y(m(t.actual),128)+" "+t.operator+" "+y(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=d(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(f.AssertionError,Error),f.fail=g,f.ok=_,f.equal=function(t,e,n){t!=e&&g(t,e,n,"==",f.equal)},f.notEqual=function(t,e,n){t==e&&g(t,e,n,"!=",f.notEqual)},f.deepEqual=function(t,e,n){b(t,e,!1)||g(t,e,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,n){b(t,e,!0)||g(t,e,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,n){b(t,e,!1)&&g(t,e,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,n,r){b(e,n,!0)&&g(e,n,r,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,n){t!==e&&g(t,e,n,"===",f.strictEqual)},f.notStrictEqual=function(t,e,n){t===e&&g(t,e,n,"!==",f.notStrictEqual)},f.throws=function(t,e,n){E(!0,t,e,n)},f.doesNotThrow=function(t,e,n){E(!1,t,e,n)},f.ifError=function(t){if(t)throw t},f.strict=r((function t(e,n){e||g(e,!0,n,"==",t)}),f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var w=Object.keys||function(t){var e=[];for(var n in t)s.call(t,n)&&e.push(n);return e}},6076:t=>{"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},2014:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},69:(t,e,n)=>{var r=n(4155),i=n(5108),o=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),h(r,t,r.depth)}function l(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function h(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=h(t,i,r)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(x(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(v(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return f(n)}var l,c="",T=!1,C=["{","}"];return d(n)&&(T=!0,C=["[","]"]),x(n)&&(c=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(c=" "+RegExp.prototype.toString.call(n)),E(n)&&(c=" "+Date.prototype.toUTCString.call(n)),w(n)&&(c=" "+f(n)),0!==a.length||T&&0!=n.length?r<0?v(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),l=T?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(l,c,C)):C[0]+c+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(n)?h(t,u.value,null):h(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return void 0===t}function v(t){return T(t)&&"[object RegExp]"===C(t)}function T(t){return"object"==typeof t&&null!==t}function E(t){return T(t)&&"[object Date]"===C(t)}function w(t){return T(t)&&("[object Error]"===C(t)||t instanceof Error)}function x(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(b(a)&&(a=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=r.pid;s[t]=function(){var r=e.format.apply(e,arguments);i.error("%s %d: %s",t,n,r)}}else s[t]=function(){};return s[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=v,e.isObject=T,e.isDate=E,e.isError=w,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(2014);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){i.log("%s - %s",N(),e.format.apply(e,arguments))},e.inherits=n(6076),e._extend=function(t,e){if(!e||!T(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,o=u(t),a=o[0],s=o[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,h=s>0?a-4:a;for(n=0;n>16&255,l[c++]=e>>8&255,l[c++]=255&e;return 2===s&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[c++]=255&e),1===s&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=16383,s=0,u=r-i;su?u:s+a));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(t,e,n)=>{"use strict";var r=n(5108),i=n(9742),o=n(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|m(t,e),r=u(n),i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return l.from(r,e,n);var i=function(t){if(l.isBuffer(t)){var e=0|y(t.length),n=u(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){for(var e=t.length<0?0:0|y(t.length),n=u(e),r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(t).length;default:if(i)return r?-1:B(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return M(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;fi&&(r=i):r=i;var o=e.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function M(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr.length?l.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;en&&(t+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,n,r,i){if(W(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,i){return e=+e,n>>>=0,i||D(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,n){return k(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return k(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var H=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)e[r+i]=t[n]+t[i];return e}()},584:t=>{t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},5108:(t,e,n)=>{var r=n(9539),i=n(8583);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==n.g&&n.g.console?n.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var l=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var n=o()-e;a.log(t+": "+n+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=r.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(r.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,r.format.apply(null,e))}},"assert"]],c=0;c{var r=n(5108),i=Object.create||function(t){var e=function(){};return e.prototype=t,new e},o=Object.keys||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n},a=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var u,l=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),u=0===c.x}catch(t){u=!1}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,n){if(e)t.call(n);else for(var r=t.length,i=E(t,r),o=0;o0&&u.length>a){u.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=u.length,"object"==typeof r&&r.warn&&r.warn("%s: %s",l.name,l.message)}}else u=s[e]=n,++t._eventsCount;return t}function _(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(n=a[t]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:f(n,l,this);break;case 2:p(n,l,this,arguments[1]);break;case 3:d(n,l,this,arguments[1],arguments[2]);break;case 4:y(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o=0;a--)if(n[a]===e||n[a].listener===e){s=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(t,e){for(var n=e,r=n+1,i=t.length;r=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return v(this,t,!0)},s.prototype.rawListeners=function(t){return v(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):T.call(t,e)},s.prototype.listenerCount=T,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},7769:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var Buffer=__webpack_require__(3085).Buffer;const{multiByteIndexOf,stringToBytes,readUInt64LE,tarHeaderChecksumMatches,uint8ArrayUtf8ByteString}=__webpack_require__(6188),supported=__webpack_require__(9898),xpiZipFilename=stringToBytes("META-INF/mozilla.rsa"),oxmlContentTypes=stringToBytes("[Content_Types].xml"),oxmlRels=stringToBytes("_rels/.rels"),fileType=t=>{if(!(t instanceof Uint8Array||t instanceof ArrayBuffer||Buffer.isBuffer(t)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof t}\``);const e=t instanceof Uint8Array?t:new Uint8Array(t);if(!(e&&e.length>1))return;const n=(t,n)=>{n={offset:0,...n};for(let r=0;rn(stringToBytes(t),e);if(n([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(n([137,80,78,71,13,10,26,10])){const t=33,n=e.findIndex(((n,r)=>r>=t&&73===e[r]&&68===e[r+1]&&65===e[r+2]&&84===e[r+3])),r=e.subarray(t,n);return r.findIndex(((t,e)=>97===r[e]&&99===r[e+1]&&84===r[e+2]&&76===r[e+3]))>=0?{ext:"apng",mime:"image/apng"}:{ext:"png",mime:"image/png"}}if(n([71,73,70]))return{ext:"gif",mime:"image/gif"};if(n([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(n([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((n([73,73,42,0])||n([77,77,0,42]))&&n([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(n([73,73,42,0])&&(n([16,251,134,1],{offset:4})||n([8,0,0,0],{offset:4}))&&n([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9}))return{ext:"arw",mime:"image/x-sony-arw"};if(n([73,73,42,0,8,0,0,0])&&(n([45,0,254,0],{offset:8})||n([39,0,254,0],{offset:8})))return{ext:"dng",mime:"image/x-adobe-dng"};if(n([73,73,42,0])&&n([28,0,254,0],{offset:8}))return{ext:"nef",mime:"image/x-nikon-nef"};if(n([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(n([73,73,42,0])||n([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(n([66,77]))return{ext:"bmp",mime:"image/bmp"};if(n([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(n([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};const i=[80,75,3,4];if(n(i)){if(n([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(n(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(r("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(r("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};let t,o=0,a=!1;do{const s=o+30;if(a||(a=n(oxmlContentTypes,{offset:s})||n(oxmlRels,{offset:s})),t||(r("word/",{offset:s})?t={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:r("ppt/",{offset:s})?t={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:r("xl/",{offset:s})&&(t={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),a&&t)return t;o=multiByteIndexOf(e,i,s)}while(o>=0);if(t)return t}if(n([80,75])&&(3===e[2]||5===e[2]||7===e[2])&&(4===e[3]||6===e[3]||8===e[3]))return{ext:"zip",mime:"application/zip"};if(n([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(e))return{ext:"tar",mime:"application/x-tar"};if(n([82,97,114,33,26,7])&&(0===e[6]||1===e[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(n([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(n([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(n([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(n([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(n([102,114,101,101],{offset:4})||n([109,100,97,116],{offset:4})||n([109,111,111,118],{offset:4})||n([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(n([102,116,121,112],{offset:4})&&0!=(96&e[8])&&0!=(96&e[9])&&0!=(96&e[10])&&0!=(96&e[11])){const t=uint8ArrayUtf8ByteString(e,8,12);switch(t){case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt ":return{ext:"mov",mime:"video/quicktime"};case"M4V ":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P ":return{ext:"m4p",mime:"video/mp4"};case"M4B ":return{ext:"m4b",mime:"audio/mp4"};case"M4A ":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V ":return{ext:"f4v",mime:"video/mp4"};case"F4P ":return{ext:"f4p",mime:"video/mp4"};case"F4A ":return{ext:"f4a",mime:"audio/mp4"};case"F4B ":return{ext:"f4b",mime:"audio/mp4"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(n([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(n([26,69,223,163])){const t=e.subarray(4,4100),n=t.findIndex(((t,e,n)=>66===n[e]&&130===n[e+1]));if(-1!==n){const e=n+3,r=n=>[...n].every(((n,r)=>t[e+r]===n.charCodeAt(0)));if(r("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(r("webm"))return{ext:"webm",mime:"video/webm"}}}if(n([82,73,70,70])){if(n([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(n([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(n([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(n([48,38,178,117,142,102,207,17,166,217])){let t=30;do{const r=readUInt64LE(e,t+16);if(n([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:t})){if(n([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(n([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:t+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}t+=r}while(t+24<=e.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(n([0,0,1,186])||n([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};for(let t=0;t<2&&tnew Promise(((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",(()=>{const t=new stream.PassThrough,e=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{t.fileType=fileType(e)}catch(t){reject(t)}readableStream.unshift(e),stream.pipeline?resolve(stream.pipeline(readableStream,t,(()=>{}))):resolve(readableStream.pipe(t))}))})),Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)})},9898:t=>{"use strict";t.exports={extensions:["jpg","png","apng","gif","webp","flif","cr2","orf","arw","dng","nef","rw2","raf","tif","bmp","jxr","psd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","msi","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","wmv","wma","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-canon-cr2","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-wma","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-msi","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/ktx","application/dicom","audio/x-musepack","text/calendar","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape"]}},6188:(t,e,n)=>{"use strict";var r=n(3085).Buffer;e.stringToBytes=t=>[...t].map((t=>t.charCodeAt(0)));const i=(t,e,n)=>String.fromCharCode(...t.slice(e,n));e.readUInt64LE=(t,e=0)=>{let n=t[e],r=1,i=0;for(;++i<8;)r*=256,n+=t[e+i]*r;return n},e.tarHeaderChecksumMatches=t=>{if(t.length<512)return!1;let e=256,n=0;for(let r=0;r<148;r++){const i=t[r];e+=i,n+=128&i}for(let r=156;r<512;r++){const i=t[r];e+=i,n+=128&i}const r=parseInt(i(t,148,154),8);return r===e||r===e-(n<<1)},e.multiByteIndexOf=(t,e,n=0)=>{if(r&&r.isBuffer(t))return t.indexOf(r.from(e),n);const i=(t,e,n)=>{for(let r=1;r=0;){if(i(t,e,o))return o;o=t.indexOf(e[0],o+1)}return-1},e.uint8ArrayUtf8ByteString=i},1787:(t,e,n)=>{var r=n(2582),i=n(4102),o=n(1540),a=n(9705).default,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){var e=new r(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),r.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),r.prototype.remove.call(this,t,e)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(t){var e=r.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=r.prototype.all.call(this);return u(t)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=l,t.exports.default=l},645:(t,e)=>{e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,l-=8);t[n+p-d]|=128*y}},8849:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(9126),i=Object.keys(r.typeHandlers),o={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};e.detector=function(t){const e=t[0];if(e in o){const n=o[e];if(r.typeHandlers[n].validate(t))return n}return i.find((e=>r.typeHandlers[e].validate(t)))}},9248:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(8497);if(!("promises"in r)){class t{constructor(t){this.fd=t}stat(){return new Promise(((t,e)=>{r.fstat(this.fd,((n,r)=>{n?e(n):t(r)}))}))}read(t,e,n,i){return new Promise(((o,a)=>{r.read(this.fd,t,e,n,i,(t=>{t?a(t):o()}))}))}close(){return new Promise(((t,e)=>{r.close(this.fd,(n=>{n?e(n):t()}))}))}}Object.defineProperty(r,"promises",{value:{open:(e,n)=>new Promise(((i,o)=>{r.open(e,n,((e,n)=>{e?o(e):i(new t(n))}))}))},writable:!1})}},7935:function(t,e,n){"use strict";var r=n(3085).Buffer,i=n(4155),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const a=n(8497),s=n(3935),u=n(9189),l=n(9126),c=n(8849);n(9248);const h=524288,f=new u.default({concurrency:100,autostart:!0});function p(t,e){const n=c.detector(t);if(n&&n in l.typeHandlers){const r=l.typeHandlers[n].calculate(t,e);if(void 0!==r)return r.type=n,r}throw new TypeError("unsupported file type: "+n+" (file: "+e+")")}function d(t,e){if(r.isBuffer(t))return p(t);if("string"!=typeof t)throw new TypeError("invalid invocation");const n=s.resolve(t);if("function"!=typeof e){const t=function(t){const e=a.openSync(t,"r"),n=a.fstatSync(e).size,i=Math.min(n,h),o=r.alloc(i);return a.readSync(e,o,0,i,0),a.closeSync(e),o}(n);return p(t,n)}f.push((()=>function(t){return o(this,void 0,void 0,(function*(){const e=yield a.promises.open(t,"r"),{size:n}=yield e.stat();if(n<=0)throw new Error("Empty file");const i=Math.min(n,h),o=r.alloc(i);return yield e.read(o,0,i,0),yield e.close(),o}))}(n).then((t=>i.nextTick(e,null,p(t,n)))).catch(e)))}t.exports=e=d,e.imageSize=d,e.setConcurrency=t=>{f.concurrency=t},e.types=Object.keys(l.typeHandlers)},8557:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readUInt=function(t,e,n,r){return n=n||0,t["readUInt"+e+(r?"BE":"LE")].call(t,n)}},9126:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(3645),i=n(3552),o=n(1680),a=n(1542),s=n(7163),u=n(7800),l=n(6625),c=n(1558),h=n(2229),f=n(4663),p=n(6221),d=n(7851),y=n(2602),m=n(8531),g=n(9948),_=n(5236);e.typeHandlers={bmp:r.BMP,cur:i.CUR,dds:o.DDS,gif:a.GIF,icns:s.ICNS,ico:u.ICO,j2c:l.J2C,jp2:c.JP2,jpg:h.JPG,ktx:f.KTX,png:p.PNG,pnm:d.PNM,psd:y.PSD,svg:m.SVG,tiff:g.TIFF,webp:_.WEBP}},3645:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BMP={validate:t=>"BM"===t.toString("ascii",0,2),calculate:t=>({height:Math.abs(t.readInt32LE(22)),width:t.readUInt32LE(18)})}},3552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(7800);e.CUR={validate:t=>0===t.readUInt16LE(0)&&2===t.readUInt16LE(2),calculate:t=>r.ICO.calculate(t)}},1680:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DDS={validate:t=>542327876===t.readUInt32LE(0),calculate:t=>({height:t.readUInt32LE(12),width:t.readUInt32LE(16)})}},1542:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=/^GIF8[79]a/;e.GIF={validate(t){const e=t.toString("ascii",0,6);return n.test(e)},calculate:t=>({height:t.readUInt16LE(8),width:t.readUInt16LE(6)})}},7163:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function r(t,e){const n=e+4;return[t.toString("ascii",e,n),t.readUInt32BE(n)]}function i(t){const e=n[t];return{width:e,height:e,type:t}}e.ICNS={validate:t=>"icns"===t.toString("ascii",0,4),calculate(t){const e=t.length,n=t.readUInt32BE(4);let o=8,a=r(t,o),s=i(a[0]);if(o+=a[1],o===n)return s;const u={height:s.height,images:[s],width:s.width};for(;o{"use strict";function n(t,e){const n=t.readUInt8(e);return 0===n?256:n}function r(t,e){const r=6+16*e;return{height:n(t,r+1),width:n(t,r)}}Object.defineProperty(e,"__esModule",{value:!0}),e.ICO={validate:t=>0===t.readUInt16LE(0)&&1===t.readUInt16LE(2),calculate(t){const e=t.readUInt16LE(4),n=r(t,0);if(1===e)return n;const i=[n];for(let n=1;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.J2C={validate:t=>"ff4fff51"===t.toString("hex",0,4),calculate:t=>({height:t.readUInt32BE(12),width:t.readUInt32BE(8)})}},1558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t=>({height:t.readUInt32BE(4),width:t.readUInt32BE(8)});e.JP2={validate(t){const e=t.toString("hex",4,8),n=t.readUInt32BE(0);if("6a502020"!==e||n<1)return!1;const r=n+4,i=t.readUInt32BE(n);return"66747970"===t.slice(r,r+i).toString("hex",0,4)},calculate(t){const e=t.readUInt32BE(0);let r=e+4+t.readUInt16BE(e+2);switch(t.toString("hex",r,r+4)){case"72726571":return r=r+4+4+(t=>{const e=t.readUInt8(0);let n=1+2*e;return n=n+2+t.readUInt16BE(n)*(2+e),n+2+t.readUInt16BE(n)*(16+e)})(t.slice(r+4)),n(t.slice(r+8,r+24));case"6a703268":return n(t.slice(r+8,r+24));default:throw new TypeError("Unsupported header found: "+t.toString("ascii",r,r+4))}}}},2229:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(8557);function i(t){return"45786966"===t.toString("hex",2,6)}function o(t,e){return{height:t.readUInt16BE(e),width:t.readUInt16BE(e+2)}}function a(t,e){const n=t.slice(2,e),i=n.toString("hex",6,8),o="4d4d"===i;if(o||"4949"===i)return function(t,e){const n=r.readUInt(t,16,14,e);for(let i=0;it.length)return;const a=t.slice(n,o);if(274===r.readUInt(a,16,0,e)){if(3!==r.readUInt(a,16,2,e))return;if(1!==r.readUInt(a,32,4,e))return;return r.readUInt(a,16,8,e)}}}(n,o)}function s(t,e){if(e>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==t[e])throw new TypeError("Invalid JPG, marker table corrupted")}e.JPG={validate:t=>"ffd8"===t.toString("hex",0,2),calculate(t){let e,n;for(t=t.slice(4);t.length;){const r=t.readUInt16BE(0);if(i(t)&&(e=a(t,r)),s(t,r),n=t[r+1],192===n||193===n||194===n){const n=o(t,r+5);return e?{height:n.height,orientation:e,width:n.width}:n}t=t.slice(r+2)}throw new TypeError("Invalid JPG, no size found")}}},4663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KTX={validate:t=>"KTX 11"===t.toString("ascii",1,7),calculate:t=>({height:t.readUInt32LE(40),width:t.readUInt32LE(36)})}},6221:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n="CgBI";e.PNG={validate(t){if("PNG\r\n\n"===t.toString("ascii",1,8)){let e=t.toString("ascii",12,16);if(e===n&&(e=t.toString("ascii",28,32)),"IHDR"!==e)throw new TypeError("Invalid PNG");return!0}return!1},calculate:t=>t.toString("ascii",12,16)===n?{height:t.readUInt32BE(36),width:t.readUInt32BE(32)}:{height:t.readUInt32BE(20),width:t.readUInt32BE(16)}}},7851:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},r=Object.keys(n),i={default:t=>{let e=[];for(;t.length>0;){const n=t.shift();if("#"!==n[0]){e=n.split(" ");break}}if(2===e.length)return{height:parseInt(e[1],10),width:parseInt(e[0],10)};throw new TypeError("Invalid PNM")},pam:t=>{const e={};for(;t.length>0;){const n=t.shift();if(n.length>16||n.charCodeAt(0)>128)continue;const[r,i]=n.split(" ");if(r&&i&&(e[r.toLowerCase()]=parseInt(i,10)),e.height&&e.width)break}if(e.height&&e.width)return{height:e.height,width:e.width};throw new TypeError("Invalid PAM")}};e.PNM={validate(t){const e=t.toString("ascii",0,2);return r.includes(e)},calculate(t){const e=t.toString("ascii",0,2),r=n[e],o=t.toString("ascii",3).split(/[\r\n]+/);return(i[r]||i.default)(o)}}},2602:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PSD={validate:t=>"8BPS"===t.toString("ascii",0,4),calculate:t=>({height:t.readUInt32BE(14),width:t.readUInt32BE(18)})}},8531:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=/"']|"[^"]*"|'[^']*')*>/,r={height:/\sheight=(['"])([^%]+?)\1/,root:n,viewbox:/\sviewBox=(['"])(.+?)\1/,width:/\swidth=(['"])([^%]+?)\1/},i=2.54,o={cm:96/i,em:16,ex:8,m:96/i*100,mm:96/i/10,pc:96/72/12,pt:96/72};function a(t){const e=/([0-9.]+)([a-z]*)/.exec(t);if(e)return Math.round(parseFloat(e[1])*(o[e[2]]||1))}function s(t){const e=t.split(" ");return{height:a(e[3]),width:a(e[2])}}e.SVG={validate(t){const e=String(t);return n.test(e)},calculate(t){const e=t.toString("utf8").match(r.root);if(e){const t=function(t){const e=t.match(r.width),n=t.match(r.height),i=t.match(r.viewbox);return{height:n&&a(n[2]),viewbox:i&&s(i[2]),width:e&&a(e[2])}}(e[0]);if(t.width&&t.height)return function(t){return{height:t.height,width:t.width}}(t);if(t.viewbox)return function(t,e){const n=e.width/e.height;return t.width?{height:Math.floor(t.width/n),width:t.width}:t.height?{height:t.height,width:Math.floor(t.height*n)}:{height:e.height,width:e.width}}(t,t.viewbox)}throw new TypeError("Invalid SVG")}}},9948:(t,e,n)=>{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=n(7990),o=n(8557);function a(t,e){const n=o.readUInt(t,16,8,e);return(o.readUInt(t,16,10,e)<<16)+n}function s(t){if(t.length>24)return t.slice(12)}const u=["49492a00","4d4d002a"];e.TIFF={validate:t=>u.includes(t.toString("hex",0,4)),calculate(t,e){if(!e)throw new TypeError("Tiff doesn't support buffer");const n="BE"===function(t){const e=t.toString("ascii",0,2);return"II"===e?"LE":"MM"===e?"BE":void 0}(t),u=function(t,e,n){const a=o.readUInt(t,32,4,n);let s=1024;const u=i.statSync(e).size;a+s>u&&(s=u-a-10);const l=r.alloc(s),c=i.openSync(e,"r");return i.readSync(c,l,0,s,a),l.slice(2)}(t,e,n),l=function(t,e){const n={};let r=t;for(;r&&r.length;){const t=o.readUInt(r,16,0,e),i=o.readUInt(r,16,2,e),u=o.readUInt(r,32,4,e);if(0===t)break;1!==u||3!==i&&4!==i||(n[t]=a(r,e)),r=s(r)}return n}(u,n),c=l[256],h=l[257];if(!c||!h)throw new TypeError("Invalid Tiff. Missing tags");return{height:h,width:c}}}},5236:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WEBP={validate(t){const e="RIFF"===t.toString("ascii",0,4),n="WEBP"===t.toString("ascii",8,12),r="VP8"===t.toString("ascii",12,15);return e&&n&&r},calculate(t){const e=t.toString("ascii",12,16);if(t=t.slice(20,30),"VP8X"===e){const e=t[0],n=0==(1&e);if(0==(192&e)&&n)return function(t){return{height:1+t.readUIntLE(7,3),width:1+t.readUIntLE(4,3)}}(t);throw new TypeError("Invalid WebP")}if("VP8 "===e&&47!==t[0])return function(t){return{height:16383&t.readInt16LE(8),width:16383&t.readInt16LE(6)}}(t);const n=t.toString("hex",3,6);if("VP8L"===e&&"9d012a"!==n)return function(t){return{height:1+((15&t[4])<<10|t[3]<<2|(192&t[2])>>6),width:1+((63&t[2])<<8|t[1])}}(t);throw new TypeError("Invalid WebP")}}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},8552:(t,e,n)=>{var r=n(852)(n(5639),"DataView");t.exports=r},1989:(t,e,n)=>{var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(7040),i=n(4125),o=n(2117),a=n(7518),s=n(4705);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(852)(n(5639),"Map");t.exports=r},3369:(t,e,n)=>{var r=n(4785),i=n(1285),o=n(6e3),a=n(9916),s=n(5265);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(852)(n(5639),"Promise");t.exports=r},8525:(t,e,n)=>{var r=n(852)(n(5639),"Set");t.exports=r},8668:(t,e,n)=>{var r=n(3369),i=n(619),o=n(2385);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e{var r=n(8407),i=n(7465),o=n(3779),a=n(7599),s=n(4758),u=n(4309);function l(t){var e=this.__data__=new r(t);this.size=e.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,t.exports=l},2705:(t,e,n)=>{var r=n(5639).Symbol;t.exports=r},1149:(t,e,n)=>{var r=n(5639).Uint8Array;t.exports=r},577:(t,e,n)=>{var r=n(852)(n(5639),"WeakMap");t.exports=r},4963:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n{var r=n(2545),i=n(5694),o=n(1469),a=n(4144),s=n(5776),u=n(6719),l=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),c=!n&&i(t),h=!n&&!c&&a(t),f=!n&&!c&&!h&&u(t),p=n||c||h||f,d=p?r(t.length,String):[],y=d.length;for(var m in t)!e&&!l.call(t,m)||p&&("length"==m||h&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,y))||d.push(m);return d}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n{t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},8866:(t,e,n)=>{var r=n(2488),i=n(1469);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},4239:(t,e,n)=>{var r=n(2705),i=n(9607),o=n(2333),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},9454:(t,e,n)=>{var r=n(4239),i=n(7005);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},939:(t,e,n)=>{var r=n(2492),i=n(7005);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},2492:(t,e,n)=>{var r=n(6384),i=n(7114),o=n(8351),a=n(6096),s=n(4160),u=n(1469),l=n(4144),c=n(6719),h="[object Arguments]",f="[object Array]",p="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,y,m,g){var _=u(t),b=u(e),v=_?f:s(t),T=b?f:s(e),E=(v=v==h?p:v)==p,w=(T=T==h?p:T)==p,x=v==T;if(x&&l(t)){if(!l(e))return!1;_=!0,E=!1}if(x&&!E)return g||(g=new r),_||c(t)?i(t,e,n,y,m,g):o(t,e,v,n,y,m,g);if(!(1&n)){var C=E&&d.call(t,"__wrapped__"),M=w&&d.call(e,"__wrapped__");if(C||M){var S=C?t.value():t,N=M?e.value():e;return g||(g=new r),m(S,N,n,y,g)}}return!!x&&(g||(g=new r),a(t,e,n,y,m,g))}},8458:(t,e,n)=>{var r=n(3560),i=n(5346),o=n(3218),a=n(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,h=l.hasOwnProperty,f=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},8749:(t,e,n)=>{var r=n(4239),i=n(1780),o=n(7005),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},280:(t,e,n)=>{var r=n(5726),i=n(6916),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},4949:(t,e,n)=>{var r=n(7226),i=n(6557),o=n(3448);t.exports=function(t,e,n){var a=0,s=null==t?a:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;a>>1,l=t[u];null!==l&&!o(l)&&(n?l<=e:l{var r=n(3448),i=Math.floor,o=Math.min;t.exports=function(t,e,n,a){var s=0,u=null==t?0:t.length;if(0===u)return 0;for(var l=(e=n(e))!=e,c=null===e,h=r(e),f=void 0===e;s{t.exports=function(t,e){for(var n=-1,r=Array(t);++n{t.exports=function(t){return function(e){return t(e)}}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4757:t=>{t.exports=function(t,e){return t.has(e)}},4429:(t,e,n)=>{var r=n(5639)["__core-js_shared__"];t.exports=r},7114:(t,e,n)=>{var r=n(8668),i=n(2908),o=n(4757);t.exports=function(t,e,n,a,s,u){var l=1&n,c=t.length,h=e.length;if(c!=h&&!(l&&h>c))return!1;var f=u.get(t),p=u.get(e);if(f&&p)return f==e&&p==t;var d=-1,y=!0,m=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++d{var r=n(2705),i=n(1149),o=n(7813),a=n(7114),s=n(8776),u=n(1814),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(t,e,n,r,l,h,f){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!h(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=s;case"[object Set]":var d=1&r;if(p||(p=u),t.size!=e.size&&!d)return!1;var y=f.get(t);if(y)return y==e;r|=2,f.set(t,e);var m=a(p(t),p(e),r,l,h,f);return f.delete(t),m;case"[object Symbol]":if(c)return c.call(t)==c.call(e)}return!1}},6096:(t,e,n)=>{var r=n(8234),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var u=1&n,l=r(t),c=l.length;if(c!=r(e).length&&!u)return!1;for(var h=c;h--;){var f=l[h];if(!(u?f in e:i.call(e,f)))return!1}var p=s.get(t),d=s.get(e);if(p&&d)return p==e&&d==t;var y=!0;s.set(t,e),s.set(e,t);for(var m=u;++h{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},8234:(t,e,n)=>{var r=n(8866),i=n(9551),o=n(3674);t.exports=function(t){return r(t,o,i)}},5050:(t,e,n)=>{var r=n(7019);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},852:(t,e,n)=>{var r=n(8458),i=n(7801);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},9607:(t,e,n)=>{var r=n(2705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},9551:(t,e,n)=>{var r=n(4963),i=n(479),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},4160:(t,e,n)=>{var r=n(8552),i=n(7071),o=n(3818),a=n(8525),s=n(577),u=n(4239),l=n(346),c="[object Map]",h="[object Promise]",f="[object Set]",p="[object WeakMap]",d="[object DataView]",y=l(r),m=l(i),g=l(o),_=l(a),b=l(s),v=u;(r&&v(new r(new ArrayBuffer(1)))!=d||i&&v(new i)!=c||o&&v(o.resolve())!=h||a&&v(new a)!=f||s&&v(new s)!=p)&&(v=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?l(n):"";if(r)switch(r){case y:return d;case m:return c;case g:return h;case _:return f;case b:return p}return e}),t.exports=v},7801:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},1789:(t,e,n)=>{var r=n(4536);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},7667:(t,e,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},1327:(t,e,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},1866:(t,e,n)=>{var r=n(4536);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},5776:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},5346:(t,e,n)=>{var r,i=n(4429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},5726:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},4785:(t,e,n)=>{var r=n(1989),i=n(8407),o=n(7071);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:(t,e,n)=>{var r=n(5050);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},6e3:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).get(t)}},9916:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).has(t)}},5265:(t,e,n)=>{var r=n(5050);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},8776:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},4536:(t,e,n)=>{var r=n(852)(Object,"create");t.exports=r},6916:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1167:(t,e,n)=>{t=n.nmd(t);var r=n(1957),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5639:(t,e,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},619:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},2385:t=>{t.exports=function(t){return this.__data__.has(t)}},1814:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},7465:(t,e,n)=>{var r=n(8407);t.exports=function(){this.__data__=new r,this.size=0}},3779:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},7599:t=>{t.exports=function(t){return this.__data__.get(t)}},4758:t=>{t.exports=function(t){return this.__data__.has(t)}},4309:(t,e,n)=>{var r=n(8407),i=n(7071),o=n(3369);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},6557:t=>{t.exports=function(t){return t}},5694:(t,e,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),i=n(1780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},4144:(t,e,n)=>{t=n.nmd(t);var r=n(5639),i=n(5062),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},8446:(t,e,n)=>{var r=n(939);t.exports=function(t,e){return r(t,e)}},3560:(t,e,n)=>{var r=n(4239),i=n(3218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},4293:t=>{t.exports=function(t){return null==t}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,n)=>{var r=n(4239),i=n(7005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},6719:(t,e,n)=>{var r=n(8749),i=n(1717),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},3674:(t,e,n)=>{var r=n(4636),i=n(280),o=n(8612);t.exports=function(t){return o(t)?r(t):i(t)}},1159:(t,e,n)=>{var r=n(4949);t.exports=function(t,e){return r(t,e)}},5871:(t,e,n)=>{var r=n(4949),i=n(7813);t.exports=function(t,e){var n=null==t?0:t.length;if(n){var o=r(t,e);if(o{t.exports=function(){return[]}},5062:t=>{t.exports=function(){return!1}},2628:(t,e,n)=>{var r=n(7415),i=n(3674);t.exports=function(t){return null==t?[]:r(t,i(t))}},3085:(t,e,n)=>{"use strict";var r=n(5108);const i=n(9742),o=n(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,n)}function c(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|m(t,e);let r=u(n);const i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Q(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Q(t,ArrayBuffer)||t&&Q(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(t,SharedArrayBuffer)||t&&Q(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return l.from(r,e,n);const i=function(t){if(l.isBuffer(t)){const e=0|y(t.length),n=u(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||K(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),n=u(e);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(i)return r?-1:X(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return M(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){let o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let r=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=e.length;let a;for(r>o/2&&(r=o/2),a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function M(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,r,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(o=u));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(u=(15&e)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=t[i+1],r=t[i+2],s=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(u=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(t){const e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;en&&(t+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(t,e,n,r,i){if(Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n);for(let t=0;t>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function O(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;ir)&&(n=r);let i="";for(let r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,n,r,i){q(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function k(t,e,n,r,i){q(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function F(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,i){return e=+e,n>>>=0,i||F(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,i){return e=+e,n>>>=0,i||F(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=$((function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||z(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<>>=0,e||R(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,n>>>=0,r||L(this,t,e,n,Math.pow(2,8*n)-1,0);let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=$((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=$((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}let i=0,o=1,a=0;for(this[e]=255&t;++i>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,t,e,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=$((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=$((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function q(t,e,n,r,i,o){if(t>n||t3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||z(e,t.length-(n+1))}(r,i,o)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,n){if(Math.floor(t)!==t)throw H(t,n),new j.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}G("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),G("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),G("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=W(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function X(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let a=0;a55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,n,r){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function Q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function K(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function $(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},3935:(t,e,n)=>{"use strict";var r=n(4155);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var n,r="",i=0,o=-1,a=0,s=0;s<=t.length;++s){if(s2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),o=s,a=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,a=0;continue}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(o+1,s):r=t.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===n&&-1!==a?++a:a=-1}return r}var a={resolve:function(){for(var t,e="",n=!1,a=arguments.length-1;a>=-1&&!n;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=r.cwd()),s=t),i(s),0!==s.length&&(e=s+"/"+e,n=47===s.charCodeAt(0))}return e=o(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var n=1;nl){if(47===e.charCodeAt(s+h))return e.slice(s+h+1);if(0===h)return e.slice(s+h)}else o>l&&(47===t.charCodeAt(n+h)?c=h:0===h&&(c=0));break}var f=t.charCodeAt(n+h);if(f!==e.charCodeAt(s+h))break;47===f&&(c=h)}var p="";for(h=n+c+1;h<=r;++h)h!==r&&47!==t.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(s+c):(s+=c,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,o=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!o){r=a;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"//":t.slice(0,r)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,r=0,o=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,u=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!a){r=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(l===e.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=u))}return r===o?o=u:-1===o&&(o=t.length),t.slice(r,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){r=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":t.slice(r,o)},extname:function(t){i(t);for(var e=-1,n=0,r=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===r&&(o=!1,r=s+1),46===u?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!o){n=s+1;break}}return-1===e||-1===r||0===a||1===a&&e===r-1&&e===n+1?"":t.slice(e,r)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var n=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+r:n+"/"+r:r}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,r=t.charCodeAt(0),o=47===r;o?(e.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,l=!0,c=t.length-1,h=0;c>=n;--c)if(47!==(r=t.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===r?-1===a?a=c:1!==h&&(h=1):-1!==a&&(h=-1);else if(!l){s=c+1;break}return-1===a||-1===u||0===h||1===h&&a===u-1&&a===s+1?-1!==u&&(e.base=e.name=0===s&&o?t.slice(1,u):t.slice(s,u)):(0===s&&o?(e.name=t.slice(1,a),e.base=t.slice(1,u)):(e.name=t.slice(s,a),e.base=t.slice(s,u)),e.ext=t.slice(a,u)),s>0?e.dir=t.slice(0,s-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,t.exports=a},7418:t=>{"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,o){for(var a,s,u=i(t),l=1;l{e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},2676:function(t,e,n){var r=n(4155);t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;ne?1:t0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=r.right,e.right=r.left,e}function s(t,e,n,r){var o=new i(t,e);if(null===n)return o.left=o.right=null,o;var s=r(t,(n=a(t,n,r)).key);return s<0?(o.left=n.left,o.right=n,n.left=null):s>=0&&(o.right=n.right,o.left=n,n.right=null),o}function u(t,e,n){var r=null,i=null;if(e){var o=n((e=a(t,e,n)).key,t);0===o?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function l(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&l(t.left,o,!1,r,i),t.right&&l(t.right,o,!0,r,i)}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new i(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=a(t,this._root,r),s=r(t,o.key);return 0===s?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=a(t,e,n)).key)?(null===e.left?r=e.right:(r=a(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=a(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=a(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&n.call(r,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,n=[],r=!1,o=new i(null,null),a=o;!r;)e?(n.push(e),e=e.left):n.length>0?e=(e=a=a.next=n.pop()).right:r=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,o=this._comparator;if(n&&p(t,e,0,r-1,o),null===this._root)this._root=h(t,e,0,r),this._size=r;else{var a=function(t,e,n){for(var r=new i(null,null),o=r,a=t,s=e;null!==a&&null!==s;)n(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),r.next}(this.toList(),function(t,e){for(var n=new i(null,null),r=n,o=0;o0){var a=n+Math.floor(o/2),s=t[a],u=e[a],l=new i(s,u);return l.left=h(t,e,n,a),l.right=h(t,e,a+1,r),l}return null}function f(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=f(t,e,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=f(t,i+1,n),a}return null}function p(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],a=n-1,s=r+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=e[a],e[a]=e[s],e[s]=u}p(t,e,n,s,i),p(t,e,s+1,r,i)}}var d=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},y=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),n(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n=0&&u>=0?al?-1:0:o<0&&u<0?al?1:0:uo?1:0}}}]),e}(),A=0,I=function(){function e(n,r,i,o){t(this,e),this.id=++A,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(oa&&s>u)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(as&&a>l)return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var p=t.comparePoint(e.rightSE.point);return p<0?1:p>0?-1:1}if(as)return 1;if(io){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(i!==o){var m=u-a,g=i-n,_=l-s,b=o-r;if(m>g&&_b)return-1}return i>o?1:il?1:t.ide.id?1:0}}]),n(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x0&&s.swapEvents(),O.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,u=r.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=n,o=t,a=-1}return new e(new O(i,!0),new O(o,!1),[r],[a])}}]),e}(),P=function(){function e(n,r,i){if(t(this,e),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=T.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=n.length;sthis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}o.x===a.x&&o.y===a.y||this.segments.push(I.fromRing(a,o,this))}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=r}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),k=function(){function e(n){t(this,e),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return n(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:I.compare;t(this,e),this.queue=n,this.tree=new c(r),this.segments=[]}return n(e,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var l=a.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l)))for(var c=this._splitSafely(a,l),h=0,f=c.length;h0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var E=a.getIntersection(s);if(null!==E){if(!a.isAnEndpoint(E))for(var w=this._splitSafely(a,E),x=0,C=w.length;xB)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var E=new U(d),w=d.size,x=d.pop();x;){var C=x.key;if(d.size===w){var M=C.segment;throw new Error("Unable to pop() ".concat(C.isLeft?"left":"right"," SweepEvent ")+"[".concat(C.point.x,", ").concat(C.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>B)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(E.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=E.process(C),N=0,A=S.length;N1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,u=[],l=!1,c=-1;function h(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&f())}function f(){if(!l){var t=a(h);l=!0;for(var e=u.length;e;){for(s=u,u=[];++c1)for(var n=1;n{"use strict";n.r(e),n.d(e,{default:()=>Ve});var r=6378137,i=.0066943799901413165,o=484813681109536e-20,a=Math.PI/2,s=1e-10,u=.017453292519943295,l=57.29577951308232,c=Math.PI/4,h=2*Math.PI,f=3.14159265359,p={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const d={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var y=/[\s_\-\/\(\)]/g;function m(t,e){if(t[e])return t[e];for(var n,r=Object.keys(t),i=e.toLowerCase().replace(y,""),o=-1;++o0?90:-90),t.lat_ts=t.lat1)}(i),i}w.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;_.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},w.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},w.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},w.prototype.number=function(t){if(!E.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},w.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},w.prototype.keyword=function(t){if(v.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},w.prototype.neutral=function(t){if(b.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(E.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},w.prototype.output=function(){for(;this.place90&&i*l<-90&&r*l>180&&r*l<-180)return null;if(Math.abs(Math.abs(i)-a)<=s)return null;if(this.sphere)e=this.x0+this.a*this.k0*k(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(c+.5*i));else{var o=Math.sin(i),u=F(this.e,i,o);e=this.x0+this.a*this.k0*k(r-this.long0),n=this.y0-this.a*this.k0*Math.log(u)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,i=t.y-this.y0;if(this.sphere)n=a-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(n=U(this.e,o)))return null}return e=k(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]};function j(t){return t}const G={init:function(){},forward:j,inverse:j,names:["longlat","identity"]};var W=n(5108),q=[B,G],H={},z=[];function V(t,e){var n=z.length;return t.names?(z[n]=t,t.names.forEach((function(t){H[t.toLowerCase()]=n})),this):(W.log(e),!0)}const X={start:function(){q.forEach(V)},add:V,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==H[e]&&z[H[e]]?z[H[e]]:void 0}};var Y={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Z=Y.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Y.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Q={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var K=n(5108),J={};function $(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:J[t]||null,isNull:!1}}function tt(t){return t/3600*Math.PI/180}function et(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function nt(t){return t.map((function(t){return[tt(t.longitudeShift),tt(t.latitudeShift)]}))}function rt(t,e,n){return{name:et(t,e+8,e+16).trim(),parent:et(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function it(t,e,n,r){for(var i=e+176,o=[],a=0;a-1}))}(t)){var e=S(t);if(function(t){var e=m(t,"authority");if(e){var n=m(e,"epsg");return n&&P.indexOf(n)>-1}}(e))return A["EPSG:3857"];var n=function(t){var e=m(t,"extension");if(e)return m(e,"proj4")}(e);return n?g(n):e}return function(t){return"+"===t[0]}(t)?g(t):void 0}(t);if("object"==typeof n){var r=ot.projections.get(n.projName);if(r){if(n.datumCode&&"none"!==n.datumCode){var i=m(Q,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(","):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a,u,l,c,h,f,p=function(t,e,n,r,i){if(!t){var o=m(Y,r);o||(o=Z),t=o.a,e=o.b,n=o.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=2,u.datum_params[3]*=o,u.datum_params[4]*=o,u.datum_params[5]*=o,u.datum_params[6]=u.datum_params[6]/1e6+1))),s&&(u.datum_type=3,u.grids=s),u.a=n,u.b=r,u.es=i,u.ep2=a,u}(n.datumCode,n.datum_params,p.a,p.b,d.es,d.ep2,y);R(this,n),R(this,r),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=_,this.init(),e(null,this)}else e(t)}else e(t)}ot.projections=X,ot.projections.start();const at=ot;function st(t,e,n){var r,i,o,s,u=t.x,l=t.y,c=t.z?t.z:0;if(l<-a&&l>-1.001*a)l=-a;else if(l>a&&l<1.001*a)l=a;else{if(l<-a)return{x:-1/0,y:-1/0,z:t.z};if(l>a)return{x:1/0,y:1/0,z:t.z}}return u>Math.PI&&(u-=2*Math.PI),i=Math.sin(l),s=Math.cos(l),o=i*i,{x:((r=n/Math.sqrt(1-e*o))+c)*s*Math.cos(u),y:(r+c)*s*Math.sin(u),z:(r*(1-e)+c)*i}}function ut(t,e,n,r){var i,o,a,s,u,l,c,h,f,p,d,y,m,g,_,b=t.x,v=t.y,T=t.z?t.z:0;if(i=Math.sqrt(b*b+v*v),o=Math.sqrt(b*b+v*v+T*T),i/n<1e-12){if(g=0,o/n<1e-12)return _=-r,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(v,b);a=T/o,h=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),f=a*u,m=0;do{m++,l=e*(c=n/Math.sqrt(1-e*f*f))/(c+(_=i*h+T*f-c*(1-e*f*f))),y=(d=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*h-(p=s*(1-l)*u)*f,h=p,f=d}while(y*y>1e-24&&m<30);return{x:g,y:Math.atan(d/Math.abs(p)),z:_}}var lt=n(5108);function ct(t){return 1===t||2===t}function ht(t,e,n){if(null===t.grids||0===t.grids.length)return lt.log("Grid shift grids not found"),-1;for(var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[],a=0;ar.y||h>r.x||d1e-12&&Math.abs(a.y)>1e-12);if(u<0)return lt.log("Inverse grid shift iterator failed to converge."),r;r.x=k(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function pt(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),a=r.x-1*i,s=r.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;n=o*e.lim[0]+i;var l=e.cvs[n][0],c=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var y=e.cvs[n][0],m=e.cvs[n][1],g=a*s,_=a*(1-s),b=(1-a)*(1-s),v=(1-a)*s;return u.x=b*l+_*h+v*y+g*p,u.y=b*c+_*f+v*m+g*d,u}function dt(t,e,n){var r,i,o,a=n.x,s=n.y,u=n.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=u,i="z"),t.axis[o]){case"e":case"n":l[i]=r;break;case"w":case"s":l[i]=-r;break;case"u":void 0!==n[i]&&(l.z=r);break;case"d":void 0!==n[i]&&(l.z=-r);break;default:return null}return l}function yt(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function mt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function gt(t,e,n,o){var a;if(Array.isArray(n)&&(n=yt(n)),function(t){mt(t.x),mt(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=gt(t,a=new at("WGS84"),n,o),t=a),o&&"enu"!==t.axis&&(n=dt(t,!1,n)),"longlat"===t.projName)n={x:n.x*u,y:n.y*u,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var o=t.a,a=t.es;if(3===t.datum_type){if(0!==ht(t,!1,n))return;o=r,a=i}var s=e.a,u=e.b,l=e.es;return 3===e.datum_type&&(s=r,u=6356752.314,l=i),a!==l||o!==s||ct(t.datum_type)||ct(e.datum_type)?(n=st(n,a,o),ct(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6];return{x:l*(t.x-u*t.y+s*t.z)+r,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),ct(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=(t.x-r)/l,h=(t.y-i)/l,f=(t.z-o)/l;return{x:c+u*h-s*f,y:-u*c+h+a*f,z:s*c-a*h+f}}}(n,e.datum_type,e.datum_params)),n=ut(n,l,s,u),3!==e.datum_type||0===ht(e,!0,n)?n:void 0):n}(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*l,y:n.y*l,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),o&&"enu"!==e.axis?dt(e,!0,n):n}var _t=at("WGS84");function bt(t,e,n,r){var i,o,a;return Array.isArray(n)?(i=gt(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.splice(3)):[i.x,i.y,n[2]].concat(n.splice(3)):[i.x,i.y].concat(n.splice(2)):[i.x,i.y]):(o=gt(t,e,n,r),2===(a=Object.keys(n)).length||a.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;o[r]=n[r]})),o)}function vt(t){return t instanceof at?t:t.oProj?t.oProj:at(t)}const Tt=function(t,e,n){t=vt(t);var r,i=!1;return void 0===e?(e=t,t=_t,i=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=_t,i=!0),e=vt(e),n?bt(t,e,n):(r={forward:function(n,r){return bt(t,e,n,r)},inverse:function(n,r){return bt(e,t,n,r)}},i&&(r.oProj=e),r)};var Et="AJSAJS",wt="AFAFAF",xt=65,Ct=73,Mt=79;const St={forward:Nt,inverse:function(t){var e=Pt(Lt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Ot};function Nt(t,e){return e=e||5,function(t,e){var n,r,i,o,a,s,u,l,c,h,f,p="00000"+t.easting,d="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,h=t.northing,f=Rt(t.zoneNumber),n=Math.floor(c/1e5),r=Math.floor(h/1e5)%20,o=Et.charCodeAt(i=f-1),a=wt.charCodeAt(i),l=!1,(s=o+n-1)>90&&(s=s-90+xt-1,l=!0),(s===Ct||oCt||(s>Ct||oMt||(s>Mt||o90&&(s=s-90+xt-1),(u=a+r)>86?(u=u-86+xt-1,l=!0):l=!1,(u===Ct||aCt||(u>Ct||aMt||(u>Mt||a86&&(u=u-86+xt-1),String.fromCharCode(s)+String.fromCharCode(u))+p.substr(p.length-5,e)+d.substr(d.length-5,e)}(function(t){var e,n,r,i,o,a,s,u=t.lat,l=t.lon,c=6378137,h=.00669438,f=.9996,p=At(u),d=At(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60),u>=56&&u<64&&l>=3&&l<12&&(s=32),u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37)),a=At(6*(s-1)-180+3),e=.006739496752268451,n=c/Math.sqrt(1-h*Math.sin(p)*Math.sin(p)),r=Math.tan(p)*Math.tan(p),i=e*Math.cos(p)*Math.cos(p);var y,m,g=f*n*((o=Math.cos(p)*(d-a))+(1-r+i)*o*o*o/6+(5-18*r+r*r+72*i-58*e)*o*o*o*o*o/120)+5e5,_=f*(c*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+n*Math.tan(p)*(o*o/2+(5-r+9*i+4*i*i)*o*o*o*o/24+(61-58*r+r*r+600*i-2.2240339282485886)*o*o*o*o*o*o/720));return u<0&&(_+=1e7),{northing:Math.round(_),easting:Math.round(g),zoneNumber:s,zoneLetter:(y=u,m="Z",84>=y&&y>=72?m="X":72>y&&y>=64?m="W":64>y&&y>=56?m="V":56>y&&y>=48?m="U":48>y&&y>=40?m="T":40>y&&y>=32?m="S":32>y&&y>=24?m="R":24>y&&y>=16?m="Q":16>y&&y>=8?m="P":8>y&&y>=0?m="N":0>y&&y>=-8?m="M":-8>y&&y>=-16?m="L":-16>y&&y>=-24?m="K":-24>y&&y>=-32?m="J":-32>y&&y>=-40?m="H":-40>y&&y>=-48?m="G":-48>y&&y>=-56?m="F":-56>y&&y>=-64?m="E":-64>y&&y>=-72?m="D":-72>y&&y>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),e)}function Ot(t){var e=Pt(Lt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function At(t){return t*(Math.PI/180)}function It(t){return t/Math.PI*180}function Pt(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,h,f,p,d=.9996,y=6378137,m=.00669438,g=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=n-5e5,b=e;r<"N"&&(b-=1e7),h=6*(i-1)-180+3,o=.006739496752268451,p=(f=b/d/6367449.145945056)+(3*g/2-27*g*g*g/32)*Math.sin(2*f)+(21*g*g/16-55*g*g*g*g/32)*Math.sin(4*f)+151*g*g*g/96*Math.sin(6*f),a=y/Math.sqrt(1-m*Math.sin(p)*Math.sin(p)),s=Math.tan(p)*Math.tan(p),u=o*Math.cos(p)*Math.cos(p),l=.99330562*y/Math.pow(1-m*Math.sin(p)*Math.sin(p),1.5),c=_/(a*d);var v=p-a*Math.tan(p)/l*(c*c/2-(5+3*s+10*u-4*u*u-9*o)*c*c*c*c/24+(61+90*s+298*u+45*s*s-1.6983531815716497-3*u*u)*c*c*c*c*c*c/720);v=It(v);var T,E=(c-(1+2*s+u)*c*c*c/6+(5-2*u+28*s-3*u*u+8*o+24*s*s)*c*c*c*c*c/120)/Math.cos(p);if(E=h+It(E),t.accuracy){var w=Pt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});T={top:w.lat,right:w.lon,bottom:v,left:E}}else T={lat:v,lon:E};return T}function Rt(t){var e=t%6;return 0===e&&(e=6),e}function Lt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(o,o+=2);for(var u=Rt(a),l=function(t,e){for(var n=Et.charCodeAt(e-1),r=1e5,i=!1;n!==t.charCodeAt(0);){if(++n===Ct&&n++,n===Mt&&n++,n>90){if(i)throw"Bad character: "+t;n=xt,i=!0}r+=1e5}return r}(r.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var n=wt.charCodeAt(e-1),r=0,i=!1;n!==t.charCodeAt(0);){if(++n===Ct&&n++,n===Mt&&n++,n>86){if(i)throw"Bad character: "+t;n=xt,i=!0}r+=1e5}return r}(r.charAt(1),u);c0&&(f=1e5/Math.pow(10,y),p=t.substring(o,o+y),m=parseFloat(p)*f,d=t.substring(o+y),g=parseFloat(d)*f),{easting:m+l,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:f}}function Dt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}var kt=n(5108);function Ft(t,e,n){if(!(this instanceof Ft))return new Ft(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=n||0;kt.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ft.fromMGRS=function(t){return new Ft(Ot(t))},Ft.prototype.toMGRS=function(t){return Nt([this.x,this.y],t)};const Ut=Ft;var Bt=.046875,jt=.01953125,Gt=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(Bt+t*(jt+t*Gt))),e[1]=t*(.75-t*(Bt+t*(jt+t*Gt)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e}function qt(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}function Ht(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),u=1-e*a*a;if(i-=u=(qt(i,a,Math.cos(i),n)-t)*(u*Math.sqrt(u))*r,Math.abs(u)s?Math.tan(o):0,y=Math.pow(d,2),m=Math.pow(y,2);e=1-this.es*Math.pow(u,2),c/=Math.sqrt(e);var g=qt(o,u,l,this.en);n=this.a*(this.k0*c*(1+h/6*(1-y+f+h/20*(5-18*y+m+14*f-58*y*f+h/42*(61+179*m-m*y-479*y)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+u*a*c/2*(1+h/12*(5-y+9*f+4*p+h/30*(61+m-58*y+270*f-330*y*f+h/56*(1385+543*m-m*y-3111*y))))))+this.y0}else{var _=l*Math.sin(a);if(Math.abs(Math.abs(_)-1)=1){if(_-1>s)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,i,o=(t.x-this.x0)*(1/this.a),u=(t.y-this.y0)*(1/this.a);if(this.es)if(n=Ht(e=this.ml0+u/this.k0,this.es,this.en),Math.abs(n)s?Math.tan(n):0,f=this.ep2*Math.pow(c,2),p=Math.pow(f,2),d=Math.pow(h,2),y=Math.pow(d,2);e=1-this.es*Math.pow(l,2);var m=o*Math.sqrt(e)/this.k0,g=Math.pow(m,2);r=n-(e*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*f*d+f-4*p-g/30*(61+90*d-252*f*d+45*y+46*f-g/56*(1385+3633*d+4095*y+1574*y*d)))),i=k(this.long0+m*(1-g/6*(1+2*d+f-g/20*(5+28*d+24*y+8*f*d+6*f-g/42*(61+662*d+1320*y+720*y*d))))/c)}else r=a*D(u),i=0;else{var _=Math.exp(o/this.k0),b=.5*(_-1/_),v=this.lat0+u/this.k0,T=Math.cos(v);e=Math.sqrt((1-Math.pow(T,2))/(1+Math.pow(b,2))),r=Math.asin(e),u<0&&(r=-r),i=0===b&&0===T?0:k(Math.atan2(b,T)+this.long0)}return t.x=i,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Vt(t){var e=Math.exp(t);return(e-1/e)/2}function Xt(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function Yt(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return e+n*Math.sin(2*e)}function Zt(t,e,n){for(var r,i,o=Math.sin(e),a=Math.cos(e),s=Vt(n),u=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),l=2*a*u,c=-2*o*s,h=t.length-1,f=t[h],p=0,d=0,y=0;--h>=0;)r=d,i=p,f=l*(d=f)-r-c*(p=y)+t[h],y=c*d-i+l*p;return[(l=o*u)*f-(c=a*s)*y,l*y+c*f]}const Qt={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(zt.init.apply(this),this.forward=zt.forward,this.inverse=zt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Yt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=k(t.x-this.long0),n=t.y;n=Yt(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),a=Math.cos(e);n=Math.atan2(r,a*i),e=Math.atan2(o*i,Xt(r,i*a)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(Xt(1,e)+1))),t<0?-e:e}(Math.tan(e));var s,u,l=Zt(this.gtu,2*n,2*e);return n+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=Zt(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(Vt(r));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(r),l=Math.cos(r);i=Math.atan2(a*l,Xt(u,l*s)),e=k((r=Math.atan2(u,l*s))+this.long0),n=Yt(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Kt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(k(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*u,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Qt.init.apply(this),this.forward=Qt.forward,this.inverse=Qt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Jt(t,e){return Math.pow((1-t)/(1+t),e)}const $t={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+c)/(Math.pow(Math.tan(.5*this.lat0+c),this.C)*Jt(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+c),this.C)*Jt(this.e*Math.sin(n),this.ratexp))-a,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+c)/this.K,1/this.C),i=20;i>0&&(n=2*Math.atan(r*Jt(this.e*Math.sin(t.y),-.5*this.e))-a,!(Math.abs(n-t.y)<1e-14));--i)t.y=n;return i?(t.x=e,t.y=n,t):null},names:["gauss"]},te={init:function(){$t.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=k(t.x-this.long0),$t.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),n=Math.cos(a),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,$t.inverse.apply(this,[t]),t.x=k(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ee={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s&&(this.k0=.5*(1+D(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=s&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s&&(this.k0=.5*this.cons*L(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/F(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=L(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,i,o,u,l=t.x,c=t.y,h=Math.sin(c),f=Math.cos(c),p=k(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=s&&Math.abs(c+this.lat0)<=s?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*f*Math.cos(p)),t.x=this.a*e*f*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*f*Math.cos(p))+this.y0,t):(n=2*Math.atan(this.ssfn_(c,h,this.e))-a,i=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=s?(o=F(this.e,c*this.con,this.con*h),u=2*this.a*this.k0*o/this.cons,t.x=this.x0+u*Math.sin(l-this.long0),t.y=this.y0-this.con*u*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)0?k(this.long0+Math.atan2(t.x,-1*t.y)):k(this.long0+Math.atan2(t.x,t.y)):k(this.long0+Math.atan2(t.x*Math.sin(l),u*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=s){if(u<=s)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=u*this.cons/(2*this.a*this.k0),n=this.con*U(this.e,r),e=this.con*k(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,u<=s?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/u),e=k(this.long0+Math.atan2(t.x*Math.sin(i),u*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),n=-1*U(this.e,Math.tan(.5*(a+o)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(a+t))*Math.pow((1-e)/(1+e),.5*n)}},ne={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,h=0;Math.abs(l-c)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};var re=1e-7;const ie={init:function(){var t,e,n,r,i,o,l,f,p,d,y,m,g,_=0,b=0,v=0,T=0,E=0,w=0,x=0;this.no_off=(g="object"==typeof(m=this).PROJECTION?Object.keys(m.PROJECTION)[0]:m.PROJECTION,"no_uoff"in m||"no_off"in m||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),C&&(x=this.alpha),M&&(_=this.rectified_grid_angle*u),C||M)b=this.longc;else if(v=this.long1,E=this.lat1,T=this.long2,w=this.lat2,Math.abs(E-w)<=re||(t=Math.abs(E))<=re||Math.abs(t-a)<=re||Math.abs(Math.abs(this.lat0)-a)<=re||Math.abs(Math.abs(w)-a)<=re)throw new Error;var S=1-this.es;e=Math.sqrt(S),Math.abs(this.lat0)>s?(f=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*f*f,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*e/t,(i=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(F(this.e,this.lat0,f),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),C||M?(C?(y=Math.asin(Math.sin(x)/r),M||(_=x)):(y=_,x=Math.asin(r*Math.sin(y))),this.lam0=b-Math.asin(.5*(i-1/i)*Math.tan(y))/this.B):(o=Math.pow(F(this.e,E,Math.sin(E)),this.B),l=Math.pow(F(this.e,w,Math.sin(w)),this.B),i=this.E/o,p=(l-o)/(l+o),d=((d=this.E*this.E)-l*o)/(d+l*o),(t=v-T)<-Math.pi?T-=h:t>Math.pi&&(T+=h),this.lam0=k(.5*(v+T)-Math.atan(d*Math.tan(.5*this.B*(v-T))/p)/this.B),y=Math.atan(2*Math.sin(this.B*k(v-this.lam0))/(i-1/i)),_=x=Math.asin(r*Math.sin(y))),this.singam=Math.sin(y),this.cosgam=Math.cos(y),this.sinrot=Math.sin(_),this.cosrot=Math.cos(_),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*y,this.v_pole_n=this.ArB*Math.log(Math.tan(c-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(c+i))},forward:function(t){var e,n,r,i,o,u,l,c,h={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-a)>s){if(e=.5*((o=this.E/Math.pow(F(this.e,t.y,Math.sin(t.y)),this.B))-(u=1/o)),n=.5*(o+u),i=Math.sin(this.B*t.x),r=(e*this.singam-i*this.cosgam)/n,Math.abs(Math.abs(r)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(h.x=l,h.y=c):(l-=this.u_0,h.x=c*this.cosrot+l*this.sinrot,h.y=l*this.cosrot-c*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(t){var e,n,r,i,o,u,l,c={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((r=Math.exp(-this.BrA*n))-1/r),o=.5*(r+1/r),l=((u=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(l)-1)s?this.ns=Math.log(r/u)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=s&&(n=D(n)*(a-2e-10));var r,i,o=Math.abs(Math.abs(n)-a);if(o>s)r=F(this.e,n,Math.sin(n)),i=this.a*this.f0*Math.pow(r,this.ns);else{if((o=n*this.ns)<=0)return null;i=0}var u=this.ns*k(e-this.long0);return t.x=this.k0*(i*Math.sin(u))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(u))+this.y0,t},inverse:function(t){var e,n,r,i,o,s=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+u*u),n=1):(e=-Math.sqrt(s*s+u*u),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*s,n*u)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(i=U(this.e,r)))return null}else i=-a;return o=k(l/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},ae={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y,c=k(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function se(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function ue(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function le(t){return.375*t*(1+.25*t*(1+.46875*t))}function ce(t){return.05859375*t*t*(1+.75*t)}function he(t){return t*t*t*(35/3072)}function fe(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)}function pe(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e}const ge={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-a)0)switch(this.qp=me(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=me(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,i,o,u,l,h,f,p,d=t.x,y=t.y;if(d=k(d-this.long0),this.sphere){if(o=Math.sin(y),p=Math.cos(y),r=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+p*r:1+this.sinph0*o+this.cosph0*p*r)<=s)return null;e=(n=Math.sqrt(2/n))*p*Math.sin(d),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*p*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)=0?(e=(f=Math.sqrt(u))*i,n=r*(this.mode===this.S_POLE?f:-f)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,i,o,u,l,c,h,f,p=t.x/this.a,d=t.y/this.a;if(this.sphere){var y,m=0,g=0;if((n=.5*(y=Math.sqrt(p*p+d*d)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(y)<=s?0:Math.asin(d*g/y),p*=g,d=m*y;break;case this.OBLIQ:n=Math.abs(y)<=s?this.lat0:Math.asin(m*this.sinph0+d*g*this.cosph0/y),p*=g*this.cosph0,d=(m-Math.sin(n)*this.sinph0)*y;break;case this.N_POLE:d=-d,n=a-n;break;case this.S_POLE:n-=a}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,d):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,d*=this.dd,(u=Math.sqrt(p*p+d*d))1&&(t=t>1?1:-1),Math.asin(t)}const be={init:function(){Math.abs(this.lat1+this.lat2)s?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=me(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*k(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,n)),o=k(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,a=_e(.5*e);if(t0||Math.abs(o)<=s?(a=this.x0+1*this.a*n*Math.sin(r)/o,u=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(a=this.x0+this.infinity_dist*n*Math.sin(r),u=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=u,t},inverse:function(t){var e,n,r,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),a=_e((r=Math.cos(i))*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=k(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]},Te={init:function(){this.sphere||(this.k0=L(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=k(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=me(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=k(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*a:a;for(var r,i,o,s,u=Math.asin(.5*e),l=0;l<30;l++)if(i=Math.sin(u),o=Math.cos(u),s=t*i,u+=r=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-i/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-10)return u;return NaN}(this.e,2*t.y*this.k0/this.a),e=k(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]},Ee={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=k(e-this.long0),i=pe(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=k(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=pe(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},we={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ue(this.es),this.e1=le(this.es),this.e2=ce(this.es),this.e3=he(this.es),this.ml0=this.a*se(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,a=k(i-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=s?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(pe(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=s)e=this.a*a,n=-1*this.ml0;else{var u=fe(this.a,this.e,Math.sin(o))/Math.tan(o);e=u*Math.sin(r),n=this.a*se(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+u*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,a,u,l,c;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=s)e=k(r/this.a+this.long0),n=0;else{var h;for(a=this.lat0+i/this.a,u=r*r/this.a/this.a+a*a,l=a,o=20;o;--o)if(l+=c=-1*(a*(l*(h=Math.tan(l))+1)-l-.5*(l*l+u)*h)/((l-a)/h-1),Math.abs(c)<=s){n=l;break}e=k(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=s)n=0,e=k(this.long0+r/this.a);else{var f,p,d,y,m;for(a=(this.ml0+i)/this.a,u=r*r/this.a/this.a+a*a,l=a,o=20;o;--o)if(m=this.e*Math.sin(l),f=Math.sqrt(1-m*m)*Math.tan(l),p=this.a*se(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(a*(f*(y=p/this.a)+1)-y-.5*f*(y*y+u))/(this.es*Math.sin(2*l)*(y*y+u-2*a*y)/(4*f)+(a-y)*(f*d-2/Math.sin(2*l))-d),Math.abs(c)<=s){n=l;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=k(this.long0+Math.asin(r*f/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]},xe={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,r=t.y-this.lat0,i=n-this.long0,a=r/o*1e-5,s=i,u=1,l=0;for(e=1;e<=10;e++)u*=a,l+=this.A[e]*u;var c,h=l,f=s,p=1,d=0,y=0,m=0;for(e=1;e<=6;e++)c=d*h+p*f,p=p*h-d*f,d=c,y=y+this.B_re[e]*p-this.B_im[e]*d,m=m+this.B_im[e]*p+this.B_re[e]*d;return t.x=m*this.a+this.x0,t.y=y*this.a+this.y0,t},inverse:function(t){var e,n,r=t.x,i=t.y,a=r-this.x0,s=(i-this.y0)/this.a,u=a/this.a,l=1,c=0,h=0,f=0;for(e=1;e<=6;e++)n=c*s+l*u,l=l*s-c*u,c=n,h=h+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(n=.999999999999),e=Math.asin(n);var r=k(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]},Ne={init:function(){Math.abs(this.lat1+this.lat2)=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=k(this.long0+o/this.ns),r=pe(this.g-n/this.a),t.x=i,t.y=r,t):(r=de(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),i=k(this.long0+o/this.ns),t.x=i,t.y=r,t)},names:["Equidistant_Conic","eqdc"]},Oe={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,i=t.y,o=k(r-this.long0);Math.abs(i)<=s&&(e=this.x0+this.R*o,n=this.y0);var u=_e(2*Math.abs(i/Math.PI));(Math.abs(o)<=s||Math.abs(Math.abs(i)-a)<=s)&&(e=this.x0,n=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*u):this.y0+Math.PI*this.R*-Math.tan(.5*u));var l=.5*Math.abs(Math.PI/o-o/Math.PI),c=l*l,h=Math.sin(u),f=Math.cos(u),p=f/(h+f-1),d=p*p,y=p*(2/h-1),m=y*y,g=Math.PI*this.R*(l*(p-m)+Math.sqrt(c*(p-m)*(p-m)-(m+c)*(d-m)))/(m+c);o<0&&(g=-g),e=this.x0+g;var _=c+p;return g=Math.PI*this.R*(y*_-l*Math.sqrt((m+c)*(c+1)-_*_))/(m+c),n=i>=0?this.y0+g:this.y0-g,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,a,u,l,c,h,f,p;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,o=(r=t.x/f)*r+(i=t.y/f)*i,f=3*(i*i/(l=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(u=a-2*i*i+r*r)*u*u/l/l/l-9*a*u/l/l)/27)/(c=(a-u*u/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(f)>1&&(f=f>=0?1:-1),p=Math.acos(f)/3,n=t.y>=0?(-h*Math.cos(p+Math.PI/3)-u/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-u/3/l)*Math.PI,e=Math.abs(r)2*a*this.a)return;return n=e/this.a,r=Math.sin(n),i=Math.cos(n),o=this.long0,Math.abs(e)<=s?u=this.lat0:(u=_e(i*this.sin_p12+t.y*r*this.cos_p12/e),l=Math.abs(this.lat0)-a,o=Math.abs(l)<=s?this.lat0>=0?k(this.long0+Math.atan2(t.x,-t.y)):k(this.long0-Math.atan2(-t.x,t.y)):k(this.long0+Math.atan2(t.x*r,e*this.cos_p12*i-t.y*this.sin_p12*r))),t.x=o,t.y=u,t}return c=ue(this.es),h=le(this.es),f=ce(this.es),p=he(this.es),Math.abs(this.sin_p12-1)<=s?(u=de(((d=this.a*se(c,h,f,p,a))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,c,h,f,p),o=k(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=u,t):Math.abs(this.sin_p12+1)<=s?(d=this.a*se(c,h,f,p,a),u=de(((e=Math.sqrt(t.x*t.x+t.y*t.y))-d)/this.a,c,h,f,p),o=k(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=u,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),y=fe(this.a,this.e,this.sin_p12),_=Math.cos(g),v=-(b=this.e*this.cos_p12*_)*b/(1-this.es),T=3*this.es*(1-v)*this.sin_p12*this.cos_p12*_/(1-this.es),x=1-v*(w=(E=e/y)-v*(1+v)*Math.pow(E,3)/6-T*(1+3*v)*Math.pow(E,4)/24)*w/2-E*w*w*w/6,m=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*_),o=k(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(m))),C=Math.sin(m),u=Math.atan2((C-this.es*x*this.sin_p12)*Math.tan(m),C*(1-this.es)),t.x=o,t.y=u,t)},names:["Azimuthal_Equidistant","aeqd"]},Ie={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,u,l=t.x,c=t.y;return r=k(l-this.long0),e=Math.sin(c),n=Math.cos(c),i=Math.cos(r),((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=s)&&(a=1*this.a*n*Math.sin(r),u=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=u,t},inverse:function(t){var e,n,r,i,o,u,l;return t.x-=this.x0,t.y-=this.y0,n=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),r=Math.sin(n),i=Math.cos(n),u=this.long0,Math.abs(e)<=s?(l=this.lat0,t.x=u,t.y=l,t):(l=_e(i*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.abs(this.lat0)-a,Math.abs(o)<=s?(u=this.lat0>=0?k(this.long0+Math.atan2(t.x,-t.y)):k(this.long0-Math.atan2(-t.x,t.y)),t.x=u,t.y=l,t):(u=k(this.long0+Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r)),t.x=u,t.y=l,t))},names:["ortho"]};function Pe(t,e,n,r){var i;return tc&&i<=a+c?(r.value=2,i-=a):i>a+c||i<=-(a+c)?(r.value=3,i=i>=0?i-f:i+f):(r.value=4,i+=a)),i}function Re(t,e){var n=t+e;return n<-f?n+=h:n>+f&&(n-=h),n}const Le={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-c/2?this.face=5:this.lat0<=-(a-c/2)?this.face=6:Math.abs(this.long0)<=c?this.face=1:Math.abs(this.long0)<=a+c?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,i,o,s,u={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,5===this.face)i=a-e,n>=c&&n<=a+c?(l.value=1,r=n-a):n>a+c||n<=-(a+c)?(l.value=2,r=n>0?n-f:n+f):n>-(a+c)&&n<=-c?(l.value=3,r=n+a):(l.value=4,r=n);else if(6===this.face)i=a+e,n>=c&&n<=a+c?(l.value=1,r=-n+a):n=-c?(l.value=2,r=-n):n<-c&&n>=-(a+c)?(l.value=3,r=-n-a):(l.value=4,r=n>0?-n+f:-n-f);else{var h,p,d,y,m,g;2===this.face?n=Re(n,+a):3===this.face?n=Re(n,+f):4===this.face&&(n=Re(n,-a)),y=Math.sin(e),m=Math.cos(e),g=Math.sin(n),h=m*Math.cos(n),p=m*g,d=y,1===this.face?r=Pe(i=Math.acos(h),d,p,l):2===this.face?r=Pe(i=Math.acos(p),d,-h,l):3===this.face?r=Pe(i=Math.acos(-h),d,-p,l):4===this.face?r=Pe(i=Math.acos(-p),d,h,l):(i=r=0,l.value=1)}return s=Math.atan(12/f*(r+Math.acos(Math.sin(r)*Math.cos(c))-a)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(r))))),2===l.value?s+=a:3===l.value?s+=f:4===l.value&&(s+=1.5*f),u.x=o*Math.cos(s),u.y=o*Math.sin(s),u.x=u.x*this.a+this.x0,u.y=u.y*this.a+this.y0,t.x=u.x,t.y=u.y,t},inverse:function(t){var e,n,r,i,o,s,u,l,c,h,p,d,y={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=2,e-=a):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=3,e=e<0?e+f:e-f):(m.value=4,e+=a),c=f/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),s=Math.atan(o),(u=1-(r=Math.cos(e))*r*(i=Math.tan(n))*i*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?u=-1:u>1&&(u=1),5===this.face)l=Math.acos(u),y.phi=a-l,1===m.value?y.lam=s+a:2===m.value?y.lam=s<0?s+f:s-f:3===m.value?y.lam=s-a:y.lam=s;else if(6===this.face)l=Math.acos(u),y.phi=l-a,1===m.value?y.lam=-s+a:2===m.value?y.lam=-s:3===m.value?y.lam=-s-a:y.lam=s<0?-s-f:-s+f;else{var g,_,b;c=(g=u)*g,_=(c+=(b=c>=1?0:Math.sqrt(1-c)*Math.sin(s))*b)>=1?0:Math.sqrt(1-c),2===m.value?(c=_,_=-b,b=c):3===m.value?(_=-_,b=-b):4===m.value&&(c=_,_=b,b=-c),2===this.face?(c=g,g=-_,_=c):3===this.face?(g=-g,_=-_):4===this.face&&(c=g,g=_,_=-c),y.phi=Math.acos(-b)-a,y.lam=Math.atan2(_,g),2===this.face?y.lam=Re(y.lam,-a):3===this.face?y.lam=Re(y.lam,-f):4===this.face&&(y.lam=Re(y.lam,+a))}return 0!==this.es&&(h=y.phi<0?1:0,p=Math.tan(y.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),y.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),h&&(y.phi=-y.phi)),y.lam+=this.long0,t.x=y.lam,t.y=y.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var De=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],ke=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Fe=.8487,Ue=1.3523,Be=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const je={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=k(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(11.459155902616464*n);r<0?r=0:r>=18&&(r=17);var i={x:Be(De[r],n=l*(n-.08726646259971647*r))*e,y:Be(ke[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*Fe+this.x0,i.y=i.y*this.a*Ue+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*Fe),y:Math.abs(t.y-this.y0)/(this.a*Ue)};if(e.y>=1)e.x/=De[18][0],e.y=t.y<0?-a:a;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if(ke[n][0]>e.y)--n;else{if(!(ke[n+1][0]<=e.y))break;++n}var r=ke[n],i=5*(e.y-r[0])/(ke[n+1][0]-r[0]);i=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)<1e-10)break}return i}((function(t){return(Be(r,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(r,t)}),i,0,100),e.x/=Be(De[n],i),e.y=(5*n+i)*u,t.y<0&&(e.y=-e.y)}return e.x=k(e.x+this.long0),e},names:["Robinson","robin"]},Ge={init:function(){this.name="geocent"},forward:function(t){return st(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var We={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const qe={init:function(){if(Object.keys(We).forEach(function(t){if(void 0===this[t])this[t]=We[t].def;else{if(We[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);We[t].num&&(this[t]=parseFloat(this[t]))}We[t].degrees&&(this[t]=this[t]*u)}.bind(this)),Math.abs(Math.abs(this.lat0)-a)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,n,r,i,o=Math.sin(t.y),a=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case 3:n=this.sinph0*o+this.cosph0*a*s;break;case 2:n=a*s;break;case 1:n=-o;break;case 0:n=o}switch(e=(n=this.pn1/(this.p-n))*a*Math.sin(t.x),this.mode){case 3:n*=this.cosph0*o-this.sinph0*a*s;break;case 2:n*=o;break;case 0:n*=-a*s;break;case 1:n*=a*s}return i=1/((r=n*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-n*this.sg)*this.cw*i,n=r*i,t.x=e*this.a,t.y=n*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,n,r,i={x:t.x,y:t.y};r=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*r,n=this.pn1*t.y*this.cw*r,t.x=e*this.cg+n*this.sg,t.y=n*this.cg-e*this.sg;var o=Xt(t.x,t.y);if(Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,r,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/Xt(this.radius_p*Math.cos(a),Math.sin(a));if(n=s*Math.cos(o)*Math.cos(a),r=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Xt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Xt(r,e)))}else"sphere"===this.shape&&(e=Math.cos(a),n=Math.cos(o)*e,r=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/Xt(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/Xt(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Xt(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Xt(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var ze;Tt.defaultDatum="WGS84",Tt.Proj=at,Tt.WGS84=new Tt.Proj("WGS84"),Tt.Point=Ut,Tt.toPoint=yt,Tt.defs=A,Tt.nadgrid=function(t,e){var n=new DataView(e),r=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&K.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:et(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(n,r);i.nSubgrids>1&&K.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o=function(t,e,n){for(var r=[],i=0;i{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(n);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var l=0;l=0?(c=d.substr(0,y),h=d.substr(y+1)):(c=d,h=""),f=decodeURIComponent(c),p=decodeURIComponent(h),e(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},2361:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,n,r,i){return n=n||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(n):o+encodeURIComponent(e(t[i]))})).join(n):i?encodeURIComponent(e(i))+r+encodeURIComponent(e(t)):""}},7673:(t,e,n)=>{"use strict";e.decode=e.parse=n(2587),e.encode=e.stringify=n(2361)},9189:(t,e,n)=>{var r=n(5717),i=n(7187).EventEmitter;function o(t){if(!(this instanceof o))return new o(t);i.call(this),t=t||{},this.concurrency=t.concurrency||1/0,this.timeout=t.timeout||0,this.autostart=t.autostart||!1,this.results=t.results||null,this.pending=0,this.session=0,this.running=!1,this.jobs=[],this.timers={}}function a(){for(var t in this.timers){var e=this.timers[t];delete this.timers[t],clearTimeout(e)}}function s(t){var e=this;function n(t){e.end(t)}this.on("error",n),this.on("end",(function r(i){e.removeListener("error",n),e.removeListener("end",r),t(i,this.results)}))}function u(t){this.session++,this.running=!1,this.emit("end",t)}t.exports=o,t.exports.default=o,r(o,i),["pop","shift","indexOf","lastIndexOf"].forEach((function(t){o.prototype[t]=function(){return Array.prototype[t].apply(this.jobs,arguments)}})),o.prototype.slice=function(t,e){return this.jobs=this.jobs.slice(t,e),this},o.prototype.reverse=function(){return this.jobs.reverse(),this},["push","unshift","splice"].forEach((function(t){o.prototype[t]=function(){var e=Array.prototype[t].apply(this.jobs,arguments);return this.autostart&&this.start(),e}})),Object.defineProperty(o.prototype,"length",{get:function(){return this.pending+this.jobs.length}}),o.prototype.start=function(t){if(t&&s.call(this,t),this.running=!0,!(this.pending>=this.concurrency))if(0!==this.jobs.length){var e=this,n=this.jobs.shift(),r=!0,i=this.session,o=null,a=!1,l=null,c=n.timeout||this.timeout;c&&(o=setTimeout((function(){a=!0,e.listeners("timeout").length>0?e.emit("timeout",f,n):f()}),c),this.timers[o]=o),this.results&&(l=this.results.length,this.results[l]=null),this.pending++,e.emit("start",n);var h=n(f);h&&h.then&&"function"==typeof h.then&&h.then((function(t){return f(null,t)})).catch((function(t){return f(t||!0)})),this.running&&this.jobs.length>0&&this.start()}else 0===this.pending&&u.call(this);function f(t,s){r&&e.session===i&&(r=!1,e.pending--,null!==o&&(delete e.timers[o],clearTimeout(o)),t?e.emit("error",t,n):!1===a&&(null!==l&&(e.results[l]=Array.prototype.slice.call(arguments,1)),e.emit("success",s,n)),e.session===i&&(0===e.pending&&0===e.jobs.length?u.call(e):e.running&&e.start()))}},o.prototype.stop=function(){this.running=!1},o.prototype.end=function(t){a.call(this),this.jobs.length=0,this.pending=0,u.call(this,t)}},2582:function(t){t.exports=function(){"use strict";function t(t,r,i,o,a){!function t(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var f=n[r],p=i,d=o;for(e(n,i,r),a(n[o],f)>0&&e(n,i,o);p0;)d--}0===a(n[i],f)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,r,i||0,o||t.length-1,a||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return te?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!p(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=d(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,s,u,l,h,f=1/0,p=1/0,d=e;d<=n-e;d++){var y=a(t,0,d,this.toBBox),m=a(t,d,n,this.toBBox),g=(i=y,o=m,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-u)),_=c(y)+c(m);g=e;p--){var d=t.children[p];s(u,t.leaf?i(d):d),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)s(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},6102:(t,e,n)=>{"use strict";var r=n(4472).hasOwnProperty("default")?n(4472).default:n(4472);function i(t,e){return(n=t).length>=2&&"number"==typeof n[0]&&"number"==typeof n[1]?e(t):t.map((function(t){return i(t,e)}));var n}function o(t,e,n){if(null==n)return n;var r=function(t){if(null==t||"object"!=typeof t)return t;var e=t.constructor();for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(n),i=o.bind(this,t,e);switch(n.type){case"Feature":r.geometry=i(n.geometry);break;case"FeatureCollection":r.features=r.features.map(i);break;case"GeometryCollection":r.geometries=r.geometries.map(i);break;default:t(r)}return e&&e(r),r}function a(t,e){var n,r=t.crs;if(void 0===r)throw new Error('Unable to detect CRS, GeoJSON has no "crs" property.');if("name"===r.type?n=e[r.properties.name]:"EPSG"===r.type&&(n=e["EPSG:"+r.properties.code]),!n)throw new Error("CRS defined in crs section could not be identified: "+JSON.stringify(r));return n}function s(t,e){return"string"==typeof t||t instanceof String?e[t]||r.Proj(t):t}function u(t,e,n,u){u=u||{},e=e?s(e,u):a(t,u),n=s(n,u);var l=r(e,n).forward.bind(l);function c(t){var e=l(t);return 3===t.length&&void 0!==t[2]&&void 0===e[2]&&(e[2]=t[2]),e}return o((function(t){t.crs&&delete t.crs,t.coordinates=i(t.coordinates,c)}),(function(t){t.bbox&&(t.bbox=function(t){var e=[Number.MAX_VALUE,Number.MAX_VALUE],n=[-Number.MAX_VALUE,-Number.MAX_VALUE];return o((function(t){i(t.coordinates,(function(t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),n[0]=Math.max(n[0],t[0]),n[1]=Math.max(n[1],t[1])}))}),null,t),[e[0],e[1],n[0],n[1]]}(t))}),t)}t.exports={detectCrs:a,reproject:u,reverse:function(t){return o((function(t){t.coordinates=i(t.coordinates,(function(t){return[t[1],t[0]]}))}),null,t)},toWgs84:function(t,e,n){return u(t,e,r.WGS84,n)}}},3686:function(t,e){var n=void 0,r=function(e){return n||(n=new Promise((function(n,r){var i,o=void 0!==e?e:{},a=o.onAbort;o.onAbort=function(t){r(new Error(t)),a&&a(t)},o.postRun=o.postRun||[],o.postRun.push((function(){n(o)})),t=void 0,i||(i=void 0!==o?o:{}),i.onRuntimeInitialized=function(){function t(t,e){this.Ka=t,this.db=e,this.Ia=1,this.cb=[]}function e(t,e){if(this.db=e,e=W(t)+1,this.Xa=xe(e),null===this.Xa)throw Error("Unable to allocate memory for the SQL string");G(t,R,this.Xa,e),this.bb=this.Xa,this.Ta=this.hb=null}function n(t){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=t){var e=this.filename,n="/",i=e;if(n&&(n="string"==typeof n?n:It(n),i=e?ut(n+"/"+e):n),e=ue(!0,!0),i=Ht(i,4095&(void 0!==e?e:438)|32768,0),t){if("string"==typeof t){n=Array(t.length);for(var o=0,s=t.length;on;++n)i.parameters.push(r["viii"[n]]);n=new WebAssembly.Function(i,t)}else{for(i={i:127,j:126,f:125,d:124},(r=[1,0,1,96]).push(3),n=0;3>n;++n)r.push(i["iii"[n]]);r.push(0),r[1]=r.length-2,n=new Uint8Array([0,97,115,109,1,0,0,0].concat(r,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0])),n=new WebAssembly.Module(n),n=new WebAssembly.Instance(n,{e:{f:t}}).exports.f}z.set(e,n)}return T.set(t,e),e}((function(t,n,r){for(var i,o=[],a=0;a{h||(c=require("fs"),h=require("path"))},s=function(t,e){return f(),t=h.normalize(t),c.readFileSync(t,e?void 0:"utf8")},l=t=>((t=s(t,!0)).buffer||(t=new Uint8Array(t)),t),u=(t,e,n)=>{f(),t=h.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m&&(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var b=i.print||console.log.bind(console),v=i.printErr||console.warn.bind(console);Object.assign(i,p),p=null,i.thisProgram&&(d=i.thisProgram);var T,E,w=[];function x(t){T.delete(z.get(t)),w.push(t)}function C(t){var e="i32";switch("*"===e.charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":P[t>>0]=0;break;case"i16":L[t>>1]=0;break;case"i32":D[t>>2]=0;break;case"i64":J=[0,(K=0,1<=+Math.abs(K)?0>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[t>>2]=J[0],D[t+4>>2]=J[1];break;case"float":k[t>>2]=0;break;case"double":F[t>>3]=0;break;default:nt("invalid type for setValue: "+e)}}function M(t,e="i8"){switch("*"===e.charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return P[t>>0];case"i16":return L[t>>1];case"i32":case"i64":return D[t>>2];case"float":return k[t>>2];case"double":return Number(F[t>>3]);default:nt("invalid type for getValue: "+e)}return null}i.wasmBinary&&(E=i.wasmBinary),i.noExitRuntime,"object"!=typeof WebAssembly&&nt("no native wasm support detected");var S,N=!1;function O(t,e,n,r){var o={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);e=Ae(n),G(t,R,e,n)}return e},array:function(t){var e=Ae(t.length);return P.set(t,e),e}};t=i["_"+t];var a,s=[],u=0;if(r)for(var l=0;l=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function j(t,e){return t?B(R,t,e):""}function G(t,e,n,r){if(!(0=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),127>=a){if(n>=r)break;e[n++]=a}else{if(2047>=a){if(n+1>=r)break;e[n++]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++]=224|a>>12}else{if(n+3>=r)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63}e[n++]=128|a>>6&63}e[n++]=128|63&a}}return e[n]=0,n-i}function W(t){for(var e=0,n=0;n=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4}return e}function q(t){var e=W(t)+1,n=xe(e);return n&&G(t,P,n,e),n}function H(){var t=S.buffer;I=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=L=new Int16Array(t),i.HEAP32=D=new Int32Array(t),i.HEAPU8=R=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=new Uint32Array(t),i.HEAPF32=k=new Float32Array(t),i.HEAPF64=F=new Float64Array(t)}var z,V=[],X=[],Y=[];function Z(){var t=i.preRun.shift();V.unshift(t)}var Q,K,J,$=0,tt=null,et=null;function nt(t){throw i.onAbort&&i.onAbort(t),v(t="Aborted("+t+")"),N=!0,new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info.")}function rt(){return Q.startsWith("data:application/octet-stream;base64,")}if(i.preloadedImages={},i.preloadedAudios={},Q="sql-wasm.wasm",!rt()){var it=Q;Q=i.locateFile?i.locateFile(it,_):_+it}function ot(){var t=Q;try{if(t==Q&&E)return new Uint8Array(E);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){nt(t)}}function at(t){for(;0=e||(e=Math.max(e,n*(1048576>n?2:1.125)>>>0),0!=n&&(e=Math.max(e,256)),n=t.Ha,t.Ha=new Uint8Array(e),0=t.node.La)return 0;if(8<(t=Math.min(t.node.La-i,r))&&o.subarray)e.set(o.subarray(i,i+t),n);else for(r=0;re)throw new Nt(28);return e},kb:function(t,e,n){Tt.pb(t.node,e+n),t.node.La=Math.max(t.node.La,e+n)},$a:function(t,e,n,r,i,o){if(0!==e)throw new Nt(28);if(32768!=(61440&t.node.mode))throw new Nt(43);if(t=t.node.Ha,2&o||t.buffer!==I){if((0{if(!(t=ht("/",t)))return{path:"",node:null};if(8<(e=Object.assign({qb:!0,jb:0},e)).jb)throw new Nt(32);t=st(t.split("/").filter((t=>!!t)),!1);for(var n=Et,r="/",i=0;i{for(var e;;){if(t===t.parent)return t=t.Pa.tb,e?"/"!==t[t.length-1]?t+"/"+e:t+e:t;e=e?t.name+"/"+e:t.name,t=t.parent}},Pt=(t,e)=>{for(var n=0,r=0;r>>0)%Mt.length},Rt=t=>{var e=Pt(t.parent.id,t.name);if(Mt[e]===t)Mt[e]=t.Va;else for(e=Mt[e];e;){if(e.Va===t){e.Va=t.Va;break}e=e.Va}},Lt=(t,e)=>{var n;if(n=(n=Ut(t,"x"))?n:t.Fa.lookup?0:2)throw new Nt(n,t);for(n=Mt[Pt(t.id,e)];n;n=n.Va){var r=n.name;if(n.parent.id===t.id&&r===e)return n}return t.Fa.lookup(t,e)},Dt=(t,e,n,r)=>(t=new ve(t,e,n,r),e=Pt(t.parent.id,t.name),t.Va=Mt[e],Mt[e]=t),kt={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Ft=t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},Ut=(t,e)=>St?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2,Bt=(t,e)=>{try{return Lt(t,e),20}catch(t){}return Ut(t,"wx")},jt=(t,e,n)=>{try{var r=Lt(t,e)}catch(t){return t.Ja}if(t=Ut(t,"wx"))return t;if(n){if(16384!=(61440&r.mode))return 54;if(r===r.parent||"/"===It(r))return 10}else if(16384==(61440&r.mode))return 31;return 0},Gt={open:t=>{t.Ga=wt[t.node.rdev].Ga,t.Ga.open&&t.Ga.open(t)},Sa:()=>{throw new Nt(70)}},Wt=(t,e)=>{wt[t]={Ga:e}},qt=(t,e)=>{var n="/"===e,r=!e;if(n&&Et)throw new Nt(10);if(!n&&!r){var i=At(e,{qb:!1});if(e=i.path,(i=i.node).Ua)throw new Nt(10);if(16384!=(61440&i.mode))throw new Nt(54)}e={type:t,Kb:{},tb:e,Db:[]},(t=t.Pa(e)).Pa=e,e.root=t,n?Et=t:i&&(i.Ua=e,i.Pa&&i.Pa.Db.push(e))},Ht=(t,e,n)=>{var r=At(t,{parent:!0}).node;if(!(t=ct(t))||"."===t||".."===t)throw new Nt(28);var i=Bt(r,t);if(i)throw new Nt(i);if(!r.Fa.Za)throw new Nt(63);return r.Fa.Za(r,t,e,n)},zt=(t,e)=>Ht(t,1023&(void 0!==e?e:511)|16384,0),Vt=(t,e,n)=>{void 0===n&&(n=e,e=438),Ht(t,8192|e,n)},Xt=(t,e)=>{if(!ht(t))throw new Nt(44);var n=At(e,{parent:!0}).node;if(!n)throw new Nt(44);e=ct(e);var r=Bt(n,e);if(r)throw new Nt(r);if(!n.Fa.symlink)throw new Nt(63);n.Fa.symlink(n,e,t)},Yt=t=>{var e=At(t,{parent:!0}).node;t=ct(t);var n=Lt(e,t),r=jt(e,t,!0);if(r)throw new Nt(r);if(!e.Fa.rmdir)throw new Nt(63);if(n.Ua)throw new Nt(10);e.Fa.rmdir(e,t),Rt(n)},Zt=t=>{var e=At(t,{parent:!0}).node;if(!e)throw new Nt(44);t=ct(t);var n=Lt(e,t),r=jt(e,t,!1);if(r)throw new Nt(r);if(!e.Fa.unlink)throw new Nt(63);if(n.Ua)throw new Nt(10);e.Fa.unlink(e,t),Rt(n)},Qt=t=>{if(!(t=At(t).node))throw new Nt(44);if(!t.Fa.readlink)throw new Nt(28);return ht(It(t.parent),t.Fa.readlink(t))},Kt=(t,e)=>{if(!(t=At(t,{Ra:!e}).node))throw new Nt(44);if(!t.Fa.Na)throw new Nt(63);return t.Fa.Na(t)},Jt=t=>Kt(t,!0),$t=(t,e)=>{if(!(t="string"==typeof t?At(t,{Ra:!0}).node:t).Fa.Ma)throw new Nt(63);t.Fa.Ma(t,{mode:4095&e|-4096&t.mode,timestamp:Date.now()})},te=(t,e)=>{if(0>e)throw new Nt(28);if(!(t="string"==typeof t?At(t,{Ra:!0}).node:t).Fa.Ma)throw new Nt(63);if(16384==(61440&t.mode))throw new Nt(31);if(32768!=(61440&t.mode))throw new Nt(28);var n=Ut(t,"w");if(n)throw new Nt(n);t.Fa.Ma(t,{size:e,timestamp:Date.now()})},ee=(t,e,n,r)=>{if(""===t)throw new Nt(44);if("string"==typeof e){var o=kt[e];if(void 0===o)throw Error("Unknown file open mode: "+e);e=o}if(n=64&e?4095&(void 0===n?438:n)|32768:0,"object"==typeof t)var a=t;else{t=ut(t);try{a=At(t,{Ra:!(131072&e)}).node}catch(t){}}if(o=!1,64&e)if(a){if(128&e)throw new Nt(20)}else a=Ht(t,n,0),o=!0;if(!a)throw new Nt(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&16384!=(61440&a.mode))throw new Nt(54);if(!o&&(n=a?40960==(61440&a.mode)?32:16384==(61440&a.mode)&&("r"!==Ft(e)||512&e)?31:Ut(a,Ft(e)):44))throw new Nt(n);return 512&e&&te(a,0),e&=-131713,(r=((t,e)=>(mt||((mt=function(){}).prototype={}),t=Object.assign(new mt,t),e=((t=0,e=4096)=>{for(;t<=e;t++)if(!xt[t])return t;throw new Nt(33)})(e,void 0),t.fd=e,xt[e]=t))({node:a,path:It(a),flags:e,seekable:!0,position:0,Ga:a.Ga,Hb:[],error:!1},r)).Ga.open&&r.Ga.open(r),!i.logReadFiles||1&e||(gt||(gt={}),t in gt||(gt[t]=1)),r},ne=t=>{if(null===t.fd)throw new Nt(8);t.gb&&(t.gb=null);try{t.Ga.close&&t.Ga.close(t)}catch(t){throw t}finally{xt[t.fd]=null}t.fd=null},re=(t,e,n)=>{if(null===t.fd)throw new Nt(8);if(!t.seekable||!t.Ga.Sa)throw new Nt(70);if(0!=n&&1!=n&&2!=n)throw new Nt(28);t.position=t.Ga.Sa(t,e,n),t.Hb=[]},ie=(t,e,n,r,i)=>{if(0>r||0>i)throw new Nt(28);if(null===t.fd)throw new Nt(8);if(1==(2097155&t.flags))throw new Nt(8);if(16384==(61440&t.node.mode))throw new Nt(31);if(!t.Ga.read)throw new Nt(28);var o=void 0!==i;if(o){if(!t.seekable)throw new Nt(70)}else i=t.position;return e=t.Ga.read(t,e,n,r,i),o||(t.position+=e),e},oe=(t,e,n,r,i,o)=>{if(0>r||0>i)throw new Nt(28);if(null===t.fd)throw new Nt(8);if(0==(2097155&t.flags))throw new Nt(8);if(16384==(61440&t.node.mode))throw new Nt(31);if(!t.Ga.write)throw new Nt(28);t.seekable&&1024&t.flags&&re(t,0,2);var a=void 0!==i;if(a){if(!t.seekable)throw new Nt(70)}else i=t.position;return e=t.Ga.write(t,e,n,r,i,o),a||(t.position+=e),e},ae=t=>{var e,n=ee(t,n||0);t=Kt(t).size;var r=new Uint8Array(t);return ie(n,r,0,t,0),e=r,ne(n),e},se=()=>{Nt||((Nt=function(t,e){this.node=e,this.Gb=function(t){this.Ja=t},this.Gb(t),this.message="FS error"}).prototype=Error(),Nt.prototype.constructor=Nt,[44].forEach((t=>{Ot[t]=new Nt(t),Ot[t].stack=""})))},ue=(t,e)=>{var n=0;return t&&(n|=365),e&&(n|=146),n},le=(t,e,n)=>{t=ut("/dev/"+t);var r=ue(!!e,!!n);yt||(yt=64);var i=yt++<<8|0;Wt(i,{open:t=>{t.seekable=!1},close:()=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,n,r,i)=>{for(var o=0,a=0;a{for(var o=0;o>2]=r.dev,D[n+4>>2]=0,D[n+8>>2]=r.ino,D[n+12>>2]=r.mode,D[n+16>>2]=r.nlink,D[n+20>>2]=r.uid,D[n+24>>2]=r.gid,D[n+28>>2]=r.rdev,D[n+32>>2]=0,J=[r.size>>>0,(K=r.size,1<=+Math.abs(K)?0>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[n+40>>2]=J[0],D[n+44>>2]=J[1],D[n+48>>2]=4096,D[n+52>>2]=r.blocks,D[n+56>>2]=r.atime.getTime()/1e3|0,D[n+60>>2]=0,D[n+64>>2]=r.mtime.getTime()/1e3|0,D[n+68>>2]=0,D[n+72>>2]=r.ctime.getTime()/1e3|0,D[n+76>>2]=0,J=[r.ino>>>0,(K=r.ino,1<=+Math.abs(K)?0>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[n+80>>2]=J[0],D[n+84>>2]=J[1],0}var pe,de=void 0;function ye(){return D[(de+=4)-4>>2]}function me(t){if(!(t=xt[t]))throw new Nt(8);return t}pe=g?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var ge,_e={};function be(){if(!ge){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(t in _e)void 0===_e[t]?delete e[t]:e[t]=_e[t];var n=[];for(t in e)n.push(t+"="+e[t]);ge=n}return ge}function ve(t,e,n,r){t||(t=this),this.parent=t,this.Pa=t.Pa,this.Ua=null,this.id=Ct++,this.name=e,this.mode=n,this.Fa={},this.Ga={},this.rdev=r}function Te(t,e){var n=Array(W(t)+1);return t=G(t,n,0,n.length),e&&(n.length=t),n}Object.defineProperties(ve.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}}}),se(),Mt=Array(4096),qt(Tt,"/"),zt("/tmp"),zt("/home"),zt("/home/web_user"),(()=>{zt("/dev"),Wt(259,{read:()=>0,write:(t,e,n,r)=>r}),Vt("/dev/null",259),pt(1280,bt),pt(1536,vt),Vt("/dev/tty",1280),Vt("/dev/tty1",1536);var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(g)try{var e=require("crypto");return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){nt("randomDevice")}}();le("random",t),le("urandom",t),zt("/dev/shm"),zt("/dev/shm/tmp")})(),(()=>{zt("/proc");var t=zt("/proc/self");zt("/proc/self/fd"),qt({Pa:()=>{var e=Dt(t,"fd",16895,73);return e.Fa={lookup:(t,e)=>{var n=xt[+e];if(!n)throw new Nt(8);return(t={parent:null,Pa:{tb:"fake"},Fa:{readlink:()=>n.path}}).parent=t}},e}},"/proc/self/fd")})();var Ee={a:function(t,e,n,r){nt("Assertion failed: "+j(t)+", at: "+[e?j(e):"unknown filename",n,r?j(r):"unknown function"])},h:function(t,e){try{return t=j(t),$t(t,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},H:function(t,e,n){try{if(e=he(t,e=j(e)),-8&n)var r=-28;else{var i=At(e,{Ra:!0}).node;i?(t="",4&n&&(t+="r"),2&n&&(t+="w"),1&n&&(t+="x"),r=t&&Ut(i,t)?-2:0):r=-44}return r}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},i:function(t,e){try{var n=xt[t];if(!n)throw new Nt(8);return $t(n.node,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},g:function(t){try{var e=xt[t];if(!e)throw new Nt(8);var n=e.node,r="string"==typeof n?At(n,{Ra:!0}).node:n;if(!r.Fa.Ma)throw new Nt(63);return r.Fa.Ma(r,{timestamp:Date.now()}),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},b:function(t,e,n){de=n;try{var r=me(t);switch(e){case 0:var i=ye();return 0>i?-28:ee(r.path,r.flags,0,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:return i=ye(),r.flags|=i,0;case 5:return i=ye(),L[i+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return D[we()>>2]=28,-1}}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},G:function(t,e){try{var n=me(t);return fe(Kt,n.path,e)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},B:function(t,e){try{var n=xt[t];if(!n)throw new Nt(8);if(0==(2097155&n.flags))throw new Nt(28);return te(n.node,e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},A:function(t,e){try{return 0===e?-28:e=r)var i=-28;else{var o=Qt(e),a=Math.min(r,W(o)),s=P[n+a];G(o,R,n,r+1),P[n+a]=s,i=a}return i}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},r:function(t){try{return t=j(t),Yt(t),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},F:function(t,e){try{return t=j(t),fe(Kt,t,e)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},o:function(t,e,n){try{return e=he(t,e=j(e)),0===n?Zt(e):512===n?Yt(e):nt("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},m:function(t,e,n){try{if(e=he(t,e=j(e),!0),n){var r=D[n>>2],i=D[n+4>>2];o=1e3*r+i/1e6,a=1e3*(r=D[(n+=8)>>2])+(i=D[n+4>>2])/1e6}else var o=Date.now(),a=o;t=o;var s=At(e,{Ra:!0}).node;return s.Fa.Ma(s,{timestamp:Math.max(t,a)}),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},e:function(){return Date.now()},j:function(t,e){t=new Date(1e3*D[t>>2]),D[e>>2]=t.getSeconds(),D[e+4>>2]=t.getMinutes(),D[e+8>>2]=t.getHours(),D[e+12>>2]=t.getDate(),D[e+16>>2]=t.getMonth(),D[e+20>>2]=t.getFullYear()-1900,D[e+24>>2]=t.getDay();var n=new Date(t.getFullYear(),0,1);D[e+28>>2]=(t.getTime()-n.getTime())/864e5|0,D[e+36>>2]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),D[e+32>>2]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},v:function(t,e,n,r,i,o,a){try{var s=xt[i];if(!s)return-8;if(0!=(2&n)&&0==(2&r)&&2!=(2097155&s.flags))throw new Nt(2);if(1==(2097155&s.flags))throw new Nt(2);if(!s.Ga.$a)throw new Nt(43);var u=s.Ga.$a(s,t,e,o,n,r),l=u.Eb;return D[a>>2]=u.ub,l}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},w:function(t,e,n,r,i,o){try{var a=xt[i];if(a&&2&n){var s=R.slice(t,t+e);a&&a.Ga.ab&&a.Ga.ab(a,s,o,e,r)}}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return-t.Ja}},n:function t(e,n,r){t.Ab||(t.Ab=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var i=(new Date).getFullYear(),o=new Date(i,0,1),a=new Date(i,6,1);i=o.getTimezoneOffset();var s=a.getTimezoneOffset();D[t>>2]=60*Math.max(i,s),D[e>>2]=Number(i!=s),t=r(o),e=r(a),t=q(t),e=q(e),s>2]=t,D[n+4>>2]=e):(D[n>>2]=e,D[n+4>>2]=t)}(e,n,r))},p:function(){return 2147483648},d:pe,c:function(t){var e=R.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var i=Math;r=Math.max(t,r),i=i.min.call(i,2147483648,r+(65536-r%65536)%65536);t:{try{S.grow(i-I.byteLength+65535>>>16),H();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},y:function(t,e){var n=0;return be().forEach((function(r,i){var o=e+n;for(i=D[t+4*i>>2]=o,o=0;o>0]=r.charCodeAt(o);P[i>>0]=0,n+=r.length+1})),0},z:function(t,e){var n=be();D[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),D[e>>2]=r,0},f:function(t){try{var e=me(t);return ne(e),0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},l:function(t,e){try{var n=me(t);return P[e>>0]=n.tty?2:16384==(61440&n.mode)?3:40960==(61440&n.mode)?7:4,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},t:function(t,e,n,r){try{t:{for(var i=me(t),o=t=0;o>2],s=ie(i,P,D[e+8*o>>2],a,void 0);if(0>s){var u=-1;break t}if(t+=s,s>2]=u,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},k:function(t,e,n,r,i){try{var o=me(t);return-9007199254740992>=(t=4294967296*n+(e>>>0))||9007199254740992<=t?-61:(re(o,t,r),J=[o.position>>>0,(K=o.position,1<=+Math.abs(K)?0>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[i>>2]=J[0],D[i+4>>2]=J[1],o.gb&&0===t&&0===r&&(o.gb=null),0)}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},C:function(t){try{var e=me(t);return e.Ga&&e.Ga.fsync?-e.Ga.fsync(e):0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}},q:function(t,e,n,r){try{t:{for(var i=me(t),o=t=0;o>2],D[e+(8*o+4)>>2],void 0);if(0>a){var s=-1;break t}t+=a}s=t}return D[r>>2]=s,0}catch(t){if(void 0===ce||!(t instanceof Nt))throw t;return t.Ja}}};!function(){function t(t){i.asm=t.exports,S=i.asm.I,H(),z=i.asm.za,X.unshift(i.asm.J),$--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==tt&&(clearInterval(tt),tt=null),et&&(t=et,et=null,t()))}function e(e){t(e.instance)}function n(t){return function(){if(!E&&(y||m)){if("function"==typeof fetch&&!Q.startsWith("file://"))return fetch(Q,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Q+"'";return t.arrayBuffer()})).catch((function(){return ot()}));if(u)return new Promise((function(t,e){u(Q,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){v("failed to asynchronously prepare wasm: "+t),nt(t)}))}var r={a:Ee};if($++,i.monitorRunDependencies&&i.monitorRunDependencies($),i.instantiateWasm)try{return i.instantiateWasm(r,t)}catch(t){return v("Module.instantiateWasm callback failed with error: "+t),!1}E||"function"!=typeof WebAssembly.instantiateStreaming||rt()||Q.startsWith("file://")||"function"!=typeof fetch?n(e):fetch(Q,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return v("wasm streaming compile failed: "+t),v("falling back to ArrayBuffer instantiation"),n(e)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.J).apply(null,arguments)},i._sqlite3_free=function(){return(i._sqlite3_free=i.asm.K).apply(null,arguments)},i._sqlite3_value_double=function(){return(i._sqlite3_value_double=i.asm.L).apply(null,arguments)},i._sqlite3_value_text=function(){return(i._sqlite3_value_text=i.asm.M).apply(null,arguments)};var we=i.___errno_location=function(){return(we=i.___errno_location=i.asm.N).apply(null,arguments)};i._sqlite3_prepare_v2=function(){return(i._sqlite3_prepare_v2=i.asm.O).apply(null,arguments)},i._sqlite3_step=function(){return(i._sqlite3_step=i.asm.P).apply(null,arguments)},i._sqlite3_finalize=function(){return(i._sqlite3_finalize=i.asm.Q).apply(null,arguments)},i._sqlite3_reset=function(){return(i._sqlite3_reset=i.asm.R).apply(null,arguments)},i._sqlite3_value_int=function(){return(i._sqlite3_value_int=i.asm.S).apply(null,arguments)},i._sqlite3_clear_bindings=function(){return(i._sqlite3_clear_bindings=i.asm.T).apply(null,arguments)},i._sqlite3_value_blob=function(){return(i._sqlite3_value_blob=i.asm.U).apply(null,arguments)},i._sqlite3_value_bytes=function(){return(i._sqlite3_value_bytes=i.asm.V).apply(null,arguments)},i._sqlite3_value_type=function(){return(i._sqlite3_value_type=i.asm.W).apply(null,arguments)},i._sqlite3_result_blob=function(){return(i._sqlite3_result_blob=i.asm.X).apply(null,arguments)},i._sqlite3_result_double=function(){return(i._sqlite3_result_double=i.asm.Y).apply(null,arguments)},i._sqlite3_result_error=function(){return(i._sqlite3_result_error=i.asm.Z).apply(null,arguments)},i._sqlite3_result_int=function(){return(i._sqlite3_result_int=i.asm._).apply(null,arguments)},i._sqlite3_result_int64=function(){return(i._sqlite3_result_int64=i.asm.$).apply(null,arguments)},i._sqlite3_result_null=function(){return(i._sqlite3_result_null=i.asm.aa).apply(null,arguments)},i._sqlite3_result_text=function(){return(i._sqlite3_result_text=i.asm.ba).apply(null,arguments)},i._sqlite3_sql=function(){return(i._sqlite3_sql=i.asm.ca).apply(null,arguments)},i._sqlite3_column_count=function(){return(i._sqlite3_column_count=i.asm.da).apply(null,arguments)},i._sqlite3_data_count=function(){return(i._sqlite3_data_count=i.asm.ea).apply(null,arguments)},i._sqlite3_column_blob=function(){return(i._sqlite3_column_blob=i.asm.fa).apply(null,arguments)},i._sqlite3_column_bytes=function(){return(i._sqlite3_column_bytes=i.asm.ga).apply(null,arguments)},i._sqlite3_column_double=function(){return(i._sqlite3_column_double=i.asm.ha).apply(null,arguments)},i._sqlite3_column_text=function(){return(i._sqlite3_column_text=i.asm.ia).apply(null,arguments)},i._sqlite3_column_type=function(){return(i._sqlite3_column_type=i.asm.ja).apply(null,arguments)},i._sqlite3_column_name=function(){return(i._sqlite3_column_name=i.asm.ka).apply(null,arguments)},i._sqlite3_bind_blob=function(){return(i._sqlite3_bind_blob=i.asm.la).apply(null,arguments)},i._sqlite3_bind_double=function(){return(i._sqlite3_bind_double=i.asm.ma).apply(null,arguments)},i._sqlite3_bind_int=function(){return(i._sqlite3_bind_int=i.asm.na).apply(null,arguments)},i._sqlite3_bind_text=function(){return(i._sqlite3_bind_text=i.asm.oa).apply(null,arguments)},i._sqlite3_bind_parameter_index=function(){return(i._sqlite3_bind_parameter_index=i.asm.pa).apply(null,arguments)},i._sqlite3_normalized_sql=function(){return(i._sqlite3_normalized_sql=i.asm.qa).apply(null,arguments)},i._sqlite3_errmsg=function(){return(i._sqlite3_errmsg=i.asm.ra).apply(null,arguments)},i._sqlite3_exec=function(){return(i._sqlite3_exec=i.asm.sa).apply(null,arguments)},i._sqlite3_changes=function(){return(i._sqlite3_changes=i.asm.ta).apply(null,arguments)},i._sqlite3_close_v2=function(){return(i._sqlite3_close_v2=i.asm.ua).apply(null,arguments)},i._sqlite3_create_function_v2=function(){return(i._sqlite3_create_function_v2=i.asm.va).apply(null,arguments)},i._sqlite3_open=function(){return(i._sqlite3_open=i.asm.wa).apply(null,arguments)};var xe=i._malloc=function(){return(xe=i._malloc=i.asm.xa).apply(null,arguments)},Ce=i._free=function(){return(Ce=i._free=i.asm.ya).apply(null,arguments)};i._RegisterExtensionFunctions=function(){return(i._RegisterExtensionFunctions=i.asm.Aa).apply(null,arguments)};var Me,Se=i._emscripten_builtin_memalign=function(){return(Se=i._emscripten_builtin_memalign=i.asm.Ba).apply(null,arguments)},Ne=i.stackSave=function(){return(Ne=i.stackSave=i.asm.Ca).apply(null,arguments)},Oe=i.stackRestore=function(){return(Oe=i.stackRestore=i.asm.Da).apply(null,arguments)},Ae=i.stackAlloc=function(){return(Ae=i.stackAlloc=i.asm.Ea).apply(null,arguments)};function Ie(){function t(){if(!Me&&(Me=!0,i.calledRun=!0,!N)){if(i.noFSInit||dt||(dt=!0,se(),i.stdin=i.stdin,i.stdout=i.stdout,i.stderr=i.stderr,i.stdin?le("stdin",i.stdin):Xt("/dev/tty","/dev/stdin"),i.stdout?le("stdout",null,i.stdout):Xt("/dev/tty","/dev/stdout"),i.stderr?le("stderr",null,i.stderr):Xt("/dev/tty1","/dev/stderr"),ee("/dev/stdin",0),ee("/dev/stdout",1),ee("/dev/stderr",1)),St=!1,at(X),i.onRuntimeInitialized&&i.onRuntimeInitialized(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;){var t=i.postRun.shift();Y.unshift(t)}at(Y)}}if(!(0<$)){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)Z();at(V),0<$||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t())}}if(i.cwrap=function(t,e,n,r){var o=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&o&&!r?i["_"+t]:function(){return O(t,e,n,arguments)}},i.UTF8ToString=j,i.stackSave=Ne,i.stackRestore=Oe,i.stackAlloc=Ae,et=function t(){Me||Ie(),Me||(et=t)},i.run=Ie,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);0{var r=n(8764),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},a.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},6479:(t,e,n)=>{var r;!function(){"use strict";function i(t,e,n){var r=e.x,i=e.y,o=n.x-r,a=n.y-i;if(0!==o||0!==a){var s=((t.x-r)*o+(t.y-i)*a)/(o*o+a*a);s>1?(r=n.x,i=n.y):s>0&&(r+=o*s,i+=a*s)}return(o=t.x-r)*o+(a=t.y-i)*a}function o(t,e,n,r,a){for(var s,u=r,l=e+1;lu&&(s=l,u=c)}u>r&&(s-e>1&&o(t,e,s,r,a),a.push(t[s]),n-s>1&&o(t,s,n,r,a))}function a(t,e){var n=t.length-1,r=[t[0]];return o(t,0,n,e,r),r.push(t[n]),r}function s(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r,i,o,a,s=t[0],u=[s],l=1,c=t.length;le&&(u.push(n),s=n);return s!==n&&u.push(n),u}(t,r),a(t,r)}void 0===(r=function(){return s}.call(e,n,e,t))||(t.exports=r)}()},8501:(t,e,n)=>{var r=n(3570),i=n(5676),o=n(7529),a=n(584),s=n(8575),u=e;u.request=function(t,e){t="string"==typeof t?s.parse(t):o(t);var i=-1===n.g.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||i,u=t.hostname||t.host,l=t.port,c=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(l?":"+l:"")+c,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var h=new r(t);return e&&h.on("response",e),h},u.get=function(t,e){var n=u.request(t,e);return n.end(),n},u.ClientRequest=r,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(t,e,n)=>{var r;function i(){if(void 0!==r)return r;if(n.g.XMLHttpRequest){r=new n.g.XMLHttpRequest;try{r.open("GET",n.g.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function o(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function a(t){return"function"==typeof t}e.fetch=a(n.g.fetch)&&a(n.g.ReadableStream),e.writableStream=a(n.g.WritableStream),e.abortController=a(n.g.AbortController),e.arraybuffer=e.fetch||o("arraybuffer"),e.msstream=!e.fetch&&o("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&a(i().overrideMimeType),r=null},3570:(t,e,n)=>{var r=n(3085).Buffer,i=n(4155),o=n(8725),a=n(5717),s=n(5676),u=n(925),l=s.IncomingMessage,c=s.readyStates,h=t.exports=function(t){var e,n=this;u.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+r.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!o.abortController)i=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}n._mode=function(t,e){return o.fetch&&e?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&t?"arraybuffer":"text"}(e,i),n._fetchTimer=null,n._socketTimeout=null,n._socketTimer=null,n.on("finish",(function(){n._onFinish()}))};a(h,u.Writable),h.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===f.indexOf(n)&&(this._headers[n]={name:t,value:e})},h.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},h.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},h.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var r=t._headers,a=null;"GET"!==e.method&&"HEAD"!==e.method&&(a=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var s=[];if(Object.keys(r).forEach((function(t){var e=r[t].name,n=r[t].value;Array.isArray(n)?n.forEach((function(t){s.push([e,t])})):s.push([e,n])})),"fetch"===t._mode){var u=null;if(o.abortController){var l=new AbortController;u=l.signal,t._fetchAbortController=l,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=n.g.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}n.g.fetch(t._opts.url,{method:t._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:u}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var h=t._xhr=new n.g.XMLHttpRequest;try{h.open(t._opts.method,t._opts.url,!0)}catch(e){return void i.nextTick((function(){t.emit("error",e)}))}"responseType"in h&&(h.responseType=t._mode),"withCredentials"in h&&(h.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in h&&h.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(h.timeout=e.requestTimeout,h.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){h.setRequestHeader(t[0],t[1])})),t._response=null,h.onreadystatechange=function(){switch(h.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(h.onprogress=function(){t._onXHRProgress()}),h.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{h.send(a)}catch(e){return void i.nextTick((function(){t.emit("error",e)}))}}}},h.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},h.prototype._connect=function(){var t=this;t._destroyed||(t._response=new l(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},h.prototype._write=function(t,e,n){this._body.push(t),n()},h.prototype._resetTimers=function(t){var e=this;n.g.clearTimeout(e._socketTimer),e._socketTimer=null,t?(n.g.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=n.g.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},h.prototype.abort=h.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},h.prototype.end=function(t,e,n){"function"==typeof t&&(n=t,t=void 0),u.Writable.prototype.end.call(this,t,e,n)},h.prototype.setTimeout=function(t,e){var n=this;e&&n.once("timeout",e),n._socketTimeout=t,n._resetTimers(!1)},h.prototype.flushHeaders=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},5676:(t,e,n)=>{var r=n(4155),i=n(3085).Buffer,o=n(8725),a=n(5717),s=n(925),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=e.IncomingMessage=function(t,e,n,a){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){r.nextTick((function(){u.emit("close")}))})),"fetch"===n){if(u._fetchResponse=e,u.url=e.url,u.statusCode=e.status,u.statusMessage=e.statusText,e.headers.forEach((function(t,e){u.headers[e.toLowerCase()]=t,u.rawHeaders.push(e,t)})),o.writableStream){var l=new WritableStream({write:function(t){return a(!1),new Promise((function(e,n){u._destroyed?n():u.push(i.from(t))?e():u._resumeFetch=e}))},close:function(){a(!0),u._destroyed||u.push(null)},abort:function(t){a(!0),u._destroyed||u.emit("error",t)}});try{return void e.body.pipeTo(l).catch((function(t){a(!0),u._destroyed||u.emit("error",t)}))}catch(t){}}var c=e.body.getReader();!function t(){c.read().then((function(e){u._destroyed||(a(e.done),e.done?u.push(null):(u.push(i.from(e.value)),t()))})).catch((function(t){a(!0),u._destroyed||u.emit("error",t)}))}()}else if(u._xhr=t,u._pos=0,u.url=t.responseURL,u.statusCode=t.status,u.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===u.headers[n]&&(u.headers[n]=[]),u.headers[n].push(e[2])):void 0!==u.headers[n]?u.headers[n]+=", "+e[2]:u.headers[n]=e[2],u.rawHeaders.push(e[1],e[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var h=u.rawHeaders["mime-type"];if(h){var f=h.match(/;\s*charset=([^;])(;|$)/);f&&(u._charset=f[1].toLowerCase())}u._charset||(u._charset="utf-8")}};a(l,s.Readable),l.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},l.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,o=null;switch(e._mode){case"text":if((o=r.responseText).length>e._pos){var a=o.substr(e._pos);if("x-user-defined"===e._charset){for(var s=i.alloc(a.length),l=0;le._pos&&(e.push(i.from(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){t(!0),e.push(null)},c.readAsArrayBuffer(o)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},7303:t=>{"use strict";var e={};function n(t,n,r){r||(r=Error);var i=function(t){var e,r;function i(e,r,i){return t.call(this,function(t,e,r){return"string"==typeof n?n:n(t,e,r)}(e,r,i))||this}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=t,e[t]=i}function r(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o,a,s,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(r(e,"type"));else{var l=("number"!=typeof u&&(u=0),u+".".length>(s=t).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(t,'" ').concat(l," ").concat(i," ").concat(r(e,"type"))}return a+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},9560:(t,e,n)=>{"use strict";var r=n(4155),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var o=n(4002),a=n(3313);n(5717)(c,o);for(var s=i(a.prototype),u=0;u{"use strict";t.exports=i;var r=n(1846);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(5717)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},4002:(t,e,n)=>{"use strict";var r,i=n(4155);t.exports=C,C.ReadableState=x,n(7187).EventEmitter;var o,a=function(t,e){return t.listeners(e).length},s=n(1463),u=n(8764).Buffer,l=n.g.Uint8Array||function(){},c=n(3646);o=c&&c.debuglog?c.debuglog("stream"):function(){};var h,f,p,d=n(6641),y=n(4910),m=n(7855).getHighWaterMark,g=n(7303).q,_=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,T=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(5717)(C,s);var E=y.errorOrDestroy,w=["error","close","destroy","pause","resume"];function x(t,e,i){r=r||n(9560),t=t||{},"boolean"!=typeof i&&(i=e instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(2553).s),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function C(t){if(r=r||n(9560),!(this instanceof C))return new C(t);var e=this instanceof r;this._readableState=new x(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function M(t,e,n,r,i){o("readableAddChunk",e);var a,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?A(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,s);else if(i||(a=function(t,e){var n,r;return r=e,u.isBuffer(r)||r instanceof l||"string"==typeof e||void 0===e||t.objectMode||(n=new _("chunk",["string","Buffer","Uint8Array"],e)),n}(s,e)),a)E(t,a);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),r)s.endEmitted?E(t,new T):S(t,s,e,!0);else if(s.ended)E(t,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?S(t,s,e,!1):P(t,s)):S(t,s,e,!1)}else r||(s.reading=!1,P(t,s));return!s.ended&&(s.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,F(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function D(t){o("readable nexttick read 0"),t.read(0)}function k(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),F(t),e.flowing&&!e.reading&&t.read(0)}function F(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function U(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(j,e,t))}function j(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function G(t,e){for(var n=0,r=t.length;n=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):A(this),null;if(0===(t=O(t,e))&&e.ended)return 0===e.length&&B(this),null;var r,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?U(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&B(this)),null!==r&&this.emit("data",r),r},C.prototype._read=function(t){E(this,new v("_read()"))},C.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,o("pipe count=%d opts=%j",r.pipesCount,e);var s=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}r.endEmitted?i.nextTick(s):n.once("end",s),t.on("unpipe",(function e(i,a){o("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",l),t.removeListener("error",f),t.removeListener("unpipe",e),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",h),c=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}));var l=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,F(t))}}(n);t.on("drain",l);var c=!1;function h(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==G(r.pipes,t))&&!c&&(o("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(e){o("onerror",e),y(),t.removeListener("error",f),0===a(t,"error")&&E(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(n):t._events.error=[n,t._events.error]:t.on(e,n)}(t,"error",f),t.once("close",p),t.once("finish",d),t.emit("pipe",n),r.flowing||(o("pipe resume"),n.resume()),t},C.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,o("on readable",r.length,r.reading),r.length?A(this):r.reading||i.nextTick(D,this))),n},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(t,e){var n=s.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(L,this),n},C.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(L,this),e},C.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(k,t,e))}(this,t)),t.paused=!1,this},C.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a{"use strict";t.exports=c;var r=n(7303).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(9560);function l(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var r,i=n(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=C,C.WritableState=x;var a,s={deprecate:n(4927)},u=n(1463),l=n(8764).Buffer,c=n.g.Uint8Array||function(){},h=n(4910),f=n(7855).getHighWaterMark,p=n(7303).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,_=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,v=p.ERR_STREAM_WRITE_AFTER_END,T=p.ERR_UNKNOWN_ENCODING,E=h.errorOrDestroy;function w(){}function x(t,e,a){r=r||n(9560),t=t||{},"boolean"!=typeof a&&(a=e instanceof r),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,o){--e.pendingcb,n?(i.nextTick(o,r),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,E(t,r)):(o(r),t._writableState.errorEmitted=!0,E(t,r),I(t,e))}(t,n,r,e,o);else{var a=O(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||N(t,n),r?i.nextTick(S,t,n,a,o):S(t,n,a,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function C(t){var e=this instanceof(r=r||n(9560));if(!e&&!a.call(C,this))return new C(t);this._writableState=new x(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function M(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new _("write")):n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function S(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),I(t,e)}function N(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),a=e.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,M(t,e,!0,e.length,i,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,h=n.callback;if(M(t,e,!1,e.objectMode?1:l.length,l,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function A(t,e){t._final((function(n){e.pendingcb--,n&&E(t,n),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var n=O(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(A,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}n(5717)(C,u),x.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(x.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===C&&t&&t._writableState instanceof x}})):a=function(t){return t instanceof this},C.prototype.pipe=function(){E(this,new g)},C.prototype.write=function(t,e,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=t,l.isBuffer(r)||r instanceof c);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=w),o.ending?function(t,e){var n=new v;E(t,n),i.nextTick(e,n)}(this,n):(s||function(t,e,n,r){var o;return null===n?o=new b:"string"==typeof n||e.objectMode||(o=new d("chunk",["string","Buffer"],n)),!o||(E(t,o),i.nextTick(r,o),!1)}(this,o,t,n))&&(o.pendingcb++,a=function(t,e,n,r,i,o){if(!n){var a=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,n)),e}(e,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=e.objectMode?1:r.length;e.length+=s;var u=e.length-1))throw new T(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new y("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,I(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,r,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(t,e){e(t)}},6819:(t,e,n)=>{"use strict";var r,i=n(4155);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=n(5467),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[s];if(null!==e){var n=t[p].read();null!==n&&(t[h]=null,t[s]=null,t[u]=null,e(d(n,!1)))}}function m(t){i.nextTick(y,t)}var g=Object.getPrototypeOf((function(){})),_=Object.setPrototypeOf((o(r={get stream(){return this[p]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,n){i.nextTick((function(){t[l]?n(t[l]):e(d(void 0,!0))}))}));var n,r=this[h];if(r)n=new Promise(function(t,e){return function(n,r){t.then((function(){e[c]?n(d(void 0,!0)):e[f](n,r)}),r)}}(r,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[f])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),o(r,"return",(function(){var t=this;return new Promise((function(e,n){t[p].destroy(null,(function(t){t?n(t):e(d(void 0,!0))}))}))})),r),g);t.exports=function(t){var e,n=Object.create(_,(o(e={},p,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,l,{value:null,writable:!0}),o(e,c,{value:t._readableState.endEmitted,writable:!0}),o(e,f,{value:function(t,e){var r=n[p].read();r?(n[h]=null,n[s]=null,n[u]=null,t(d(r,!1))):(n[s]=t,n[u]=e)},writable:!0}),e));return n[h]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[u];return null!==e&&(n[h]=null,n[s]=null,n[u]=null,e(t)),void(n[l]=t)}var r=n[s];null!==r&&(n[h]=null,n[s]=null,n[u]=null,r(d(void 0,!0))),n[c]=!0})),t.on("readable",m.bind(null,n)),n}},6641:(t,e,n)=>{"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,n,r,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,n=i,r=s,a.prototype.copy.call(e,n,r),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var n;return ti.length?i.length:t;if(o===i.length?r+=i:r+=i.slice(0,t),0==(t-=o)){o===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e{"use strict";var r=n(4155);function i(t,e){a(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(a,this,t)):r.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?n._writableState?n._writableState.errorEmitted?r.nextTick(o,n):(n._writableState.errorEmitted=!0,r.nextTick(i,n,t)):r.nextTick(i,n,t):e?(r.nextTick(o,n),e(t)):r.nextTick(o,n)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}},5467:(t,e,n)=>{"use strict";var r=n(7303).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9689:(t,e,n)=>{"use strict";var r,i=n(7303).q,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===r&&(r=n(5467)),r(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var u=!1;return function(e){if(!s&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function l(t){t()}function c(t,e){return t.pipe(e)}function h(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),n=0;n0,(function(t){r||(r=t),t&&a.forEach(l),o||(a.forEach(l),i(r))}))}));return e.reduce(c)}},7855:(t,e,n)=>{"use strict";var r=n(7303).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var o=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},1463:(t,e,n)=>{t.exports=n(7187).EventEmitter},925:(t,e,n)=>{(e=t.exports=n(4002)).Stream=e,e.Readable=e,e.Writable=n(3313),e.Duplex=n(9560),e.Transform=n(1846),e.PassThrough=n(4842),e.finished=n(5467),e.pipeline=n(9689)},2553:(t,e,n)=>{"use strict";var r=n(9509).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=l,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},1191:function(t,e,n){"use strict";var r=n(4155),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BoundingBox=void 0;var r=n(5604),i=n(1375),o=function(){function t(e,n,r,i){e instanceof t?(this.minLongitude=e.minLongitude,this.maxLongitude=e.maxLongitude,this.minLatitude=e.minLatitude,this.maxLatitude=e.maxLatitude):(this.minLongitude=e,this.maxLongitude=n,this.minLatitude=r,this.maxLatitude=i)}return Object.defineProperty(t.prototype,"minLongitude",{get:function(){return this._minLongitude},set:function(t){this._minLongitude=t,this.width=this.maxLongitude-this.minLongitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLongitude",{get:function(){return this._maxLongitude},set:function(t){this._maxLongitude=t,this.width=this.maxLongitude-this.minLongitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minLatitude",{get:function(){return this._minLatitude},set:function(t){this._minLatitude=t,this.height=this.maxLatitude-this.minLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLatitude",{get:function(){return this._maxLatitude},set:function(t){this._maxLatitude=t,this.height=this.maxLatitude-this.minLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),t.prototype.buildEnvelope=function(){return{minY:this.minLatitude,minX:this.minLongitude,maxY:this.maxLatitude,maxX:this.maxLongitude}},t.prototype.toGeoJSON=function(){return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[this.minLongitude,this.minLatitude],[this.maxLongitude,this.minLatitude],[this.maxLongitude,this.maxLatitude],[this.minLongitude,this.maxLatitude],[this.minLongitude,this.minLatitude]]]}}},t.prototype.equals=function(t){return!!t&&(this===t||this.maxLatitude===t.maxLatitude&&this.minLatitude===t.minLatitude&&this.maxLongitude===t.maxLongitude&&this.maxLatitude===t.maxLatitude)},t.prototype.projectBoundingBox=function(e,n){var o=this.minLatitude,a=this.maxLatitude,s=this.minLongitude,u=this.maxLongitude;if(e&&"undefined"!==e&&n&&"undefined"!==n){r.Projection.isWebMercator(n)&&r.Projection.isWGS84(e)&&(a=Math.min(a,i.ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE),o=Math.max(o,i.ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE),u=Math.min(u,i.ProjectionConstants.WEB_MERCATOR_MAX_LON_RANGE),s=Math.max(s,i.ProjectionConstants.WEB_MERCATOR_MIN_LON_RANGE));var l=void 0;l=r.Projection.isConverter(n)?n:r.Projection.getConverter(n);var c=void 0;if(c=r.Projection.isConverter(e)?e:r.Projection.getConverter(e),r.Projection.convertersMatch(l,c))return new t(s,u,o,a);var h=l.forward(c.inverse([s,o])),f=l.forward(c.inverse([u,a])),p=l.forward(c.inverse([u,o])),d=l.forward(c.inverse([s,a]));return new t(Math.min(h[0],d[0]),Math.max(f[0],p[0]),Math.min(h[1],p[1]),Math.max(f[1],p[1]))}return this},t}();e.BoundingBox=o},3437:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasUtils=void 0;var i=function(){function t(){}return t.base64toUInt8Array=function(t){for(var e=r.from(t,"base64").toString("binary"),n=e.length,i=new Uint8Array(n);n--;)i[n]=e.charCodeAt(n);return i},t}();e.CanvasUtils=i},2807:function(t,e,n){"use strict";var r=n(3085).Buffer,i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Contents=void 0;var n=function(){function t(){}return t.prototype.copy=function(){var e=new t;return e.table_name=this.table_name,e.data_type=this.data_type,e.identifier=this.identifier,e.description=this.description,e.min_x=this.min_x,e.max_x=this.max_x,e.min_y=this.min_y,e.max_y=this.max_y,e.srs_id=this.srs_id,e},t.prototype.getTableName=function(){return this.table_name},t}();e.Contents=n},6638:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsDao=void 0;var a=n(4115),s=n(3506),u=n(5925),l=n(1968),c=n(5897),h=n(8572),f=n(2527),p=n(9971),d=n(1375),y=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_PK],n}return i(e,t),e.prototype.createObject=function(t){var e=new c.Contents;return t&&(e.table_name=t.table_name,e.data_type=t.data_type,e.identifier=t.identifier,e.description=t.description,e.last_change=t.last_change,e.min_y=t.min_y,e.max_y=t.max_y,e.min_x=t.min_x,e.max_x=t.max_x,e.srs_id=t.srs_id),e},e.prototype.getTables=function(t){var n;if(t){var r=new h.ColumnValues;r.addColumn(e.COLUMN_DATA_TYPE,t),n=this.queryForColumns("table_name",r)}else n=this.queryForColumns("table_name");for(var i=[],o=0;o0&&a.forEach((function(t){o.deleteByMultiId([t.table_name,t.zoom_level])}))}var s=this.geoPackage.tileMatrixSetDao;if(s.isTableExists()){var u=this.getTileMatrixSet(t);null!=u&&s.deleteById(u.table_name)}break;case p.ContentsDataType.ATTRIBUTES:this.dropTableWithTableName(t.table_name)}else this.dropTableWithTableName(t.table_name);e=this.delete(t)}return e},e.prototype.deleteCascade=function(t,e){var n=this.deleteCascadeContents(t);return e&&this.dropTableWithTableName(t.table_name),n},e.prototype.deleteByIdCascade=function(t,e){var n=0;if(null!=t){var r=this.queryForId(t);null!=r?n=this.deleteCascade(r,e):e&&this.dropTableWithTableName(t)}return n},e.prototype.deleteTable=function(t){try{this.deleteByIdCascade(t,!0)}catch(e){throw new Error("Failed to delete table: "+t)}},e.TABLE_NAME="gpkg_contents",e.COLUMN_PK="table_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_DATA_TYPE="data_type",e.COLUMN_IDENTIFIER="identifier",e.COLUMN_DESCRIPTION="description",e.COLUMN_LAST_CHANGE="last_change",e.COLUMN_MIN_X="min_x",e.COLUMN_MIN_Y="min_y",e.COLUMN_MAX_X="max_x",e.COLUMN_MAX_Y="max_y",e.COLUMN_SRS_ID="srs_id",e}(a.Dao);e.ContentsDao=y},9971:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsDataType=void 0,(n=e.ContentsDataType||(e.ContentsDataType={})).FEATURES="features",n.TILES="tiles",n.ATTRIBUTES="attributes",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){var n=null;if(null!=e)switch(e.toLowerCase()){case t.FEATURES:n=t.FEATURES;break;case t.TILES:n=t.TILES;break;case t.ATTRIBUTES:n=t.ATTRIBUTES}return n}}(e.ContentsDataType||(e.ContentsDataType={}))},341:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SpatialReferenceSystem=void 0;var r=n(5604),i=n(1375),o=function(){function t(){}return Object.defineProperty(t.prototype,"projection",{get:function(){return"NONE"===this.organization?null:!this.organization||this.organization.toUpperCase()!==i.ProjectionConstants.EPSG||this.organization_coordsys_id!==i.ProjectionConstants.EPSG_CODE_4326&&this.organization_coordsys_id!==i.ProjectionConstants.EPSG_CODE_3857?this.definition_12_063&&""!==this.definition_12_063&&"undefined"!==this.definition_12_063?r.Projection.getConverter(this.definition_12_063):this.definition&&""!==this.definition&&"undefined"!==this.definition?r.Projection.getConverter(this.definition):null:r.Projection.getEPSGConverter(this.organization_coordsys_id)},enumerable:!1,configurable:!0}),t.TABLE_NAME="gpkg_spatial_ref_sys",t}();e.SpatialReferenceSystem=o},5965:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SpatialReferenceSystemDao=void 0;var o=n(4115),a=n(341),s=n(8572),u=n(1375),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.idColumns=[e.COLUMN_SRS_ID],n.gpkgTableName=e.TABLE_NAME,n}return i(e,t),e.prototype.createObject=function(t){var e=new a.SpatialReferenceSystem;return t&&(e.srs_name=t.srs_name,e.srs_id=t.srs_id,e.organization=t.organization,e.organization_coordsys_id=t.organization_coordsys_id,e.definition=t.definition,e.definition_12_063=t.definition,e.description=t.description),e},e.prototype.getAllSpatialReferenceSystems=function(){var t=[];if(null!=this.connection&&this.isTableExists()){var e=this.queryForAll();if(e&&e.length)for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnValues=void 0;var n=function(){function t(){this.values={},this.columns=[]}return t.prototype.addColumn=function(t,e){this.columns.push(t),this.values[t]=e},t.prototype.getValue=function(t){return this.values[t]},t}();e.ColumnValues=n},4115:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dao=void 0;var r=n(8572),i=n(8877),o=n(5042),a=function(){function t(t){this.geoPackage=t,this.connection=t.database}return t.prototype.isTableExists=function(){return this.connection.isTableExists(this.gpkgTableName)},t.prototype.refresh=function(t){return this.queryForSameId(t)},t.prototype.queryForId=function(t){var e=this.buildPkWhere(t),n=this.buildPkWhereArgs(t),r=i.SqliteQueryBuilder.buildQuery(!1,"'"+this.gpkgTableName+"'",void 0,e),o=this.connection.get(r,n);if(o)return this.createObject(o)},t.prototype.queryForSameId=function(t){var e=this.getMultiId(t);return this.queryForMultiId(e)},t.prototype.getMultiId=function(t){for(var e=[],n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnConstraints=void 0;e.DataColumnConstraints=function(){}},7175:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnConstraintsDao=void 0;var o=n(4115),a=n(8590),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_CONSTRAINT_NAME,e.COLUMN_CONSTRAINT_TYPE,e.COLUMN_VALUE],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.DataColumnConstraints;return t&&(e.constraint_name=t.constraint_name,e.constraint_type=t.constraint_type,e.value=t.value,e.min=t.min,e.max=t.max,e.min_is_inclusive=t.min_is_inclusive,e.max_is_inclusive=t.max_is_inclusive,e.description=t.description),e},e.prototype.queryByConstraintName=function(t){return this.queryForEach(e.COLUMN_CONSTRAINT_NAME,t)},e.prototype.queryUnique=function(t,e,n){var r=new a.DataColumnConstraints;return r.constraint_name=t,r.constraint_type=e,r.value=n,this.queryForSameId(r)},e.TABLE_NAME="gpkg_data_column_constraints",e.COLUMN_CONSTRAINT_NAME="constraint_name",e.COLUMN_CONSTRAINT_TYPE="constraint_type",e.COLUMN_VALUE="value",e.COLUMN_MIN="min",e.COLUMN_MIN_IS_INCLUSIVE="min_is_inclusive",e.COLUMN_MAX="max",e.COLUMN_MAX_IS_INCLUSIVE="max_is_inclusive",e.COLUMN_DESCRIPTION="description",e.ENUM_TYPE="enum",e.GLOB_TYPE="glob",e.RANGE_TYPE="range",e}(o.Dao);e.DataColumnConstraintsDao=s},8133:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumns=void 0;e.DataColumns=function(t){t=t||{},this.table_name=t.table_name,this.column_name=t.column_name,this.name=t.name,this.title=t.title,this.description=t.description,this.mime_type=t.mime_type,this.constraint_name=t.constraint_name}},4941:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.DataColumnsDao=void 0;var a=n(4115),s=n(6638),u=n(8133),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_PK1,e.COLUMN_PK2],n}return i(e,t),e.prototype.createObject=function(t){var e=new u.DataColumns;return t&&(e.table_name=t.table_name,e.column_name=t.column_name,e.name=t.name,e.title=t.title,e.description=t.description,e.mime_type=t.mime_type,e.constraint_name=t.constraint_name),e},e.prototype.getContents=function(t){return new s.ContentsDao(this.geoPackage).queryForId(t.table_name)},e.prototype.queryByConstraintName=function(t){return this.queryForEach(e.COLUMN_CONSTRAINT_NAME,t)},e.prototype.getDataColumns=function(t,n){var r,i;if(this.isTableExists()){var a,s=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t)+" and "+this.buildWhereWithFieldAndValue(e.COLUMN_COLUMN_NAME,n),u=[t,n];try{for(var l=o(this.queryWhere(s,u)),c=l.next();!c.done;c=l.next()){var h=c.value;a=this.createObject(h)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return a}},e.prototype.deleteByTableName=function(t){var n="";n+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t);var r=this.buildWhereArgs(t);return this.deleteWhere(n,r)},e.TABLE_NAME="gpkg_data_columns",e.COLUMN_PK1="table_name",e.COLUMN_PK2="column_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_NAME="name",e.COLUMN_TITLE="title",e.COLUMN_DESCRIPTION="description",e.COLUMN_MIME_TYPE="mime_type",e.COLUMN_CONSTRAINT_NAME="constraint_name",e}(a.Dao);e.DataColumnsDao=l},8314:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.AlterTable=void 0;var i=n(362),o=n(5042),a=n(5329),s=n(2431),u=n(2841),l=n(1133),c=n(7043),h=n(175),f=n(8934),p=n(1078),d=n(735),y=function(){function t(){}return t.alterTableSQL=function(t){return"ALTER TABLE "+a.StringUtils.quoteWrap(t)},t.renameTable=function(e,n,r){var i=t.renameTableSQL(n,r);e.run(i)},t.renameTableSQL=function(e,n){return t.alterTableSQL(e)+" RENAME TO "+a.StringUtils.quoteWrap(n)},t.renameColumn=function(e,n,r,i){var o=t.renameColumnSQL(n,r,i);e.run(o)},t.renameColumnSQL=function(e,n,r){return t.alterTableSQL(e)+" RENAME COLUMN "+a.StringUtils.quoteWrap(n)+" TO "+a.StringUtils.quoteWrap(r)},t.addColumn=function(e,n,r,i){var o=t.addColumnSQL(n,r,i);e.run(o)},t.addColumnSQL=function(e,n,r){return t.alterTableSQL(e)+" ADD COLUMN "+a.StringUtils.quoteWrap(n)+" "+r},t.dropColumnForUserTable=function(e,n,r){t.dropColumnsForUserTable(e,n,[r])},t.dropColumnsForUserTable=function(e,n,r){var i=n.copy();r.forEach((function(t){i.dropColumnWithName(t)}));var o=new s.TableMapping(i.getTableName(),i.getTableName(),i.getUserColumns().getColumns());r.forEach((function(t){o.addDroppedColumn(t)})),t.alterTableWithTableMapping(e,i,o),r.forEach((function(t){n.dropColumnWithName(t)}))},t.dropColumn=function(e,n,r){t.dropColumns(e,n,[r])},t.dropColumns=function(e,n,r){var o=new i.UserCustomTableReader(n).readTable(e);t.dropColumnsForUserTable(e,o,r)},t.alterColumnForTable=function(e,n,r){t.alterColumnsForTable(e,n,[r])},t.alterColumnsForTable=function(e,n,r){var i=n.copy();r.forEach((function(t){i.alterColumn(t)})),t.alterTable(e,i),r.forEach((function(t){n.alterColumn(t)}))},t.alterColumn=function(e,n,r){t.alterColumns(e,n,[r])},t.alterColumns=function(e,n,r){var o=new i.UserCustomTableReader(n).readTable(e);t.alterColumnsForTable(e,o,r)},t.copyTable=function(e,n,r,i){void 0===i&&(i=!0);var o=new s.TableMapping(n.getTableName(),r,n.getUserColumns().getColumns());o.transferContent=i,t.alterTableWithTableMapping(e,n,o)},t.copyTableWithName=function(e,n,r,o){void 0===o&&(o=!0);var a=new i.UserCustomTableReader(n).readTable(e);t.copyTable(e,a,r,o)},t.alterTable=function(e,n){var r=new s.TableMapping(n.getTableName(),n.getTableName(),n.getUserColumns().getColumns());t.alterTableWithTableMapping(e,n,r)},t.alterTableWithTableMapping=function(e,n,r){n.getUserColumns().getColumns().forEach((function(t){t.clearConstraints().forEach((function(e){var n=o.CoreSQLUtils.modifySQL(null,e.name,e.buildSql(),r);null!=n&&t.addConstraint(new u.RawConstraint(e.type,l.ConstraintParser.getName(n),n))}))})),n.clearConstraints().forEach((function(t){var e=o.CoreSQLUtils.modifySQL(null,t.name,t.buildSql(),r);null!=e&&n.addConstraint(new u.RawConstraint(t.type,t.name,e))}));var i=o.CoreSQLUtils.createTableSQL(n);t.alterTableWithSQLAndTableMapping(e,i,r)},t.alterTableWithSQLAndTableMapping=function(e,n,i){var a=i.fromTable,s=i.isNewTable(),u=o.CoreSQLUtils.setForeignKeys(e,!1);e.transaction((function(){try{var l=c.SQLiteMaster.queryViewsOnTable(e,[h.SQLiteMasterColumn.NAME,h.SQLiteMasterColumn.SQL],a);if(!s)for(var y=0;y0){for(var n=[],r=0;r0&&(n=n.concat(" ")),n=n.concat(r+1).concat(": ");for(var i=e[r],a=0;a0&&(n=n.concat(", ")),n=n.concat(i.get(a))}throw new Error("Foreign Key Check Violations: "+n)}},t}();e.AlterTable=y},5042:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CoreSQLUtils=void 0;var r=n(5329),i=n(2431),o=n(5045),a=n(7043),s=n(1078),u=n(175),l=function(){function t(){}return t.createTableSQL=function(e){var n="";n=n.concat("CREATE TABLE ").concat(r.StringUtils.quoteWrap(e.getTableName())).concat(" (");for(var i=e.getUserColumns().getColumns(),o=0;o0&&(n=n.concat(",")),n=(n=n.concat("\n ")).concat(t.columnSQL(a))}return e.getConstraints().all().forEach((function(t){n=(n=n.concat(",\n ")).concat(t.buildSql())})),n=n.concat("\n);")},t.columnSQL=function(e){return r.StringUtils.quoteWrap(e.getName())+" "+t.columnDefinition(e)},t.columnDefinition=function(t){var e="";return e=e.concat(t.getType()),t.hasMax()&&(e=e.concat("(").concat(t.getMax().toString()).concat(")")),t.getConstraints().all().forEach((function(n){e=(e=e.concat(" ")).concat(t.buildConstraintSql(n))})),e.toString()},t.foreignKeys=function(t){var e=t.get("PRAGMA foreign_keys",null)[0];return null!=e&&e},t.setForeignKeys=function(e,n){var r=t.foreignKeys(e);if(r!==n){var i=t.foreignKeysSQL(n);e.run(i)}return r},t.foreignKeysSQL=function(t){return"PRAGMA foreign_keys = "+t},t.foreignKeyCheck=function(e){var n=t.foreignKeyCheckSQL(null);return e.all(n,null)},t.foreignKeyCheckForTable=function(e,n){var r=t.foreignKeyCheckSQL(n);return e.all(r,null)},t.foreignKeyCheckSQL=function(t){return"PRAGMA foreign_key_check"+(null!=t?"("+r.StringUtils.quoteWrap(t)+")":"")},t.integrityCheckSQL=function(){return"PRAGMA integrity_check"},t.quickCheckSQL=function(){return"PRAGMA quick_check"},t.dropTable=function(e,n){var r=t.dropTableSQL(n);e.run(r)},t.dropTableSQL=function(t){return"DROP TABLE IF EXISTS "+r.StringUtils.quoteWrap(t)},t.dropView=function(e,n){var r=t.dropViewSQL(n);e.run(r)},t.dropViewSQL=function(t){return"DROP VIEW IF EXISTS "+r.StringUtils.quoteWrap(t)},t.transferTableContentForTableMapping=function(e,n){var r=t.transferTableContentSQL(n);e.run(r)},t.transferTableContentSQL=function(t){var e="INSERT INTO ";e=(e=e.concat(r.StringUtils.quoteWrap(t.toTable))).concat(" (");var n="",i="";t.hasWhere()&&(i=i.concat(t.where));var o=t.getColumns();return t.getColumnNames().forEach((function(t){var a=t,s=o[t];n.length>0&&(e=e.concat(", "),n=n.concat(", ")),e=e.concat(r.StringUtils.quoteWrap(a)),s.hasConstantValue()?n=n.concat(s.getConstantValueAsString()):(s.hasDefaultValue()&&(n=n.concat("ifnull(")),n=n.concat(r.StringUtils.quoteWrap(s.fromColumn)),s.hasDefaultValue()&&(n=(n=(n=n.concat(",")).concat(s.getDefaultValueAsString())).concat(")"))),s.hasWhereValue()&&(i.length>0&&(i=i.concat(" AND ")),i=(i=(i=(i=(i=i.concat(r.StringUtils.quoteWrap(s.fromColumn))).concat(" ")).concat(s.whereOperator)).concat(" ")).concat(s.getWhereValueAsString()))})),e=(e=(e=(e=e.concat(") SELECT ")).concat(n)).concat(" FROM ")).concat(r.StringUtils.quoteWrap(t.fromTable)),i.length>0&&(e=(e=e.concat(" WHERE ")).concat(i)),e.toString()},t.transferTableContent=function(e,n,r,a,s,u){var l=o.TableInfo.info(e,n),c=i.TableMapping.fromTableInfo(l);null!=u&&c.removeColumn(u);var h=c.getColumn(r);h.constantValue=a,h.whereValue=s,t.transferTableContentForTableMapping(e,c)},t.tempTableName=function(t,e,n){for(var r=e+"_"+n,i=0;t.tableExists(r);)r=e+ ++i+"_"+n;return r},t.modifySQL=function(e,n,r,i){var o=r;if(null!=n&&i.isNewTable()){var a=t.createName(e,n,i.fromTable,i.toTable),s=t.replaceName(o,n,a);null!=s&&(o=s);var u=t.replaceName(o,i.fromTable,i.toTable);null!=u&&(o=u)}return t.modifySQLWithTableMapping(o,i)},t.modifySQLWithTableMapping=function(e,n){for(var r=e,i=Array.from(n.droppedColumns),o=0;o=0){for(var i=!1,o="",a=t.split(e),s=0;s<=a.length;s++){if(s>0){var u="_",l=a[s-1];0===l.length?1==s&&(u=" "):u=l.substring(l.length-1);var c="_";if(s0&&c.match("\\W").length>0?(o=o.concat(n),i=!0):o=o.concat(e)}s=0&&h+10&&(l=l.substring(0,h),c=parseInt(f))}if(o=l+"_"+ ++c,null!=e)for(;a.SQLiteMaster.count(e,null,s.SQLiteMasterQuery.createForColumnValue(u.SQLiteMasterColumn.NAME,o))>0;)o=l+"_"+ ++c}return o},t.vacuum=function(t){t.run("VACUUM")},t.NUMBER_PATTERN="\\d+",t}();e.CoreSQLUtils=l},4777:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Db=void 0;var n=function(){function t(){}return t.registerDbAdapter=function(e){t.adapterCreator=e},t.create=function(e){return new t.adapterCreator(e)},t.adapterCreator=void 0,t}();e.Db=n},5116:function(t,e,n){"use strict";var r=n(5108),i=n(3085).Buffer,o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageDataType=void 0,(n=e.GeoPackageDataType||(e.GeoPackageDataType={}))[n.BOOLEAN=0]="BOOLEAN",n[n.TINYINT=1]="TINYINT",n[n.SMALLINT=2]="SMALLINT",n[n.MEDIUMINT=3]="MEDIUMINT",n[n.INT=4]="INT",n[n.INTEGER=5]="INTEGER",n[n.FLOAT=6]="FLOAT",n[n.DOUBLE=7]="DOUBLE",n[n.REAL=8]="REAL",n[n.TEXT=9]="TEXT",n[n.BLOB=10]="BLOB",n[n.DATE=11]="DATE",n[n.DATETIME=12]="DATETIME",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.columnDefaultValue=function(e,n){var r=null;if(null!=e){if(null!=n)switch(n){case t.BOOLEAN:var i=null;if("boolean"==typeof e)i=e;else if("string"==typeof e)switch(e){case"0":case"false":i=!1;break;case"1":case"true":i=!0}null!=i&&(r=i?"1":"0");break;case t.TEXT:(r=e.toString()).startsWith("'")&&r.endsWith("'")||(r="'"+r+"'")}null==r&&(r=e.toString())}return r}}(e.GeoPackageDataType||(e.GeoPackageDataType={}))},1790:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MappedColumn=void 0;var i=n(7319),o=r(n(4293)),a=r(n(8446)),s=function(){function t(t,e,n,r){this._toColumn=t,this._fromColumn=e,this._defaultValue=n,this._dataType=r}return Object.defineProperty(t.prototype,"toColumn",{get:function(){return this._toColumn},set:function(t){this._toColumn=t},enumerable:!1,configurable:!0}),t.prototype.hasNewName=function(){return!(0,o.default)(this._fromColumn)&&!(0,a.default)(this._fromColumn,this._toColumn)},Object.defineProperty(t.prototype,"fromColumn",{get:function(){return this._fromColumn},set:function(t){this._fromColumn=t},enumerable:!1,configurable:!0}),t.prototype.hasDefaultValue=function(){return!(0,o.default)(this._defaultValue)},Object.defineProperty(t.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(t){this._defaultValue=t},enumerable:!1,configurable:!0}),t.prototype.getDefaultValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._defaultValue,this._dataType)},Object.defineProperty(t.prototype,"dataType",{get:function(){return this._dataType},set:function(t){this._dataType=t},enumerable:!1,configurable:!0}),t.prototype.hasConstantValue=function(){return!(0,o.default)(this._constantValue)},Object.defineProperty(t.prototype,"constantValue",{get:function(){return this._constantValue},set:function(t){this._constantValue=t},enumerable:!1,configurable:!0}),t.prototype.getConstantValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._constantValue,this._dataType)},t.prototype.hasWhereValue=function(){return!(0,o.default)(this._whereValue)},Object.defineProperty(t.prototype,"whereValue",{get:function(){return this._whereValue},set:function(t){this._whereValue=t},enumerable:!1,configurable:!0}),t.prototype.getWhereValueAsString=function(){return i.GeoPackageDataType.columnDefaultValue(this._whereValue,this._dataType)},t.prototype.setWhereValueAndOperator=function(t,e){this._whereValue=t,this.whereOperator=e},Object.defineProperty(t.prototype,"whereOperator",{get:function(){return(0,o.default)(this._whereOperator)?"=":this._whereOperator},set:function(t){this._whereOperator=t},enumerable:!1,configurable:!0}),t}();e.MappedColumn=s},7043:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0){this._results=t,this._count=t.length;for(var n=0;n=this._results.length){var e;throw e=0===this._results.length?"Results are empty":"Row index: "+t+", not within range 0 to "+(this._results.length-1),new Error(e)}return this._results[t]},t.getValue=function(t,e){return t[o.SQLiteMasterColumn.nameFromType(e).toLowerCase()]},t.prototype.getConstraints=function(t){var e=new s.TableConstraints;if(this.getType(t)===a.SQLiteMasterType.TABLE){var n=this.getSql(t);null!=n&&(e=u.ConstraintParser.getConstraints(n))}return e},t.count=function(e,n,r){return t.query(e,null,n,r).count()},t.query=function(e,n,s,u){var l="SELECT ",c=[];if(null!=n&&n.length>0)for(var h=0;h0&&(l=l.concat(", ")),l=l.concat(o.SQLiteMasterColumn.nameFromType(n[h]).toLowerCase());else l=l.concat("count(*) as cnt");l=(l=l.concat(" FROM ")).concat(t.TABLE_NAME);var f=null!=u&&u.has(),p=null!=s&&s.length>0;if((f||p)&&(l=l.concat(" WHERE "),f&&(l=l.concat(u.buildSQL()),c.push.apply(c,i([],r(u.getArguments()),!1))),p)){for(f&&(l=l.concat(" AND")),l=l.concat(" type IN ("),h=0;h0&&(l=l.concat(", ")),l=l.concat("?"),c.push(a.SQLiteMasterType.nameFromType(s[h]).toLowerCase());l=l.concat(")")}return new t(e.all(l,c),n)},t.queryViewsOnTable=function(e,n,r){return t.query(e,n,[a.SQLiteMasterType.VIEW],l.SQLiteMasterQuery.createTableViewQuery(r))},t.countViewsOnTable=function(e,n){return t.count(e,[a.SQLiteMasterType.VIEW],l.SQLiteMasterQuery.createTableViewQuery(n))},t.queryForConstraints=function(e,n){for(var r=new s.TableConstraints,i=t.query(e,[o.SQLiteMasterColumn.TYPE,o.SQLiteMasterColumn.NAME,o.SQLiteMasterColumn.TBL_NAME,o.SQLiteMasterColumn.ROOTPAGE,o.SQLiteMasterColumn.SQL],[a.SQLiteMasterType.TABLE],l.SQLiteMasterQuery.createForColumnValue(o.SQLiteMasterColumn.TBL_NAME,n)),u=0;u{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterColumn=void 0,(n=e.SQLiteMasterColumn||(e.SQLiteMasterColumn={}))[n.TYPE=0]="TYPE",n[n.NAME=1]="NAME",n[n.TBL_NAME=2]="TBL_NAME",n[n.ROOTPAGE=3]="ROOTPAGE",n[n.SQL=4]="SQL",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.asArray=function(){return[t.TYPE,t.NAME,t.TBL_NAME,t.ROOTPAGE,t.SQL]}}(e.SQLiteMasterColumn||(e.SQLiteMasterColumn={}))},1078:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterQuery=void 0;var r=n(175),i=n(5329),o=function(){function t(t){this.queries=[],this.arguments=[],this.combineOperation=t}return t.prototype.add=function(t,e,n){this.validateAdd(),this.queries.push("LOWER("+i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+") "+e+" LOWER(?)"),this.arguments.push(n)},t.prototype.addIsNull=function(t){this.validateAdd(),this.queries.push(i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+" IS NULL")},t.prototype.addIsNotNull=function(t){this.validateAdd(),this.queries.push(i.StringUtils.quoteWrap(r.SQLiteMasterColumn.nameFromType(t).toLowerCase())+" IS NOT NULL")},t.prototype.validateAdd=function(){if((null===this.combineOperation||void 0===this.combineOperation)&&0!==this.queries.length)throw new Error("Query without a combination operation supports only a single query")},t.prototype.has=function(){return 0!==this.queries.length},t.prototype.buildSQL=function(){var t="";this.queries.length>1&&(t=t.concat("( "));for(var e=0;e0&&(t=(t=(t=t.concat(" ")).concat(this.combineOperation)).concat(" ")),t=t.concat(this.queries[e]);return this.queries.length>1&&(t=t.concat(" )")),t},t.prototype.getArguments=function(){return this.arguments},t.create=function(){return new t(null)},t.createOr=function(){return new t("OR")},t.createAnd=function(){return new t("AND")},t.createForColumnValue=function(t,e){var n=this.create();return n.add(t,"=",e),n},t.createForOperationAndColumnValue=function(t,e,n){var r=this.create();return r.add(t,e,n),r},t.createOrForColumnValue=function(t,e){var n=this.createOr();return e.forEach((function(e){n.add(t,"=",e)})),n},t.createOrForOperationAndColumnValue=function(t,e,n){var r=this.createOr();return n.forEach((function(n){r.add(t,e,n)})),r},t.createAndForColumnValue=function(t,e){var n=this.createAnd();return e.forEach((function(e){n.add(t,"=",e)})),n},t.createAndForOperationAndColumnValue=function(t,e,n){var r=this.createAnd();return n.forEach((function(n){r.add(t,e,n)})),r},t.createTableViewQuery=function(e){var n=[];return n.push('%"'+e+'"%'),n.push("% "+e+" %"),n.push("%,"+e+" %"),n.push("% "+e+",%"),n.push("%,"+e+",%"),n.push("% "+e),n.push("%,"+e),t.createOrForOperationAndColumnValue(r.SQLiteMasterColumn.SQL,"LIKE",n)},t}();e.SQLiteMasterQuery=o},8934:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SQLiteMasterType=void 0,(n=e.SQLiteMasterType||(e.SQLiteMasterType={}))[n.TABLE=0]="TABLE",n[n.INDEX=1]="INDEX",n[n.VIEW=2]="VIEW",n[n.TRIGGER=3]="TRIGGER",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]}}(e.SQLiteMasterType||(e.SQLiteMasterType={}))},922:function(t,e,n){"use strict";var r=n(5108),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SqliteQueryBuilder=void 0;var n=function(){function t(){}return t.fixColumnName=function(t){return t.replace(/\W+/g,"_")},t.buildQuery=function(e,n,r,i,o,a,s,u,l,c){var h="";if(t.isEmpty(a)&&!t.isEmpty(s))throw new Error("Illegal Arguments: having clauses require a groupBy clause");return h+="select ",e&&(h+="distinct "),r&&r.length?h=t.appendColumnsToString(r,h):h+="* ",h+="from "+n,o&&(h+=" "+o),h=t.appendClauseToString(h," where ",i),h=t.appendClauseToString(h," group by ",a),h=t.appendClauseToString(h," having ",s),h=t.appendClauseToString(h," order by ",u),h=t.appendClauseToString(h," limit ",l),t.appendClauseToString(h," offset ",c)},t.buildCount=function(e,n){var r="select count(*) as count from "+e;return t.appendClauseToString(r," where ",n)},t.buildInsert=function(e,n){if(n.columnNames)return t.buildInsertFromColumnNames(e,n);var r="insert into "+e+" (",i="",o="",a=!0;for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&void 0!==n[s]&&(a||(i+=",",o+=","),a=!1,i+=s,o+="$"+t.fixColumnName(s));return r+(i+") values (")+o+")"},t.buildInsertFromColumnNames=function(e,n){for(var r="insert into "+e+" (",i="",o="",a=!0,s=n.columnNames,u=0;u0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SqljsAdapter=void 0;var l=u(n(3686)),c=function(){function t(t){this.filePath=t}return t.setSqljsWasmLocateFile=function(e){t.sqljsWasmLocateFile=e},t.prototype.initialize=function(){var e=this;return new Promise((function(o,a){new Promise((function(e){null==t.SQL?(0,l.default)({locateFile:t.sqljsWasmLocateFile}).then((function(n){t.SQL=n,e(n)})).catch((function(t){a(t)})):e(t.SQL)})).then((function(t){if(!e.filePath||"string"!=typeof e.filePath){if(e.filePath){var s=e.filePath;return e.db=new t.Database(s),o(e)}return e.db=new t.Database,o(e)}if(void 0!==r&&r.version){var u=n(1929);if(0!==e.filePath.indexOf("http")){try{u.statSync(e.filePath)}catch(n){return e.db=new t.Database,o(e)}var l=u.readFileSync(e.filePath),c=new Uint8Array(l);return e.db=new t.Database(c),o(e)}n(8501).get(e.filePath,(function(n){if(200!==n.statusCode)return a(new Error("Unable to reach url: "+e.filePath));var r=[];n.on("data",(function(t){return r.push(t)})),n.on("end",(function(){var n=new Uint8Array(i.concat(r));e.db=new t.Database(n),o(e)}))})).on("error",(function(t){return a(t)}))}else{var h=new XMLHttpRequest;h.open("GET",e.filePath,!0),h.responseType="arraybuffer",h.onload=function(){if(200!==h.status)return a(new Error("Unable to reach url: "+e.filePath));var n=new Uint8Array(h.response);return e.db=new t.Database(n),o(e)},h.onerror=function(){return a(new Error("Error reaching url: "+e.filePath))},h.send()}})).catch((function(t){a(t)}))}))},t.prototype.close=function(){this.db.close()},t.prototype.getDBConnection=function(){return this.db},t.prototype.export=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this.db.export()]}))}))},t.prototype.registerFunction=function(t,e){return this.db.create_function(t,e),this},t.prototype.get=function(t,e){e=e||[];var n,r=this.db.prepare(t);return r.bind(e),r.step()&&(n=r.getAsObject()),r.free(),n},t.prototype.isTableExists=function(t){var e,n=this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=:name");return n.bind([t]),n.step()&&(e=n.getAsObject()),n.free(),!!e},t.prototype.all=function(t,e){var n,r,i=[],o=this.each(t,e);try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=u.value;i.push(l)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.each=function(t,e){var n,r=this.db.prepare(t);return r.bind(e),(n={})[Symbol.iterator]=function(){return this},n.next=function(){return r.step()?{value:r.getAsObject(),done:!1}:(r.free(),{value:void 0,done:!0})},n},t.prototype.run=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];this.db.run(t,e);var r,i=this.db.exec("select last_insert_rowid();");return i&&(r=i[0].values[0][0]),{lastInsertRowid:r,changes:this.db.getRowsModified()}},t.prototype.insert=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];var r=this.db.prepare(t,e);r.step(),r.free();var i=this.db.exec("select last_insert_rowid();");return i?i[0].values[0][0]:void 0},t.prototype.prepareStatement=function(t){return this.db.prepare(t)},t.prototype.bindAndInsert=function(t,e){if(e&&!(e instanceof Array))for(var n in e)e["$"+n]=e[n];return t.run(e).lastInsertRowid},t.prototype.closeStatement=function(t){t.free()},t.prototype.delete=function(t,e){var n,r=this.db.prepare(t,e);return r.step(),n=this.db.getRowsModified(),r.free(),n},t.prototype.dropTable=function(t){var e=this.db.exec('DROP TABLE IF EXISTS "'+t+'"');return this.db.exec("VACUUM"),!!e},t.prototype.count=function(t,e,n){var r='SELECT COUNT(*) as count FROM "'+t+'"';return e&&(r+=" where "+e),this.get(r,n).count},t.prototype.transaction=function(t){this.db.exec("BEGIN TRANSACTION");try{t(),this.db.exec("COMMIT TRANSACTION")}catch(t){throw this.db.exec("ROLLBACK TRANSACTION"),t}},t.sqljsWasmLocateFile=function(t){return t},t}();e.SqljsAdapter=c},5329:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtils=void 0;var n=function(){function t(){}return t.quoteWrap=function(t){var e=null;return null!==t&&(e=t.startsWith('"')&&t.endsWith('"')?t:'"'+t+'"'),e},t.quoteUnwrap=function(t){var e=null;return null!=t&&(e=t.startsWith('"')&&t.endsWith('"')?t.substring(1,t.length-1):t),e},t}();e.StringUtils=n},3765:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColumnConstraints=void 0;var r=n(7686),i=function(){function t(t){this.name=t,this.constraints=new r.Constraints}return t.prototype.addConstraint=function(t){this.constraints.add(t)},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.getConstraints=function(){return this.constraints},t.prototype.getConstraint=function(t){return t>=this.constraints.size()?null:this.constraints.get(t)},t.prototype.numConstraints=function(){return this.constraints.size()},t.prototype.addColumnConstraints=function(t){null!=t&&this.addConstraints(t.getConstraints())},t.prototype.hasConstraints=function(){return this.constraints.has()},t}();e.ColumnConstraints=i},8007:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constraint=void 0;var r=n(5329),i=function(){function t(t,e,n){void 0===n&&(n=Number.MAX_SAFE_INTEGER),this.type=t,this.name=e,this.order=n}return t.prototype.buildNameSql=function(){var e="";return null!==this.name&&void 0!==this.name&&(e=t.CONSTRAINT+" "+r.StringUtils.quoteWrap(this.name)+" "),e},t.prototype.buildSql=function(){return""},t.prototype.copy=function(){return new t(this.type,this.name)},t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.compareTo=function(t){return this.getOrder(this.order)-this.getOrder(t.order)<=0?-1:1},t.prototype.getOrder=function(t){return null!=t?t:Number.MAX_VALUE},t.CONSTRAINT="CONSTRAINT",t}();e.Constraint=i},1133:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConstraintParser=void 0;var r=n(4980),i=n(3765),o=n(8007),a=n(91),s=n(2841),u=n(5329),l=function(){function t(){}return t.getConstraints=function(e){var n=new r.TableConstraints,i=-1,o=-1;if(null!=e&&(i=e.indexOf("("),o=e.lastIndexOf(")")),i>=0&&o>=0){for(var a=e.substring(i+1,o).trim(),s=0,u=0,l=0;l0&&(o=o.concat(" ")),o=o.concat(e[a]);var u=t.getName(o);return new s.RawConstraint(i,u,o)},t.getConstraint=function(e,n){var r=null,i=t.getNameAndDefinition(e),o=i[1];if(null!=o){var u,l=o.split(/\s+/)[0];null!=(u=n?a.ConstraintType.getTableType(l):a.ConstraintType.getColumnType(l))&&(r=new s.RawConstraint(u,i[0],e.trim()))}return r},t.getTableConstraint=function(e){return t.getConstraint(e,!0)},t.isTableConstraint=function(e){return null!==t.getTableConstraint(e)},t.getTableType=function(e){var n=null,r=t.getTableConstraint(e);return null!=r&&(n=r.type),n},t.isTableType=function(e,n){var r=!1,i=t.getTableType(n);return null!=i&&(r=e===i),r},t.getColumnConstraint=function(e){return t.getConstraint(e,!1)},t.isColumnConstraint=function(e){return null!=t.getColumnConstraint(e)},t.getColumnType=function(e){var n=null,r=t.getColumnConstraint(e);return null!=r&&(n=r.type),n},t.isColumnType=function(e,n){var r=!1,i=t.getColumnType(n);return null!=i&&(r=e==i),r},t.getTableOrColumnConstraint=function(e){var n=t.getTableConstraint(e);return null==n&&(n=t.getColumnConstraint(e)),n},t.isConstraint=function(e){return null!==t.getTableOrColumnConstraint(e)},t.getType=function(e){var n=null,r=t.getTableOrColumnConstraint(e);return null!=r&&(n=r.getType()),n},t.isType=function(e,n){var r=!1,i=t.getType(n);return null!=i&&(r=e===i),r},t.getName=function(e){var n=null,r=t.NAME_PATTERN(e);return null!==r&&r.length>t.NAME_PATTERN_NAME_GROUP&&(n=u.StringUtils.quoteUnwrap(r[t.NAME_PATTERN_NAME_GROUP])),n},t.getNameAndDefinition=function(e){var n=[null,e],r=t.CONSTRAINT_PATTERN(e.trim());if(null!==r&&r.length>t.CONSTRAINT_PATTERN_DEFINITION_GROUP){var i=u.StringUtils.quoteUnwrap(r[t.CONSTRAINT_PATTERN_NAME_GROUP]);null!=i&&(i=i.trim());var o=r[t.CONSTRAINT_PATTERN_DEFINITION_GROUP];null!=o&&(o=o.trim()),n=[i,o]}return n},t.NAME_PATTERN=function(t){return t.match(/CONSTRAINT\s+("[\s\S]+"|\S+)\s/i)},t.NAME_PATTERN_NAME_GROUP=1,t.CONSTRAINT_PATTERN=function(t){return t.match(/(CONSTRAINT\s+("[\s\S]+"|\S+)\s)?([\s\S]*)/i)},t.CONSTRAINT_PATTERN_NAME_GROUP=2,t.CONSTRAINT_PATTERN_DEFINITION_GROUP=3,t}();e.ConstraintParser=l},91:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ConstraintType=void 0,(n=e.ConstraintType||(e.ConstraintType={}))[n.PRIMARY_KEY=0]="PRIMARY_KEY",n[n.UNIQUE=1]="UNIQUE",n[n.CHECK=2]="CHECK",n[n.FOREIGN_KEY=3]="FOREIGN_KEY",n[n.NOT_NULL=4]="NOT_NULL",n[n.DEFAULT=5]="DEFAULT",n[n.COLLATE=6]="COLLATE",n[n.AUTOINCREMENT=7]="AUTOINCREMENT",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){return t[e]},t.TABLE_CONSTRAINTS=new Set([t.PRIMARY_KEY,t.UNIQUE,t.CHECK,t.FOREIGN_KEY]),t.COLUMN_CONSTRAINTS=new Set([t.PRIMARY_KEY,t.NOT_NULL,t.UNIQUE,t.CHECK,t.DEFAULT,t.COLLATE,t.FOREIGN_KEY,t.AUTOINCREMENT]);var e=new Map;Array.from(t.TABLE_CONSTRAINTS).forEach((function(t){r(e,t)}));var n=new Map;function r(e,n){var r=t.nameFromType(n),i=r.split("_");e.set(i[0],n),i.length>0&&e.set(r.replace("_"," "),n)}function i(t){return e.get(t.toUpperCase())}function o(t){return n.get(t.toUpperCase())}Array.from(t.COLUMN_CONSTRAINTS).forEach((function(t){r(n,t)})),t.getTableType=i,t.getColumnType=o,t.getType=function(t){var e=i(t);return null==e&&(e=o(t)),e}}(e.ConstraintType||(e.ConstraintType={}))},7686:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Constraints=void 0;var i=r(n(1159)),o=function(){function t(){this.constraints=[],this.typedConstraints={}}return t.prototype.add=function(t){var e=this.constraints.map((function(t){return t.order})).lastIndexOf(t.order),n=e+1;-1===e&&(n=(0,i.default)(this.constraints.map((function(t){return t.order})),t.order)),n===this.constraints.length?this.constraints.push(t):this.constraints.splice(n,0,t),null!==this.typedConstraints[t.getType()]&&void 0!==this.typedConstraints[t.getType()]||(this.typedConstraints[t.getType()]=[]),this.typedConstraints[t.getType()].push(t)},t.prototype.addConstraintArray=function(t){for(var e=0;e0},t.prototype.hasType=function(t){return 0!==this.getConstraintsForType(t).length},t.prototype.all=function(){return this.constraints},t.prototype.get=function(t){return this.constraints[t]},t.prototype.getConstraintsForType=function(t){var e=this.typedConstraints[t];return null==e&&(e=[]),e},t.prototype.clear=function(){var t=this.constraints.slice();return this.constraints=[],this.typedConstraints={},t},t.prototype.clearConstraintsByType=function(t){var e=this.typedConstraints[t];return delete this.typedConstraints[t],null===e?e=[]:0===e.length&&(this.constraints=this.constraints.filter((function(e){return e.getType()!==t}))),e},t.prototype.copy=function(){var e=new t;return e.addConstraints(this),e},t.prototype.size=function(){return this.constraints.length},t}();e.Constraints=o},2841:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RawConstraint=void 0;var o=n(8007),a=function(t){function e(e,n,r,i){void 0===i&&(i=null);var o=t.call(this,e,n,i)||this;return o.sql=r,o}return i(e,t),e.prototype.buildSql=function(){var t=this.sql;return t.toUpperCase().startsWith(o.Constraint.CONSTRAINT)||(t=this.buildNameSql()+t),t},e}(o.Constraint);e.RawConstraint=a},4033:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableColumn=void 0;var n=function(){function t(t,e,n,r,i,o,a,s,u,l){this.index=t,this.name=e,this.type=n,this.dataType=r,this.max=i,this.notNull=o,this.defaultValueString=a,this.defaultValue=s,this.primaryKey=u,this.autoincrement=l}return t.prototype.getIndex=function(){return this.index},t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getDataType=function(){return this.dataType},t.prototype.isDataType=function(t){return this.dataType===t},t.prototype.getMax=function(){return this.max},t.prototype.isNotNull=function(){return this.notNull},t.prototype.getDefaultValueString=function(){return this.defaultValueString},t.prototype.getDefaultValue=function(){return this.defaultValue},t.prototype.isPrimaryKey=function(){return this.primaryKey},t.prototype.isAutoIncrement=function(){return this.autoincrement},t}();e.TableColumn=n},4980:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableConstraints=void 0;var r=n(3765),i=n(7686),o=function(){function t(){this.constraints=new i.Constraints,this.columnConstraints={}}return t.prototype.addTableConstraint=function(t){this.constraints.add(t)},t.prototype.addTableConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.getTableConstraints=function(){return this.constraints},t.prototype.getTableConstraint=function(t){return t>=this.constraints.size()?null:this.constraints.get(t)},t.prototype.numTableConstraints=function(){return this.constraints.size()},t.prototype.addColumnConstraint=function(t,e){this.getOrCreateColumnConstraints(t).addConstraint(e)},t.prototype.addConstraints=function(t,e){this.getOrCreateColumnConstraints(t).addConstraints(e)},t.prototype.addColumnConstraints=function(t){this.getOrCreateColumnConstraints(t.name).addColumnConstraints(t)},t.prototype.getOrCreateColumnConstraints=function(t){var e=this.columnConstraints[t];return null==e&&(e=new r.ColumnConstraints(t),this.columnConstraints[t]=e),e},t.prototype.addColumnConstraintsMap=function(t){var e=this;t.forEach((function(t){e.addColumnConstraints(t)}))},t.prototype.getColumnConstraintsMap=function(){return this.columnConstraints},t.prototype.getColumnsWithConstraints=function(){return Array.from(Object.keys(this.columnConstraints))},t.prototype.getColumnConstraints=function(t){return this.columnConstraints[t]},t.prototype.getColumnConstraint=function(t,e){var n=null,r=this.getColumnConstraints(t);return null!=r&&(n=r.getConstraint(e)),n},t.prototype.numColumnConstraints=function(t){var e=0,n=this.getColumnConstraints(t);return null!=n&&(e=n.numConstraints()),e},t.prototype.addAllConstraints=function(t){null!=t&&(this.addTableConstraints(t.getTableConstraints()),this.addColumnConstraintsMap(t.getColumnConstraintsMap()))},t.prototype.hasConstraints=function(){return this.hasTableConstraints()||this.hasColumnConstraints()},t.prototype.hasTableConstraints=function(){return this.constraints.has()},t.prototype.hasColumnConstraints=function(){return Object.keys(this.columnConstraints).length>0},t.prototype.hasColumnConstraintsForColumn=function(t){return this.numColumnConstraints(t)>0},t}();e.TableConstraints=o},5045:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.TableInfo=void 0;var i=n(4033),o=n(7319),a=n(9211),s=n(7043),u=n(175),l=n(5329),c=function(){function t(t,e){var n=this;this.namesToColumns=new Map,this.primaryKeys=[],this.tableName=t,this.columns=e,e.forEach((function(t){n.namesToColumns.set(t.getName(),t),t.isPrimaryKey()&&n.primaryKeys.push(t)}))}return t.prototype.getTableName=function(){return this.tableName},t.prototype.numColumns=function(){return this.columns.length},t.prototype.getColumns=function(){return this.columns.slice()},t.prototype.getColumnAtIndex=function(t){if(t<0||t>=this.columns.length)throw new Error("Column index: "+t+", not within range 0 to "+(this.columns.length-1));return this.columns[t]},t.prototype.hasColumn=function(t){return null!==this.getColumn(t)&&void 0!==this.getColumn(t)},t.prototype.getColumn=function(t){return this.namesToColumns.get(t)},t.prototype.hasPrimaryKey=function(){return 0!==this.primaryKeys.length},t.prototype.getPrimaryKeys=function(){return this.primaryKeys.slice()},t.prototype.getPrimaryKey=function(){var t=null;return this.hasPrimaryKey()&&(t=this.primaryKeys[0]),t},t.info=function(e,n){var o="PRAGMA table_info("+l.StringUtils.quoteWrap(n)+")",a=e.all(o,null),c=[];a.forEach((function(o){var a=o.cid,l=o.name,h=o.type,f=1===o.notnull,p=o.dflt_value,d=1===o.pk,y=!1;d&&(y=1===e.all("SELECT tbl_name FROM "+s.SQLiteMaster.TABLE_NAME+" WHERE "+u.SQLiteMasterColumn.nameFromType(u.SQLiteMasterColumn.TBL_NAME)+"=? AND "+u.SQLiteMasterColumn.nameFromType(u.SQLiteMasterColumn.SQL)+" LIKE ?",[n,"%AUTOINCREMENT%"]).length);var m=null;if(null!=h&&h.endsWith(")")){var g=h.indexOf("(");if(g>-1){var _=h.substring(g+1,h.length-1);if(0!==_.length)try{m=parseInt(_),h=h.substring(0,g)}catch(t){r.error(t)}}}var b=t.getDataType(h),v=void 0;o.dflt_value&&(v=o.dflt_value.replace(/\\'/g,""));var T=new i.TableColumn(a,l,h,b,m,f,p,v,d,y);c.push(T)}));var h=null;return 0!==c.length&&(h=new t(n,c)),h},t.getDataType=function(t){var e=o.GeoPackageDataType.fromName(t);null==e&&(null!=a.GeometryType.fromName(t)&&(e=o.GeoPackageDataType.BLOB));return e},t.CID="cid",t.NAME="name",t.TYPE="type",t.NOT_NULL="notnull",t.DFLT_VALUE="dflt_value",t.PK="pk",t.DEFAULT_NULL="NULL",t}();e.TableInfo=c},1648:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0&&(t=t.concat(", ")),t=t.concat(r.getName())}return t.concat(")")},e.prototype.copy=function(){return new(e.bind.apply(e,a([void 0,this.name],o(this.columns),!1)))},e.prototype.add=function(){for(var t=this,e=[],n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableCreator=void 0;var r=n(5965),i=n(5042),o=function(){function t(t){this.geopackage=t,this.connection=t.database}return t.prototype.createRequired=function(){var t=new r.SpatialReferenceSystemDao(this.geopackage);return this.createSpatialReferenceSystem(),this.createContents(),t.createUndefinedGeographic(),t.createWgs84(),t.createUndefinedCartesian(),t.createWebMercator(),!0},t.prototype.createSpatialReferenceSystem=function(){return this.createTable("spatial_reference_system")},t.prototype.createContents=function(){return this.createTable("contents")},t.prototype.createGeometryColumns=function(){return this.createTable("geometry_columns")},t.prototype.createTileMatrixSet=function(){return this.createTable("tile_matrix_set")},t.prototype.createTileMatrix=function(){return this.createTable("tile_matrix")},t.prototype.createDataColumns=function(){return this.createTable("data_columns")},t.prototype.createDataColumnConstraints=function(){return this.createTable("data_column_constraints")},t.prototype.createMetadata=function(){return this.createTable("metadata")},t.prototype.createMetadataReference=function(){return this.createTable("metadata_reference")},t.prototype.createExtensions=function(){return this.createTable("extensions")},t.prototype.createTableIndex=function(){return this.createTable("table_index")},t.prototype.createGeometryIndex=function(){return this.createTable("geometry_index")},t.prototype.createFeatureTileLink=function(){return this.createTable("feature_tile_link")},t.prototype.createExtendedRelations=function(){return this.createTable("extended_relations")},t.prototype.createContentsId=function(){return this.createTable("contents_id")},t.prototype.createTileScaling=function(){return this.createTable("tile_scaling")},t.prototype.createTable=function(e){for(var n=!0,r=t.tableCreationScripts[e],i=0;i 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_x_size_update'BEFORE UPDATE OF pixel_x_size ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: pixel_x_size must be greater than 0')WHERE NOT (NEW.pixel_x_size > 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_y_size_insert'BEFORE INSERT ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table ''gpkg_tile_matrix'' violates constraint: pixel_y_size must be greater than 0')WHERE NOT (NEW.pixel_y_size > 0);END","CREATE TRIGGER 'gpkg_tile_matrix_pixel_y_size_update'BEFORE UPDATE OF pixel_y_size ON 'gpkg_tile_matrix'FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table ''gpkg_tile_matrix'' violates constraint: pixel_y_size must be greater than 0')WHERE NOT (NEW.pixel_y_size > 0);END"],data_columns:["CREATE TABLE gpkg_data_columns ( table_name TEXT NOT NULL, column_name TEXT NOT NULL, name TEXT, title TEXT, description TEXT, mime_type TEXT, constraint_name TEXT, CONSTRAINT pk_gdc PRIMARY KEY (table_name, column_name), CONSTRAINT gdc_tn UNIQUE (table_name, name))"],data_column_constraints:['CREATE TABLE gpkg_data_column_constraints ( constraint_name TEXT NOT NULL, constraint_type TEXT NOT NULL, /* "range" | "enum" | "glob" */ value TEXT, min NUMERIC, min_is_inclusive BOOLEAN, /* 0 = false, 1 = true */ max NUMERIC, max_is_inclusive BOOLEAN, /* 0 = false, 1 = true */ description TEXT, CONSTRAINT gdcc_ntv UNIQUE (constraint_name, constraint_type, value))'],metadata:['CREATE TABLE gpkg_metadata ( id INTEGER CONSTRAINT m_pk PRIMARY KEY ASC NOT NULL, md_scope TEXT NOT NULL DEFAULT "dataset", md_standard_uri TEXT NOT NULL, mime_type TEXT NOT NULL DEFAULT "text/xml", metadata TEXT NOT NULL)',"CREATE TRIGGER 'gpkg_metadata_md_scope_insert' BEFORE INSERT ON 'gpkg_metadata' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata violates constraint: md_scope must be one of undefined | fieldSession | collectionSession | series | dataset | featureType | feature | attributeType | attribute | tile | model | catalogue | schema | taxonomy software | service | collectionHardware | nonGeographicDataset | dimensionGroup') WHERE NOT(NEW.md_scope IN ('undefined','fieldSession','collectionSession','series','dataset', 'featureType','feature','attributeType','attribute','tile','model', 'catalogue','schema','taxonomy','software','service', 'collectionHardware','nonGeographicDataset','dimensionGroup')); END","CREATE TRIGGER 'gpkg_metadata_md_scope_update' BEFORE UPDATE OF 'md_scope' ON 'gpkg_metadata' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata violates constraint: md_scope must be one of undefined | fieldSession | collectionSession | series | dataset | featureType | feature | attributeType | attribute | tile | model | catalogue | schema | taxonomy software | service | collectionHardware | nonGeographicDataset | dimensionGroup') WHERE NOT(NEW.md_scope IN ('undefined','fieldSession','collectionSession','series','dataset', 'featureType','feature','attributeType','attribute','tile','model', 'catalogue','schema','taxonomy','software','service', 'collectionHardware','nonGeographicDataset','dimensionGroup')); END"],metadata_reference:["CREATE TABLE gpkg_metadata_reference ( reference_scope TEXT NOT NULL, table_name TEXT, column_name TEXT, row_id_value INTEGER, timestamp DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')), md_file_id INTEGER NOT NULL, md_parent_id INTEGER, CONSTRAINT crmr_mfi_fk FOREIGN KEY (md_file_id) REFERENCES gpkg_metadata(id), CONSTRAINT crmr_mpi_fk FOREIGN KEY (md_parent_id) REFERENCES gpkg_metadata(id))","CREATE TRIGGER 'gpkg_metadata_reference_reference_scope_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: reference_scope must be one of \"geopackage\", table\", \"column\", \"row\", \"row/col\"') WHERE NOT NEW.reference_scope IN ('geopackage','table','column','row','row/col'); END","CREATE TRIGGER 'gpkg_metadata_reference_reference_scope_update' BEFORE UPDATE OF 'reference_scope' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: referrence_scope must be one of \"geopackage\", \"table\", \"column\", \"row\", \"row/col\"') WHERE NOT NEW.reference_scope IN ('geopackage','table','column','row','row/col'); END","CREATE TRIGGER 'gpkg_metadata_reference_column_name_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: column name must be NULL when reference_scope is \"geopackage\", \"table\" or \"row\"') WHERE (NEW.reference_scope IN ('geopackage','table','row') AND NEW.column_name IS NOT NULL); SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: column name must be defined for the specified table when reference_scope is \"column\" or \"row/col\"') WHERE (NEW.reference_scope IN ('column','row/col') AND NOT NEW.table_name IN ( SELECT name FROM SQLITE_MASTER WHERE type = 'table' AND name = NEW.table_name AND sql LIKE ('%' || NEW.column_name || '%'))); END","CREATE TRIGGER 'gpkg_metadata_reference_column_name_update' BEFORE UPDATE OF column_name ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: column name must be NULL when reference_scope is \"geopackage\", \"table\" or \"row\"') WHERE (NEW.reference_scope IN ('geopackage','table','row') AND NEW.column_nameIS NOT NULL); SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: column name must be defined for the specified table when reference_scope is \"column\" or \"row/col\"') WHERE (NEW.reference_scope IN ('column','row/col') AND NOT NEW.table_name IN ( SELECT name FROM SQLITE_MASTER WHERE type = 'table' AND name = NEW.table_name AND sql LIKE ('%' || NEW.column_name || '%'))); END","CREATE TRIGGER 'gpkg_metadata_reference_row_id_value_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: row_id_value must be NULL when reference_scope is \"geopackage\", \"table\" or \"column\"') WHERE NEW.reference_scope IN ('geopackage','table','column') AND NEW.row_id_value IS NOT NULL; END ","CREATE TRIGGER 'gpkg_metadata_reference_row_id_value_update' BEFORE UPDATE OF 'row_id_value' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: row_id_value must be NULL when reference_scope is \"geopackage\", \"table\" or \"column\"') WHERE NEW.reference_scope IN ('geopackage','table','column') AND NEW.row_id_value IS NOT NULL; END","CREATE TRIGGER 'gpkg_metadata_reference_timestamp_insert' BEFORE INSERT ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'insert on table gpkg_metadata_reference violates constraint: timestamp must be a valid time in ISO 8601 \"yyyy-mm-ddThh:mm:ss.cccZ\" form') WHERE NOT (NEW.timestamp GLOB '[1-2][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]Z' AND strftime('%s',NEW.timestamp) NOT NULL); END","CREATE TRIGGER 'gpkg_metadata_reference_timestamp_update' BEFORE UPDATE OF 'timestamp' ON 'gpkg_metadata_reference' FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'update on table gpkg_metadata_reference violates constraint: timestamp must be a valid time in ISO 8601 \"yyyy-mm-ddThh:mm:ss.cccZ\" form') WHERE NOT (NEW.timestamp GLOB '[1-2][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]Z' AND strftime('%s',NEW.timestamp) NOT NULL); END "],extensions:["CREATE TABLE gpkg_extensions ( table_name TEXT, column_name TEXT, extension_name TEXT NOT NULL, definition TEXT NOT NULL, scope TEXT NOT NULL, CONSTRAINT ge_tce UNIQUE (table_name, column_name, extension_name))"],table_index:["CREATE TABLE nga_table_index ( table_name TEXT NOT NULL PRIMARY KEY, last_indexed DATETIME)"],geometry_index:["CREATE TABLE nga_geometry_index ( table_name TEXT NOT NULL, geom_id INTEGER NOT NULL, min_x DOUBLE NOT NULL, max_x DOUBLE NOT NULL, min_y DOUBLE NOT NULL, max_y DOUBLE NOT NULL, min_z DOUBLE, max_z DOUBLE, min_m DOUBLE, max_m DOUBLE, CONSTRAINT pk_ngi PRIMARY KEY (table_name, geom_id), CONSTRAINT fk_ngi_nti_tn FOREIGN KEY (table_name) REFERENCES nga_table_index(table_name))"],feature_tile_link:["CREATE TABLE nga_feature_tile_link ( feature_table_name TEXT NOT NULL, tile_table_name TEXT NOT NULL, CONSTRAINT pk_nftl PRIMARY KEY (feature_table_name, tile_table_name))"],extended_relations:["CREATE TABLE gpkgext_relations ( id INTEGER PRIMARY KEY AUTOINCREMENT, base_table_name TEXT NOT NULL, base_primary_column TEXT NOT NULL DEFAULT 'id', related_table_name TEXT NOT NULL, related_primary_column TEXT NOT NULL DEFAULT 'id', relation_name TEXT NOT NULL, mapping_table_name TEXT NOT NULL UNIQUE)"],contents_id:["CREATE TABLE nga_contents_id ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, table_name TEXT NOT NULL, CONSTRAINT uk_nci_table_name UNIQUE (table_name), CONSTRAINT fk_nci_gc_tn FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name))"],tile_scaling:["CREATE TABLE nga_tile_scaling ( table_name TEXT PRIMARY KEY NOT NULL, scaling_type TEXT NOT NULL, zoom_in INTEGER, zoom_out INTEGER, CONSTRAINT fk_nts_gtms_tn FOREIGN KEY (table_name) REFERENCES gpkg_tile_matrix_set (table_name), CHECK (scaling_type in ('in','out','in_out','out_in','closest_in_out','closest_out_in')))"]},t}();e.TableCreator=o},2431:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TableMapping=void 0;var i=r(n(4293)),o=r(n(8446)),a=r(n(3674)),s=r(n(2628)),u=n(1790),l=function(){function t(t,e,n){var r=this;this._transferContent=!0,this._columns={},this._droppedColumns=new Set,this._fromTable=t,this._toTable=e,n.forEach((function(t){r.addMappedColumn(new u.MappedColumn(t.name,t.name,t.defaultValue,t.dataType))}))}return t.fromTableInfo=function(e){var n=new t(e.getTableName(),e.getTableName(),[]);return e.getColumns().forEach((function(t){n.addMappedColumn(new u.MappedColumn(t.getName(),t.getName(),t.getDefaultValue(),t.getDataType()))})),n},Object.defineProperty(t.prototype,"fromTable",{get:function(){return this._fromTable},set:function(t){this._fromTable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toTable",{get:function(){return this._toTable},set:function(t){this._toTable=t},enumerable:!1,configurable:!0}),t.prototype.isNewTable=function(){return!(0,i.default)(this._toTable)&&!(0,o.default)(this._toTable,this._fromTable)},t.prototype.isTransferContent=function(){return this._transferContent},Object.defineProperty(t.prototype,"transferContent",{set:function(t){this._transferContent=t},enumerable:!1,configurable:!0}),t.prototype.addMappedColumn=function(t){this._columns[t.toColumn]=t},t.prototype.addColumnWithName=function(t){this._columns[t]=new u.MappedColumn(t,null,null,null)},t.prototype.removeColumn=function(t){var e=this._columns[t];return delete this._columns[t],e},t.prototype.getColumnNames=function(){return(0,a.default)(this._columns)},t.prototype.getColumns=function(){return this._columns},t.prototype.getMappedColumns=function(){return(0,s.default)(this._columns)},t.prototype.getColumn=function(t){return this._columns[t]},t.prototype.addDroppedColumn=function(t){this._droppedColumns.add(t)},t.prototype.removeDroppedColumn=function(t){return this._droppedColumns.delete(t)},Object.defineProperty(t.prototype,"droppedColumns",{get:function(){return this._droppedColumns},enumerable:!1,configurable:!0}),t.prototype.isDroppedColumn=function(t){return this._droppedColumns.has(t)},t.prototype.hasWhere=function(){return!(0,i.default)(this._where)},Object.defineProperty(t.prototype,"where",{get:function(){return this._where},set:function(t){this._where=t},enumerable:!1,configurable:!0}),t}();e.TableMapping=l},8140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseExtension=void 0;var r=n(624),i=function(){function t(t){this.geoPackage=t,this.connection=t.connection,this.extensionsDao=t.extensionDao}return t.prototype.getOrCreate=function(t,e,n,r,i){var o=this.getExtension(t,e,n);return o.length?o[0]:(this.extensionsDao.createTable(),this.createExtension(t,e,n,r,i),this.getExtension(t,e,n)[0])},t.prototype.getExtension=function(t,e,n){return this.extensionsDao.isTableExists()?this.extensionsDao.queryByExtensionAndTableNameAndColumnName(t,e,n):[]},t.prototype.hasExtension=function(t,e,n){return!!this.getExtension(t,e,n).length},t.prototype.hasExtensions=function(t){return 0!==this.extensionsDao.queryAllByExtension(t).length},t.prototype.createExtension=function(t,e,n,i,o){var a=new r.Extension;return a.table_name=e,a.column_name=n,a.extension_name=t,a.definition=i,a.scope=o,this.extensionsDao.create(a)},t}();e.BaseExtension=i},4650:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsId=void 0;e.ContentsId=function(){}},7092:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsIdDao=void 0;var o=n(4115),a=n(4650),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=["id"],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.ContentsId;return t&&(e.id=t.id,e.table_name=t.table_name),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createContentsId()},e.prototype.getTableNames=function(){for(var t=[],e=this.queryForColumns("table_name"),n=0;n0?n[0]:null},e.prototype.deleteByTableName=function(t){return this.deleteWhere(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t))},e.TABLE_NAME="nga_contents_id",e.COLUMN_ID="id",e.COLUMN_TABLE_NAME="table_name",e}(o.Dao);e.ContentsIdDao=s},1314:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ContentsIdExtension=void 0;var o=n(8140),a=n(624),s=n(7092),u=n(6638),l=function(t){function e(e){var n=t.call(this,e)||this;return n.contentsIdDao=e.contentsIdDao,n}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,null,null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE);return this.contentsIdDao.createTable(),t},Object.defineProperty(e.prototype,"dao",{get:function(){return this.contentsIdDao},enumerable:!1,configurable:!0}),e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)&&this.contentsIdDao.isTableExists()},e.prototype.get=function(t){var e=null;return t&&t.table_name&&(e=this.getByTableName(t.table_name)),e},e.prototype.getByTableName=function(t){var e=null;return this.contentsIdDao.isTableExists()&&(e=this.contentsIdDao.queryForTableName(t)),e},e.prototype.getId=function(t){var e=null;return t&&t.table_name&&(e=this.getIdByTableName(t.table_name)),e},e.prototype.getIdByTableName=function(t){var e=null;if(this.contentsIdDao.isTableExists()){var n=this.contentsIdDao.queryForTableName(t);n&&(e=n.id)}return e},e.prototype.create=function(t){var e=null;return t&&t.table_name&&(e=this.createWithTableName(t.table_name)),e},e.prototype.createWithTableName=function(t){var e=this.contentsIdDao.createObject();return e.table_name=t,e.id=this.contentsIdDao.create(e),e},e.prototype.createId=function(t){var e=null;return t&&t.table_name&&(e=this.createIdWithTableName(t.table_name)),e},e.prototype.createIdWithTableName=function(t){return this.createWithTableName(t)},e.prototype.getOrCreateId=function(t){var e=null;return t&&t.table_name&&(e=this.getOrCreateIdByTableName(t.table_name)),e},e.prototype.getOrCreateIdByTableName=function(t){var e=this.getByTableName(t);return null==e&&(e=this.createWithTableName(t)),e},e.prototype.deleteId=function(t){var e=0;return t&&t.table_name&&(e=this.deleteIdByTableName(t.table_name)),e},e.prototype.deleteIdByTableName=function(t){return this.contentsIdDao.deleteByTableName(t)},e.prototype.count=function(){var t=0;return this.has()&&(t=this.contentsIdDao.count()),t},e.prototype.createIds=function(t){void 0===t&&(t="");for(var e=this.getMissing(t),n=0;n0&&(r+=u.ContentsDao.COLUMN_DATA_TYPE,r+=" = ?",i.push(t)),r.length>0&&(n+=" WHERE "+r),n+=")",e=this.connection.all(n,i)}return e},e.prototype.getMissing=function(t){void 0===t&&(t="");var e="SELECT "+u.ContentsDao.COLUMN_TABLE_NAME+" FROM "+u.ContentsDao.TABLE_NAME,n="",r=[];return null!=t&&t.length>0&&(n+=u.ContentsDao.COLUMN_DATA_TYPE,n+=" = ?",r.push(t)),this.has()&&(n.length>0&&(n+=" AND "),n+=u.ContentsDao.COLUMN_TABLE_NAME,n+=" NOT IN (SELECT ",n+=s.ContentsIdDao.COLUMN_TABLE_NAME,n+=" FROM ",n+=s.ContentsIdDao.TABLE_NAME,n+=")"),n.length>0&&(e+=" WHERE "+n),this.connection.all(e,r)},e.prototype.removeExtension=function(){this.contentsIdDao.isTableExists()&&this.geoPackage.deleteTable(s.ContentsIdDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_NAME="nga_contents_id",e.EXTENSION_AUTHOR="nga",e.EXTENSION_NAME_NO_AUTHOR="contents_id",e.EXTENSION_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/contents-id.html",e}(o.BaseExtension);e.ContentsIdExtension=l},5306:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CrsWktExtension=void 0;var o=n(624),a=function(t){function e(n){var r=t.call(this,n)||this;return r.extensionName=e.EXTENSION_NAME,r.extensionDefinition=e.EXTENSION_CRS_WKT_DEFINITION,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,null,null,this.extensionDefinition,o.Extension.READ_WRITE)},e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)},e.prototype.removeExtension=function(){try{this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)}catch(t){throw new Error("Failed to delete CrsWkt extension. GeoPackage: "+this.geoPackage.name)}},e.EXTENSION_NAME="gpkg_crs_wkt",e.EXTENSION_CRS_WKT_AUTHOR="gpkg",e.EXTENSION_CRS_WKT_NAME_NO_AUTHOR="crs_wkt",e.EXTENSION_CRS_WKT_DEFINITION="http://www.geopackage.org/spec/#extension_crs_wkt",e}(n(8140).BaseExtension);e.CrsWktExtension=a},624:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extension=void 0;var n=function(){function t(){}return t.prototype.setExtensionName=function(e,n){this.extension_name=t.buildExtensionName(e,n)},Object.defineProperty(t.prototype,"author",{get:function(){return t.getAuthorWithExtensionName(this.extension_name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionNameNoAuthor",{get:function(){return t.getExtensionNameNoAuthor(this.extension_name)},enumerable:!1,configurable:!0}),t.buildExtensionName=function(e,n){return e+t.EXTENSION_NAME_DIVIDER+n},t.getAuthorWithExtensionName=function(e){return e.split(t.EXTENSION_NAME_DIVIDER)[0]},t.getExtensionNameNoAuthor=function(e){return e.slice(e.indexOf(t.EXTENSION_NAME_DIVIDER)+1)},t.prototype.getTableName=function(){return this.table_name},t.prototype.setTableName=function(t){this.table_name=t,null==t&&(this.column_name=null)},t.EXTENSION_NAME_DIVIDER="_",t.READ_WRITE="read-write",t.WRITE_ONLY="write-only",t}();e.Extension=n},5698:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionDao=void 0;var a=n(624),s=n(4115),u=n(8572),l=n(1459),c=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME,e.COLUMN_COLUMN_NAME,e.COLUMN_EXTENSION_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.Extension;return e.table_name=t.table_name,e.column_name=t.column_name,e.extension_name=t.extension_name,e.definition=t.definition,e.scope=t.scope,e},e.prototype.queryByExtension=function(t){var n=this.queryForAllEq(e.COLUMN_EXTENSION_NAME,t);if(n[0])return this.createObject(n[0])},e.prototype.queryAllByExtension=function(t){var n,r,i=[];try{for(var a=o(this.queryForAllEq(e.COLUMN_EXTENSION_NAME,t)),s=a.next();!s.done;s=a.next()){var u=s.value,l=this.createObject(u);i.push(l)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.queryByExtensionAndTableName=function(t,n){var r,i,a=new u.ColumnValues;a.addColumn(e.COLUMN_EXTENSION_NAME,t),a.addColumn(e.COLUMN_TABLE_NAME,n);var s=[];try{for(var l=o(this.queryForFieldValues(a)),c=l.next();!c.done;c=l.next()){var h=c.value;s.push(this.createObject(h))}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s},e.prototype.queryByExtensionAndTableNameAndColumnName=function(t,n,r){var i,a,s=new u.ColumnValues;s.addColumn(e.COLUMN_EXTENSION_NAME,t),null!=n&&s.addColumn(e.COLUMN_TABLE_NAME,n),null!=r&&s.addColumn(e.COLUMN_COLUMN_NAME,r);var l=[];try{for(var c=o(this.queryForFieldValues(s)),h=c.next();!h.done;h=c.next()){var f=h.value,p=this.createObject(f);l.push(p)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return l},e.prototype.createTable=function(){return new l.TableCreator(this.geoPackage).createExtensions()},e.prototype.deleteByExtension=function(t){var n=new u.ColumnValues;return n.addColumn(e.COLUMN_EXTENSION_NAME,t),this.deleteWhere(this.buildWhere(n,"="),this.buildWhereArgs(n))},e.prototype.deleteByExtensionAndTableName=function(t,n){var r=new u.ColumnValues;return r.addColumn(e.COLUMN_EXTENSION_NAME,t),r.addColumn(e.COLUMN_TABLE_NAME,n),this.deleteWhere(this.buildWhere(r,"and"),this.buildWhereArgs(r))},e.prototype.deleteByExtensionAndTableNameAndColumnName=function(t,n,r){var i=new u.ColumnValues;return i.addColumn(e.COLUMN_EXTENSION_NAME,t),i.addColumn(e.COLUMN_TABLE_NAME,n),i.addColumn(e.COLUMN_COLUMN_NAME,r),this.deleteWhere(this.buildWhere(i,"and"),this.buildWhereArgs(i))},e.TABLE_NAME="gpkg_extensions",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_EXTENSION_NAME="extension_name",e.COLUMN_DEFINITION="definition",e.COLUMN_SCOPE="scope",e}(s.Dao);e.ExtensionDao=c},9406:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageExtensions=void 0;var i=n(6131),o=n(5859),a=n(1832),s=n(5045),u=n(5042),l=n(362),c=n(8314),h=n(2431),f=n(8904),p=n(8116),d=n(4941),y=n(1459),m=n(1133),g=n(3501),_=n(2056),b=n(5306),v=function(){function t(){}return t.deleteTableExtensions=function(e,n){i.NGAExtensions.deleteTableExtensions(e,n),t.deleteRTreeSpatialIndex(e,n),t.deleteRelatedTables(e,n),t.deleteSchema(e,n),t.deleteMetadata(e,n),t.deleteExtensionForTable(e,n)},t.deleteExtensions=function(t){i.NGAExtensions.deleteExtensions(t),this.deleteRTreeSpatialIndexExtension(t),this.deleteRelatedTablesExtension(t),this.deleteSchemaExtension(t),this.deleteMetadataExtension(t),this.deleteCrsWktExtension(t),this.delete(t)},t.copyTableExtensions=function(e,n,o){try{t.copyRTreeSpatialIndex(e,n,o),t.copyRelatedTables(e,n,o),t.copySchema(e,n,o),t.copyMetadata(e,n,o),i.NGAExtensions.copyTableExtensions(e,n,o)}catch(t){r.warn("Failed to copy extensions for table: "+o+", copied from table: "+n,t)}},t.deleteExtensionForTable=function(t,e){var n=t.extensionDao;try{n.isTableExists()&&n.deleteByExtension(e)}catch(n){throw new Error("Failed to delete Table extensions. GeoPackage: "+t.name+", Table: "+e)}},t.delete=function(t){var e=t.extensionDao;try{e.isTableExists()&&t.dropTable(e.gpkgTableName)}catch(e){throw new Error("Failed to delete all extensions. GeoPackage: "+t.name)}},t.deleteRTreeSpatialIndex=function(e,n){var r=t.getRTreeIndexExtension(e);r.has(n)&&r.deleteTable(n)},t.deleteRTreeSpatialIndexExtension=function(e){var n=t.getRTreeIndexExtension(e);n.has()&&n.deleteAll()},t.copyRTreeSpatialIndex=function(e,n,i){try{var o=t.getRTreeIndexExtension(e);if(o.has(n)){var a=e.geometryColumnsDao.queryForTableName(i);if(null!=a){var u=s.TableInfo.info(e.connection,i);if(null!=u){var l=u.getPrimaryKey().getName();o.createWithParameters(i,a.column_name,l)}}}}catch(t){r.warn("Failed to create RTree for table: "+i+", copied from table: "+n,t)}},t.getRTreeIndexExtension=function(t){return new o.RTreeIndex(t,null)},t.deleteRelatedTables=function(e,n){var r=t.getRelatedTableExtension(e);r.has()&&r.removeRelationships(n)},t.deleteRelatedTablesExtension=function(e){var n=t.getRelatedTableExtension(e);n.has()&&n.removeExtension()},t.copyRelatedTables=function(e,n,i){try{var o=t.getRelatedTableExtension(e);if(o.has()){var p=o.extendedRelationDao,d=e.extensionDao;p.getBaseTableRelations(n).forEach((function(t){var r=t.mapping_table_name,o=d.queryByExtensionAndTableName(a.RelatedTablesExtension.EXTENSION_NAME,r).concat(d.queryByExtensionAndTableName(a.RelatedTablesExtension.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,r));if(o.length>0){var p=u.CoreSQLUtils.createName(e.connection,r,n,i),y=new l.UserCustomTableReader(r).readTable(e.connection);c.AlterTable.copyTable(e.connection,y,p);var m=o[0];m.setTableName(p),d.create(m);var g=h.TableMapping.fromTableInfo(s.TableInfo.info(e.connection,f.ExtendedRelationDao.TABLE_NAME));g.removeColumn(f.ExtendedRelationDao.ID);var _=g.getColumn(f.ExtendedRelationDao.BASE_TABLE_NAME);_.constantValue=i,_.whereValue=n;var b=g.getColumn(f.ExtendedRelationDao.MAPPING_TABLE_NAME);b.constantValue=p,b.whereValue=r,u.CoreSQLUtils.transferTableContentForTableMapping(e.connection,g)}}))}}catch(t){r.warn("Failed to create Related Tables for table: "+i+", copied from table: "+n,t)}},t.getRelatedTableExtension=function(t){return new a.RelatedTablesExtension(t)},t.deleteSchema=function(t,e){var n=t.dataColumnsDao;try{n.isTableExists()&&n.deleteByTableName(e)}catch(n){throw new Error("Failed to delete Schema extension. GeoPackage: "+t.name+", Table: "+e)}},t.deleteSchemaExtension=function(t){var e=new p.SchemaExtension(t);e.has()&&e.removeExtension()},t.copySchema=function(t,e,n){try{if(t.isTable(d.DataColumnsDao.TABLE_NAME)){var i=new l.UserCustomTableReader(d.DataColumnsDao.TABLE_NAME).readUserCustomTable(t),o=i.getColumnWithColumnName(d.DataColumnsDao.COLUMN_NAME);if(o.hasConstraints()){if(o.clearConstraints(),i.hasConstraints()){i.clearConstraints();var a=y.TableCreator.tableCreationScripts.data_columns[0],s=m.ConstraintParser.getConstraints(a);i.addConstraints(s.getTableConstraints())}c.AlterTable.alterColumnForTable(t.connection,i,o)}u.CoreSQLUtils.transferTableContent(t.connection,d.DataColumnsDao.TABLE_NAME,d.DataColumnsDao.COLUMN_TABLE_NAME,n,e)}}catch(t){r.warn("Failed to create Schema for table: "+n+", copied from table: "+e,t)}},t.deleteMetadata=function(t,e){var n=t.metadataReferenceDao;try{n.isTableExists()&&n.deleteByTableName(e)}catch(n){throw new Error("Failed to delete Metadata extension. GeoPackage: "+t.name+", Table: "+e)}},t.deleteMetadataExtension=function(t){var e=new g.MetadataExtension(t);e.has()&&e.removeExtension()},t.copyMetadata=function(t,e,n){try{t.isTable(_.MetadataReferenceDao.TABLE_NAME)&&u.CoreSQLUtils.transferTableContent(t.connection,_.MetadataReferenceDao.TABLE_NAME,_.MetadataReferenceDao.COLUMN_TABLE_NAME,n,e)}catch(t){r.warn("Failed to create Metadata for table: "+n+", copied from table: "+e,t)}},t.deleteCrsWktExtension=function(t){var e=new b.CrsWktExtension(t);e.has()&&e.removeExtension()},t}();e.GeoPackageExtensions=v},5626:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=r}return!1}catch(t){return!1}},e.prototype.getFeatureTableIndexExtension=function(){return this.getExtension(this.extensionName,this.tableName,this.columnName)[0]},e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,this.tableName,this.columnName,this.extensionDefinition,l.Extension.READ_WRITE)},e.prototype.getOrCreateTableIndex=function(){return this.tableIndex||(this.tableIndexDao.createTable(),this.createTableIndex(),this.tableIndex)},e.prototype.createTableIndex=function(){var t=new c.TableIndex;return t.table_name=this.tableName,t.last_indexed=new Date,this.tableIndexDao.create(t)},Object.defineProperty(e.prototype,"tableIndex",{get:function(){return this.tableIndexDao.isTableExists()?this.tableIndexDao.queryForId(this.tableName):void 0},enumerable:!1,configurable:!0}),e.prototype.createOrClearGeometryIndicies=function(){return this.geometryIndexDao.createTable(),this.clearGeometryIndicies()},e.prototype.clearGeometryIndicies=function(){var t=this.geometryIndexDao.buildWhereWithFieldAndValue(h.GeometryIndexDao.COLUMN_TABLE_NAME,this.tableName),e=this.geometryIndexDao.buildWhereArgs(this.tableName);return this.geometryIndexDao.deleteWhere(t,e)},e.prototype.indexTable=function(t){return o(this,void 0,void 0,(function(){var e=this;return a(this,(function(n){return[2,new Promise((function(n,r){setTimeout((function(){e.indexChunk(0,t,n,r)}))})).then((function(){return 1===e.updateLastIndexed(t)}))]}))}))},e.prototype.indexChunk=function(t,e,n,r){var i=this,o=this.featureDao.queryForChunk(100,t);o.length?(this.progress("Indexing "+100*t+" to "+100*(t+1)),o.forEach((function(t){var n=i.featureDao.getRow(t);i.indexRow(e,n.id,n.geometry)})),setTimeout((function(){i.indexChunk(++t,e,n,r)}))):n()},e.prototype.indexRow=function(t,e,n){if(!n)return!1;var r=n.envelope;if(!r){var i=n.geometry;i&&(r=p.EnvelopeBuilder.buildEnvelopeWithGeometry(i))}if(r){var o=this.geometryIndexDao.populate(t,e,r);return 1===this.geometryIndexDao.createOrUpdate(o)}return!1},e.prototype.updateLastIndexed=function(t){return t||((t=new c.TableIndex).table_name=this.tableName),t.last_indexed=(new Date).toISOString(),this.tableIndexDao.createOrUpdate(t)},e.prototype.queryWithBoundingBox=function(t,e){var n=t.projectBoundingBox(e,this.featureDao.projection).buildEnvelope();return this.queryWithGeometryEnvelope(n)},e.prototype.queryWithGeometryEnvelope=function(t){return this.rtreeIndexed?this.rtreeIndexDao.queryWithGeometryEnvelope(t):this.geometryIndexDao.queryWithGeometryEnvelope(t)},e.prototype.countWithBoundingBox=function(t,e){var n=t.projectBoundingBox(e,this.featureDao.projection).buildEnvelope();return this.countWithGeometryEnvelope(n)},e.prototype.countWithGeometryEnvelope=function(t){return this.rtreeIndexed?this.rtreeIndexDao.countWithGeometryEnvelope(t):this.geometryIndexDao.countWithGeometryEnvelope(t)},e.EXTENSION_GEOMETRY_INDEX_AUTHOR="nga",e.EXTENSION_GEOMETRY_INDEX_NAME_NO_AUTHOR="geometry_index",e.EXTENSION_NAME=l.Extension.buildExtensionName(e.EXTENSION_GEOMETRY_INDEX_AUTHOR,e.EXTENSION_GEOMETRY_INDEX_NAME_NO_AUTHOR),e.EXTENSION_GEOMETRY_INDEX_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/geometry-index.html",e}(u.BaseExtension);e.FeatureTableIndex=d},8021:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryIndex=void 0;var n=function(){function t(){}return Object.defineProperty(t.prototype,"tableIndex",{set:function(t){this.table_name=t.table_name},enumerable:!1,configurable:!0}),t}();e.GeometryIndex=n},9095:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryIndexDao=void 0;var o=n(4115),a=n(8021),s=n(1459),u=function(t){function e(n,r){var i=t.call(this,n)||this;return i.gpkgTableName=e.TABLE_NAME,i.idColumns=["table_name","geom_id"],i.featureDao=r,i}return i(e,t),e.prototype.createObject=function(t){var e=new a.GeometryIndex;return t&&(e.table_name=t.table_name,e.geom_id=t.geom_id,e.min_x=t.min_x,e.max_x=t.max_x,e.min_y=t.min_y,e.max_y=t.max_y,e.min_z=t.min_z,e.max_z=t.max_z,e.min_m=t.min_m,e.max_m=t.max_m),e},e.prototype.getTableIndex=function(t){return this.geoPackage.tableIndexDao.queryForId(t.table_name)},e.prototype.queryForTableName=function(t){return this.queryForEach(e.COLUMN_TABLE_NAME,t)},e.prototype.countByTableName=function(t){return this.count(e.COLUMN_TABLE_NAME,t)},e.prototype.populate=function(t,e,n){var r=new a.GeometryIndex;return r.tableIndex=t,r.geom_id=e,r.min_x=n.minX,r.min_y=n.minY,r.max_x=n.maxX,r.max_y=n.maxY,n.hasZ&&(r.min_z=n.minZ,r.max_z=n.maxZ),n.hasM&&(r.min_m=n.minM,r.max_m=n.maxM),r},e.prototype.createTable=function(){return!!this.isTableExists()||new s.TableCreator(this.geoPackage).createGeometryIndex()},e.prototype._generateGeometryEnvelopeQuery=function(t){var n=this.featureDao.gpkgTableName,r="";r+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,n),r+=" and ";var i=t.minX=")):(r+="(",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_X,t.maxX,"<="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_X,t.minX,">="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_X,t.minX,">="),r+=" or ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_X,t.maxX,"<="),r+=")"),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_Y,t.maxY,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_Y,t.minY,">=");var o=[n,t.maxX,t.minX];return i||o.push(t.minX,t.maxX),o.push(t.maxY,t.minY),t.hasZ&&(r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_Z,t.minZ,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_Z,t.maxZ,">="),o.push(t.maxZ,t.minZ)),t.hasM&&(r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MIN_M,t.minM,"<="),r+=" and ",r+=this.buildWhereWithFieldAndValue(e.COLUMN_MAX_M,t.maxM,">="),o.push(t.maxM,t.minM)),{join:'inner join "'+n+'" on "'+n+'".'+this.featureDao.idColumns[0]+" = "+e.COLUMN_GEOM_ID,where:r,whereArgs:o,tableNameArr:['"'+n+'".*']}},e.prototype.queryWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.queryJoinWhereWithArgs(e.join,e.where,e.whereArgs,e.tableNameArr)},e.prototype.countWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.countJoinWhereWithArgs(e.join,e.where,e.whereArgs)},e.TABLE_NAME="nga_geometry_index",e.COLUMN_TABLE_NAME=e.TABLE_NAME+".table_name",e.COLUMN_TABLE_NAME_FIELD="table_name",e.COLUMN_GEOM_ID=e.TABLE_NAME+".geom_id",e.COLUMN_MIN_X=e.TABLE_NAME+".min_x",e.COLUMN_MAX_X=e.TABLE_NAME+".max_x",e.COLUMN_MIN_Y=e.TABLE_NAME+".min_y",e.COLUMN_MAX_Y=e.TABLE_NAME+".max_y",e.COLUMN_MIN_Z=e.TABLE_NAME+".min_z",e.COLUMN_MAX_Z=e.TABLE_NAME+".max_z",e.COLUMN_MIN_M=e.TABLE_NAME+".min_m",e.COLUMN_MAX_M=e.TABLE_NAME+".max_m",e}(o.Dao);e.GeometryIndexDao=u},7049:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableIndex=void 0;e.TableIndex=function(){}},9581:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TableIndexDao=void 0;var o=n(4115),a=n(1459),s=n(7049),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.TableIndex;return t&&(e.table_name=t.table_name,e.last_indexed=t.last_indexed),e},e.prototype.createTable=function(){return new a.TableCreator(this.geoPackage).createTableIndex()},e.TABLE_NAME="nga_table_index",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_LAST_INDEXED="last_indexed",e}(o.Dao);e.TableIndexDao=u},3501:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataExtension=void 0;var o=n(8140),a=n(624),s=n(2056),u=n(663),l=function(t){function e(n){var r=t.call(this,n)||this;return r.extensionName=e.EXTENSION_NAME,r.extensionDefinition=e.EXTENSION_Metadata_DEFINITION,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(this.extensionName,null,null,this.extensionDefinition,a.Extension.READ_WRITE)},e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,null,null)},e.prototype.removeExtension=function(){this.geoPackage.isTable(s.MetadataReferenceDao.TABLE_NAME)&&this.geoPackage.dropTable(s.MetadataReferenceDao.TABLE_NAME),this.geoPackage.isTable(u.MetadataDao.TABLE_NAME)&&this.geoPackage.dropTable(u.MetadataDao.TABLE_NAME);try{this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)}catch(t){throw new Error("Failed to delete Schema extension. GeoPackage: "+this.geoPackage.name)}},e.EXTENSION_NAME="gpkg_metadata",e.EXTENSION_Metadata_AUTHOR="gpkg",e.EXTENSION_Metadata_NAME_NO_AUTHOR="metadata",e.EXTENSION_Metadata_DEFINITION="http://www.geopackage.org/spec/#extension_metadata",e}(o.BaseExtension);e.MetadataExtension=l},6131:(t,e,n)=>{"use strict";var r=n(5108);Object.defineProperty(e,"__esModule",{value:!0}),e.NGAExtensions=void 0;var i=n(5626),o=n(9095),a=n(9581),s=n(5042),u=n(7960),l=n(7523),c=n(8479),h=n(1832),f=n(1314),p=n(362),d=n(8314),y=n(2431),m=n(233),g=n(8904),_=n(5045),b=n(7092),v=function(){function t(){}return t.deleteTableExtensions=function(e,n){t.deleteGeometryIndex(e,n),t.deleteTileScaling(e,n),t.deleteFeatureStyle(e,n),t.deleteContentsId(e,n)},t.deleteExtensions=function(e){t.deleteGeometryIndexExtension(e),t.deleteTileScalingExtension(e),t.deleteFeatureStyleExtension(e),t.deleteContentsIdExtension(e)},t.copyTableExtensions=function(e,n,i){try{t.copyContentsId(e,n,i),t.copyFeatureStyle(e,n,i),t.copyTileScaling(e,n,i),t.copyGeometryIndex(e,n,i)}catch(t){r.warn("Failed to copy extensions for table: "+i+", copied from table: "+n,t)}},t.deleteGeometryIndex=function(t,e){var n=t.getGeometryIndexDao(null),r=t.tableIndexDao,s=t.extensionDao;try{n.isTableExists()&&n.deleteWhere(n.buildWhereWithFieldAndValue(o.GeometryIndexDao.COLUMN_TABLE_NAME_FIELD,e),n.buildWhereArgs(e)),r.isTableExists()&&r.deleteWhere(r.buildWhereWithFieldAndValue(a.TableIndexDao.COLUMN_TABLE_NAME,e),r.buildWhereArgs(e)),s.isTableExists()&&s.deleteByExtensionAndTableName(i.FeatureTableIndex.EXTENSION_NAME,e)}catch(n){throw new Error("Failed to delete Table Index. GeoPackage: "+t.name+", Table: "+e)}},t.deleteGeometryIndexExtension=function(t){var e=t.getGeometryIndexDao(null),n=t.tableIndexDao,r=t.extensionDao;try{e.isTableExists()&&t.dropTable(o.GeometryIndexDao.TABLE_NAME),n.isTableExists()&&t.dropTable(a.TableIndexDao.TABLE_NAME),r.isTableExists()&&r.deleteByExtension(i.FeatureTableIndex.EXTENSION_NAME)}catch(e){throw new Error("Failed to delete Table Index extension and tables. GeoPackage: "+t.name)}},t.copyGeometryIndex=function(t,e,n){try{var a=t.extensionDao;if(a.isTableExists()){var u=a.queryByExtensionAndTableName(i.FeatureTableIndex.EXTENSION_NAME,e);if(u.length>0){var l=u[0];l.table_name=n,a.create(l);var c=t.tableIndexDao;if(c.isTableExists()){var h=c.queryForId(e);null!=h&&(h.table_name=n,c.create(h),t.isTable(o.GeometryIndexDao.TABLE_NAME)&&s.CoreSQLUtils.transferTableContent(t.connection,o.GeometryIndexDao.TABLE_NAME,o.GeometryIndexDao.COLUMN_TABLE_NAME_FIELD,n,e))}}}}catch(t){r.warn("Failed to create Geometry Index for table: "+n+", copied from table: "+e,t)}},t.deleteTileScaling=function(t,e){var n=t.tileScalingDao,r=t.extensionDao;try{n.isTableExists()&&n.deleteByTableName(e),r.isTableExists()&&r.deleteByExtensionAndTableName(l.TileScalingExtension.EXTENSION_NAME,e)}catch(n){throw new Error("Failed to delete Tile Scaling. GeoPackage: "+t.name+", Table: "+e)}},t.deleteTileScalingExtension=function(t){var e=t.tileScalingDao,n=t.extensionDao;try{e.isTableExists()&&t.dropTable(e.gpkgTableName),n.isTableExists()&&n.deleteByExtension(l.TileScalingExtension.EXTENSION_NAME)}catch(e){throw new Error("Failed to delete Tile Scaling extension and table. GeoPackage: "+t.name)}},t.copyTileScaling=function(t,e,n){try{var i=new l.TileScalingExtension(t,e);if(i.has()){var o=i.getOrCreateExtension();null!=o&&(o.setTableName(n),i.extensionsDao.create(o),t.isTable(u.TileScalingDao.TABLE_NAME)&&s.CoreSQLUtils.transferTableContent(t.connection,u.TileScalingDao.TABLE_NAME,u.TileScalingDao.COLUMN_TABLE_NAME,n,e))}}catch(t){r.warn("Failed to create Tile Scaling for table: "+n+", copied from table: "+e,t)}},t.deleteFeatureStyle=function(e,n){var r=t.getFeatureStyleExtension(e);r.has(n)&&r.deleteRelationships(n)},t.deleteFeatureStyleExtension=function(e){var n=t.getFeatureStyleExtension(e);n.has(null)&&n.removeExtension()},t.copyFeatureStyle=function(e,n,i){try{var o=t.getFeatureStyleExtension(e);if(o.hasRelationship(n)){var a=o.getOrCreateExtension(n);if(null!=a){a.setTableName(i),o.extensionsDao.create(a);var s=o.getContentsId(),u=s.getIdByTableName(n),l=s.getIdByTableName(i);null!=u&&null!=l&&(o.hasTableStyleRelationship(n)&&t.copyFeatureTableStyle(o,c.FeatureStyleExtension.TABLE_MAPPING_TABLE_STYLE,n,i,u,l),o.hasTableIconRelationship(n)&&t.copyFeatureTableStyle(o,c.FeatureStyleExtension.TABLE_MAPPING_TABLE_ICON,n,i,u,l))}}}catch(t){r.warn("Failed to create Feature Style for table: "+i+", copied from table: "+n,t)}},t.copyFeatureTableStyle=function(t,e,n,r,i,o){var a=t.geoPackage,u=t.getMappingTableName(e,n),l=a.extensionDao,c=l.queryByExtensionAndTableName(h.RelatedTablesExtension.EXTENSION_NAME,u).concat(l.queryByExtensionAndTableName(h.RelatedTablesExtension.EXTENSION_RELATED_TABLES_NAME_NO_AUTHOR,u));if(c.length>0){var f=t.getMappingTableName(e,r),v=new p.UserCustomTableReader(u).readTable(a.connection);d.AlterTable.copyTable(a.connection,v,f,!1);var T=new y.TableMapping(v.getTableName(),f,v.getUserColumns().getColumns()),E=T.getColumn(m.UserMappingTable.COLUMN_BASE_ID);E.constantValue=o,E.whereValue=i,s.CoreSQLUtils.transferTableContentForTableMapping(a.connection,T);var w=c[0];w.setTableName(f),l.create(w);var x=y.TableMapping.fromTableInfo(_.TableInfo.info(a.connection,g.ExtendedRelationDao.TABLE_NAME));x.removeColumn(g.ExtendedRelationDao.ID),x.getColumn(g.ExtendedRelationDao.BASE_TABLE_NAME).whereValue=b.ContentsIdDao.TABLE_NAME;var C=x.getColumn(g.ExtendedRelationDao.MAPPING_TABLE_NAME);C.constantValue=f,C.whereValue=u,s.CoreSQLUtils.transferTableContentForTableMapping(a.connection,x)}},t.getFeatureStyleExtension=function(t){return new c.FeatureStyleExtension(t)},t.deleteContentsId=function(t,e){var n=new f.ContentsIdExtension(t);n.has()&&n.deleteIdByTableName(e)},t.deleteContentsIdExtension=function(t){var e=new f.ContentsIdExtension(t);e.has()&&e.removeExtension()},t.copyContentsId=function(t,e,n){try{var i=new f.ContentsIdExtension(t);if(i.has())null!=i.getByTableName(e)&&i.createWithTableName(n)}catch(t){r.warn("Failed to create Contents Id for table: "+n+", copied from table: "+e,t)}},t}();e.NGAExtensions=v},3096:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DublinCoreMetadata=void 0;var r=n(2224),i=function(){function t(){}return t.hasColumn=function(t,e){var n,i=(n=t instanceof r.UserRow?t.table:t).hasColumn(e.name);if(!n.hasColumn(e.name)){var o=e.synonyms;if(o)for(var a=0;a{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DublinCoreType=void 0;var n=function(){function t(t,e){this.name=t,this.synonyms=e}return t.fromName=function(e){for(var n in t)if((r=t[n]).name===e)return r;for(var n in t){var r;if((r=t[n]).synonyms)for(var i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedRelation=void 0;e.ExtendedRelation=function(){}},8904:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedRelationDao=void 0;var a=n(4115),s=n(8572),u=n(7817),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=["id"],n}return i(e,t),e.prototype.createObject=function(t){var e=new u.ExtendedRelation;return t&&(e.base_table_name=t.base_table_name,e.base_primary_column=t.base_primary_column,e.related_table_name=t.base_primary_column,e.related_table_name=t.related_table_name,e.relation_name=t.relation_name,e.mapping_table_name=t.mapping_table_name,e.related_primary_column=t.related_primary_column,e.id=t.id),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createExtendedRelations()},e.prototype.getBaseTables=function(){for(var t=[],e=this.queryForColumns("base_table_name"),n=0;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.RelatedTablesExtension=void 0;var s=n(8140),u=n(624),l=n(7502),c=n(6366),h=n(2702),f=n(4599),p=n(233),d=n(6302),y=n(1447),m=n(8904),g=n(8483),_=n(5897),b=n(8572),v=n(7817),T=n(7403),E=n(362),w=n(8008),x=n(2071),C=n(1394),M=function(t){function e(e){var n=t.call(this,e)||this;return n.extendedRelationDao=e.extendedRelationDao,n}return o(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,"gpkgext_relations",void 0,e.EXTENSION_RELATED_TABLES_DEFINITION,u.Extension.READ_WRITE);return this.extendedRelationDao.createTable(),t},e.prototype.getOrCreateMappingTable=function(t){return this.getOrCreateExtension(),this.getOrCreate(e.EXTENSION_NAME,t,void 0,e.EXTENSION_RELATED_TABLES_DEFINITION,u.Extension.READ_WRITE)},e.prototype.setContents=function(t){var e=this.geoPackage.contentsDao.queryForId(t.getTableName());return t.setContents(e)},e.prototype.getUserDao=function(t){return y.UserCustomDao.readTable(this.geoPackage,t)},e.prototype.getMappingDao=function(t){var e;return e=t instanceof v.ExtendedRelation?t.mapping_table_name:t,new d.UserMappingDao(this.getUserDao(e),this.geoPackage)},e.prototype.getRelationships=function(t){return this.extendedRelationDao.isTableExists()?t?this.geoPackage.extendedRelationDao.getBaseTableRelations(t):this.extendedRelationDao.queryForAll():[]},e.prototype.hasRelations=function(t,e,n){var r=[];return this.extendedRelationDao.isTableExists()&&(r=this.extendedRelationDao.getRelations(t,e,n)),!!r.length},e.prototype.getRelatedRows=function(t,e){for(var n=this.getRelationships(t),r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RelationType=void 0;var r=n(9971),i=function(){function t(t,e){this.name=t,this.dataType=e}return t.fromName=function(e){return t[e.toUpperCase()]},t.FEATURES=new t("features",r.ContentsDataType.FEATURES),t.SIMPLE_ATTRIBUTES=new t("simple_attributes",r.ContentsDataType.ATTRIBUTES),t.MEDIA=new t("media",r.ContentsDataType.ATTRIBUTES),t.ATTRIBUTES=new t("attributes",r.ContentsDataType.ATTRIBUTES),t.TILES=new t("tiles",r.ContentsDataType.TILES),t}();e.RelationType=i},2702:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleAttributesDao=void 0;var o=n(4668),a=n(7374),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.newRow=function(t,e){return new a.SimpleAttributesRow(this.table,t,e)},Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.getRows=function(t){for(var e=[],n=0;n-1))throw n;this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_node"'),this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_parent"'),this.geoPackage.connection.run('DROP TABLE IF EXISTS "rtree_'+t+"_"+e+'_rowid"'),this.geoPackage.connection.run("PRAGMA writable_schema = ON"),this.geoPackage.connection.run('DELETE FROM sqlite_master WHERE type = "table" AND name = "rtree_'+t+"_"+e+'"'),this.geoPackage.connection.run("PRAGMA writable_schema = OFF")}},e.prototype.dropTriggersByFeatureTable=function(t){this.dropTriggers(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropTriggers=function(t,e){var n=this.has(t,e);return n&&this.dropAllTriggers(t,e),n},e.prototype.dropAllTriggersByFeatureTable=function(t){this.dropAllTriggers(t.getTableName(),t.getGeometryColumnName())},e.prototype.dropAllTriggers=function(t,e){this.dropInsertTrigger(t,e),this.dropUpdate1Trigger(t,e),this.dropUpdate2Trigger(t,e),this.dropUpdate3Trigger(t,e),this.dropUpdate4Trigger(t,e),this.dropDeleteTrigger(t,e)},e.prototype.dropInsertTrigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_INSERT_NAME)},e.prototype.dropUpdate1Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE1_NAME)},e.prototype.dropUpdate2Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE2_NAME)},e.prototype.dropUpdate3Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE3_NAME)},e.prototype.dropUpdate4Trigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_UPDATE4_NAME)},e.prototype.dropDeleteTrigger=function(t,n){this.dropTrigger(t,n,e.TRIGGER_DELETE_NAME)},e.prototype.dropTrigger=function(t,e,n){this.geoPackage.connection.run('DROP TRIGGER IF EXISTS "rtree_'+t+"_"+e+"_"+n+'"')},e.TRIGGER_INSERT_NAME="insert",e.TRIGGER_UPDATE1_NAME="update1",e.TRIGGER_UPDATE2_NAME="update2",e.TRIGGER_UPDATE3_NAME="update3",e.TRIGGER_UPDATE4_NAME="update4",e.TRIGGER_DELETE_NAME="delete",e}(a.BaseExtension);e.RTreeIndex=h},735:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RTreeIndexDao=void 0;var o=n(4115),a=n(5859),s=n(8877),u=function(t){function e(n,r){var i=t.call(this,n)||this;return i.gpkgTableName=e.TABLE_NAME,i.featureDao=r,i}return i(e,t),e.prototype.createObject=function(t){return new a.RTreeIndex(this.geoPackage,this.featureDao)},e.prototype._generateGeometryEnvelopeQuery=function(t){var e=this.featureDao.gpkgTableName,n="",r=t.minX=")):(n+="(",n+=this.buildWhereWithFieldAndValue("minx",t.maxX,"<="),n+=" or ",n+=this.buildWhereWithFieldAndValue("maxx",t.minX,">="),n+=" or ",n+=this.buildWhereWithFieldAndValue("minx",t.minX,">="),n+=" or ",n+=this.buildWhereWithFieldAndValue("maxx",t.maxX,"<="),n+=")"),n+=" and ",n+=this.buildWhereWithFieldAndValue("miny",t.maxY,"<="),n+=" and ",n+=this.buildWhereWithFieldAndValue("maxy",t.minY,">=");var i=[];return i.push(t.maxX,t.minX),r||i.push(t.minX,t.maxX),i.push(t.maxY,t.minY),{join:'inner join "'+e+'" on "'+e+'".'+this.featureDao.idColumns[0]+' = "'+this.gpkgTableName+'".id',where:n,whereArgs:i,tableNameArr:['"'+e+'".*']}},e.prototype.queryWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.queryJoinWhereWithArgs(e.join,e.where,e.whereArgs,e.tableNameArr)},e.prototype.countWithGeometryEnvelope=function(t){var e=this._generateGeometryEnvelopeQuery(t);return this.connection.get(s.SqliteQueryBuilder.buildCount("'"+this.gpkgTableName+"'",e.where),e.whereArgs).count},e.TABLE_NAME="rtree",e.PREFIX="rtree_",e.COLUMN_TABLE_NAME=e.TABLE_NAME+".table_name",e.COLUMN_GEOM_ID=e.TABLE_NAME+".geom_id",e.COLUMN_MIN_X=e.TABLE_NAME+".minx",e.COLUMN_MAX_X=e.TABLE_NAME+".maxx",e.COLUMN_MIN_Y=e.TABLE_NAME+".miny",e.COLUMN_MAX_Y=e.TABLE_NAME+".maxy",e.COLUMN_MIN_Z=e.TABLE_NAME+".minz",e.COLUMN_MAX_Z=e.TABLE_NAME+".maxz",e.COLUMN_MIN_M=e.TABLE_NAME+".minm",e.COLUMN_MAX_M=e.TABLE_NAME+".maxm",e.EXTENSION_NAME="gpkg_rtree_index",e.EXTENSION_RTREE_INDEX_AUTHOR="gpkg",e.EXTENSION_RTREE_INDEX_NAME_NO_AUTHOR="rtree_index",e.EXTENSION_RTREE_INDEX_DEFINITION="http://www.geopackage.org/spec/#extension_rtree",e}(o.Dao);e.RTreeIndexDao=u},7523:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingExtension=void 0;var o=n(8140),a=n(624),s=n(7960),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tableName=n,r.tileScalingDao=e.tileScalingDao,r}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=this.getOrCreate(e.EXTENSION_NAME,this.tableName,null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE);return this.tileScalingDao.createTable(),t},e.prototype.createOrUpdate=function(t){return t.table_name=this.tableName,this.tileScalingDao.createOrUpdate(t)},Object.defineProperty(e.prototype,"dao",{get:function(){return this.tileScalingDao},enumerable:!1,configurable:!0}),e.prototype.has=function(){return this.hasExtension(e.EXTENSION_NAME,this.tableName,null)&&this.tileScalingDao.isTableExists()},e.prototype.removeExtension=function(){this.tileScalingDao.isTableExists()&&this.geoPackage.deleteTable(s.TileScalingDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_NAME="nga_tile_scaling",e.EXTENSION_AUTHOR="nga",e.EXTENSION_NAME_NO_AUTHOR="tile_scaling",e.EXTENSION_DEFINITION="http://ngageoint.github.io/GeoPackage/docs/extensions/tile-scaling.html",e}(o.BaseExtension);e.TileScalingExtension=u},4301:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileScaling=void 0;var r=n(2777),i=function(){function t(){}return t.prototype.isZoomIn=function(){return(null==this.zoom_in||this.zoom_in>0)&&null!=this.scaling_type&&this.scaling_type!=r.TileScalingType.OUT},t.prototype.isZoomOut=function(){return(null==this.zoom_out||this.zoom_out>0)&&null!=this.scaling_type&&this.scaling_type!=r.TileScalingType.IN},t}();e.TileScaling=i},7960:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingDao=void 0;var o=n(4115),a=n(4301),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_TABLE_NAME],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.TileScaling;return t&&(e.table_name=t.table_name,e.scaling_type=t.scaling_type,e.zoom_in=t.zoom_in,e.zoom_out=t.zoom_out),e},e.prototype.createTable=function(){return this.geoPackage.getTableCreator().createTileScaling()},e.prototype.queryForTableName=function(t){var n=this.queryForAll(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t));return n.length>0?this.createObject(n[0]):null},e.prototype.deleteByTableName=function(t){return this.deleteWhere(this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t),this.buildWhereArgs(t))},e.TABLE_NAME="nga_tile_scaling",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_SCALING_TYPE="scaling_type",e.COLUMN_ZOOM_IN="zoom_in",e.COLUMN_ZOOM_OUT="zoom_out",e}(o.Dao);e.TileScalingDao=s},2777:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TileScalingType=void 0,(n=e.TileScalingType||(e.TileScalingType={})).IN="in",n.OUT="out",n.IN_OUT="in_out",n.OUT_IN="out_in",n.CLOSEST_IN_OUT="closest_in_out",n.CLOSEST_OUT_IN="closest_out_in"},8116:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SchemaExtension=void 0;var o=n(8140),a=n(624),s=n(4941),u=n(7175),l=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getOrCreateExtension=function(){var t=[];return t.push(this.getOrCreate(e.EXTENSION_NAME,s.DataColumnsDao.TABLE_NAME,null,e.EXTENSION_SCHEMA_DEFINITION,a.Extension.READ_WRITE)),t.push(this.getOrCreate(e.EXTENSION_NAME,u.DataColumnConstraintsDao.TABLE_NAME,null,e.EXTENSION_SCHEMA_DEFINITION,a.Extension.READ_WRITE)),t},e.prototype.has=function(){return this.hasExtensions(e.EXTENSION_NAME)},e.prototype.removeExtension=function(){this.geoPackage.isTable(s.DataColumnsDao.TABLE_NAME)&&this.geoPackage.dropTable(s.DataColumnsDao.TABLE_NAME),this.geoPackage.isTable(u.DataColumnConstraintsDao.TABLE_NAME)&&this.geoPackage.dropTable(u.DataColumnConstraintsDao.TABLE_NAME),this.extensionsDao.isTableExists()&&this.extensionsDao.deleteByExtension(e.EXTENSION_NAME)},e.EXTENSION_SCHEMA_AUTHOR="gpkg",e.EXTENSION_SCHEMA_NAME_NO_AUTHOR="schema",e.EXTENSION_NAME=e.EXTENSION_SCHEMA_AUTHOR+"_"+e.EXTENSION_SCHEMA_NAME_NO_AUTHOR,e.EXTENSION_SCHEMA_DEFINITION="http://www.geopackage.org/spec/#extension_schema",e}(o.BaseExtension);e.SchemaExtension=l},612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyle=void 0;var n=function(){function t(t,e){this.styleRow=t,this.iconRow=e}return Object.defineProperty(t.prototype,"style",{get:function(){return this.styleRow},set:function(t){this.styleRow=t},enumerable:!1,configurable:!0}),t.prototype.hasStyle=function(){return!!this.styleRow},Object.defineProperty(t.prototype,"icon",{get:function(){return this.iconRow},set:function(t){this.iconRow=t},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(){return!!this.iconRow},t.prototype.useIcon=function(){return this.hasIcon()&&(!this.iconRow.isTableIcon()||!this.hasStyle()||this.styleRow.isTableStyle())},t}();e.FeatureStyle=n},2752:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyles=void 0;e.FeatureStyles=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.styles=t,this.icons=e}},6536:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTableStyles=void 0;var r=n(2752),i=n(612),o=n(7924),a=n(4725),s=n(8412),u=n(9211),l=function(){function t(t,e){this.geoPackage=t,e instanceof s.FeatureTable?this.tableName=e.getTableName():this.tableName=e,this.featureStyleExtension=t.featureStyleExtension,this.cachedTableFeatureStyles=new r.FeatureStyles}return t.prototype.getFeatureStyleExtension=function(){return this.featureStyleExtension},t.prototype.getTableName=function(){return this.tableName},t.prototype.has=function(){return this.featureStyleExtension.has(this.tableName)},t.prototype.createRelationships=function(){return this.featureStyleExtension.createRelationships(this.tableName)},t.prototype.hasRelationship=function(){return this.featureStyleExtension.hasRelationship(this.tableName)},t.prototype.createStyleRelationship=function(){return this.featureStyleExtension.createStyleRelationship(this.tableName)},t.prototype.hasStyleRelationship=function(){return this.featureStyleExtension.hasStyleRelationship(this.tableName)},t.prototype.createTableStyleRelationship=function(){return this.featureStyleExtension.createTableStyleRelationship(this.tableName)},t.prototype.hasTableStyleRelationship=function(){return this.featureStyleExtension.hasTableStyleRelationship(this.tableName)},t.prototype.createIconRelationship=function(){return this.featureStyleExtension.createIconRelationship(this.tableName)},t.prototype.hasIconRelationship=function(){return this.featureStyleExtension.hasIconRelationship(this.tableName)},t.prototype.createTableIconRelationship=function(){return this.featureStyleExtension.createTableIconRelationship(this.tableName)},t.prototype.hasTableIconRelationship=function(){return this.featureStyleExtension.hasTableIconRelationship(this.tableName)},t.prototype.deleteRelationships=function(){return this.featureStyleExtension.deleteRelationships(this.tableName)},t.prototype.deleteStyleRelationship=function(){return this.featureStyleExtension.deleteStyleRelationship(this.tableName)},t.prototype.deleteTableStyleRelationship=function(){return this.featureStyleExtension.deleteTableStyleRelationship(this.tableName)},t.prototype.deleteIconRelationship=function(){return this.featureStyleExtension.deleteIconRelationship(this.tableName)},t.prototype.deleteTableIconRelationship=function(){return this.featureStyleExtension.deleteTableIconRelationship(this.tableName)},t.prototype.getStyleMappingDao=function(){return this.featureStyleExtension.getStyleMappingDao(this.tableName)},t.prototype.getTableStyleMappingDao=function(){return this.featureStyleExtension.getTableStyleMappingDao(this.tableName)},t.prototype.getIconMappingDao=function(){return this.featureStyleExtension.getIconMappingDao(this.tableName)},t.prototype.getTableIconMappingDao=function(){return this.featureStyleExtension.getTableIconMappingDao(this.tableName)},t.prototype.getStyleDao=function(){return this.featureStyleExtension.getStyleDao()},t.prototype.getIconDao=function(){return this.featureStyleExtension.getIconDao()},t.prototype.getTableFeatureStyles=function(){return this.featureStyleExtension.getTableFeatureStyles(this.tableName)},t.prototype.getTableStyles=function(){return this.featureStyleExtension.getTableStyles(this.tableName)},t.prototype.getCachedTableStyles=function(){var t=this.cachedTableFeatureStyles.styles;return null===t&&(null===(t=this.getTableStyles())&&(t=new o.Styles(!0)),this.cachedTableFeatureStyles.styles=t),t.isEmpty()&&(t=null),t},t.prototype.getTableStyle=function(t){return this.featureStyleExtension.getTableStyle(this.tableName,t)},t.prototype.getTableStyleDefault=function(){return this.featureStyleExtension.getTableStyleDefault(this.tableName)},t.prototype.getTableIcons=function(){return this.featureStyleExtension.getTableIcons(this.tableName)},t.prototype.getCachedTableIcons=function(){var t=this.cachedTableFeatureStyles.icons;return null===t&&(null===(t=this.getTableIcons())&&(t=new a.Icons(!0)),this.cachedTableFeatureStyles.icons=t),t.isEmpty()&&(t=null),t},t.prototype.getTableIcon=function(t){return this.featureStyleExtension.getTableIcon(this.tableName,t)},t.prototype.getTableIconDefault=function(){return this.featureStyleExtension.getTableIconDefault(this.tableName)},t.prototype.getFeatureStylesForFeatureRow=function(t){return this.featureStyleExtension.getFeatureStylesForFeatureRow(t)},t.prototype.getFeatureStyles=function(t){return this.featureStyleExtension.getFeatureStyles(this.tableName,t)},t.prototype.getFeatureStyleForFeatureRow=function(t){return this.getFeatureStyleForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getFeatureStyleForFeatureRowAndGeometryType=function(t,e){return this.getFeatureStyle(t.id,e)},t.prototype.getFeatureStyleDefaultForFeatureRow=function(t){return this.getFeatureStyle(t.id,null)},t.prototype.getFeatureStyle=function(t,e){var n=null,r=this.getStyle(t,e),o=this.getIcon(t,e);return null==r&&null==o||(n=new i.FeatureStyle(r,o)),n},t.prototype.getFeatureStyleDefault=function(t){return this.getFeatureStyle(t,null)},t.prototype.getStylesForFeatureRow=function(t){return this.featureStyleExtension.getStylesForFeatureRow(t)},t.prototype.getStylesForFeatureId=function(t){return this.featureStyleExtension.getStylesForFeatureId(this.tableName,t)},t.prototype.getStyleForFeatureRow=function(t){return this.getStyleForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getStyleForFeatureRowAndGeometryType=function(t,e){return this.getStyle(t.id,e)},t.prototype.getStyleDefaultForFeatureRow=function(t){return this.getStyle(t.id,null)},t.prototype.getStyle=function(t,e){var n=this.featureStyleExtension.getStyle(this.tableName,t,e,!1);if(null===n){var r=this.getCachedTableStyles();null!==r&&(n=r.getStyle(e))}return n},t.prototype.getStyleDefault=function(t){return this.getStyle(t,null)},t.prototype.getIconsForFeatureRow=function(t){return this.featureStyleExtension.getIconsForFeatureRow(t)},t.prototype.getIconsForFeatureId=function(t){return this.featureStyleExtension.getIconsForFeatureId(this.tableName,t)},t.prototype.getIconForFeatureRow=function(t){return this.getIconForFeatureRowAndGeometryType(t,u.GeometryType.fromName(t.geometryType.toUpperCase()))},t.prototype.getIconForFeatureRowAndGeometryType=function(t,e){return this.getIcon(t.id,e)},t.prototype.getIconDefaultForFeatureRow=function(t){return this.getIcon(t.id,null)},t.prototype.getIcon=function(t,e){var n=this.featureStyleExtension.getIcon(this.tableName,t,e,!1);if(null===n){var r=this.getCachedTableIcons();null!==r&&(n=r.getIcon(e))}return n},t.prototype.getIconDefault=function(t){return this.getIcon(t,null)},t.prototype.setTableFeatureStyles=function(t){var e=this.featureStyleExtension.setTableFeatureStyles(this.tableName,t);return this.clearCachedTableFeatureStyles(),e},t.prototype.setTableStyles=function(t){var e=this.featureStyleExtension.setTableStyles(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.setTableStyleDefault=function(t){var e=this.featureStyleExtension.setTableStyleDefault(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.setTableStyle=function(t,e){var n=this.featureStyleExtension.setTableStyle(this.tableName,t,e);return this.clearCachedTableStyles(),n},t.prototype.setTableIcons=function(t){var e=this.featureStyleExtension.setTableIcons(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.setTableIconDefault=function(t){var e=this.featureStyleExtension.setTableIconDefault(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.setTableIcon=function(t,e){var n=this.featureStyleExtension.setTableIcon(this.tableName,t,e);return this.clearCachedTableIcons(),n},t.prototype.setFeatureStylesForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStylesForFeatureRow(t,e)},t.prototype.setFeatureStyles=function(t,e){return this.featureStyleExtension.setFeatureStyles(this.tableName,t,e)},t.prototype.setFeatureStyleForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStyleForFeatureRow(t,e)},t.prototype.setFeatureStyleForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setFeatureStyleForFeatureRowAndGeometryType(t,e,n)},t.prototype.setFeatureStyleDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setFeatureStyleDefaultForFeatureRow(t,e)},t.prototype.setFeatureStyle=function(t,e,n){return this.featureStyleExtension.setFeatureStyle(this.tableName,t,e,n)},t.prototype.setFeatureStyleDefault=function(t,e){return this.featureStyleExtension.setFeatureStyleDefault(this.tableName,t,e)},t.prototype.setStylesForFeatureRow=function(t,e){return this.featureStyleExtension.setStylesForFeatureRow(t,e)},t.prototype.setStyles=function(t,e){return this.featureStyleExtension.setStyles(this.tableName,t,e)},t.prototype.setStyleForFeatureRow=function(t,e){return this.featureStyleExtension.setStyleForFeatureRow(t,e)},t.prototype.setStyleForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setStyleForFeatureRowAndGeometryType(t,e,n)},t.prototype.setStyleDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setStyleDefaultForFeatureRow(t,e)},t.prototype.setStyle=function(t,e,n){return this.featureStyleExtension.setStyle(this.tableName,t,e,n)},t.prototype.setStyleDefault=function(t,e){return this.featureStyleExtension.setStyleDefault(this.tableName,t,e)},t.prototype.setIconsForFeatureRow=function(t,e){return this.featureStyleExtension.setIconsForFeatureRow(t,e)},t.prototype.setIcons=function(t,e){return this.featureStyleExtension.setIcons(this.tableName,t,e)},t.prototype.setIconForFeatureRow=function(t,e){return this.featureStyleExtension.setIconForFeatureRow(t,e)},t.prototype.setIconForFeatureRowAndGeometryType=function(t,e,n){return this.featureStyleExtension.setIconForFeatureRowAndGeometryType(t,e,n)},t.prototype.setIconDefaultForFeatureRow=function(t,e){return this.featureStyleExtension.setIconDefaultForFeatureRow(t,e)},t.prototype.setIcon=function(t,e,n){return this.featureStyleExtension.setIcon(this.tableName,t,e,n)},t.prototype.setIconDefault=function(t,e){return this.featureStyleExtension.setIconDefault(this.tableName,t,e)},t.prototype.deleteAllFeatureStyles=function(){var t=this.featureStyleExtension.deleteAllFeatureStyles(this.tableName);return this.clearCachedTableFeatureStyles(),t},t.prototype.deleteAllStyles=function(){var t=this.featureStyleExtension.deleteAllStyles(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteAllIcons=function(){var t=this.featureStyleExtension.deleteAllIcons(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableFeatureStyles=function(){var t=this.featureStyleExtension.deleteTableFeatureStyles(this.tableName);return this.clearCachedTableFeatureStyles(),t},t.prototype.deleteTableStyles=function(){var t=this.featureStyleExtension.deleteTableStyles(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteTableStyleDefault=function(){var t=this.featureStyleExtension.deleteTableStyleDefault(this.tableName);return this.clearCachedTableStyles(),t},t.prototype.deleteTableStyle=function(t){var e=this.featureStyleExtension.deleteTableStyle(this.tableName,t);return this.clearCachedTableStyles(),e},t.prototype.deleteTableIcons=function(){var t=this.featureStyleExtension.deleteTableIcons(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableIconDefault=function(){var t=this.featureStyleExtension.deleteTableIconDefault(this.tableName);return this.clearCachedTableIcons(),t},t.prototype.deleteTableIcon=function(t){var e=this.featureStyleExtension.deleteTableIcon(this.tableName,t);return this.clearCachedTableIcons(),e},t.prototype.clearCachedTableFeatureStyles=function(){this.cachedTableFeatureStyles.styles=null,this.cachedTableFeatureStyles.icons=null},t.prototype.clearCachedTableStyles=function(){this.cachedTableFeatureStyles.styles=null},t.prototype.clearCachedTableIcons=function(){this.cachedTableFeatureStyles.icons=null},t.prototype.deleteFeatureStyles=function(){return this.featureStyleExtension.deleteFeatureStyles(this.tableName)},t.prototype.deleteStyles=function(){return this.featureStyleExtension.deleteStyles(this.tableName)},t.prototype.deleteStylesForFeatureRow=function(t){return this.featureStyleExtension.deleteStylesForFeatureRow(t)},t.prototype.deleteStylesForFeatureId=function(t){return this.featureStyleExtension.deleteStylesForFeatureId(this.tableName,t)},t.prototype.deleteStyleDefaultForFeatureRow=function(t){return this.featureStyleExtension.deleteStyleDefaultForFeatureRow(t)},t.prototype.deleteStyleDefault=function(t){return this.featureStyleExtension.deleteStyleDefault(this.tableName,t)},t.prototype.deleteStyleForFeatureRow=function(t){return this.featureStyleExtension.deleteStyleForFeatureRow(t)},t.prototype.deleteStyleForFeatureRowAndGeometryType=function(t,e){return this.featureStyleExtension.deleteStyleForFeatureRowAndGeometryType(t,e)},t.prototype.deleteStyle=function(t,e){return this.featureStyleExtension.deleteStyle(this.tableName,t,e)},t.prototype.deleteStyleAndMappingsByStyleRow=function(t){return this.featureStyleExtension.deleteStyleAndMappingsByStyleRow(this.tableName,t)},t.prototype.deleteStyleAndMappingsByStyleRowId=function(t){return this.featureStyleExtension.deleteStyleAndMappingsByStyleRowId(this.tableName,t)},t.prototype.deleteIcons=function(){return this.featureStyleExtension.deleteIcons(this.tableName)},t.prototype.deleteIconsForFeatureRow=function(t){return this.featureStyleExtension.deleteIconsForFeatureRow(t)},t.prototype.deleteIconsForFeatureId=function(t){return this.featureStyleExtension.deleteIconsForFeatureId(this.tableName,t)},t.prototype.deleteIconDefaultForFeatureRow=function(t){return this.featureStyleExtension.deleteIconDefaultForFeatureRow(t)},t.prototype.deleteIconDefault=function(t){return this.featureStyleExtension.deleteIconDefault(this.tableName,t)},t.prototype.deleteIconForFeatureRow=function(t){return this.featureStyleExtension.deleteIconForFeatureRow(t)},t.prototype.deleteIconForFeatureRowAndGeometryType=function(t,e){return this.featureStyleExtension.deleteIconForFeatureRowAndGeometryType(t,e)},t.prototype.deleteIcon=function(t,e){return this.featureStyleExtension.deleteIcon(this.tableName,t,e)},t.prototype.deleteIconAndMappingsByIconRow=function(t){return this.featureStyleExtension.deleteIconAndMappingsByIconRow(this.tableName,t)},t.prototype.deleteIconAndMappingsByIconRowId=function(t){return this.featureStyleExtension.deleteIconAndMappingsByIconRowId(this.tableName,t)},t.prototype.getAllTableStyleIds=function(){return this.featureStyleExtension.getAllTableStyleIds(this.tableName)},t.prototype.getAllTableIconIds=function(){return this.featureStyleExtension.getAllTableIconIds(this.tableName)},t.prototype.getAllStyleIds=function(){return this.featureStyleExtension.getAllStyleIds(this.tableName)},t.prototype.getAllIconIds=function(){return this.featureStyleExtension.getAllIconIds(this.tableName)},t}();e.FeatureTableStyles=l},8600:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.putIconForIconRow=function(t,e){return this.put(t.id,e)},t.prototype.put=function(t,e){var n=this.iconCache[t];if(this.iconCache[t]=e,n){var r=this.accessHistory.indexOf(t);r>-1&&this.accessHistory.splice(r,1)}if(this.accessHistory.push(t),Object.keys(this.iconCache).length>this.cacheSize){var i=this.accessHistory.shift();if(i){var a=this.iconCache[i];a&&o.Canvas.disposeImage(a),delete this.iconCache[i]}}return n},t.prototype.removeIconForIconRow=function(t){return this.remove(t.id)},t.prototype.remove=function(t){var e=this.iconCache[t];if(delete this.iconCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){var t=this;Object.keys(this.iconCache).forEach((function(e){var n=t.iconCache[e];o.Canvas.disposeImage(n)})),this.iconCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.iconCache);if(e.length>t)for(var n=e.length-t,r=0;r1))throw new Error("Anchor must be set inclusively between 0.0 and 1.0, invalid value: "+t);return!0},e.prototype.isTableIcon=function(){return this.tableIcon},e.prototype.setTableIcon=function(t){this.tableIcon=t},e}(o.MediaRow);e.IconRow=s},2015:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.IconTable=void 0;var o=n(6366),a=n(7319),s=n(5865),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.TABLE_TYPE="media",e}return i(e,t),e.prototype.getNameColumnIndex=function(){return this.getColumnIndex(e.COLUMN_NAME)},e.prototype.getNameColumn=function(){return this.getColumnWithColumnName(e.COLUMN_NAME)},e.prototype.getDescriptionColumnIndex=function(){return this.getColumnIndex(e.COLUMN_DESCRIPTION)},e.prototype.getDescriptionColumn=function(){return this.getColumnWithColumnName(e.COLUMN_DESCRIPTION)},e.prototype.getWidthColumnIndex=function(){return this.getColumnIndex(e.COLUMN_WIDTH)},e.prototype.getWidthColumn=function(){return this.getColumnWithColumnName(e.COLUMN_WIDTH)},e.prototype.getHeightColumnIndex=function(){return this.getColumnIndex(e.COLUMN_HEIGHT)},e.prototype.getHeightColumn=function(){return this.getColumnWithColumnName(e.COLUMN_HEIGHT)},e.prototype.getAnchorUColumnIndex=function(){return this.getColumnIndex(e.COLUMN_ANCHOR_U)},e.prototype.getAnchorUColumn=function(){return this.getColumnWithColumnName(e.COLUMN_ANCHOR_U)},e.prototype.getAnchorVColumnIndex=function(){return this.getColumnIndex(e.COLUMN_ANCHOR_V)},e.prototype.getAnchorVColumn=function(){return this.getColumnWithColumnName(e.COLUMN_ANCHOR_V)},e.create=function(){return new e(e.TABLE_NAME,e.createColumns(),e.requiredColumns())},e.createRequiredColumns=function(){return o.MediaTable.createRequiredColumns()},e.requiredColumns=function(){return o.MediaTable.requiredColumns()},e.createColumns=function(){var t=e.createRequiredColumns(),n=t.length;return t.push(s.UserColumn.createColumn(n++,e.COLUMN_NAME,a.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_DESCRIPTION,a.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_WIDTH,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_HEIGHT,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_ANCHOR_U,a.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n,e.COLUMN_ANCHOR_V,a.GeoPackageDataType.REAL,!1)),t},e.TABLE_NAME="nga_icon",e.COLUMN_NAME="name",e.COLUMN_DESCRIPTION="description",e.COLUMN_WIDTH="width",e.COLUMN_HEIGHT="height",e.COLUMN_ANCHOR_U="anchor_u",e.COLUMN_ANCHOR_V="anchor_v",e}(o.MediaTable);e.IconTable=u},4725:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Icons=void 0;var n=function(){function t(t){void 0===t&&(t=!1),this.defaultIcon=null,this.icons=new Map,this.tableIcons=t}return t.prototype.setDefault=function(t){null!=t&&t.setTableIcon(this.tableIcons),this.defaultIcon=t},t.prototype.getDefault=function(){return this.defaultIcon},t.prototype.setIcon=function(t,e){void 0===e&&(e=null),null!==e?null!=t?(t.setTableIcon(this.tableIcons),this.icons.set(e,t)):this.icons.delete(e):this.setDefault(t)},t.prototype.getIcon=function(t){void 0===t&&(t=null);var e=null;return null!==t&&this.icons.has(t)&&(e=this.icons.get(t)),null!=e&&null!==t||(e=this.getDefault()),e},t.prototype.isEmpty=function(){return 0===this.icons.size&&null===this.defaultIcon},t.prototype.getGeometryTypes=function(){return Array.from(this.icons.keys())},t}();e.Icons=n},8479:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureStyleExtension=void 0;var o=n(8140),a=n(624),s=n(7092),u=n(2015),l=n(9529),c=n(3934),h=n(3237),f=n(8138),p=n(3410),d=n(1553),y=n(8412),m=n(2752),g=n(612),_=n(7924),b=n(4725),v=n(362),T=n(9211),E=function(t){function e(e){var n=t.call(this,e)||this;return n.relatedTablesExtension=e.relatedTablesExtension,n.contentsIdExtension=e.contentsIdExtension,n}return i(e,t),e.prototype.getOrCreateExtension=function(t){return this.getOrCreate(e.EXTENSION_NAME,this.getFeatureTableName(t),null,e.EXTENSION_DEFINITION,a.Extension.READ_WRITE)},e.prototype.has=function(t){return this.hasExtension(e.EXTENSION_NAME,this.getFeatureTableName(t),null)},e.prototype.getTables=function(){var t=[];if(this.extensionsDao.isTableExists())for(var n=this.extensionsDao.queryAllByExtension(e.EXTENSION_NAME),r=0;r1))throw new Error("Opacity must be set inclusively between 0.0 and 1.0, invalid value: "+t);return!0},e.prototype.createColor=function(t,e){var n="#000000";if(null!==t&&(n=t),null!==e){var r=Math.round(255*e).toString(16);1===r.length&&(r="0"+r),n+=r}return n.toUpperCase()},e.prototype._hasColor=function(t,e){return null!==t||null!==e},e.prototype.isTableStyle=function(){return this.tableStyle},e.prototype.setTableStyle=function(t){this.tableStyle=t},e.colorPattern=/^#([0-9a-fA-F]{3}){1,2}$/,e}(n(6861).AttributesRow);e.StyleRow=o},3934:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleTable=void 0;var o=n(3931),a=n(8483),s=n(5865),u=n(7319),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.TABLE_TYPE="media",e.data_type=a.RelationType.ATTRIBUTES.dataType,e.relation_name=a.RelationType.ATTRIBUTES.name,e}return i(e,t),e.prototype.getNameColumnIndex=function(){return this.getColumnIndex(e.COLUMN_NAME)},e.prototype.getNameColumn=function(){return this.getColumnWithColumnName(e.COLUMN_NAME)},e.prototype.getDescriptionColumnIndex=function(){return this.getColumnIndex(e.COLUMN_DESCRIPTION)},e.prototype.getDescriptionColumn=function(){return this.getColumnWithColumnName(e.COLUMN_DESCRIPTION)},e.prototype.getColorColumnIndex=function(){return this.getColumnIndex(e.COLUMN_COLOR)},e.prototype.getColorColumn=function(){return this.getColumnWithColumnName(e.COLUMN_COLOR)},e.prototype.getOpacityColumnIndex=function(){return this.getColumnIndex(e.COLUMN_OPACITY)},e.prototype.getOpacityColumn=function(){return this.getColumnWithColumnName(e.COLUMN_OPACITY)},e.prototype.getWidthColumnIndex=function(){return this.getColumnIndex(e.COLUMN_WIDTH)},e.prototype.getWidthColumn=function(){return this.getColumnWithColumnName(e.COLUMN_WIDTH)},e.prototype.getFillColorColumnIndex=function(){return this.getColumnIndex(e.COLUMN_FILL_COLOR)},e.prototype.getFillColorColumn=function(){return this.getColumnWithColumnName(e.COLUMN_FILL_COLOR)},e.prototype.getFillOpacityColumnIndex=function(){return this.getColumnIndex(e.COLUMN_FILL_OPACITY)},e.prototype.getFillOpacityColumn=function(){return this.getColumnWithColumnName(e.COLUMN_FILL_OPACITY)},e.create=function(){return new e(e.TABLE_NAME,e.createColumns())},e.createColumns=function(){var t=[],n=0;return t.push(s.UserColumn.createPrimaryKeyColumn(n++,e.COLUMN_ID)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_NAME,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_DESCRIPTION,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_COLOR,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_OPACITY,u.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_WIDTH,u.GeoPackageDataType.REAL,!1)),t.push(s.UserColumn.createColumn(n++,e.COLUMN_FILL_COLOR,u.GeoPackageDataType.TEXT,!1)),t.push(s.UserColumn.createColumn(7,e.COLUMN_FILL_OPACITY,u.GeoPackageDataType.REAL,!1)),t},e.TABLE_NAME="nga_style",e.COLUMN_ID="id",e.COLUMN_NAME="name",e.COLUMN_DESCRIPTION="description",e.COLUMN_COLOR="color",e.COLUMN_OPACITY="opacity",e.COLUMN_WIDTH="width",e.COLUMN_FILL_COLOR="fill_color",e.COLUMN_FILL_OPACITY="fill_opacity",e}(o.AttributesTable);e.StyleTable=l},1553:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.StyleTableReader=void 0;var o=n(464),a=n(3934),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createTable=function(t,e){return new a.StyleTable(t,e)},e}(o.AttributesTableReader);e.StyleTableReader=s},7924:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Styles=void 0;var n=function(){function t(t){void 0===t&&(t=!1),this.defaultStyle=null,this.styles=new Map,this.tableStyles=t}return t.prototype.setDefault=function(t){null!=t&&t.setTableStyle(this.tableStyles),this.defaultStyle=t},t.prototype.getDefault=function(){return this.defaultStyle},t.prototype.setStyle=function(t,e){void 0===e&&(e=null),null!==e?null!=t?(t.setTableStyle(this.tableStyles),this.styles.set(e,t)):this.styles.delete(e):this.setDefault(t)},t.prototype.getStyle=function(t){void 0===t&&(t=null);var e=null;return null!==t&&(e=this.styles.get(t)),null!=e&&null!==t||(e=this.getDefault()),e},t.prototype.isEmpty=function(){return 0===this.styles.size&&null===this.defaultStyle},t.prototype.getGeometryTypes=function(){return Array.from(this.styles.keys())},t}();e.Styles=n},7719:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.WebPExtension=void 0;var o=n(8140),a=n(624),s=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tableName=n,r}return i(e,t),e.prototype.getOrCreateExtension=function(){return this.getOrCreate(e.EXTENSION_NAME,this.tableName,"tile_data",e.EXTENSION_WEBP_DEFINITION,a.Extension.READ_WRITE)},e.EXTENSION_NAME="gpkg_webp",e.EXTENSION_WEBP_AUTHOR="gpkg",e.EXTENSION_WEBP_NAME_NO_AUTHOR="webp",e.EXTENSION_WEBP_DEFINITION="http://www.geopackage.org/spec/#extension_webp",e}(o.BaseExtension);e.WebPExtension=s},812:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryColumns=void 0;var r=n(9971),i=function(){function t(){}return Object.defineProperty(t.prototype,"geometryType",{get:function(){return this.geometry_type_name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return"".concat(this.table_name," ").concat(this.column_name)},enumerable:!1,configurable:!0}),t.prototype.setContents=function(t){if(null!=t){var e=t.data_type;if(null==e||e!==r.ContentsDataType.FEATURES)throw new Error("The Contents of a GeometryColumns must have a data type of "+r.ContentsDataType.nameFromType(r.ContentsDataType.FEATURES));this.table_name=t.table_name}else this.table_name=null},t.TABLE_NAME="tableName",t.COLUMN_NAME="columnName",t.GEOMETRY_TYPE_NAME="geometryTypeName",t.SRS_ID="srsId",t.Z="z",t.M="m",t}();e.GeometryColumns=i},1968:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryColumnsDao=void 0;var a=n(4115),s=n(812),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName="gpkg_geometry_columns",n.idColumns=[e.COLUMN_ID_1,e.COLUMN_ID_2],n.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_COLUMN_NAME,e.COLUMN_GEOMETRY_TYPE_NAME,e.COLUMN_SRS_ID,e.COLUMN_Z,e.COLUMN_M],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.GeometryColumns;return t&&(e.table_name=t.table_name,e.column_name=t.column_name,e.geometry_type_name=t.geometry_type_name,e.srs_id=t.srs_id,e.z=t.z,e.m=t.m),e},e.prototype.queryForTableName=function(t){var n=this.queryForAllEq(e.COLUMN_TABLE_NAME,t);if(n&&n.length)return this.createObject(n[0])},e.prototype.getFeatureTables=function(){var t,n,r=[];try{for(var i=o(this.connection.each("select "+e.COLUMN_TABLE_NAME+" from "+this.gpkgTableName)),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s[e.COLUMN_TABLE_NAME])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.getSrs=function(t){return this.geoPackage.spatialReferenceSystemDao.queryForId(t.srs_id)},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.prototype.getProjection=function(t){var e=this.getSrs(t);return this.geoPackage.spatialReferenceSystemDao.getProjection(e)},e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_ID_1=e.COLUMN_TABLE_NAME,e.COLUMN_ID_2=e.COLUMN_COLUMN_NAME,e.COLUMN_GEOMETRY_TYPE_NAME="geometry_type_name",e.COLUMN_SRS_ID="srs_id",e.COLUMN_Z="z",e.COLUMN_M="m",e}(a.Dao);e.GeometryColumnsDao=u},961:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureColumn=void 0;var o=n(5865),a=n(7319),s=n(9211),u=n(5071),l=function(t){function e(e,n,r,i,o,a,s,u,l){var c=t.call(this,e,n,r,i,o,a,s,l)||this;return c.geometryType=u,c.type=c.getTypeName(n,r,u),c}return i(e,t),e.createPrimaryKeyColumn=function(t,n,r){return void 0===r&&(r=u.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,n,a.GeoPackageDataType.INTEGER,void 0,!0,void 0,!0,void 0,r)},e.createGeometryColumn=function(t,n,r,i,o){if(null==r)throw new Error("Geometry Type is required to create column: "+n);return new e(t,n,a.GeoPackageDataType.BLOB,void 0,i,o,!1,r,!1)},e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,void 0,s)},e.prototype.getTypeName=function(e,n,r){return null!=r?s.GeometryType.nameFromType(r):t.prototype.getTypeName.call(this,e,n)},e.getGeometryTypeFromTableColumn=function(t){var e=null;return t.isDataType(a.GeoPackageDataType.BLOB)&&(e=s.GeometryType.fromName(t.type)),e},e.prototype.copy=function(){return new e(this.index,this.name,this.dataType,this.max,this.notNull,this.defaultValue,this.primaryKey,this.geometryType,this.autoincrement)},e.prototype.isGeometry=function(){return null!==this.geometryType},e.prototype.getGeometryType=function(){return this.geometryType},e}(o.UserColumn);e.FeatureColumn=l},5053:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureColumns=void 0;var o=n(2114),a=n(7319),s=function(t){function e(e,n,r,i){var o=t.call(this,e,r,i)||this;return o.geometryIndex=-1,o.geometryColumn=n,o.updateColumns(),o}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getGeometryColumnName(),this.getColumns(),this.isCustom())},e.prototype.updateColumns=function(){t.prototype.updateColumns.call(this);var e=null;if(null!==this.geometryColumn&&void 0!==this.geometryColumn)e=this.getColumnIndex(this.geometryColumn,!1);else for(var n=0;n=0},e.prototype.getGeometryColumn=function(){var t=null;return this.hasGeometryColumn()&&(t=this.getColumnForIndex(this.geometryIndex)),t},e}(o.UserColumns);e.FeatureColumns=s},2071:function(t,e,n){"use strict";var r,i=n(5108),o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0;break;case"Polygon":case"MultiPolygon":r=null!==(0,h.default)(o,n);break;case"MultiPoint":r=e.multiPointIntersects(o,n);break;case"GeometryCollection":r=e.geometryCollectionIntersects(o,n)}}return r},e.verifyGeometryCollection=function(t,n){return e.geometryCollectionIntersects(t,n.toGeoJSON().geometry)||(0,f.default)(t,n.toGeoJSON().geometry)?t:void 0},e.readTable=function(t,e){return t.getFeatureDao(e)},e}(y.UserDao);e.FeatureDao=T},234:function(t,e,n){"use strict";var r,i=n(3085).Buffer,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureRow=void 0;var a=n(2224),s=n(961),u=n(857),l=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.featureTable=e,i}return o(e,t),Object.defineProperty(e.prototype,"geometryColumnIndex",{get:function(){return this.featureTable.getGeometryColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryColumn",{get:function(){return this.featureTable.getGeometryColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometry",{get:function(){return this.getValueWithIndex(this.featureTable.getGeometryColumnIndex())},set:function(t){this.setValueWithIndex(this.featureTable.getGeometryColumnIndex(),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryType",{get:function(){var t=null,e=this.getValueWithIndex(this.featureTable.getGeometryColumnIndex());return null!==e&&(t=e.toGeoJSON().type),t},enumerable:!1,configurable:!0}),e.prototype.toObjectValue=function(e,n){var r=this.getColumnWithIndex(e);return r instanceof s.FeatureColumn&&r.isGeometry()&&n&&n instanceof i||n instanceof Uint8Array?new u.GeometryData(n):t.prototype.toObjectValue.call(this,e,n)},e.prototype.getValueWithColumnName=function(e){var n=this.values[e],r=this.getColumnWithColumnName(e);return null!=n&&r instanceof s.FeatureColumn&&r.isGeometry()&&n.toData?n.toData():t.prototype.getValueWithColumnName.call(this,e)},e}(a.UserRow);e.FeatureRow=l},8412:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTable=void 0;var o=n(8018),a=n(5053),s=n(9971),u=function(t){function e(e,n,r){return t.call(this,new a.FeatureColumns(e,n,r,!1))||this}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getGeometryColumnName(),this.getUserColumns().getColumns())},e.prototype.getGeometryColumnIndex=function(){return this.getUserColumns().getGeometryIndex()},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.getGeometryColumn=function(){return this.getUserColumns().getGeometryColumn()},e.prototype.getGeometryColumnName=function(){return this.getUserColumns().getGeometryColumnName()},e.prototype.getIdAndGeometryColumnNames=function(){return[this.getPkColumnName(),this.getGeometryColumnName()]},e.prototype.validateContents=function(t){var e=t.data_type;if(null==e||e!==s.ContentsDataType.FEATURES)throw new Error("The Contents of a FeatureTable must have a data type of "+s.ContentsDataType.FEATURES)},e}(o.UserTable);e.FeatureTable=u},4896:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTableReader=void 0;var o=n(1968),a=n(8412),s=n(4880),u=n(961),l=n(812),c=function(t){function e(e){var n=t.call(this,e instanceof l.GeometryColumns?e.table_name:e)||this;return e instanceof l.GeometryColumns&&(n.columnName=e.column_name),n}return i(e,t),e.prototype.readFeatureTable=function(t){if(null===this.columnName||void 0===this.columnName){var e=new o.GeometryColumnsDao(t);this.columnName=e.queryForTableName(this.table_name).column_name}return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new a.FeatureTable(t,this.columnName,e)},e.prototype.createColumn=function(t){return new u.FeatureColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,u.FeatureColumn.getGeometryTypeFromTableColumn(t),t.autoincrement)},e}(s.UserTableReader);e.FeatureTableReader=c},9211:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryType=void 0,(n=e.GeometryType||(e.GeometryType={}))[n.GEOMETRY=0]="GEOMETRY",n[n.POINT=1]="POINT",n[n.LINESTRING=2]="LINESTRING",n[n.POLYGON=3]="POLYGON",n[n.MULTIPOINT=4]="MULTIPOINT",n[n.MULTILINESTRING=5]="MULTILINESTRING",n[n.MULTIPOLYGON=6]="MULTIPOLYGON",n[n.GEOMETRYCOLLECTION=7]="GEOMETRYCOLLECTION",n[n.CIRCULARSTRING=8]="CIRCULARSTRING",n[n.COMPOUNDCURVE=9]="COMPOUNDCURVE",n[n.CURVEPOLYGON=10]="CURVEPOLYGON",n[n.MULTICURVE=11]="MULTICURVE",n[n.MULTISURFACE=12]="MULTISURFACE",n[n.CURVE=13]="CURVE",n[n.SURFACE=14]="SURFACE",n[n.POLYHEDRALSURFACE=15]="POLYHEDRALSURFACE",n[n.TIN=16]="TIN",n[n.TRIANGLE=17]="TRIANGLE",function(t){t.nameFromType=function(e){var n=null;return null!=e&&(n=t[e]),n},t.fromName=function(e){return t[e]}}(e.GeometryType||(e.GeometryType={}))},4325:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackage=void 0;var c=l(n(1011)),h=l(n(6102)),f=l(n(3892)),p=l(n(7383)),d=l(n(8147)),y=l(n(1013)),m=o(n(4102)),g=l(n(4472)),_=n(857),b=n(5306),v=n(1832),T=n(8479),E=n(1314),w=n(7523),x=n(5965),C=n(1968),M=n(2071),S=n(4896),N=n(6638),O=n(5925),A=n(3506),I=n(4941),P=n(7175),R=n(663),L=n(2056),D=n(5698),k=n(9581),F=n(9095),U=n(8904),B=n(8008),j=n(1394),G=n(7092),W=n(7960),q=n(3931),H=n(9631),z=n(464),V=n(8412),X=n(8138),Y=n(8704),Z=n(5897),Q=n(7319),K=n(8116),J=n(812),$=n(1459),tt=n(1938),et=n(3684),nt=n(2527),rt=n(5899),it=n(5865),ot=n(8133),at=n(4275),st=n(961),ut=n(6366),lt=n(8483),ct=n(4599),ht=n(297),ft=n(731),pt=n(4301),dt=n(2777),yt=n(8375),mt=n(8314),gt=n(9406),_t=n(9971),bt=n(9211),vt=n(7686),Tt=n(5604),Et=n(1375),wt=n(8877),xt=function(){function t(t,e,n){this.name=t,this.path=e,this.connection=n,this.tableCreator=new $.TableCreator(this),this.loadSpatialReferenceSystemsIntoProj4()}return t.prototype.close=function(){this.connection.close()},Object.defineProperty(t.prototype,"database",{get:function(){return this.connection},enumerable:!1,configurable:!0}),t.prototype.export=function(){return a(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.connection.export()]}))}))},t.prototype.loadSpatialReferenceSystemsIntoProj4=function(){this.spatialReferenceSystemDao.getAllSpatialReferenceSystems().forEach((function(t){try{t.srs_id>0&&(t.organization!==Et.ProjectionConstants.EPSG||t.organization_coordsys_id!==Et.ProjectionConstants.EPSG_CODE_4326&&t.organization_coordsys_id!==Et.ProjectionConstants.EPSG_CODE_3857)&&Tt.Projection.loadProjection([t.organization,t.organization_coordsys_id].join(":"),t.definition)}catch(t){}}))},t.prototype.validate=function(){var t=[];return t.concat(at.GeoPackageValidate.validateMinimumTables(this))},Object.defineProperty(t.prototype,"spatialReferenceSystemDao",{get:function(){return this._spatialReferenceSystemDao||(this._spatialReferenceSystemDao=new x.SpatialReferenceSystemDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsDao",{get:function(){return this._contentsDao||(this._contentsDao=new N.ContentsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileMatrixSetDao",{get:function(){return this._tileMatrixSetDao||(this._tileMatrixSetDao=new O.TileMatrixSetDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileMatrixDao",{get:function(){return this._tileMatrixDao||(this._tileMatrixDao=new A.TileMatrixDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataColumnsDao",{get:function(){return this._dataColumnsDao||(this._dataColumnsDao=new I.DataColumnsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensionDao",{get:function(){return this._extensionDao||(this._extensionDao=new D.ExtensionDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tableIndexDao",{get:function(){return this._tableIndexDao||(this._tableIndexDao=new k.TableIndexDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"geometryColumnsDao",{get:function(){return this._geometryColumnsDao||(this._geometryColumnsDao=new C.GeometryColumnsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataColumnConstraintsDao",{get:function(){return this._dataColumnConstraintsDao||(this._dataColumnConstraintsDao=new P.DataColumnConstraintsDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadataReferenceDao",{get:function(){return this._metadataReferenceDao||(this._metadataReferenceDao=new L.MetadataReferenceDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadataDao",{get:function(){return this._metadataDao||(this._metadataDao=new R.MetadataDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extendedRelationDao",{get:function(){return this._extendedRelationDao||(this._extendedRelationDao=new U.ExtendedRelationDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsIdDao",{get:function(){return this._contentsIdDao||(this._contentsIdDao=new G.ContentsIdDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tileScalingDao",{get:function(){return this._tileScalingDao||(this._tileScalingDao=new W.TileScalingDao(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentsIdExtension",{get:function(){return this._contentsIdExtension||(this._contentsIdExtension=new E.ContentsIdExtension(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"featureStyleExtension",{get:function(){return this._featureStyleExtension||(this._featureStyleExtension=new T.FeatureStyleExtension(this))},enumerable:!1,configurable:!0}),t.prototype.getTileScalingExtension=function(t){return new w.TileScalingExtension(this,t)},t.prototype.getGeometryIndexDao=function(t){return new F.GeometryIndexDao(this,t)},Object.defineProperty(t.prototype,"relatedTablesExtension",{get:function(){return this._relatedTablesExtension||(this._relatedTablesExtension=new v.RelatedTablesExtension(this))},enumerable:!1,configurable:!0}),t.prototype.getSrs=function(t){return this.spatialReferenceSystemDao.queryForId(t)},t.prototype.createRequiredTables=function(){return this.tableCreator.createRequired(),this},t.prototype.createSupportedExtensions=function(){return new b.CrsWktExtension(this).getOrCreateExtension(),new K.SchemaExtension(this).getOrCreateExtension(),this},t.prototype.getTileDao=function(t){if(t instanceof Z.Contents)t=this.contentsDao.getTileMatrixSet(t);else if(!(t instanceof rt.TileMatrixSet)){var e=this.tileMatrixSetDao,n=e.queryForAllEq(O.TileMatrixSetDao.COLUMN_TABLE_NAME,t);if(n.length>1)throw new Error("Unexpected state. More than one Tile Matrix Set matched for table name: "+t+", count: "+n.length);if(0===n.length)throw new Error("No Tile Matrix found for table name: "+t);t=e.createObject(n[0])}if(!t)throw new Error("Non null TileMatrixSet is required to create Tile DAO");var r=[],i=this.tileMatrixDao;i.queryForAllEq(A.TileMatrixDao.COLUMN_TABLE_NAME,t.table_name,null,null,A.TileMatrixDao.COLUMN_ZOOM_LEVEL+" ASC, "+A.TileMatrixDao.COLUMN_PIXEL_X_SIZE+" DESC, "+A.TileMatrixDao.COLUMN_PIXEL_Y_SIZE+" DESC").forEach((function(t){var e=i.createObject(t);i.hasTiles(e)&&r.push(e)}));var o=new H.TileTableReader(t).readTileTable(this);return new j.TileDao(this,o,t,r)},t.prototype.getTables=function(t){return void 0===t&&(t=!1),t?{features:this.contentsDao.getContentsForTableType(_t.ContentsDataType.FEATURES),tiles:this.contentsDao.getContentsForTableType(_t.ContentsDataType.TILES),attributes:this.contentsDao.getContentsForTableType(_t.ContentsDataType.ATTRIBUTES)}:{features:this.getFeatureTables(),tiles:this.getTileTables(),attributes:this.getAttributesTables()}},t.prototype.getAttributesTables=function(){return this.contentsDao.getTables(_t.ContentsDataType.ATTRIBUTES)},t.prototype.hasAttributeTable=function(t){var e=this.getAttributesTables();return e&&-1!=e.indexOf(t)},t.prototype.getTileTables=function(){var t=this.contentsDao;return t.isTableExists()?t.getTables(_t.ContentsDataType.TILES):[]},t.prototype.hasTileTable=function(t){var e=this.getTileTables();return e&&-1!==e.indexOf(t)},t.prototype.hasFeatureTable=function(t){var e=this.getFeatureTables();return e&&-1!=e.indexOf(t)},t.prototype.getFeatureTables=function(){var t=this.contentsDao;return t.isTableExists()?t.getTables(_t.ContentsDataType.FEATURES):[]},t.prototype.isTable=function(t){return!!this.connection.tableExists(t)},t.prototype.isTableType=function(t,e){return t===this.getTableType(e)},t.prototype.getTableType=function(t){var e=this.getTableContents(t);if(e)return e.data_type},t.prototype.getTableContents=function(t){return this.contentsDao.queryForId(t)},t.prototype.dropTable=function(t){return this.connection.dropTable(t)},t.prototype.deleteTable=function(t){gt.GeoPackageExtensions.deleteTableExtensions(this,t),this.contentsDao.deleteTable(t)},t.prototype.deleteTableQuietly=function(t){try{this.deleteTable(t)}catch(t){}},t.prototype.getTableCreator=function(){return this.tableCreator},t.prototype.index=function(){return a(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:t=this.getFeatureTables(),e=0,n.label=1;case 1:return e0&&n[0]instanceof it.UserColumn)s=n;else{var u=0;s.push(st.FeatureColumn.createPrimaryKeyColumn(u++,"id")),s.push(st.FeatureColumn.createGeometryColumn(u++,a.column_name,bt.GeometryType.GEOMETRY,!1,null));for(var l=0;n&&lc.maxZoom)){for(var h=0;hc.maxWebMapZoom)){l.columns=[];for(var h=0;h1e4){var p=f.toGeoJSON();return p.feature_count=h,p.coverage=!0,p.gp_table=e,p.gp_name=this.name,p}var d=[f.maxLongitude,f.maxLatitude],y=[f.minLongitude,f.minLatitude],g=(d[0]-y[0])/256*10;f.maxLongitude=a+g,f.minLongitude=a-g,f.maxLatitude=o+g,f.minLatitude=o-g;var _,b=c.queryForGeoJSONIndexedFeaturesWithBoundingBox(f),v=[],T=1e11,E=m.point([a,o]);try{for(var w=u(b),x=w.next();!x.done;x=w.next()){var C=x.value;C.type="Feature";var M=t.determineDistance(E.geometry,C);(M{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageConstants=void 0;var n=function(){function t(){}return t.GEOPACKAGE_EXTENSION="gpkg",t.GEOPACKAGE_EXTENDED_EXTENSION="gpkx",t.APPLICATION_ID="GPKG",t.USER_VERSION="10200",t.GEOPACKAGE_EXTENSION_AUTHOR=t.GEOPACKAGE_EXTENSION,t.GEOMETRY_EXTENSION_PREFIX="geom",t.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER="GP",t.GEOPACKAGE_GEOMETRY_VERSION_1=0,t.SQLITE_HEADER_PREFIX="SQLite format 3",t}();e.GeoPackageConstants=n},5095:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Envelope=void 0;e.Envelope=function(){}},1895:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.EnvelopeBuilder=void 0;var i=r(n(9705)),o=function(){function t(){}return t.buildEnvelopeWithGeometry=function(t){var e=t.toGeoJSON(),n=(0,i.default)(e);return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}();e.EnvelopeBuilder=o},857:function(t,e,n){"use strict";var r=n(3085).Buffer,i=n(5108),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryData=void 0;var a=o(n(1011)),s=n(1506),u=n(5095),l=function(){function t(e){this.empty=!0,this.byteOrder=t.BIG_ENDIAN,e&&this.fromData(e)}return t.prototype.setSrsId=function(t){this.srsId=t},t.prototype.setGeometry=function(t){this.empty=!1,this.geometry=t},t.prototype.setEnvelope=function(t){this.envelope=t},t.prototype.toGeoJSON=function(){return this.geometry.toGeoJSON()},t.prototype.fromData=function(t){t instanceof Uint8Array?this.buffer=t=r.from(t):this.buffer=t;var e=this.buffer.toString("ascii",0,2);if(e!==s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER)throw new Error("Unexpected GeoPackage Geometry magic number: "+e+", Expected: "+s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER);var n=this.buffer.readUInt8(2);if(n!==s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1)throw new Error("Unexpected GeoPackage Geometry version "+n+", Expected: "+s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1);var o=this.buffer.readUInt8(3),u=this.readFlags(o);this.srsId=this.buffer[this.byteOrder?"readUInt32LE":"readUInt32BE"](4);var l=this.readEnvelope(u,this.buffer);this.envelope=l.envelope;var c=l.offset,h=this.buffer.slice(c);try{this.geometry=a.default.Geometry.parse(h),this.geometryError=void 0}catch(t){this.geometryError=t.message,i.log("Error parsing geometry")}},t.prototype.toData=function(){var t=r.alloc(8);t.write(s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_MAGIC_NUMBER),t.writeUInt8(s.GeoPackageConstants.GEOPACKAGE_GEOMETRY_VERSION_1,2);var e=this.buildFlagsByte();t.writeUInt8(e,3),t[this.byteOrder?"writeUInt32LE":"writeUInt32BE"](this.srsId,4);var n=[t,this.writeEnvelope()];try{n.push(this.geometry.toWkb()),this.geometryError=void 0}catch(t){this.geometryError=t.message}return this.buffer=r.concat(n),this.buffer},t.prototype.writeEnvelope=function(){if(!this.envelope)return r.alloc(0);var t=32;this.envelope.hasZ&&(t+=16),this.envelope.hasM&&(t+=16);var e,n=r.alloc(t);(e=this.byteOrder?n.writeDoubleLE.bind(n):n.writeDoubleBE.bind(n))(this.envelope.minX,0),e(this.envelope.maxX,8),e(this.envelope.minY,16),e(this.envelope.maxY,24);var i=32;return this.envelope.hasZ&&(e(this.envelope.minZ,i),e(this.envelope.maxZ,i+8),i=48),this.envelope.hasM&&(e(this.envelope.minM,i),e(this.envelope.maxM,i+8)),n},t.prototype.buildFlagsByte=function(){var e=0;return e+=(this.extended?1:0)<<5,e+=(this.empty?1:0)<<4,(e+=(this.envelope?this.getIndicatorWithEnvelope(this.envelope):0)<<1)+(this.byteOrder===t.BIG_ENDIAN?0:1)},t.prototype.getIndicatorWithEnvelope=function(t){var e=1;return t.hasZ&&e++,t.hasM&&(e+=2),e},t.prototype.readFlags=function(t){var e=t>>7&1,n=t>>6&1;if(0!==e||0!==n)throw new Error("Unexpected GeoPackage Geometry flags. Flag bit 7 and 6 should both be 0, 7="+e+", 6="+n);var r=t>>5&1;this.extended=1===r;var i=t>>4&1;this.empty=1===i;var o=t>>1&7;if(o>4)throw new Error("Unexpected GeoPackage Geometry flags. Envelope contents indicator must be between 0 and 4. Actual: "+o);var a=1&t;return this.byteOrder=a,o},t.prototype.readEnvelope=function(t,e){var n;n=this.byteOrder?e.readDoubleLE.bind(e):e.readDoubleBE.bind(e);var r=0,i={envelope:void 0,offset:8};if(t<=0)return i;var o=new u.Envelope;return o.minX=n(8+8*r++),o.maxX=n(8+8*r++),o.minY=n(8+8*r++),o.maxY=n(8+8*r++),o.hasZ=!1,o.hasM=!1,2!==t&&4!==t||(o.hasZ=!0,o.minZ=n(8+8*r++),o.maxZ=n(8+8*r++)),3!==t&&4!==t||(o.hasM=!0,o.minM=n(8+8*r++),o.maxM=n(8+8*r++)),i.envelope=o,i.offset=8+8*r,i},t.BIG_ENDIAN=0,t.LITTLE_ENDIAN=1,t}();e.GeometryData=l},3026:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(){}return t.prototype.getScopeInformation=function(e){switch(e){case t.UNDEFINED:return{name:t.UNDEFINED,code:"NA",definition:"Metadata information scope is undefined"};case t.FIELD_SESSION:return{name:t.FIELD_SESSION,code:"012",definition:"Information applies to the field session"};case t.COLLECTION_SESSION:return{name:t.COLLECTION_SESSION,code:"004",definition:"Information applies to the collection session"};case t.SERIES:return{name:t.SERIES,code:"006",definition:"Information applies to the (dataset) series"};case t.DATASET:return{name:t.DATASET,code:"005",definition:"Information applies to the (geographic feature) dataset"};case t.FEATURE_TYPE:return{name:t.FEATURE_TYPE,code:"010",definition:"Information applies to a feature type (class)"};case t.FEATURE:return{name:t.FEATURE,code:"009",definition:"Information applies to a feature (instance)"};case t.ATTRIBUTE_TYPE:return{name:t.ATTRIBUTE_TYPE,code:"002",definition:"Information applies to the attribute class"};case t.ATTRIBUTE:return{name:t.ATTRIBUTE,code:"001",definition:"Information applies to the characteristic of a feature (instance)"};case t.TILE:return{name:t.TILE,code:"016",definition:"Information applies to a tile, a spatial subset of geographic data"};case t.MODEL:return{name:t.MODEL,code:"015",definition:"Information applies to a copy or imitation of an existing or hypothetical object"};case t.CATALOG:return{name:t.CATALOG,code:"NA",definition:"Metadata applies to a feature catalog"};case t.SCHEMA:return{name:t.SCHEMA,code:"NA",definition:"Metadata applies to an application schema"};case t.TAXONOMY:return{name:t.TAXONOMY,code:"NA",definition:"Metadata applies to a taxonomy or knowledge system"};case t.SOFTWARE:return{name:t.SOFTWARE,code:"013",definition:"Information applies to a computer program or routine"};case t.SERVICE:return{name:t.SERVICE,code:"014",definition:"Information applies to a capability which a service provider entity makes available to a service user entity through a set of interfaces that define a behaviour, such as a use case"};case t.COLLECTION_HARDWARE:return{name:t.COLLECTION_HARDWARE,code:"003",definition:"Information applies to the collection hardware class"};case t.NON_GEOGRAPHIC_DATASET:return{name:t.NON_GEOGRAPHIC_DATASET,code:"007",definition:"Information applies to non-geographic data"};case t.DIMENSION_GROUP:return{name:t.DIMENSION_GROUP,code:"008",definition:"Information applies to a dimension group"}}},t.UNDEFINED="undefined",t.FIELD_SESSION="fieldSession",t.COLLECTION_SESSION="collectionSession",t.SERIES="series",t.DATASET="dataset",t.FEATURE_TYPE="featureType",t.FEATURE="feature",t.ATTRIBUTE_TYPE="attributeType",t.ATTRIBUTE="attribute",t.TILE="tile",t.MODEL="model",t.CATALOG="catalog",t.SCHEMA="schema",t.TAXONOMY="taxonomy",t.SOFTWARE="software",t.SERVICE="service",t.COLLECTION_HARDWARE="collectionHardware",t.NON_GEOGRAPHIC_DATASET="nonGeographicDataset",t.DIMENSION_GROUP="dimensionGroup",t}();e.Metadata=n},663:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataDao=void 0;var o=n(4115),a=n(3026),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_ID],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.Metadata;return t&&(e.id=t.id,e.md_scope=t.md_scope,e.md_standard_uri=t.md_standard_uri,e.mime_type=t.mime_type,e.metadata=t.metadata),e},e.TABLE_NAME="gpkg_metadata",e.COLUMN_ID="id",e.COLUMN_MD_SCOPE="md_scope",e.COLUMN_MD_STANDARD_URI="md_standard_uri",e.COLUMN_MIME_TYPE="mime_type",e.COLUMN_METADATA="metadata",e}(o.Dao);e.MetadataDao=s},9173:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReference=void 0;var n=function(){function t(){}return t.prototype.toDatabaseValue=function(t){return"timestamp"===t?this.timestamp.toISOString():this[t]},t.prototype.setMetadata=function(t){this.md_file_id=t?t.id:-1},t.prototype.setParentMetadata=function(t){this.md_parent_id=t?t.id:-1},t.prototype.setReferenceScopeType=function(e){switch(this.reference_scope=e,e){case t.GEOPACKAGE:this.table_name=void 0,this.column_name=void 0,this.row_id_value=void 0;break;case t.TABLE:this.column_name=void 0,this.row_id_value=void 0;break;case t.ROW:this.column_name=void 0;break;case t.COLUMN:this.row_id_value=void 0}},t.GEOPACKAGE="geopackage",t.TABLE="table",t.COLUMN="column",t.ROW="row",t.ROW_COL="row/col",t}();e.MetadataReference=n},2056:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReferenceDao=void 0;var o=n(4115),a=n(8572),s=n(9173),u=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName=e.TABLE_NAME,n.idColumns=[e.COLUMN_MD_FILE_ID,e.COLUMN_MD_PARENT_ID],n}return i(e,t),e.prototype.createObject=function(t){var e=new s.MetadataReference;return t&&(e.reference_scope=t.reference_scope,e.table_name=t.table_name,e.column_name=t.column_name,e.row_id_value=t.row_id_value,e.timestamp=new Date(t.timestamp),e.md_file_id=t.md_file_id,e.md_parent_id=t.md_parent_id),e},e.prototype.removeMetadataParent=function(t){var n={};n[e.COLUMN_MD_PARENT_ID]=null;var r=this.buildWhereWithFieldAndValue(e.COLUMN_MD_PARENT_ID,t),i=this.buildWhereArgs(t);return this.updateWithValues(n,r,i).changes},e.prototype.queryByMetadataAndParent=function(t,n){var r=new a.ColumnValues;return r.addColumn(e.COLUMN_MD_FILE_ID,t),r.addColumn(e.COLUMN_MD_PARENT_ID,n),this.queryForFieldValues(r)},e.prototype.queryByMetadata=function(t){var n=new a.ColumnValues;return n.addColumn(e.COLUMN_MD_FILE_ID,t),this.queryForFieldValues(n)},e.prototype.queryByMetadataParent=function(t){var n=new a.ColumnValues;return n.addColumn(e.COLUMN_MD_PARENT_ID,t),this.queryForFieldValues(n)},e.prototype.deleteByTableName=function(t){var n="";n+=this.buildWhereWithFieldAndValue(e.COLUMN_TABLE_NAME,t);var r=this.buildWhereArgs(t);return this.deleteWhere(n,r)},e.TABLE_NAME="gpkg_metadata_reference",e.COLUMN_REFERENCE_SCOPE="reference_scope",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_COLUMN_NAME="column_name",e.COLUMN_ROW_ID="row_id_value",e.COLUMN_TIMESTAMP="timestamp",e.COLUMN_MD_FILE_ID="md_file_id",e.COLUMN_MD_PARENT_ID="md_parent_id",e}(o.Dao);e.MetadataReferenceDao=u},7403:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionBuilder=void 0;var n=function(){function t(){}return t.build=function(t){var e={};return t.forEach((function(t){e["set"+t.slice(0,1).toUpperCase()+t.slice(1)]=function(e){return this[t]=e,this},e["get"+t.slice(0,1).toUpperCase()+t.slice(1)]=function(){return this[t]}})),e},t}();e.OptionBuilder=n},5604:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Projection=void 0;var i=r(n(4472)),o=r(n(8446)),a=n(1375),s=function(){function t(){}return t.loadProjection=function(t,e){if(!t||!e)throw new Error("Invalid projection name/definition");null==i.default.defs(t)&&i.default.defs(t,e)},t.loadProjections=function(e){if(!e)throw new Error("Invalid array of projections");for(var n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProjectionConstants=void 0;var n=function(){function t(){}return t.EPSG="EPSG",t.EPSG_PREFIX="EPSG:",t.EPSG_CODE_3857=3857,t.EPSG_CODE_4326=4326,t.EPSG_CODE_900913=900913,t.EPSG_CODE_102113=102113,t.EPSG_3857=t.EPSG_PREFIX+t.EPSG_CODE_3857,t.EPSG_4326=t.EPSG_PREFIX+t.EPSG_CODE_4326,t.EPSG_900913=t.EPSG_PREFIX+t.EPSG_CODE_900913,t.EPSG_102113=t.EPSG_PREFIX+t.EPSG_CODE_102113,t.WEB_MERCATOR_MAX_LAT_RANGE=85.0511287798066,t.WEB_MERCATOR_MIN_LAT_RANGE=-85.05112877980659,t.WEB_MERCATOR_MAX_LON_RANGE=180,t.WEB_MERCATOR_MIN_LON_RANGE=-180,t.WEB_MERCATOR_HALF_WORLD_WIDTH=20037508.342789244,t.WGS84_HALF_WORLD_LON_WIDTH=180,t.WGS84_HALF_WORLD_LAT_HEIGHT=90,t}();e.ProjectionConstants=n},7977:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.width||n.yPositionInFinalTileStart>=this.height||this.addChunk(t,n)},t.prototype.addChunk=function(t,e){this.chunks.push({chunk:t,position:e})},t.prototype.reproject=function(t,e){return r(this,void 0,void 0,(function(){var t,r,o,a,l,c,h,d,y,m,g,_,b,v=this;return i(this,(function(i){if("undefined"!=typeof window&&window.Worker)return f.TileUtilities.getPiecePosition(e,this.tileBoundingBox,this.height,this.width,this.projectionTo,this.projectionToDefinition,this.projectionFrom,this.projectionFromDefinition,this.tileHeightUnitsPerPixel,this.tileWidthUnitsPerPixel,this.tileMatrix.pixel_x_size,this.tileMatrix.pixel_y_size),t={sourceImageData:this.tileContext.getImageData(0,0,this.tileMatrix.tile_width,this.tileMatrix.tile_height).data.buffer,height:this.height,width:this.width,projectionTo:this.projectionTo,projectionToDefinition:this.projectionToDefinition,projectionFrom:this.projectionFrom,projectionFromDefinition:this.projectionFromDefinition,maxLatitude:this.tileBoundingBox.maxLatitude,minLongitude:this.tileBoundingBox.minLongitude,tileWidthUnitsPerPixel:this.tileWidthUnitsPerPixel,tileHeightUnitsPerPixel:this.tileHeightUnitsPerPixel,tilePieceBoundingBox:JSON.stringify(e),tileBoundingBox:JSON.stringify(this.tileBoundingBox),pixel_y_size:this.tileMatrix.pixel_y_size,pixel_x_size:this.tileMatrix.pixel_x_size,tile_width:this.tileMatrix.tile_width,tile_height:this.tileMatrix.tile_height},[2,new Promise((function(e){try{(r=n(8034)(n(7591))).onmessage=function(t){v.canvas.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(t.data),v.height,v.width),0,0),e()},r.postMessage(t,[v.tileContext.getImageData(0,0,v.tileMatrix.tile_width,v.tileMatrix.tile_height).data.buffer])}catch(n){var r,i=(r=u.default)(t);v.canvas.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(i),v.height,v.width),0,0),e()}}))];r=this.height,o=this.width,a=this.tileMatrix.tile_height,l=this.tileMatrix.tile_width,c=void 0;try{null==p.Projection.hasProjection(this.projectionTo)&&p.Projection.loadProjection(this.projectionTo,this.projectionToDefinition),null==p.Projection.hasProjection(this.projectionFrom)&&p.Projection.loadProjection(this.projectionFrom,this.projectionFromDefinition),c=(0,s.default)(this.projectionTo,this.projectionFrom)}catch(t){}for(h=void 0,d=0;d=0&&_=0&&b{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomFeaturesTile=void 0;e.CustomFeaturesTile=function(){this.compressFormat="png",this.tileBorderStrokeWidth=2,this.tileBorderColor="rgba(0, 0, 0, 1.0)",this.tileFillColor="rgba(0, 0, 0, 0.0625)",this.drawUnindexedTiles=!0}},3060:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1)throw new Error("Circle padding percentage must be between 0.0 and 1.0: "+t);this.circlePaddingPercentage=t},e.prototype.getTileBorderStrokeWidth=function(){return this.tileBorderStrokeWidth},e.prototype.setTileBorderStrokeWidth=function(t){this.tileBorderStrokeWidth=t},e.prototype.getTileBorderColor=function(){return this.tileBorderColor},e.prototype.setTileBorderColor=function(t){this.tileBorderColor=t},e.prototype.getTileFillColor=function(){return this.tileFillColor},e.prototype.setTileFillColor=function(t){this.tileFillColor=t},e.prototype.isDrawUnindexedTiles=function(){return this.drawUnindexedTiles},e.prototype.setDrawUnindexedTiles=function(t){this.drawUnindexedTiles=t},e.prototype.getCompressFormat=function(){return this.compressFormat},e.prototype.setCompressFormat=function(t){this.compressFormat=t},e.prototype.drawUnindexedTile=function(t,e,n){return void 0===n&&(n=null),o(this,void 0,void 0,(function(){var r;return a(this,(function(i){return r=null,this.drawUnindexedTiles&&(r=this.drawTile(t,e,"?",n)),[2,r]}))}))},e.prototype.drawTile=function(t,e,n,r){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,s.Canvas.initializeAdapter()];case 1:return o.sent(),[2,new Promise((function(o){var a,u=!1;null!=r?a=r:(a=s.Canvas.create(t,e),u=!0);var l=a.getContext("2d");l.clearRect(0,0,t,e),null!==i.tileFillColor&&(l.fillStyle=i.tileFillColor,l.fillRect(0,0,t,e)),null!==i.tileBorderColor&&(l.strokeStyle=i.tileBorderColor,l.lineWidth=i.tileBorderStrokeWidth,l.strokeRect(0,0,t,e));var c=s.Canvas.measureText(l,i.textFont,i.textSize,n),h=i.textSize,f=Math.round(t/2),p=Math.round(e/2);if(null!=i.circleBorderColor||null!=i.circleFillColor){var d=Math.max(c,h),y=Math.round(d/2);y=Math.round(y+d*i.circlePaddingPercentage),null!=i.circleFillColor&&(l.fillStyle=i.circleFillColor,l.beginPath(),l.arc(f,p,y,0,2*Math.PI,!0),l.closePath(),l.fill()),null!=i.circleBorderColor&&(l.strokeStyle=i.circleBorderColor,l.lineWidth=i.circleStrokeWidth,l.beginPath(),l.arc(f,p,y,0,2*Math.PI,!0),l.closePath(),l.stroke())}s.Canvas.drawText(l,n,[f,p],i.textFont,i.textSize,i.textColor),s.Canvas.toDataURL(a,"image/"+i.compressFormat).then((function(t){u&&s.Canvas.disposeCanvas(a),o(t)}))}))]}}))}))},e}(n(2544).CustomFeaturesTile);e.NumberFeaturesTile=u},6667:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureDrawType=void 0,(n=e.FeatureDrawType||(e.FeatureDrawType={})).CIRCLE="CIRCLE",n.STROKE="STROKE",n.FILL="FILL",function(t){t.nameFromType=function(e){return t[e]},t.fromName=function(e){switch(e){case"CIRCLE":return t.CIRCLE;case"STROKE":return t.STROKE;case"FILL":return t.FILL}}}(e.FeatureDrawType||(e.FeatureDrawType={}))},6063:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeaturePaint=void 0;var n=function(){function t(){this.featurePaints={}}return t.prototype.getPaint=function(t){return this.featurePaints[t]},t.prototype.setPaint=function(t,e){this.featurePaints[t]=e},t}();e.FeaturePaint=n},9957:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FeaturePaintCache=void 0;var r=n(6063),i=function(){function t(e){void 0===e&&(e=t.DEFAULT_STYLE_PAINT_CACHE_SIZE),this.cacheSize=e,this.paintCache={},this.accessHistory=[]}return t.prototype.getFeaturePaintForStyleRow=function(t){return this.getFeaturePaint(t.id)},t.prototype.getFeaturePaint=function(t){var e=this.paintCache[t];if(e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.getPaintForStyleRow=function(t,e){return this.getPaint(t.id,e)},t.prototype.getPaint=function(t,e){var n=null,r=this.getFeaturePaint(t);return null!=r&&(n=r.getPaint(e)),n},t.prototype.setPaintForStyleRow=function(t,e,n){this.setPaint(t.id,e,n)},t.prototype.setPaint=function(t,e,n){var i=this.paintCache[t];if(i){var o=this.accessHistory.indexOf(t);o>-1&&this.accessHistory.splice(o,1)}else i=new r.FeaturePaint;if(i.setPaint(e,n),this.paintCache[t]=i,this.accessHistory.push(t),Object.keys(this.paintCache).length>this.cacheSize){var a=this.accessHistory.shift();a&&delete this.paintCache[a]}},t.prototype.remove=function(t){var e=this.paintCache[t];if(delete this.paintCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){this.paintCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.paintCache);if(e.length>t)for(var n=e.length-t,r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryCache=void 0;var n=function(){function t(e){void 0===e&&(e=t.DEFAULT_GEOMETRY_CACHE_SIZE),this.cacheSize=e,this.geometryCache={},this.accessHistory=[]}return t.prototype.getGeometryForFeatureRow=function(t){return this.getGeometry(t.id)},t.prototype.getGeometry=function(t){var e=this.geometryCache[t];if(e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1),this.accessHistory.push(t)}return e},t.prototype.setGeometry=function(t,e){var n=this.accessHistory.indexOf(t);if(n>-1&&this.accessHistory.splice(n,1),this.geometryCache[t]=e,this.accessHistory.push(t),Object.keys(this.geometryCache).length>this.cacheSize){var r=this.accessHistory.shift();r&&delete this.geometryCache[r]}},t.prototype.remove=function(t){var e=this.geometryCache[t];if(delete this.geometryCache[t],e){var n=this.accessHistory.indexOf(t);n>-1&&this.accessHistory.splice(n,1)}return e},t.prototype.clear=function(){this.geometryCache={},this.accessHistory=[]},t.prototype.resize=function(t){this.cacheSize=t;var e=Object.keys(this.geometryCache);if(e.length>t)for(var n=e.length-t,r=0;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureTiles=void 0;var u=s(n(7383)),l=s(n(3809)),c=s(n(6479)),h=n(3684),f=n(2527),p=n(8600),d=n(943),y=n(4538),m=n(9957),g=n(5211),_=n(6536),b=n(3437),v=n(5604),T=n(1375),E=function(){function t(t,e,n){void 0===e&&(e=256),void 0===n&&(n=256),this.featureDao=t,this.tileWidth=e,this.tileHeight=n,this.projection=null,this.webMercatorProjection=null,this.simplifyGeometries=!0,this.simplifyToleranceInPixels=1,this.compressFormat="png",this.pointRadius=4,this.pointPaint=new g.Paint,this.pointIcon=null,this.linePaint=new g.Paint,this._lineStrokeWidth=2,this.polygonPaint=new g.Paint,this._polygonStrokeWidth=2,this.fillPolygon=!0,this.polygonFillPaint=new g.Paint,this.featurePaintCache=new m.FeaturePaintCache,this.geometryCache=new d.GeometryCache,this.cacheGeometries=!0,this.iconCache=new p.IconCache,this._scale=1,this.maxFeaturesPerTile=null,this.maxFeaturesTileDraw=null,this.projection=this.featureDao.projection,this.linePaint.strokeWidth=2,this.polygonPaint.strokeWidth=2,this.polygonFillPaint.color="#00000011",this.geoPackage=this.featureDao.geoPackage,null!=this.geoPackage&&(this.featureTableStyles=new _.FeatureTableStyles(this.geoPackage,t.table),this.featureTableStyles.has()||(this.featureTableStyles=null)),this.webMercatorProjection=v.Projection.getWebMercatorToWGS84Converter(),this.calculateDrawOverlap()}return t.prototype.cleanup=function(){this.clearIconCache(),this.pointIcon&&(b.Canvas.disposeImage(this.pointIcon.getIcon()),this.pointIcon=null)},Object.defineProperty(t.prototype,"drawOverlap",{set:function(t){this.widthDrawOverlap=t,this.heightDrawOverlap=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"simplifyTolerance",{get:function(){return this.simplifyToleranceInPixels},set:function(t){this.simplifyToleranceInPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"widthDrawOverlap",{get:function(){return this.widthOverlap},set:function(t){this.widthOverlap=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"heightDrawOverlap",{get:function(){return this.heightOverlap},set:function(t){this.heightOverlap=t},enumerable:!1,configurable:!0}),t.prototype.ignoreFeatureTableStyles=function(){this.featureTableStyles=null,this.calculateDrawOverlap()},t.prototype.clearCache=function(){this.clearStylePaintCache(),this.clearIconCache()},t.prototype.clearStylePaintCache=function(){this.featurePaintCache.clear()},Object.defineProperty(t.prototype,"stylePaintCacheSize",{set:function(t){this.featurePaintCache.resize(t)},enumerable:!1,configurable:!0}),t.prototype.clearIconCache=function(){this.iconCache.clear()},Object.defineProperty(t.prototype,"iconCacheSize",{set:function(t){this.iconCache.resize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this._scale},set:function(t){this._scale=t,this.linePaint.strokeWidth=t*this.lineStrokeWidth,this.polygonPaint.strokeWidth=t*this.polygonStrokeWidth,this.featurePaintCache.clear()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"geometryCacheMaxSize",{set:function(t){this.geometryCache.resize(t)},enumerable:!1,configurable:!0}),t.prototype.calculateDrawOverlap=function(){this.pointIcon?(this.heightOverlap=this.scale*this.pointIcon.getHeight(),this.widthOverlap=this.scale*this.pointIcon.getWidth()):(this.heightOverlap=this.scale*this.pointRadius,this.widthOverlap=this.scale*this.pointRadius);var t=this.scale*this.lineStrokeWidth/2;this.heightOverlap=Math.max(this.heightOverlap,t),this.widthOverlap=Math.max(this.widthOverlap,t);var e=this.scale*this.polygonStrokeWidth/2;if(this.heightOverlap=Math.max(this.heightOverlap,e),this.widthOverlap=Math.max(this.widthOverlap,e),null!=this.featureTableStyles&&this.featureTableStyles.has()){var n=[],r=this.featureTableStyles.getAllTableStyleIds();null!=r&&(n=n.concat(r));var i=this.featureTableStyles.getAllStyleIds();null!=i&&(n=n.concat(i.filter((function(t){return-1===n.indexOf(t)}))));for(var o=this.featureTableStyles.getStyleDao(),a=0;a0))return[3,16];if(!(null==this.maxFeaturesPerTile||g<=this.maxFeaturesPerTile))return[3,13];_=this.getTransformFunction(s),v=this.featureDao.fastQueryBoundingBox(d,s),o.label=2;case 2:o.trys.push([2,9,10,11]),E=a(v),w=E.next(),o.label=3;case 3:if(w.done)return[3,8];if(null==(x=w.value).geometry)return[3,7];C=null,this.cacheGeometries&&(C=this.geometryCache.getGeometry(x.id)),null==C&&(C=x.geometry.geometry.toGeoJSON(),this.geometryCache.setGeometry(x.id,C)),M=this.getFeatureStyle(x),o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.drawGeometry(C,l,p,M,_)];case 5:return o.sent(),[3,7];case 6:return o.sent(),r.error("Failed to draw feature in tile. Id: "+x.id+", Table: "+this.featureDao.table_name),[3,7];case 7:return w=E.next(),[3,3];case 8:return[3,11];case 9:return S=o.sent(),N={error:S},[3,11];case 10:try{w&&!w.done&&(O=E.return)&&O.call(E)}finally{if(N)throw N.error}return[7];case 11:return[4,b.Canvas.toDataURL(i,"image/"+this.compressFormat)];case 12:return f=o.sent(),[3,15];case 13:return null==this.maxFeaturesTileDraw?[3,15]:[4,this.maxFeaturesTileDraw.drawTile(y,m,g.toString(),i)];case 14:f=o.sent(),o.label=15;case 15:return[3,18];case 16:return[4,b.Canvas.toDataURL(i,"image/"+this.compressFormat)];case 17:f=o.sent(),o.label=18;case 18:return c&&b.Canvas.disposeCanvas(i),[2,f]}}))}))},t.prototype.drawTileWithBoundingBox=function(t,e,n,s){return i(this,void 0,void 0,(function(){var e,i,u,l,c,h,f,p,d,y,m,g,_,v,T,E,w,x;return o(this,(function(o){switch(o.label){case 0:return e=this.tileWidth,i=this.tileHeight,l=!1,[4,b.Canvas.initializeAdapter()];case 1:o.sent(),null!=s?u=s:(u=b.Canvas.create(e,i),l=!0),(c=u.getContext("2d")).clearRect(0,0,e,i),h=this.featureDao,f=h.queryForEach(void 0,void 0,void 0,void 0,void 0,[h.table.getIdColumn().getName(),h.table.getGeometryColumn().getName()]),p=this.getTransformFunction(n),o.label=2;case 2:o.trys.push([2,9,10,11]),d=a(f),y=d.next(),o.label=3;case 3:if(y.done)return[3,8];if(m=y.value,null==(g=h.getRow(m)).geometry)return[3,7];if(_=null,this.cacheGeometries&&(_=this.geometryCache.getGeometryForFeatureRow(g)),null==_&&(_=g.geometry.geometry.toGeoJSON(),this.geometryCache.setGeometry(g.id,_)),null==_)return[3,7];v=this.getFeatureStyle(g),o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.drawGeometry(_,c,t,v,p)];case 5:return o.sent(),[3,7];case 6:return o.sent(),r.error("Failed to draw feature in tile. Id: "+g.id+", Table: "+this.featureDao.table_name),[3,7];case 7:return y=d.next(),[3,3];case 8:return[3,11];case 9:return T=o.sent(),w={error:T},[3,11];case 10:try{y&&!y.done&&(x=d.return)&&x.call(d)}finally{if(w)throw w.error}return[7];case 11:return[4,b.Canvas.toDataURL(u,"image/"+this.compressFormat)];case 12:return E=o.sent(),l&&b.Canvas.disposeCanvas(u),[2,E]}}))}))},t.prototype.drawPoint=function(t,e,n,r,a){return i(this,void 0,void 0,(function(){var i,s,u,l,c,f,p,d,y,m,g,_,b,v;return o(this,(function(o){switch(o.label){case 0:return c=a(t.coordinates),f=h.TileBoundingBoxUtils.getXPixel(this.tileWidth,n,c[0]),p=h.TileBoundingBoxUtils.getYPixel(this.tileHeight,n,c[1]),null!=r&&r.useIcon()?(d=r.icon,[4,this.iconCache.createIcon(d)]):[3,2];case 1:return y=o.sent(),i=Math.round(this.scale*y.width),s=Math.round(this.scale*y.height),f>=0-i&&f<=this.tileWidth+i&&p>=0-s&&p<=this.tileHeight+s&&(u=Math.round(f-d.anchorUOrDefault*i),l=Math.round(p-d.anchorVOrDefault*s),e.drawImage(y.image,u,l,i,s)),[3,3];case 2:if(null!=this.pointIcon){if(i=Math.round(this.scale*this.pointIcon.getWidth()),s=Math.round(this.scale*this.pointIcon.getHeight()),f>=0-i&&f<=this.tileWidth+i&&p>=0-s&&p<=this.tileHeight+s){u=Math.round(f-this.scale*this.pointIcon.getXOffset()),l=Math.round(p-this.scale*this.pointIcon.getYOffset());try{e.drawImage(this.pointIcon.getIcon().image,u,l,i,s)}catch(t){}}}else e.save(),m=null,null!=r&&null!=(g=r.style)&&(m=this.scale*(g.getWidthOrDefault()/2)),null==m&&(m=this.scale*this.pointRadius),_=this.getPointPaint(r),f>=0-m&&f<=this.tileWidth+m&&p>=0-m&&p<=this.tileHeight+m&&(b=Math.round(f),v=Math.round(p),e.beginPath(),e.arc(b,v,m,0,2*Math.PI,!0),e.closePath(),e.fillStyle=_.colorRGBA,e.fill()),e.restore();o.label=3;case 3:return[2]}}))}))},t.prototype.simplifyPoints=function(t,e){return void 0===e&&(e=!1),(0,c.default)(t.map((function(t){return{x:t[0],y:t[1]}})),this.simplifyToleranceInPixels,!1).map((function(t){return[t.x,t.y]}))},t.prototype.getPath=function(t,e,n,r,i){var o=this;void 0===r&&(r=!1);var a=t.coordinates.map((function(t){var e=i(t.slice());return[h.TileBoundingBoxUtils.getXPixel(o.tileWidth,n,e[0]),h.TileBoundingBoxUtils.getYPixel(o.tileHeight,n,e[1])]})),s=this.simplifyGeometries?this.simplifyPoints(a,r):a;if(s.length>1){e.moveTo(s[0][0],s[0][1]);for(var u=1;u{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Paint=void 0;var n=function(){function t(){this._color="#000000FF",this._strokeWidth=1}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorRGBA",{get:function(){var t=parseInt(this.color.substr(1,2),16),e=parseInt(this.color.substr(3,2),16),n=parseInt(this.color.substr(5,2),16),r=1;return this.color.length>7&&(r=parseInt(this.color.substr(7,2),16)/255),"rgba("+t+","+e+","+n+","+r+")"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t},enumerable:!1,configurable:!0}),t}();e.Paint=n},9325:function(t,e,n){"use strict";var r=n(5108),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrix=void 0;var n=function(){function t(){}return Object.defineProperty(t.prototype,"contents",{set:function(t){t&&"tiles"===t.data_type&&(this.table_name=t.table_name)},enumerable:!1,configurable:!0}),t.TABLE_NAME="tableName",t.ZOOM_LEVEL="zoomLevel",t.MATRIX_WIDTH="matrixWidth",t.MATRIX_HEIGHT="matrixHeight",t.TILE_WIDTH="tileWidth",t.TILE_HEIGHT="tileHeight",t.PIXEL_X_SIZE="pixelXSize",t.PIXEL_Y_SIZE="pixelYSize",t}();e.TileMatrix=n},3506:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixDao=void 0;var o=n(4115),a=n(1938),s=n(8877),u=n(8334),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.gpkgTableName="gpkg_tile_matrix",n.idColumns=[e.COLUMN_PK1,e.COLUMN_PK2],n.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_ZOOM_LEVEL,e.COLUMN_MATRIX_WIDTH,e.COLUMN_MATRIX_HEIGHT,e.COLUMN_TILE_WIDTH,e.COLUMN_TILE_HEIGHT,e.COLUMN_PIXEL_X_SIZE,e.COLUMN_PIXEL_Y_SIZE],n}return i(e,t),e.prototype.createObject=function(t){var e=new a.TileMatrix;return t&&(e.table_name=t.table_name,e.zoom_level=t.zoom_level,e.matrix_width=t.matrix_width,e.matrix_height=t.matrix_height,e.tile_width=t.tile_width,e.tile_height=t.tile_height,e.pixel_x_size=t.pixel_x_size,e.pixel_y_size=t.pixel_y_size),e},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.prototype.getTileMatrixSet=function(t){return this.geoPackage.tileMatrixSetDao.queryForId(t.table_name)},e.prototype.tileCount=function(t){var e=this.buildWhereWithFieldAndValue(u.TileColumn.COLUMN_ZOOM_LEVEL,t.zoom_level),n=this.buildWhereArgs([t.zoom_level]),r=s.SqliteQueryBuilder.buildCount("'"+t.table_name+"'",e),i=this.connection.get(r,n);return null==i?void 0:i.count},e.prototype.hasTiles=function(t){var e=this.buildWhereWithFieldAndValue(u.TileColumn.COLUMN_ZOOM_LEVEL,t.zoom_level),n=this.buildWhereArgs([t.zoom_level]),r=s.SqliteQueryBuilder.buildQuery(!1,"'"+t.table_name+"'",void 0,e);return null!=this.connection.get(r,n)},e.TABLE_NAME="gpkg_tile_matrix",e.COLUMN_PK1="table_name",e.COLUMN_PK2="zoom_level",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_ZOOM_LEVEL="zoom_level",e.COLUMN_MATRIX_WIDTH="matrix_width",e.COLUMN_MATRIX_HEIGHT="matrix_height",e.COLUMN_TILE_WIDTH="tile_width",e.COLUMN_TILE_HEIGHT="tile_height",e.COLUMN_PIXEL_X_SIZE="pixel_x_size",e.COLUMN_PIXEL_Y_SIZE="pixel_y_size",e}(o.Dao);e.TileMatrixDao=l},5899:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixSet=void 0;var r=n(2527),i=function(){function t(){}return Object.defineProperty(t.prototype,"boundingBox",{get:function(){return new r.BoundingBox(this.min_x,this.max_x,this.min_y,this.max_y)},set:function(t){this.min_x=t.minLongitude,this.max_x=t.maxLongitude,this.min_y=t.minLatitude,this.max_y=t.maxLatitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contents",{set:function(t){t&&"tiles"===t.data_type&&(this.table_name=t.table_name)},enumerable:!1,configurable:!0}),t.TABLE_NAME="tableName",t.MIN_X="minX",t.MIN_Y="minY",t.MAX_X="maxX",t.MAX_Y="maxY",t.SRS_ID="srsId",t}();e.TileMatrixSet=i},5925:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TileMatrixSetDao=void 0;var a=n(4115),s=n(5899),u=function(t){function e(n){var r=t.call(this,n)||this;return r.gpkgTableName="gpkg_tile_matrix_set",r.idColumns=[e.COLUMN_PK],r.columns=[e.COLUMN_TABLE_NAME,e.COLUMN_SRS_ID,e.COLUMN_MIN_X,e.COLUMN_MIN_Y,e.COLUMN_MAX_X,e.COLUMN_MAX_Y],r.columnToPropertyMap={},r.columnToPropertyMap[e.COLUMN_TABLE_NAME]=s.TileMatrixSet.TABLE_NAME,r.columnToPropertyMap[e.COLUMN_SRS_ID]=s.TileMatrixSet.SRS_ID,r.columnToPropertyMap[e.COLUMN_MIN_X]=s.TileMatrixSet.MIN_X,r.columnToPropertyMap[e.COLUMN_MIN_Y]=s.TileMatrixSet.MIN_Y,r.columnToPropertyMap[e.COLUMN_MAX_X]=s.TileMatrixSet.MAX_X,r.columnToPropertyMap[e.COLUMN_MAX_Y]=s.TileMatrixSet.MAX_Y,r}return i(e,t),e.prototype.createObject=function(t){var e=new s.TileMatrixSet;return t&&(e.table_name=t.table_name,e.srs_id=t.srs_id,e.min_y=t.min_y,e.min_x=t.min_x,e.max_y=t.max_y,e.max_x=t.max_x),e},e.prototype.getTileTables=function(){var t,n,r=[];try{for(var i=o(this.connection.each("select "+e.COLUMN_TABLE_NAME+" from "+e.TABLE_NAME)),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s[e.COLUMN_TABLE_NAME])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.getProjection=function(t){var e=this.getSrs(t);if(e)return this.geoPackage.spatialReferenceSystemDao.getProjection(e)},e.prototype.getSrs=function(t){return this.geoPackage.spatialReferenceSystemDao.queryForId(t.srs_id)},e.prototype.getContents=function(t){return this.geoPackage.contentsDao.queryForId(t.table_name)},e.TABLE_NAME="gpkg_tile_matrix_set",e.COLUMN_PK="table_name",e.COLUMN_TABLE_NAME="table_name",e.COLUMN_SRS_ID="srs_id",e.COLUMN_MIN_X="min_x",e.COLUMN_MIN_Y="min_y",e.COLUMN_MAX_X="max_x",e.COLUMN_MAX_Y="max_y",e}(a.Dao);e.TileMatrixSetDao=u},731:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageTileRetriever=void 0;var a=n(3684),s=n(7977),u=n(2777),l=n(5604),c=n(1375),h=function(){function t(t,e,n){this.tileDao=t,this.tileDao.adjustTileMatrixLengths(),this.width=e,this.height=n,this.scaling=null}return t.prototype.setScaling=function(t){this.scaling=t},t.prototype.getWebMercatorBoundingBox=function(){return null==this.setWebMercatorBoundingBox&&(this.setWebMercatorBoundingBox=this.tileDao.tileMatrixSet.boundingBox.projectBoundingBox(this.tileDao.projection,c.ProjectionConstants.EPSG_3857)),this.setWebMercatorBoundingBox},t.prototype.hasTile=function(t,e,n){var r=!1;if(t>=0&&e>=0&&n>=0){var i=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n);r=this.hasTileForBoundingBox(i,c.ProjectionConstants.EPSG_3857)}return r},t.prototype.hasTileForBoundingBox=function(t,e){for(var n=t.projectBoundingBox(e,this.tileDao.projection),r=this.getTileMatrices(n),i=!1,o=0;!i&&o0}return i},t.prototype.getTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857)]}))}))},t.prototype.getWebMercatorTile=function(t,e,n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857)]}))}))},t.prototype.drawTileIn=function(t,e,n,o){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=a.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(t,e,n),[2,this.getTileWithBounds(r,c.ProjectionConstants.EPSG_3857,o)]}))}))},t.prototype.getTileWithWgs84Bounds=function(t,e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){return n=t.projectBoundingBox(c.ProjectionConstants.EPSG_4326,c.ProjectionConstants.EPSG_3857),[2,this.getTileWithBounds(n,c.ProjectionConstants.EPSG_3857,e)]}))}))},t.prototype.getTileWithWgs84BoundsInProjection=function(t,e,n,o){return r(this,void 0,void 0,(function(){var e;return i(this,(function(r){return e=t.projectBoundingBox(c.ProjectionConstants.EPSG_4326,n),[2,this.getTileWithBounds(e,n,o)]}))}))},t.prototype.getTileWithBounds=function(t,e,n){return r(this,void 0,void 0,(function(){var r,u,c,h,f,p,d,y,m,g,_,b,v,T,E,w,x,C,M,S,N;return i(this,(function(i){switch(i.label){case 0:if(null==(r=l.Projection.hasProjection(e)))throw new Error("Projection "+e+" is not loaded.");u=t.projectBoundingBox(e,this.tileDao.projection),c=this.getTileMatrices(u),h=!1,f=null,p=0,i.label=1;case 1:return!h&&p=p;h--)f.push(h)}if(0==l.length)s=f;else if(0==f.length)s=l;else{var d=this.scaling.scaling_type;switch(d){case u.TileScalingType.IN:case u.TileScalingType.IN_OUT:s=l.concat(f);break;case u.TileScalingType.OUT:case u.TileScalingType.OUT_IN:s=f.concat(l);break;case u.TileScalingType.CLOSEST_IN_OUT:case u.TileScalingType.CLOSEST_OUT_IN:var y=void 0,m=void 0;d==u.TileScalingType.CLOSEST_IN_OUT?(y=l,m=f):(y=f,m=l),s=[];for(var g=Math.max(y.length,m.length),_=0;_{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileBoundingBoxUtils=void 0;var r=n(1375),i=n(7218),o=n(2527),a=function(){function t(){}return t.webMercatorTileBox=function(e,n){var i=t.tilesPerSideWithZoom(n),a=t.tileSizeWithTilesPerSide(i),s=Math.max(-r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.minLongitude),u=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.maxLongitude),l=Math.max(-r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.minLatitude),c=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,e.maxLatitude),h=Math.floor((s+r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)/a),f=Math.max(0,Math.ceil((u+r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)/a)-1),p=Math.floor((r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-c)/a),d=Math.max(0,Math.ceil((r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-l)/a)-1);return new o.BoundingBox(h,f,p,d)},t.wgs84TileBox=function(e,n){var i=t.tilesPerWGS84LatSide(n),a=t.tilesPerWGS84LonSide(n),s=t.tileSizeLatPerWGS84Side(i),u=t.tileSizeLonPerWGS84Side(a),l=Math.max(-r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,e.minLongitude),c=Math.min(r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH,e.maxLongitude),h=Math.max(-r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT,e.minLatitude),f=Math.min(r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT,e.maxLatitude),p=Math.floor((l+r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)/u),d=Math.max(0,Math.ceil((c+r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH)/u)-1),y=Math.floor((r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-f)/s),m=Math.max(0,Math.ceil((r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-h)/s)-1);return new o.BoundingBox(p,d,y,m)},t.determinePositionAndScale=function(t,e,n,r,i,o){var a={},s=r.maxLongitude-r.minLongitude,u=(t.minLongitude-r.minLongitude)/s,l=r.maxLatitude-r.minLatitude,c=(r.maxLatitude-t.maxLatitude)/l,h=o/s,f=(t.maxLongitude-t.minLongitude)*h,p=i/l,d=(t.maxLatitude-t.minLatitude)*p;return a.yPositionInFinalTileStart=c*i,a.xPositionInFinalTileStart=u*o,a.dx=a.xPositionInFinalTileStart,a.dy=a.yPositionInFinalTileStart,a.sx=0,a.sy=0,a.dWidth=f,a.dHeight=d,a.sWidth=n,a.sHeight=e,a},t.getWebMercatorBoundingBoxFromXYZ=function(e,n,i,a){for(var s=t.tilesPerSideWithZoom(i),u=t.tileSizeWithTilesPerSide(s);e<0;)e+=s;for(;e>=s;)e-=s;var l=0;if(a&&a.buffer&&a.tileSize){var c=a.buffer;l=u/a.tileSize*c}var h=-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH+e*u-l,f=-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH+(e+1)*u+l,p=r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-(n+1)*u-l,d=r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH-n*u+l;return h=Math.max(-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,h),f=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,f),p=Math.max(-1*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,p),d=Math.min(r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH,d),new o.BoundingBox(h,f,p,d)},t.getWGS84BoundingBoxFromXYZ=function(e,n,i){var a=t.tilesPerWGS84LatSide(i),s=t.tilesPerWGS84LonSide(i),u=t.tileSizeLatPerWGS84Side(a),l=t.tileSizeLonPerWGS84Side(s),c=-1*r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH+e*l,h=-1*r.ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH+(e+1)*l,f=r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-(n+1)*u,p=r.ProjectionConstants.WGS84_HALF_WORLD_LAT_HEIGHT-n*u;return new o.BoundingBox(c,h,f,p)},t.tileSizeWithTilesPerSide=function(t){return 2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t},t.intersects=function(e,n){return null!=t.intersection(e,n)},t.intersection=function(t,e){var n=Math.max(t.minLongitude,e.minLongitude),r=Math.max(t.minLatitude,e.minLatitude),i=Math.min(t.maxLongitude,e.maxLongitude),a=Math.min(t.maxLatitude,e.maxLatitude);return n>i||r>a?null:new o.BoundingBox(n,i,r,a)},t.tilesPerSideWithZoom=function(t){return 1<=0&&(a<0&&(a=0),s>=n&&(s=n-1));var u=t.getRowWithTotalBoundingBox(e,r,o.minLatitude),l=t.getRowWithTotalBoundingBox(e,r,o.maxLatitude);return l=0&&(l<0&&(l=0),u>=r&&(u=r-1)),new i.TileGrid(a,s,l,u)},t.getTileColumnWithTotalBoundingBox=function(t,e,n){var r=t.minLongitude,i=t.maxLongitude;return n=i?e:~~((n-r)/((i-r)/e))},t.getRowWithTotalBoundingBox=function(t,e,n){var r=t.minLatitude,i=t.maxLatitude;return n=i?-1:~~((i-n)/((i-r)/e))},t.getTileBoundingBox=function(t,e,n,r){var a=e.matrix_width,s=e.matrix_height,u=new i.TileGrid(n,n,r,r),l=t.minLongitude,c=(t.maxLongitude-l)/a,h=l+c*u.min_x,f=h+c*(u.max_x+1-u.min_x),p=t.minLatitude,d=t.maxLatitude,y=(d-p)/s,m=d-y*u.min_y,g=m-y*(u.max_y+1-u.min_y);return new o.BoundingBox(h,f,g,m)},t.getTileGridBoundingBox=function(t,e,n,r){var i=t.minLongitude,a=t.width/e,s=i+a*r.min_x,u=s+a*(r.max_x+1-r.min_x),l=t.maxLatitude,c=t.height/n,h=l-c*r.min_y,f=h-c*(r.max_y+1-r.min_y);return new o.BoundingBox(s,u,f,h)},t.getXPixel=function(t,e,n){return(n-e.minLongitude)/e.width*t},t.getLongitudeFromPixel=function(t,e,n,r){return r/t*n.width+e.minLongitude},t.getYPixel=function(t,e,n){return(e.maxLatitude-n)/e.height*t},t.getLatitudeFromPixel=function(t,e,n,r){return e.maxLatitude-r/t*n.height},t.tileSize=function(t){return 2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t},t.zoomLevelOfTileSize=function(t){var e=2*r.ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH/t;return Math.log(e)/Math.log(2)},t.tileWidthDegrees=function(t){return 360/t},t.prototype.statictileHeightDegrees=function(t){return 180/t},t.tilesPerSide=function(t){return Math.pow(2,t)},t.tileSizeWithZoom=function(t){var e=this.tilesPerSide(t);return this.tileSize(e)},t.toleranceDistance=function(t,e){return this.tileSizeWithZoom(t)/e},t.toleranceDistanceWidthAndHeight=function(t,e,n){return this.toleranceDistance(t,Math.max(e,n))},t.getFloatRoundedRectangle=function(e,n,r,i){var o=Math.round(t.getXPixel(e,r,i.minLongitude)),a=Math.round(t.getXPixel(e,r,i.maxLongitude)),s=Math.round(t.getYPixel(n,r,i.maxLatitude)),u=Math.round(t.getYPixel(n,r,i.minLatitude));return{left:o,right:a,bottom:u,top:s,isValid:o{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TileGrid=void 0;var n=function(){function t(t,e,n,r){this.min_x=t,this.max_x=e,this.min_y=n,this.max_y=r}return t.prototype.count=function(){return(this.max_x+1-this.min_x)*(this.max_y+1-this.min_y)},t.prototype.equals=function(t){return!!t&&this.min_x===t.min_x&&this.max_x===t.max_x&&this.min_y===t.min_y&&this.max_y===t.max_y},t}();e.TileGrid=n},8334:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileColumn=void 0;var o=n(5865),a=n(7319),s=n(5071),u=function(t){function e(e,n,r,i,o,a,s,u){return t.call(this,e,n,r,i,o,a,s,u)||this}return i(e,t),e.createIdColumn=function(t,n){return void 0===n&&(n=s.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,e.COLUMN_ID,a.GeoPackageDataType.INTEGER,null,!1,null,!0,n)},e.createZoomLevelColumn=function(t){return new e(t,e.COLUMN_ZOOM_LEVEL,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileColumnColumn=function(t){return new e(t,e.COLUMN_TILE_COLUMN,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileRowColumn=function(t){return new e(t,e.COLUMN_TILE_ROW,a.GeoPackageDataType.INTEGER,null,!0,null,!1,!1)},e.createTileDataColumn=function(t){return new e(t,e.COLUMN_TILE_DATA,a.GeoPackageDataType.BLOB,null,!0,null,!1,!1)},e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,s)},e.COLUMN_ID="id",e.COLUMN_ZOOM_LEVEL="zoom_level",e.COLUMN_TILE_COLUMN="tile_column",e.COLUMN_TILE_ROW="tile_row",e.COLUMN_TILE_DATA="tile_data",e}(o.UserColumn);e.TileColumn=u},6295:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileColumns=void 0;var o=n(7319),a=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.zoomLevelIndex=-1,i.tileColumnIndex=-1,i.tileRowIndex=-1,i.tileDataIndex=-1,i.updateColumns(),i}return i(e,t),e.prototype.copy=function(){var t=new e(this._tableName,this._columns,this._custom);return t.zoomLevelIndex=this.zoomLevelIndex,t.tileColumnIndex=this.tileColumnIndex,t.tileRowIndex=this.tileRowIndex,t.tileDataIndex=this.tileDataIndex,t},e.prototype.updateColumns=function(){t.prototype.updateColumns.call(this);var n=this.getColumnIndex(e.ZOOM_LEVEL,!1);this.isCustom()||this.missingCheck(n,e.ZOOM_LEVEL),null!==n&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(n)),this.zoomLevelIndex=n);var r=this.getColumnIndex(e.TILE_COLUMN,!1);this.isCustom()||this.missingCheck(r,e.TILE_COLUMN),null!=r&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(r)),this.tileColumnIndex=r);var i=this.getColumnIndex(e.TILE_ROW,!1);this.isCustom()||this.missingCheck(i,e.TILE_ROW),null!=i&&(this.typeCheck(o.GeoPackageDataType.INTEGER,this.getColumnForIndex(i)),this.tileRowIndex=i);var a=this.getColumnIndex(e.TILE_DATA,!1);this.isCustom()||this.missingCheck(a,e.TILE_DATA),null!=a&&(this.typeCheck(o.GeoPackageDataType.BLOB,this.getColumnForIndex(a)),this.tileDataIndex=a)},e.prototype.getZoomLevelIndex=function(){return this.zoomLevelIndex},e.prototype.setZoomLevelIndex=function(t){this.zoomLevelIndex=t},e.prototype.hasZoomLevelColumn=function(){return this.zoomLevelIndex>=0},e.prototype.getZoomLevelColumn=function(){var t=null;return this.hasZoomLevelColumn()&&(t=this.getColumnForIndex(this.zoomLevelIndex)),t},e.prototype.getTileColumnIndex=function(){return this.tileColumnIndex},e.prototype.setTileColumnIndex=function(t){this.tileColumnIndex=t},e.prototype.hasTileColumnColumn=function(){return this.tileColumnIndex>=0},e.prototype.getTileColumnColumn=function(){var t=null;return this.hasTileColumnColumn()&&(t=this.getColumnForIndex(this.tileColumnIndex)),t},e.prototype.getTileRowIndex=function(){return this.tileRowIndex},e.prototype.setTileRowIndex=function(t){this.tileRowIndex=t},e.prototype.hasTileRowColumn=function(){return this.tileRowIndex>=0},e.prototype.getTileRowColumn=function(){var t=null;return this.hasTileRowColumn()&&(t=this.getColumnForIndex(this.tileRowIndex)),t},e.prototype.getTileDataIndex=function(){return this.tileDataIndex},e.prototype.setTileDataIndex=function(t){this.tileDataIndex=t},e.prototype.hasTileDataColumn=function(){return this.tileDataIndex>=0},e.prototype.getTileDataColumn=function(){var t=null;return this.hasTileDataColumn()&&(t=this.getColumnForIndex(this.tileDataIndex)),t},e.ID="id",e.ZOOM_LEVEL="zoom_level",e.TILE_COLUMN="tile_column",e.TILE_ROW="tile_row",e.TILE_DATA="tile_data",e}(n(2114).UserColumns);e.TileColumns=a},1394:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TileDao=void 0;var a=n(4668),s=n(3506),u=n(5925),l=n(1332),c=n(8334),h=n(7218),f=n(8572),p=n(3684),d=n(2527),y=n(1584),m=n(5604),g=n(1375),_=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;o.tileMatrixSet=r,o.tileMatrices=i,o.zoomLevelToTileMatrix=[],o.widths=[],o.heights=[],0===i.length?(o.minZoom=0,o.maxZoom=0):(o.minZoom=o.tileMatrices[0].zoom_level,o.maxZoom=o.tileMatrices[o.tileMatrices.length-1].zoom_level);for(var a=o.tileMatrices.length-1;a>=0;a--){var s=o.tileMatrices[a];o.zoomLevelToTileMatrix[s.zoom_level]=s}return o.initialize(),o}return i(e,t),e.prototype.initialize=function(){var t=this.geoPackage.tileMatrixSetDao;this.srs=t.getSrs(this.tileMatrixSet),this.projection=[this.srs.organization.toUpperCase(),this.srs.organization_coordsys_id].join(":"),m.Projection.loadProjection(this.projection,this.srs.definition);for(var e=this.tileMatrices.length-1;e>=0;e--){var n=this.tileMatrices[e],r=n.pixel_x_size*n.tile_width,i=n.pixel_y_size*n.tile_height,o=m.Projection.getConverter(this.projection);o.to_meter&&(r=o.to_meter*n.pixel_x_size*n.tile_width,i=o.to_meter*n.pixel_y_size*n.tile_height),this.widths.push(r),this.heights.push(i)}this.setWebMapZoomLevels()},e.prototype.webZoomToGeoPackageZoom=function(t){var e=p.TileBoundingBoxUtils.getWebMercatorBoundingBoxFromXYZ(0,0,t);return this.determineGeoPackageZoomLevel(e,t)},e.prototype.setWebMapZoomLevels=function(){this.minWebMapZoom=20,this.maxWebMapZoom=0,this.webZoomToGeoPackageZooms={};for(var t=this.tileMatrixSet.max_x-this.tileMatrixSet.min_x,e=this.tileMatrixSet.max_y-this.tileMatrixSet.min_y,n=0;nh&&(this.minWebMapZoom=h),this.maxWebMapZoom~~r.matrix_width&&(r.matrix_width=~~i),o>~~r.matrix_height&&(r.matrix_height=~~o)}},e.prototype.getTileMatrixWithZoomLevel=function(t){return this.zoomLevelToTileMatrix[t]},e.prototype.getZoomLevelForLength=function(t){return y.TileDaoUtils.getZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getClosestZoomLevelForLength=function(t){return y.TileDaoUtils.getClosestZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getClosestZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getClosestZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getApproximateZoomLevelForLength=function(t){return y.TileDaoUtils.getApproximateZoomLevelForLength(this.widths,this.heights,this.tileMatrices,t)},e.prototype.getApproximateZoomLevelForWidthAndHeight=function(t,e){return y.TileDaoUtils.getApproximateZoomLevelForWidthAndHeight(this.widths,this.heights,this.tileMatrices,t,e)},e.prototype.getMaxLength=function(){return y.TileDaoUtils.getMaxLengthForTileWidthsAndHeights(this.widths,this.heights)},e.prototype.getMinLength=function(){return y.TileDaoUtils.getMinLengthForTileWidthsAndHeights(this.widths,this.heights)},e.prototype.queryForTile=function(t,e,n){var r,i,a,s=new f.ColumnValues;s.addColumn(c.TileColumn.COLUMN_TILE_COLUMN,t),s.addColumn(c.TileColumn.COLUMN_TILE_ROW,e),s.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,n);try{for(var u=o(this.queryForFieldValues(s)),l=u.next();!l.done;l=u.next()){var h=l.value;a=this.getRow(h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return a},e.prototype.queryForTilesWithZoomLevel=function(t){var e,n=this,r=this.queryForEach(c.TileColumn.COLUMN_ZOOM_LEVEL,t);return(e={})[Symbol.iterator]=function(){return this},e.next=function(){var t=r.next();return t.done?{value:void 0,done:!0}:{value:n.getRow(t.value),done:!1}},e},e.prototype.queryForTilesDescending=function(t){var e,n=this,r=this.queryForEach(c.TileColumn.COLUMN_ZOOM_LEVEL,t,void 0,void 0,c.TileColumn.COLUMN_TILE_COLUMN+" DESC, "+c.TileColumn.COLUMN_TILE_ROW+" DESC");return(e={})[Symbol.iterator]=function(){return this},e.next=function(){var t=r.next();return t.done?{value:void 0,done:!0}:{value:n.getRow(t.value),done:!1}},e},e.prototype.queryForTilesInColumn=function(t,e){var n,r=this,i=new f.ColumnValues;i.addColumn(c.TileColumn.COLUMN_TILE_COLUMN,t),i.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,e);var o=this.queryForFieldValues(i);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=o.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n},e.prototype.queryForTilesInRow=function(t,e){var n,r=this,i=new f.ColumnValues;i.addColumn(c.TileColumn.COLUMN_TILE_ROW,t),i.addColumn(c.TileColumn.COLUMN_ZOOM_LEVEL,e);var o=this.queryForFieldValues(i);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=o.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n},e.prototype.queryByTileGrid=function(t,e){var n,r=this;if(t){var i="";i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,e),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.min_x,">="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.max_x,"<="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.min_y,">="),i+=" and ",i+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.max_y,"<=");var o=this.buildWhereArgs([e,t.min_x,t.max_x,t.min_y,t.max_y]),a=this.queryWhereWithArgsDistinct(i,o);return(n={})[Symbol.iterator]=function(){return this},n.next=function(){var t=a.next();return t.done?{value:void 0,done:!0}:{value:r.getRow(t.value),done:!1}},n}},e.prototype.countByTileGrid=function(t,e){if(t){var n="";n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,e),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.min_x,">="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t.max_x,"<="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.min_y,">="),n+=" and ",n+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,t.max_y,"<=");var r=this.buildWhereArgs([e,t.min_x,t.max_x,t.min_y,t.max_y]);return this.countWhere(n,r)}},e.prototype.deleteTile=function(t,e,n){var r="";r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_ZOOM_LEVEL,n),r+=" and ",r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_COLUMN,t),r+=" and ",r+=this.buildWhereWithFieldAndValue(c.TileColumn.COLUMN_TILE_ROW,e);var i=this.buildWhereArgs([n,t,e]);return this.deleteWhere(r,i)},e.prototype.dropTable=function(){var t=this.geoPackage.tileMatrixDao,e=a.UserDao.prototype.dropTable.call(this);this.geoPackage.tileMatrixSetDao.delete(this.tileMatrixSet);for(var n=this.tileMatrices.length-1;n>=0;n--){var r=this.tileMatrices[n];t.delete(r)}return this.geoPackage.contentsDao.deleteById(this.gpkgTableName),e},e.prototype.rename=function(e){t.prototype.rename.call(this,e);var n=this.tileMatrixSet.table_name,r={};r[u.TileMatrixSetDao.COLUMN_TABLE_NAME]=e;var i=this.buildWhereWithFieldAndValue(u.TileMatrixSetDao.COLUMN_TABLE_NAME,n),o=this.buildWhereArgs([n]),a=this.geoPackage.contentsDao,l=a.queryForId(n);l.table_name=e,l.identifier=e,a.create(l),this.geoPackage.tileMatrixSetDao.updateWithValues(r,i,o);var c=this.geoPackage.tileMatrixDao,h={};h[s.TileMatrixDao.COLUMN_TABLE_NAME]=e;var f=this.buildWhereWithFieldAndValue(s.TileMatrixDao.COLUMN_TABLE_NAME,n);c.updateWithValues(h,f,o),a.deleteById(n)},e.readTable=function(t,e){return t.getTileDao(e)},e}(a.UserDao);e.TileDao=_},1584:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TileDaoUtils=void 0;var i=r(n(5871)),o=r(n(1159)),a=function(){function t(){}return t.adjustTileMatrixLengths=function(t,e){var n=t.max_x-t.min_x,r=t.max_y-t.min_y;e.forEach((function(t){var e=Math.floor(n/(t.pixel_x_size*t.tile_width)),i=Math.floor(r/(t.pixel_y_size*t.tile_height));e>t.matrix_width&&(t.matrix_width=e),i>t.matrix_height&&(t.matrix_height=i)}))},t.getZoomLevelForLength=function(e,n,r,i){return t._getZoomLevelForLength(e,n,r,i,!0)},t.getZoomLevelForWidthAndHeight=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,o,!0)},t.getClosestZoomLevelForLength=function(e,n,r,i){return t._getZoomLevelForLength(e,n,r,i,!1)},t.getClosestZoomLevelForWidthAndHeight=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,o,!1)},t._getZoomLevelForLength=function(e,n,r,i,o){return t._getZoomLevelForWidthAndHeight(e,n,r,i,i,o)},t._getZoomLevelForWidthAndHeight=function(e,n,r,a,s,u){var l=null,c=(0,i.default)(e,a);-1===c&&(c=(0,o.default)(e,a)),c<0&&(c=-1*(c+1));var h=(0,i.default)(n,s);if(-1===h&&(h=(0,o.default)(n,s)),h<0&&(h=-1*(h+1)),0==c?u&&a=t.getMaxLength(e)?c=-1:--c:t.closerToZoomIn(e,a,c)&&--c,0==h?u&&s=t.getMaxLength(n)?h=-1:--h:t.closerToZoomIn(n,s,h)&&--h,c>=0||h>=0){var f;f=c<0?h:h<0?c:Math.min(c,h),l=t.getTileMatrixAtLengthIndex(r,f).zoom_level}return l},t.closerToZoomIn=function(t,e,n){return Math.log(e/t[n-1])/Math.log(2)s){var p=Math.log(r/s)/Math.log(2);l=Math.ceil(p),c=Math.floor(p),h=s*Math.pow(2,l),f=s*Math.pow(2,c),o=n[0].zoom_level,o-=r-f<=h-r?c:l}else{var d=(0,i.default)(e,r);d<0&&(d=-1*(d+1));var y=Math.log(r/e[d])/Math.log(.5),m=t.getTileMatrixAtLengthIndex(n,d).zoom_level;o=m+=Math.round(y)}return o},t.getMaxLengthForTileWidthsAndHeights=function(e,n){var r=t.getMaxLength(e),i=t.getMaxLength(n);return Math.min(r,i)},t.getMinLengthForTileWidthsAndHeights=function(e,n){var r=t.getMinLength(e),i=t.getMinLength(n);return Math.max(r,i)},t.getMaxLength=function(t){return t[t.length-1]/.51},t.getMinLength=function(t){return.51*t[0]},t}();e.TileDaoUtils=a},1332:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileRow=void 0;var o=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.tileTable=e,i}return i(e,t),Object.defineProperty(e.prototype,"zoomLevelColumnIndex",{get:function(){return this.tileTable.getZoomLevelColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevelColumn",{get:function(){return this.tileTable.getZoomLevelColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this.getValueWithColumnName(this.zoomLevelColumn.name)},set:function(t){this.setValueWithIndex(this.zoomLevelColumnIndex,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumnColumnIndex",{get:function(){return this.tileTable.getTileColumnColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumnColumn",{get:function(){return this.tileTable.getTileColumnColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileColumn",{get:function(){return this.getValueWithColumnName(this.tileColumnColumn.name)},set:function(t){this.setValueWithColumnName(this.tileColumnColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowColumnIndex",{get:function(){return this.tileTable.getTileRowColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowColumn",{get:function(){return this.tileTable.getTileRowColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.getValueWithColumnName(this.rowColumn.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileRow",{set:function(t){this.setValueWithColumnName(this.rowColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataColumnIndex",{get:function(){return this.tileTable.getTileDataColumnIndex()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataColumn",{get:function(){return this.tileTable.getTileDataColumn()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileData",{get:function(){return this.getValueWithColumnName(this.tileDataColumn.name)},set:function(t){this.setValueWithColumnName(this.tileDataColumn.name,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileDataImage",{get:function(){return null},enumerable:!1,configurable:!0}),e}(n(2224).UserRow);e.TileRow=o},8704:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileTable=void 0;var o=n(8018),a=n(8334),s=n(6295),u=n(1648),l=n(9971),c=function(t){function e(e,n){var r=t.call(this,new s.TileColumns(e,n,!1))||this,i=new u.UniqueConstraint;return i.add(r.getUserColumns().getZoomLevelColumn()),i.add(r.getUserColumns().getTileColumnColumn()),i.add(r.getUserColumns().getTileRowColumn()),r.addConstraint(i),r}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.columns._columns)},e.prototype.getDataType=function(){return l.ContentsDataType.TILES},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.createUserColumns=function(t){return new s.TileColumns(this.getTableName(),t,!0)},e.prototype.getZoomLevelColumnIndex=function(){return this.getUserColumns().getZoomLevelIndex()},e.prototype.getZoomLevelColumn=function(){return this.getUserColumns().getZoomLevelColumn()},e.prototype.getTileColumnColumnIndex=function(){return this.getUserColumns().getTileColumnIndex()},e.prototype.getTileColumnColumn=function(){return this.getUserColumns().getTileColumnColumn()},e.prototype.getTileRowColumnIndex=function(){return this.getUserColumns().getTileRowIndex()},e.prototype.getTileRowColumn=function(){return this.getUserColumns().getTileRowColumn()},e.prototype.getTileDataColumnIndex=function(){return this.getUserColumns().getTileDataIndex()},e.prototype.getTileDataColumn=function(){return this.getUserColumns().getTileDataColumn()},e.createRequiredColumns=function(t){void 0===t&&(t=0);var e=[];return e.push(a.TileColumn.createIdColumn(t++)),e.push(a.TileColumn.createZoomLevelColumn(t++)),e.push(a.TileColumn.createTileColumnColumn(t++)),e.push(a.TileColumn.createTileRowColumn(t++)),e.push(a.TileColumn.createTileDataColumn(t)),e},e.prototype.validateContents=function(t){var e=t.data_type;if(null==e||e!==l.ContentsDataType.TILES)throw new Error("The Contents of a TileTable must have a data type of tiles")},e.COLUMN_ID=s.TileColumns.ID,e.COLUMN_ZOOM_LEVEL=s.TileColumns.ZOOM_LEVEL,e.COLUMN_TILE_COLUMN=s.TileColumns.TILE_COLUMN,e.COLUMN_TILE_ROW=s.TileColumns.TILE_ROW,e.COLUMN_TILE_DATA=s.TileColumns.TILE_DATA,e}(o.UserTable);e.TileTable=c},9631:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TileTableReader=void 0;var o=n(4880),a=n(8704),s=n(8334),u=function(t){function e(e){var n=t.call(this,e.table_name)||this;return n.tileMatrixSet=e,n}return i(e,t),e.prototype.readTileTable=function(t){return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new a.TileTable(t,e)},e.prototype.createColumn=function(t){return new s.TileColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},e}(o.UserTableReader);e.TileTableReader=u},5762:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomColumn=void 0;var o=n(5865),a=n(7319),s=n(5071),u=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,e,n,r,i,o,a,s,u)||this;if(null==r)throw new Error("Data type is required to create column: "+n);return l}return i(e,t),e.createColumn=function(t,n,r,i,o,a,s){return void 0===i&&(i=!1),new e(t,n,r,a,i,o,!1,s)},e.createPrimaryKeyColumn=function(t,n,r){return void 0===r&&(r=s.UserTableDefaults.DEFAULT_AUTOINCREMENT),new e(t,n,a.GeoPackageDataType.INTEGER,void 0,void 0,void 0,!0,r)},e}(o.UserColumn);e.UserCustomColumn=u},496:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomColumns=void 0;var o=function(t){function e(e,n,r,i){var o=t.call(this,e,n,i)||this;return o.requiredColumns=null==r?[]:r.slice(),o.updateColumns(),o}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getColumns(),this.getRequiredColumns(),this.isCustom())},e.prototype.getRequiredColumns=function(){return this.requiredColumns},e.prototype.setRequiredColumns=function(t){void 0===t&&(t=[]),this.requiredColumns=t.slice()},e.prototype.updateColumns=function(){var e=this;if(t.prototype.updateColumns.call(this),!this.isCustom()&&null!==this.requiredColumns&&0!==this.requiredColumns.length){var n=new Set(this.requiredColumns),r={};this.getColumns().forEach((function(t){var i=t.getName(),o=t.getIndex();if(n.has(i)){var a=r[i];e.duplicateCheck(o,a,i),r[i]=o}})),n.forEach((function(t){e.missingCheck(r[t],t)}))}},e}(n(2114).UserColumns);e.UserCustomColumns=o},1447:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomDao=void 0;var o=n(4668),a=n(362),s=function(t){function e(e,n){return t.call(this,e,n)||this}return i(e,t),e.prototype.createObject=function(t){return this.getRow(t)},e.readTable=function(t,n){return new e(t,new a.UserCustomTableReader(n).readTable(t.database))},e}(o.UserDao);e.UserCustomDao=s},2378:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomTable=void 0;var o=n(8018),a=n(496),s=function(t){function e(e,n,r){return void 0===r&&(r=[]),t.call(this,new a.UserCustomColumns(e,n,r,!0))||this}return i(e,t),e.prototype.copy=function(){return new e(this.getTableName(),this.getUserColumns().getColumns(),this.getUserColumns().getRequiredColumns())},e.prototype.getDataType=function(){return null},e.prototype.getUserColumns=function(){return t.prototype.getUserColumns.call(this)},e.prototype.getRequiredColumns=function(){return this.getUserColumns().getRequiredColumns()},e}(o.UserTable);e.UserCustomTable=s},362:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserCustomTableReader=void 0;var o=n(2378),a=n(4880),s=n(5762),u=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.readUserCustomTable=function(t){return this.readTable(t.database)},e.prototype.createTable=function(t,e){return new o.UserCustomTable(t,e,null)},e.prototype.createColumn=function(t){return new s.UserCustomColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},e}(a.UserTableReader);e.UserCustomTableReader=u},5865:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UserColumn=void 0;var i=r(n(8446)),o=n(7319),a=n(2841),s=n(1133),u=n(91),l=n(5071),c=n(7686),h=function(){function t(t,e,n,r,i,o,a,s,u){this.index=t,this.name=e,this.dataType=n,this.max=r,this.notNull=i,this.defaultValue=o,this.primaryKey=a,this.autoincrement=s,this.unique=u,this.constraints=new c.Constraints,this.validateMax(),this.type=this.getTypeName(e,n),this.addDefaultConstraints()}return t.validateDataType=function(t,e){if(null==e)throw new Error("Data Type is required to create column: "+t)},t.prototype.copy=function(){var e=new t(this.index,this.name,this.dataType,this.max,this.notNull,this.defaultValue,this.primaryKey,this.unique);return e.min=this.min,e.constraints=this.constraints.copy(),e},t.prototype.clearConstraints=function(){return this.constraints.clear()},t.prototype.getConstraints=function(){return this.constraints},t.prototype.setIndex=function(t){if(this.hasIndex()){if(!(0,i.default)(t,this.index))throw new Error("User Column with a valid index may not be changed. Column Name: "+this.name+", Index: "+this.index+", Attempted Index: "+this.index)}else this.index=t},t.prototype.hasIndex=function(){return this.index>t.NO_INDEX},t.prototype.resetIndex=function(){this.index=t.NO_INDEX},t.prototype.getIndex=function(){return this.index},t.prototype.setName=function(t){this.name=t},t.prototype.getName=function(){return this.name},t.prototype.isNamed=function(t){return this.name===t},t.prototype.hasMax=function(){return null!=this.max},t.prototype.setMax=function(t){this.max=t},t.prototype.getMax=function(){return this.max},t.prototype.setNotNull=function(t){this.notNull!==t&&(t?this.addNotNullConstraint():this.removeConstraintByType(u.ConstraintType.NOT_NULL)),this.notNull=t},t.prototype.isNotNull=function(){return this.notNull},t.prototype.hasDefaultValue=function(){return null!==this.defaultValue&&void 0!==this.defaultValue},t.prototype.setDefaultValue=function(t){this.removeConstraintByType(u.ConstraintType.DEFAULT),null!=t&&this.addDefaultValueConstraint(t),this.defaultValue=t},t.prototype.getDefaultValue=function(){return this.defaultValue},t.prototype.setPrimaryKey=function(t){this.primaryKey!==t&&(t?this.addPrimaryKeyConstraint():(this.autoincrement=!1,this.removeConstraintByType(u.ConstraintType.AUTOINCREMENT),this.removeConstraintByType(u.ConstraintType.PRIMARY_KEY))),this.primaryKey=t},t.prototype.isPrimaryKey=function(){return this.primaryKey},t.prototype.setAutoincrement=function(t){this.autoincrement!==t&&(t?this.addAutoincrementConstraint():this.removeConstraintByType(u.ConstraintType.AUTOINCREMENT)),this.autoincrement=t},t.prototype.isAutoincrement=function(){return this.autoincrement},t.prototype.setUnique=function(t){this.unique!==t&&(t?this.addUniqueConstraint():this.removeConstraintByType(u.ConstraintType.UNIQUE)),this.unique=t},t.prototype.isUnique=function(){return this.unique},t.prototype.setDataType=function(t){this.dataType=t},t.prototype.getDataType=function(){return this.dataType},t.prototype.getTypeName=function(e,n){return t.validateDataType(e,n),o.GeoPackageDataType.nameFromType(n)},t.prototype.validateMax=function(){if(this.max&&this.dataType!==o.GeoPackageDataType.TEXT&&this.dataType!==o.GeoPackageDataType.BLOB)throw new Error("Column max is only supported for TEXT and BLOB columns. column: "+this.name+", max: "+this.max+", type: "+this.dataType);return!0},t.createPrimaryKeyColumn=function(e,n,r){return void 0===r&&(r=l.UserTableDefaults.DEFAULT_AUTOINCREMENT),new t(e,n,o.GeoPackageDataType.INTEGER,void 0,!0,void 0,!0,r)},t.createColumn=function(e,n,r,i,o,a){return void 0===i&&(i=!1),new t(e,n,r,a,i,o,!1)},t.prototype.addDefaultConstraints=function(){this.isNotNull()&&this.addNotNullConstraint(),this.hasDefaultValue()&&this.addDefaultValueConstraint(this.getDefaultValue()),this.isPrimaryKey()&&(this.addPrimaryKeyConstraint(),this.isAutoincrement()&&this.addAutoincrementConstraint()),this.isUnique()&&this.addUniqueConstraint()},t.prototype.addConstraint=function(t){null!==t.order&&void 0!==t.order||this.setConstraintOrder(t),this.constraints.add(t)},t.prototype.setConstraintOrder=function(e){var n=null;switch(e.getType()){case u.ConstraintType.PRIMARY_KEY:n=t.PRIMARY_KEY_CONSTRAINT_ORDER;break;case u.ConstraintType.UNIQUE:n=t.UNIQUE_CONSTRAINT_ORDER;break;case u.ConstraintType.NOT_NULL:n=t.NOT_NULL_CONSTRAINT_ORDER;break;case u.ConstraintType.DEFAULT:n=t.DEFAULT_VALUE_CONSTRAINT_ORDER;break;case u.ConstraintType.AUTOINCREMENT:n=t.AUTOINCREMENT_CONSTRAINT_ORDER}e.order=n},t.prototype.addConstraintSql=function(t){var e=s.ConstraintParser.getType(t),n=s.ConstraintParser.getName(t);this.constraints.add(new a.RawConstraint(e,n,t))},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.addColumnConstraints=function(t){this.addConstraints(t.getConstraints())},t.prototype.addNotNullConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.NOT_NULL,null,"NOT NULL",t.NOT_NULL_CONSTRAINT_ORDER))},t.prototype.addDefaultValueConstraint=function(e){this.addConstraint(new a.RawConstraint(u.ConstraintType.DEFAULT,null,"DEFAULT "+o.GeoPackageDataType.columnDefaultValue(e,this.getDataType()),t.DEFAULT_VALUE_CONSTRAINT_ORDER))},t.prototype.addPrimaryKeyConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.PRIMARY_KEY,null,"PRIMARY KEY",t.PRIMARY_KEY_CONSTRAINT_ORDER))},t.prototype.addAutoincrementConstraint=function(){if(!this.isPrimaryKey())throw new Error("Autoincrement may only be set on a primary key column");this.addConstraint(new a.RawConstraint(u.ConstraintType.AUTOINCREMENT,null,"AUTOINCREMENT",t.AUTOINCREMENT_CONSTRAINT_ORDER))},t.prototype.addUniqueConstraint=function(){this.addConstraint(new a.RawConstraint(u.ConstraintType.UNIQUE,null,"UNIQUE",t.UNIQUE_CONSTRAINT_ORDER))},t.prototype.removeConstraintByType=function(t){this.constraints.clearConstraintsByType(t)},t.prototype.getType=function(){return this.type},t.prototype.hasConstraints=function(){return this.constraints.has()},t.prototype.buildConstraintSql=function(t){var e=null;return!l.UserTableDefaults.DEFAULT_PK_NOT_NULL&&this.isPrimaryKey()&&t.getType()===u.ConstraintType.NOT_NULL||(e=t.buildSql()),e},t.NO_INDEX=-1,t.NOT_NULL_CONSTRAINT_ORDER=1,t.DEFAULT_VALUE_CONSTRAINT_ORDER=2,t.PRIMARY_KEY_CONSTRAINT_ORDER=3,t.AUTOINCREMENT_CONSTRAINT_ORDER=4,t.UNIQUE_CONSTRAINT_ORDER=5,t}();e.UserColumn=h},2114:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserColumns=void 0;var r=n(7319),i=function(){function t(t,e,n){void 0===n&&(n=!1),this._pkIndex=-1,this._tableName=t,this._columns=e,this._custom=n,this._nameToIndex=new Map,this._columnNames=[]}return t.prototype.copy=function(){var e=[];this._columns.forEach((function(t){e.push(t.copy())}));var n=new t(this._tableName,e,this._custom);return n._columnNames=Array.from(this._columnNames),n._nameToIndex=new Map(this._nameToIndex),n._pkIndex=this._pkIndex,n},t.prototype.updateColumns=function(){var t=this;if(this._nameToIndex.clear(),!this._custom){var e=new Set,n=[];this._columns.forEach((function(r){if(r.hasIndex()){var i=r.getIndex();if(e.has(i))throw new Error("Duplicate index: "+i+", Table Name: "+t._tableName);e.add(i)}else n.push(r)}));var r=-1;n.forEach((function(t){for(;e.has(++r););t.setIndex(r)})),this._columns.sort((function(t,e){return t.index-e.index}))}this._pkIndex=-1,this._columnNames=[];for(var i=0;i=0},t.prototype.getPkColumnIndex=function(){return this._pkIndex},t.prototype.getPkColumn=function(){var t=null;return this.hasPkColumn()&&(t=this._columns[this._pkIndex]),t},t.prototype.getPkColumnName=function(){return this.getPkColumn().getName()},t.prototype.columnsOfType=function(t){return this._columns.filter((function(e){return e.getDataType()===t}))},t.prototype.addColumn=function(t){this._columns.push(t),this.updateColumns()},t.prototype.renameColumn=function(t,e){this.renameColumnWithName(t.getName(),e),t.setName(e)},t.prototype.renameColumnWithName=function(t,e){this.renameColumnWithIndex(this.getColumnIndexForColumnName(t),e)},t.prototype.renameColumnWithIndex=function(t,e){this._columns[t].setName(e),this.updateColumns()},t.prototype.dropColumn=function(t){this.dropColumnWithIndex(t.getIndex())},t.prototype.dropColumnWithName=function(t){this.dropColumnWithIndex(this.getColumnIndexForColumnName(t))},t.prototype.dropColumnWithIndex=function(t){this._columns.splice(t,1),this._columns.forEach((function(t){return t.resetIndex()})),this.updateColumns()},t.prototype.alterColumn=function(t){var e=this.getColumn(t.getName()).getIndex();t.setIndex(e),this._columns[e]=t},t}();e.UserColumns=i},4668:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.UserDao=void 0;var o=n(4115),a=n(6366),s=n(4599),u=n(2224),l=n(8483),c=n(8314),h=n(5042),f=function(t){function e(e,n){var r=t.call(this,e)||this;return r._table=n,r.table_name=n.getTableName(),r.gpkgTableName=n.getTableName(),n.getPkColumn()?r.idColumns=[n.getPkColumn().getName()]:r.idColumns=[],r.columns=n.getUserColumns().getColumnNames(),r}return i(e,t),e.prototype.createObject=function(t){return t?this.getRow(t):this.newRow()},e.prototype.setValueInObject=function(t,e,n){t.setValueNoValidationWithIndex(e,n)},e.prototype.getRow=function(t){if(t instanceof u.UserRow)return t;if(this.table){for(var e=this.table.getColumnCount(),n={},r=0;r{"use strict";var r=n(3085).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.UserRow=void 0;var i=n(7319),o=function(){function t(t,e,n){if(this.table=t,this.columnTypes=e,this.values=n,!this.columnTypes){var r=this.table.getColumnCount();this.columnTypes={},this.values={};for(var i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTable=void 0;var r=n(7686),i=function(){function t(t){this.constraints=new r.Constraints,this.columns=t,this.constraints=new r.Constraints}return t.prototype.copy=function(){var e=new t(this.columns.copy());return e.constraints.addConstraints(this.constraints),null!==this.contents&&void 0!==this.contents&&(e.contents=this.contents.copy()),e},t.prototype.getTableName=function(){return this.columns.getTableName()},Object.defineProperty(t.prototype,"tableType",{get:function(){return"userTable"},enumerable:!1,configurable:!0}),t.prototype.getUserColumns=function(){return this.columns},t.prototype.getColumnIndex=function(t){return this.columns.getColumnIndexForColumnName(t)},t.prototype.hasColumn=function(t){try{return this.getColumnIndex(t),!0}catch(t){return!1}},t.prototype.getColumnNameWithIndex=function(t){return this.columns.getColumnName(t)},t.prototype.getColumnWithIndex=function(t){return this.columns.getColumnForIndex(t)},t.prototype.getColumnWithColumnName=function(t){return this.getColumnWithIndex(this.getColumnIndex(t))},t.prototype.getColumnCount=function(){return this.columns.columnCount()},t.prototype.getPkColumn=function(){return this.columns.getPkColumn()},t.prototype.getPkColumnName=function(){return this.columns.getPkColumnName()},t.prototype.getIdColumnIndex=function(){return this.columns.getPkColumnIndex()},t.prototype.getIdColumn=function(){return this.getPkColumn()},t.prototype.addConstraint=function(t){this.constraints.add(t)},t.prototype.addConstraints=function(t){this.constraints.addConstraints(t)},t.prototype.hasConstraints=function(){return this.constraints.has()},t.prototype.getConstraints=function(){return this.constraints},t.prototype.getConstraintsByType=function(t){return this.constraints.getConstraintsForType(t)},t.prototype.clearConstraints=function(){return this.constraints.clear()},t.prototype.columnsOfType=function(t){return this.columns.columnsOfType(t)},t.prototype.getContents=function(){return this.contents},t.prototype.setContents=function(t){this.contents=t,null!=t&&this.validateContents(t)},t.prototype.validateContents=function(t){},t.prototype.addColumn=function(t){this.columns.addColumn(t)},t.prototype.renameColumn=function(t,e){this.columns.renameColumn(t,e)},t.prototype.renameColumnWithName=function(t,e){this.columns.renameColumnWithName(t,e)},t.prototype.renameColumnAtIndex=function(t,e){this.columns.renameColumnWithIndex(t,e)},t.prototype.dropColumn=function(t){this.columns.dropColumn(t)},t.prototype.dropColumnWithName=function(t){this.columns.dropColumnWithName(t)},t.prototype.dropColumnWithIndex=function(t){this.columns.dropColumnWithIndex(t)},t.prototype.alterColumn=function(t){this.columns.alterColumn(t)},t}();e.UserTable=i},5071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTableDefaults=void 0;var n=function(){function t(){}return t.DEFAULT_AUTOINCREMENT=!0,t.DEFAULT_PK_NOT_NULL=!0,t}();e.UserTableDefaults=n},4880:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserTableReader=void 0;var r=n(5865),i=n(5045),o=n(7043),a=function(){function t(t){this.table_name=t}return t.prototype.readTable=function(t){var e=this,n=[],r=i.TableInfo.info(t,this.table_name);if(null==r)throw new Error("Table does not exist: "+this.table_name);var a=o.SQLiteMaster.queryForConstraints(t,this.table_name);r.getColumns().forEach((function(t){if(null===t.getDataType()||void 0===t.getDataType())throw new Error("Unsupported column data type "+t.getType());var r=e.createColumn(t),i=a.getColumnConstraints(r.getName());null!=i&&i.hasConstraints()&&(r.clearConstraints(),r.addConstraints(i.constraints)),n.push(r)}));var s=this.createTable(this.table_name,n);return s.addConstraints(a.getTableConstraints()),s},t.prototype.createColumn=function(t){return new r.UserColumn(t.index,t.name,t.dataType,t.max,t.notNull,t.defaultValue,t.primaryKey,t.autoincrement)},t}();e.UserTableReader=a},4275:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPackageValidate=e.GeoPackageValidationError=void 0;var i=r(n(3935)),o=n(1506),a=function(t,e){this.error=t,this.fatal=e};e.GeoPackageValidationError=a;var s=function(){function t(){}return t.hasGeoPackageExtension=function(t){var e=i.default.extname(t);return e&&""!==e&&(e.toLowerCase()==="."+o.GeoPackageConstants.GEOPACKAGE_EXTENSION.toLowerCase()||e.toLowerCase()==="."+o.GeoPackageConstants.GEOPACKAGE_EXTENDED_EXTENSION.toLowerCase())},t.validateGeoPackageExtension=function(e){if(!t.hasGeoPackageExtension(e))return new a("GeoPackage database file '"+e+"' does not have a valid extension of '"+o.GeoPackageConstants.GEOPACKAGE_EXTENSION+"' or '"+o.GeoPackageConstants.GEOPACKAGE_EXTENDED_EXTENSION+"'",!0)},t.validateMinimumTables=function(t){var e=[],n=t.spatialReferenceSystemDao.isTableExists(),r=t.contentsDao.isTableExists();return n||e.push(new a("gpkg_spatial_ref_sys table does not exist",!0)),r||e.push(new a("gpkg_contents table does not exist",!0)),e},t.hasMinimumTables=function(t){return 0==this.validateMinimumTables(t).length},t}();e.GeoPackageValidate=s},2038:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.WKB=void 0;var r=function(){function t(){}return t.fromName=function(e){return"GEOMETRY"===(e=e.toUpperCase())?t.typeMap.wkb.GeometryCollection:t.wktToEnum[e]},t.typeMap={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7}},t.wktToEnum=((n={})[t.typeMap.wkt.Point]=t.typeMap.wkb.Point,n[t.typeMap.wkt.LineString]=t.typeMap.wkb.LineString,n[t.typeMap.wkt.Polygon]=t.typeMap.wkb.Polygon,n[t.typeMap.wkt.MultiPoint]=t.typeMap.wkb.MultiPoint,n[t.typeMap.wkt.MultiLineString]=t.typeMap.wkb.MultiLineString,n[t.typeMap.wkt.MultiPolygon]=t.typeMap.wkb.MultiPolygon,n[t.typeMap.wkt.GeometryCollection]=t.typeMap.wkb.GeometryCollection,n),t}();e.WKB=r},2511:function(t,e,n){var r;t=n.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,u=36,l=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(t){throw RangeError(f[t])}function m(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+m((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=d((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+d(t)})).join("")}function v(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,n){var r=0;for(t=n?p(t/700):t>>1,t+=p(t/e);t>455;r+=u)t=p(t/35);return p(r+36*t/(t+38))}function E(t){var e,n,r,i,o,a,l,c,h,f,d,m=[],g=t.length,_=0,v=128,E=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),m.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=g&&y("invalid-input"),((c=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||c>p((s-_)/a))&&y("overflow"),_+=c*a,!(c<(h=l<=E?1:l>=E+26?26:l-E));l+=u)a>p(s/(f=u-h))&&y("overflow"),a*=f;E=T(_-o,e=m.length+1,0==o),p(_/e)>s-v&&y("overflow"),v+=p(_/e),_%=e,m.splice(_++,0,v)}return b(m)}function w(t){var e,n,r,i,o,a,l,c,h,f,m,g,b,E,w,x=[];for(g=(t=_(t)).length,e=128,n=0,o=72,a=0;a=e&&mp((s-n)/(b=r+1))&&y("overflow"),n+=(l-e)*b,e=l,a=0;as&&y("overflow"),m==e){for(c=n,h=u;!(c<(f=h<=o?1:h>=o+26?26:h-o));h+=u)w=c-f,E=u-f,x.push(d(v(f+w%E,0))),c=p(w/E);x.push(d(v(c,0))),o=T(n,b,r==i),n=0,++r}++n,++e}return x.join("")}a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:E,encode:w,toASCII:function(t){return g(t,(function(t){return c.test(t)?"xn--"+w(t):t}))},toUnicode:function(t){return g(t,(function(t){return l.test(t)?E(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return a}.call(e,n,e,t))||(t.exports=r)}()},8575:(t,e,n)=>{"use strict";var r=n(2511),i=n(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){return i.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=n(7673);function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o127?R+="x":R+=P[L];if(!R.match(p)){var k=A.slice(0,S),F=A.slice(S+1),U=P.match(d);U&&(k.push(U[1]),F.unshift(U[2])),F.length&&(b="/"+F.join(".")+b),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+B,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[E])for(S=0,I=c.length;S0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=w.slice(-1)[0],M=(n.host||t.host||w.length>1)&&("."===C||".."===C)||""===C,S=0,N=w.length;N>=0;N--)"."===(C=w[N])?w.splice(N,1):".."===C?(w.splice(N,1),S++):S&&(w.splice(N,1),S--);if(!T&&!E)for(;S--;S)w.unshift("..");!T||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),M&&"/"!==w.join("/").substr(-1)&&w.push("");var O,A=""===w[0]||w[0]&&"/"===w[0].charAt(0);return x&&(n.hostname=n.host=A?"":w.length?w.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),(T=T||n.host&&w.length)&&!A&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},2502:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},4927:(t,e,n)=>{var r=n(5108);function i(t){try{if(!n.g.localStorage)return!1}catch(t){return!1}var e=n.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?r.trace(e):r.warn(e),n=!0}return t.apply(this,arguments)}}},1496:t=>{"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9539:(t,e,n)=>{var r=n(4155),i=n(5108),o=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),h(r,t,r.depth)}function l(t,e){var n=u.styles[e];return n?"["+u.colors[n][0]+"m"+t+"["+u.colors[n][1]+"m":t}function c(t,e){return t}function h(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=h(t,i,r)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return g(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),w(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(x(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(v(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return f(n)}var l,c="",T=!1,C=["{","}"];return d(n)&&(T=!0,C=["[","]"]),x(n)&&(c=" [Function"+(n.name?": "+n.name:"")+"]"),v(n)&&(c=" "+RegExp.prototype.toString.call(n)),E(n)&&(c=" "+Date.prototype.toUTCString.call(n)),w(n)&&(c=" "+f(n)),0!==a.length||T&&0!=n.length?r<0?v(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),l=T?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(l,c,C)):C[0]+c+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(n)?h(t,u.value,null):h(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return void 0===t}function v(t){return T(t)&&"[object RegExp]"===C(t)}function T(t){return"object"==typeof t&&null!==t}function E(t){return T(t)&&"[object Date]"===C(t)}function w(t){return T(t)&&("[object Error]"===C(t)||t instanceof Error)}function x(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function M(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(b(a)&&(a=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var n=r.pid;s[t]=function(){var r=e.format.apply(e,arguments);i.error("%s %d: %s",t,n,r)}}else s[t]=function(){};return s[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=_,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=v,e.isObject=T,e.isDate=E,e.isError=w,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(384);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var t=new Date,e=[M(t.getHours()),M(t.getMinutes()),M(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){i.log("%s - %s",N(),e.format.apply(e,arguments))},e.inherits=n(1496),e._extend=function(t,e){if(!e||!T(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}},8034:t=>{var e=arguments[3],n=arguments[4],r=arguments[5],i=JSON.stringify;t.exports=function(t,o){for(var a,s=Object.keys(r),u=0,l=s.length;u{var r=n(3085).Buffer;function i(t,e){this.buffer=t,this.position=0,this.isBigEndian=e||!1}function o(t,e,n){return function(){var r;return r=this.isBigEndian?e.call(this.buffer,this.position):t.call(this.buffer,this.position),this.position+=n,r}}t.exports=i,i.prototype.readUInt8=o(r.prototype.readUInt8,r.prototype.readUInt8,1),i.prototype.readUInt16=o(r.prototype.readUInt16LE,r.prototype.readUInt16BE,2),i.prototype.readUInt32=o(r.prototype.readUInt32LE,r.prototype.readUInt32BE,4),i.prototype.readInt8=o(r.prototype.readInt8,r.prototype.readInt8,1),i.prototype.readInt16=o(r.prototype.readInt16LE,r.prototype.readInt16BE,2),i.prototype.readInt32=o(r.prototype.readInt32LE,r.prototype.readInt32BE,4),i.prototype.readFloat=o(r.prototype.readFloatLE,r.prototype.readFloatBE,4),i.prototype.readDouble=o(r.prototype.readDoubleLE,r.prototype.readDoubleBE,8),i.prototype.readVarInt=function(){var t,e=0,n=0;do{e+=(127&(t=this.buffer[this.position+n]))<<7*n,n++}while(t>=128);return this.position+=n,e}},2659:(t,e,n)=>{var r=n(3085).Buffer;function i(t,e){this.buffer=new r(t),this.position=0,this.allowResize=e}function o(t,e){return function(n,r){this.ensureSize(e),t.call(this.buffer,n,this.position,r),this.position+=e}}t.exports=i,i.prototype.writeUInt8=o(r.prototype.writeUInt8,1),i.prototype.writeUInt16LE=o(r.prototype.writeUInt16LE,2),i.prototype.writeUInt16BE=o(r.prototype.writeUInt16BE,2),i.prototype.writeUInt32LE=o(r.prototype.writeUInt32LE,4),i.prototype.writeUInt32BE=o(r.prototype.writeUInt32BE,4),i.prototype.writeInt8=o(r.prototype.writeInt8,1),i.prototype.writeInt16LE=o(r.prototype.writeInt16LE,2),i.prototype.writeInt16BE=o(r.prototype.writeInt16BE,2),i.prototype.writeInt32LE=o(r.prototype.writeInt32LE,4),i.prototype.writeInt32BE=o(r.prototype.writeInt32BE,4),i.prototype.writeFloatLE=o(r.prototype.writeFloatLE,4),i.prototype.writeFloatBE=o(r.prototype.writeFloatBE,4),i.prototype.writeDoubleLE=o(r.prototype.writeDoubleLE,8),i.prototype.writeDoubleBE=o(r.prototype.writeDoubleBE,8),i.prototype.writeBuffer=function(t){this.ensureSize(t.length),t.copy(this.buffer,this.position,0,t.length),this.position+=t.length},i.prototype.writeVarInt=function(t){for(var e=1;0!=(4294967168&t);)this.writeUInt8(127&t|128),t>>>=7,e++;return this.writeUInt8(127&t),e},i.prototype.ensureSize=function(t){if(this.buffer.length{var r=n(3085).Buffer;t.exports=m;var i=n(4905),o=n(9213),a=n(9645),s=n(978),u=n(1665),l=n(9606),c=n(9763),h=n(2292),f=n(6382),p=n(2659),d=n(2620),y=n(3172);function m(){this.srid=void 0,this.hasZ=!1,this.hasM=!1}m.parse=function(t,e){if("string"==typeof t||t instanceof d)return m._parseWkt(t);if(r.isBuffer(t)||t instanceof f)return m._parseWkb(t,e);throw new Error("first argument must be a string or Buffer")},m._parseWkt=function(t){var e,n,r=(e=t instanceof d?t:new d(t)).matchRegex([/^SRID=(\d+);/]);r&&(n=parseInt(r[1],10));var f=e.matchType(),p=e.matchDimension(),y={srid:n,hasZ:p.hasZ,hasM:p.hasM};switch(f){case i.wkt.Point:return o._parseWkt(e,y);case i.wkt.LineString:return a._parseWkt(e,y);case i.wkt.Polygon:return s._parseWkt(e,y);case i.wkt.MultiPoint:return u._parseWkt(e,y);case i.wkt.MultiLineString:return l._parseWkt(e,y);case i.wkt.MultiPolygon:return c._parseWkt(e,y);case i.wkt.GeometryCollection:return h._parseWkt(e,y)}},m._parseWkb=function(t,e){var n,r,p,d={};switch((n=t instanceof f?t:new f(t)).isBigEndian=!n.readInt8(),r=n.readUInt32(),d.hasSrid=536870912==(536870912&r),d.isEwkb=536870912&r||1073741824&r||2147483648&r,d.hasSrid&&(d.srid=n.readUInt32()),d.hasZ=!1,d.hasM=!1,d.isEwkb||e&&e.isEwkb?(2147483648&r&&(d.hasZ=!0),1073741824&r&&(d.hasM=!0),p=15&r):r>=1e3&&r<2e3?(d.hasZ=!0,p=r-1e3):r>=2e3&&r<3e3?(d.hasM=!0,p=r-2e3):r>=3e3&&r<4e3?(d.hasZ=!0,d.hasM=!0,p=r-3e3):p=r,p){case i.wkb.Point:return o._parseWkb(n,d);case i.wkb.LineString:return a._parseWkb(n,d);case i.wkb.Polygon:return s._parseWkb(n,d);case i.wkb.MultiPoint:return u._parseWkb(n,d);case i.wkb.MultiLineString:return l._parseWkb(n,d);case i.wkb.MultiPolygon:return c._parseWkb(n,d);case i.wkb.GeometryCollection:return h._parseWkb(n,d);default:throw new Error("GeometryType "+p+" not supported")}},m.parseTwkb=function(t){var e,n={},r=(e=t instanceof f?t:new f(t)).readUInt8(),p=e.readUInt8(),d=15&r;if(n.precision=y.decode(r>>4),n.precisionFactor=Math.pow(10,n.precision),n.hasBoundingBox=p>>0&1,n.hasSizeAttribute=p>>1&1,n.hasIdList=p>>2&1,n.hasExtendedPrecision=p>>3&1,n.isEmpty=p>>4&1,n.hasExtendedPrecision){var m=e.readUInt8();n.hasZ=1==(1&m),n.hasM=2==(2&m),n.zPrecision=y.decode((28&m)>>2),n.zPrecisionFactor=Math.pow(10,n.zPrecision),n.mPrecision=y.decode((224&m)>>5),n.mPrecisionFactor=Math.pow(10,n.mPrecision)}else n.hasZ=!1,n.hasM=!1;if(n.hasSizeAttribute&&e.readVarInt(),n.hasBoundingBox){var g=2;n.hasZ&&g++,n.hasM&&g++;for(var _=0;_>>0,!0),t.writeUInt32LE(this.srid),t.writeBuffer(e.slice(5)),t.buffer},m.prototype._getWktType=function(t,e){var n=t;return this.hasZ&&this.hasM?n+=" ZM ":this.hasZ?n+=" Z ":this.hasM&&(n+=" M "),!e||this.hasZ||this.hasM||(n+=" "),e&&(n+="EMPTY"),n},m.prototype._getWktCoordinate=function(t){var e=t.x+" "+t.y;return this.hasZ&&(e+=" "+t.z),this.hasM&&(e+=" "+t.m),e},m.prototype._writeWkbType=function(t,e,n){var r=0;void 0!==this.srid||n&&void 0!==n.srid?(this.hasZ&&(r|=2147483648),this.hasM&&(r|=1073741824)):this.hasZ&&this.hasM?r+=3e3:this.hasZ?r+=1e3:this.hasM&&(r+=2e3),t.writeUInt32LE(r+e>>>0,!0)},m.getTwkbPrecision=function(t,e,n){return{xy:t,z:e,m:n,xyFactor:Math.pow(10,t),zFactor:Math.pow(10,e),mFactor:Math.pow(10,n)}},m.prototype._writeTwkbHeader=function(t,e,n,r){var i=(y.encode(n.xy)<<4)+e,o=(this.hasZ||this.hasM)<<3;if(o+=r<<4,t.writeUInt8(i),t.writeUInt8(o),this.hasZ||this.hasM){var a=0;this.hasZ&&(a|=1),this.hasM&&(a|=2),t.writeUInt8(a)}},m.prototype.toGeoJSON=function(t){var e={};return this.srid&&t&&(t.shortCrs?e.crs={type:"name",properties:{name:"EPSG:"+this.srid}}:t.longCrs&&(e.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+this.srid}})),e}},2292:(t,e,n)=>{t.exports=s;var r=n(9539),i=n(4905),o=n(7056),a=n(2659);function s(t,e){o.call(this),this.geometries=t||[],this.srid=e,this.geometries.length>0&&(this.hasZ=this.geometries[0].hasZ,this.hasM=this.geometries[0].hasM)}r.inherits(s,o),s.Z=function(t,e){var n=new s(t,e);return n.hasZ=!0,n},s.M=function(t,e){var n=new s(t,e);return n.hasM=!0,n},s.ZM=function(t,e){var n=new s(t,e);return n.hasZ=!0,n.hasM=!0,n},s._parseWkt=function(t,e){var n=new s;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{n.geometries.push(o.parse(t))}while(t.isMatch([","]));return t.expectGroupEnd(),n},s._parseWkb=function(t,e){var n=new s;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i0&&(e.hasZ=e.geometries[0].hasZ),e},s.prototype.toWkt=function(){if(0===this.geometries.length)return this._getWktType(i.wkt.GeometryCollection,!0);for(var t=this._getWktType(i.wkt.GeometryCollection,!1)+"(",e=0;e0){t.writeVarInt(this.geometries.length);for(var r=0;r{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(9213),s=n(2659);function u(t,e){i.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}r.inherits(u,i),u.Z=function(t,e){var n=new u(t,e);return n.hasZ=!0,n},u.M=function(t,e){var n=new u(t,e);return n.hasM=!0,n},u.ZM=function(t,e){var n=new u(t,e);return n.hasZ=!0,n.hasM=!0,n},u._parseWkt=function(t,e){var n=new u;return n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),n.points.push.apply(n.points,t.matchCoordinates(e)),t.expectGroupEnd()),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i0&&(e.hasZ=t.coordinates[0].length>2);for(var n=0;n0){t.writeVarInt(this.points.length);for(var r=new a(0,0,0,0),u=0;u{t.exports=l;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(9645),u=n(2659);function l(t,e){o.call(this),this.lineStrings=t||[],this.srid=e,this.lineStrings.length>0&&(this.hasZ=this.lineStrings[0].hasZ,this.hasM=this.lineStrings[0].hasM)}r.inherits(l,o),l.Z=function(t,e){var n=new l(t,e);return n.hasZ=!0,n},l.M=function(t,e){var n=new l(t,e);return n.hasM=!0,n},l.ZM=function(t,e){var n=new l(t,e);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var n=new l;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{t.expectGroupStart(),n.lineStrings.push(new s(t.matchCoordinates(e))),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),n},l._parseWkb=function(t,e){var n=new l;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var n=0;n0){t.writeVarInt(this.lineStrings.length);for(var r=new a(0,0,0,0),s=0;s{t.exports=u;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(2659);function u(t,e){o.call(this),this.points=t||[],this.srid=e,this.points.length>0&&(this.hasZ=this.points[0].hasZ,this.hasM=this.points[0].hasM)}r.inherits(u,o),u.Z=function(t,e){var n=new u(t,e);return n.hasZ=!0,n},u.M=function(t,e){var n=new u(t,e);return n.hasM=!0,n},u.ZM=function(t,e){var n=new u(t,e);return n.hasZ=!0,n.hasM=!0,n},u._parseWkt=function(t,e){var n=new u;return n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"])||(t.expectGroupStart(),n.points.push.apply(n.points,t.matchCoordinates(e)),t.expectGroupEnd()),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i0&&(e.hasZ=t.coordinates[0].length>2);for(var n=0;n0){t.writeVarInt(this.points.length);for(var r=new a(0,0,0,0),u=0;u{t.exports=l;var r=n(9539),i=n(4905),o=n(7056),a=n(9213),s=n(978),u=n(2659);function l(t,e){o.call(this),this.polygons=t||[],this.srid=e,this.polygons.length>0&&(this.hasZ=this.polygons[0].hasZ,this.hasM=this.polygons[0].hasM)}r.inherits(l,o),l.Z=function(t,e){var n=new l(t,e);return n.hasZ=!0,n},l.M=function(t,e){var n=new l(t,e);return n.hasM=!0,n},l.ZM=function(t,e){var n=new l(t,e);return n.hasZ=!0,n.hasM=!0,n},l._parseWkt=function(t,e){var n=new l;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();do{t.expectGroupStart();var r=[],i=[];for(t.expectGroupStart(),r.push.apply(r,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),i.push(t.matchCoordinates(e)),t.expectGroupEnd();n.polygons.push(new s(r,i)),t.expectGroupEnd()}while(t.isMatch([","]));return t.expectGroupEnd(),n},l._parseWkb=function(t,e){var n=new l;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;for(var r=t.readUInt32(),i=0;i0&&t.coordinates[0].length>0&&t.coordinates[0][0].length>0&&(e.hasZ=t.coordinates[0][0][0].length>2);for(var n=0;n0){t.writeVarInt(this.polygons.length);for(var r=new a(0,0,0,0),s=0;s{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(2659),s=n(3172);function u(t,e,n,r,o){i.call(this),this.x=t,this.y=e,this.z=n,this.m=r,this.srid=o,this.hasZ=void 0!==this.z,this.hasM=void 0!==this.m}r.inherits(u,i),u.Z=function(t,e,n,r){var i=new u(t,e,n,void 0,r);return i.hasZ=!0,i},u.M=function(t,e,n,r){var i=new u(t,e,void 0,n,r);return i.hasM=!0,i},u.ZM=function(t,e,n,r,i){var o=new u(t,e,n,r,i);return o.hasZ=!0,o.hasM=!0,o},u._parseWkt=function(t,e){var n=new u;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;t.expectGroupStart();var r=t.matchCoordinate(e);return n.x=r.x,n.y=r.y,n.z=r.z,n.m=r.m,t.expectGroupEnd(),n},u._parseWkb=function(t,e){var n=u._readWkbPoint(t,e);return n.srid=e.srid,n},u._readWkbPoint=function(t,e){return new u(t.readDouble(),t.readDouble(),e.hasZ?t.readDouble():void 0,e.hasM?t.readDouble():void 0)},u._parseTwkb=function(t,e){var n=new u;return n.hasZ=e.hasZ,n.hasM=e.hasM,e.isEmpty||(n.x=s.decode(t.readVarInt())/e.precisionFactor,n.y=s.decode(t.readVarInt())/e.precisionFactor,n.z=e.hasZ?s.decode(t.readVarInt())/e.zPrecisionFactor:void 0,n.m=e.hasM?s.decode(t.readVarInt())/e.mPrecisionFactor:void 0),n},u._readTwkbPoint=function(t,e,n){return n.x+=s.decode(t.readVarInt())/e.precisionFactor,n.y+=s.decode(t.readVarInt())/e.precisionFactor,e.hasZ&&(n.z+=s.decode(t.readVarInt())/e.zPrecisionFactor),e.hasM&&(n.m+=s.decode(t.readVarInt())/e.mPrecisionFactor),new u(n.x,n.y,n.z,n.m)},u._parseGeoJSON=function(t){return u._readGeoJSONPoint(t.coordinates)},u._readGeoJSONPoint=function(t){return 0===t.length?new u:t.length>2?new u(t[0],t[1],t[2]):new u(t[0],t[1])},u.prototype.toWkt=function(){return void 0===this.x&&void 0===this.y&&void 0===this.z&&void 0===this.m?this._getWktType(o.wkt.Point,!0):this._getWktType(o.wkt.Point,!1)+"("+this._getWktCoordinate(this)+")"},u.prototype.toWkb=function(t){var e=new a(this._getWkbSize());return e.writeInt8(1),this._writeWkbType(e,o.wkb.Point,t),void 0===this.x&&void 0===this.y?(e.writeDoubleLE(NaN),e.writeDoubleLE(NaN),this.hasZ&&e.writeDoubleLE(NaN),this.hasM&&e.writeDoubleLE(NaN)):this._writeWkbPoint(e),e.buffer},u.prototype._writeWkbPoint=function(t){t.writeDoubleLE(this.x),t.writeDoubleLE(this.y),this.hasZ&&t.writeDoubleLE(this.z),this.hasM&&t.writeDoubleLE(this.m)},u.prototype.toTwkb=function(){var t=new a(0,!0),e=i.getTwkbPrecision(5,0,0),n=void 0===this.x&&void 0===this.y;return this._writeTwkbHeader(t,o.wkb.Point,e,n),n||this._writeTwkbPoint(t,e,new u(0,0,0,0)),t.buffer},u.prototype._writeTwkbPoint=function(t,e,n){var r=this.x*e.xyFactor,i=this.y*e.xyFactor,o=this.z*e.zFactor,a=this.m*e.mFactor;t.writeVarInt(s.encode(r-n.x)),t.writeVarInt(s.encode(i-n.y)),this.hasZ&&t.writeVarInt(s.encode(o-n.z)),this.hasM&&t.writeVarInt(s.encode(a-n.m)),n.x=r,n.y=i,n.z=o,n.m=a},u.prototype._getWkbSize=function(){var t=21;return this.hasZ&&(t+=8),this.hasM&&(t+=8),t},u.prototype.toGeoJSON=function(t){var e=i.prototype.toGeoJSON.call(this,t);return e.type=o.geoJSON.Point,void 0===this.x&&void 0===this.y?e.coordinates=[]:void 0!==this.z?e.coordinates=[this.x,this.y,this.z]:e.coordinates=[this.x,this.y],e}},978:(t,e,n)=>{t.exports=u;var r=n(9539),i=n(7056),o=n(4905),a=n(9213),s=n(2659);function u(t,e,n){i.call(this),this.exteriorRing=t||[],this.interiorRings=e||[],this.srid=n,this.exteriorRing.length>0&&(this.hasZ=this.exteriorRing[0].hasZ,this.hasM=this.exteriorRing[0].hasM)}r.inherits(u,i),u.Z=function(t,e,n){var r=new u(t,e,n);return r.hasZ=!0,r},u.M=function(t,e,n){var r=new u(t,e,n);return r.hasM=!0,r},u.ZM=function(t,e,n){var r=new u(t,e,n);return r.hasZ=!0,r.hasM=!0,r},u._parseWkt=function(t,e){var n=new u;if(n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM,t.isMatch(["EMPTY"]))return n;for(t.expectGroupStart(),t.expectGroupStart(),n.exteriorRing.push.apply(n.exteriorRing,t.matchCoordinates(e)),t.expectGroupEnd();t.isMatch([","]);)t.expectGroupStart(),n.interiorRings.push(t.matchCoordinates(e)),t.expectGroupEnd();return t.expectGroupEnd(),n},u._parseWkb=function(t,e){var n=new u;n.srid=e.srid,n.hasZ=e.hasZ,n.hasM=e.hasM;var r=t.readUInt32();if(r>0){for(var i=t.readUInt32(),o=0;o0&&t.coordinates[0].length>0&&(e.hasZ=t.coordinates[0][0].length>2);for(var n=0;n0&&e.interiorRings.push([]);for(var r=0;r0?(e.writeUInt32LE(1+this.interiorRings.length),e.writeUInt32LE(this.exteriorRing.length)):e.writeUInt32LE(0);for(var n=0;n0){t.writeVarInt(1+this.interiorRings.length),t.writeVarInt(this.exteriorRing.length);for(var r=new a(0,0,0,0),u=0;u0&&(e+=4+this.exteriorRing.length*t);for(var n=0;n0){for(var n=[],r=0;r{t.exports={wkt:{Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION"},wkb:{Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6,GeometryCollection:7},geoJSON:{Point:"Point",LineString:"LineString",Polygon:"Polygon",MultiPoint:"MultiPoint",MultiLineString:"MultiLineString",MultiPolygon:"MultiPolygon",GeometryCollection:"GeometryCollection"}}},2620:(t,e,n)=>{t.exports=o;var r=n(4905),i=n(9213);function o(t){this.value=t,this.position=0}o.prototype.match=function(t){this.skipWhitespaces();for(var e=0;e{e.Types=n(4905),e.Geometry=n(7056),e.Point=n(9213),e.LineString=n(9645),e.Polygon=n(978),e.MultiPoint=n(1665),e.MultiLineString=n(9606),e.MultiPolygon=n(9763),e.GeometryCollection=n(2292)},3172:t=>{t.exports={encode:function(t){return t<<1^t>>31},decode:function(t){return t>>1^-(1&t)}}},7529:t=>{t.exports=function(){for(var t={},n=0;n{"use strict";if(void 0===__WEBPACK_EXTERNAL_MODULE__3730__){var e=new Error("Cannot find module 'better-sqlite3'");throw e.code="MODULE_NOT_FOUND",e}t.exports=__WEBPACK_EXTERNAL_MODULE__3730__},5699:()=>{},4919:()=>{},1929:()=>{},2203:()=>{},7990:()=>{},8497:()=>{},1408:()=>{},3646:()=>{}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};return(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),t.OffscreenCanvasAdapter=t.NumberFeaturesTile=t.MetadataReference=t.MetadataExtension=t.MetadataDao=t.Metadata=t.MediaTable=t.ImageUtils=t.IconTable=t.Icons=t.IconCache=t.HtmlCanvasAdapter=t.GeoPackageValidate=t.GeoPackageTileRetriever=t.GeoPackageDataType=t.GeoPackageConnection=t.GeoPackageAPI=t.GeoPackage=t.GeometryData=t.GeometryColumnsDao=t.GeometryColumns=t.GeometryType=t.FeatureTiles=t.FeatureTableStyles=t.FeatureTableReader=t.FeatureTableIndex=t.FeatureTable=t.FeatureStyles=t.FeatureStyleExtension=t.FeatureStyle=t.FeaturePaint=t.FeatureDrawType=t.FeatureColumn=t.Extension=t.DublinCoreType=t.DublinCoreMetadata=t.DataColumnsDao=t.DataColumns=t.DataColumnConstraintsDao=t.DataColumnConstraints=t.CrsWktExtension=t.Context=t.ConstraintType=t.Constraints=t.Constraint=t.ContentsIdDao=t.ContentsDao=t.CanvasKitCanvasAdapter=t.Canvas=t.BoundingBox=void 0,t.WKB=t.WebPExtension=t.UserTableReader=t.UserTable=t.UserRow=t.UserMappingTable=t.UserDao=t.UserColumn=t.TileUtilities=t.TileTable=t.TileScalingType=t.TileScaling=t.TileMatrixSet=t.TileMatrix=t.TileColumn=t.TileBoundingBoxUtils=t.TileCreator=t.TableCreator=t.StyleTable=t.Styles=t.SqljsAdapter=t.StyleMappingTable=t.SqliteQueryBuilder=t.SqliteAdapter=t.SpatialReferenceSystem=t.SimpleAttributesTable=t.ShadedFeaturesTile=t.SchemaExtension=t.setSqljsWasmLocateFile=t.setCanvasKitWasmLocateFile=t.RTreeIndexDao=t.RTreeIndex=t.RelatedTablesExtension=t.ProjectionConstants=t.Projection=t.Paint=t.OptionBuilder=void 0;var e=__webpack_require__(2527);Object.defineProperty(t,"BoundingBox",{enumerable:!0,get:function(){return e.BoundingBox}});var n=__webpack_require__(4325);Object.defineProperty(t,"GeoPackage",{enumerable:!0,get:function(){return n.GeoPackage}});var r=__webpack_require__(6638);Object.defineProperty(t,"ContentsDao",{enumerable:!0,get:function(){return r.ContentsDao}});var i=__webpack_require__(7092);Object.defineProperty(t,"ContentsIdDao",{enumerable:!0,get:function(){return i.ContentsIdDao}});var o=__webpack_require__(8007);Object.defineProperty(t,"Constraint",{enumerable:!0,get:function(){return o.Constraint}});var a=__webpack_require__(7686);Object.defineProperty(t,"Constraints",{enumerable:!0,get:function(){return a.Constraints}});var s=__webpack_require__(91);Object.defineProperty(t,"ConstraintType",{enumerable:!0,get:function(){return s.ConstraintType}});var u=__webpack_require__(5306);Object.defineProperty(t,"CrsWktExtension",{enumerable:!0,get:function(){return u.CrsWktExtension}});var l=__webpack_require__(8590);Object.defineProperty(t,"DataColumnConstraints",{enumerable:!0,get:function(){return l.DataColumnConstraints}});var c=__webpack_require__(7175);Object.defineProperty(t,"DataColumnConstraintsDao",{enumerable:!0,get:function(){return c.DataColumnConstraintsDao}});var h=__webpack_require__(8133);Object.defineProperty(t,"DataColumns",{enumerable:!0,get:function(){return h.DataColumns}});var f=__webpack_require__(7319);Object.defineProperty(t,"GeoPackageDataType",{enumerable:!0,get:function(){return f.GeoPackageDataType}});var p=__webpack_require__(4941);Object.defineProperty(t,"DataColumnsDao",{enumerable:!0,get:function(){return p.DataColumnsDao}});var d=__webpack_require__(3096);Object.defineProperty(t,"DublinCoreMetadata",{enumerable:!0,get:function(){return d.DublinCoreMetadata}});var y=__webpack_require__(1485);Object.defineProperty(t,"DublinCoreType",{enumerable:!0,get:function(){return y.DublinCoreType}});var m=__webpack_require__(624);Object.defineProperty(t,"Extension",{enumerable:!0,get:function(){return m.Extension}});var g=__webpack_require__(961);Object.defineProperty(t,"FeatureColumn",{enumerable:!0,get:function(){return g.FeatureColumn}});var _=__webpack_require__(4538);Object.defineProperty(t,"FeatureDrawType",{enumerable:!0,get:function(){return _.FeatureDrawType}});var b=__webpack_require__(6063);Object.defineProperty(t,"FeaturePaint",{enumerable:!0,get:function(){return b.FeaturePaint}});var v=__webpack_require__(612);Object.defineProperty(t,"FeatureStyle",{enumerable:!0,get:function(){return v.FeatureStyle}});var T=__webpack_require__(8479);Object.defineProperty(t,"FeatureStyleExtension",{enumerable:!0,get:function(){return T.FeatureStyleExtension}});var E=__webpack_require__(2752);Object.defineProperty(t,"FeatureStyles",{enumerable:!0,get:function(){return E.FeatureStyles}});var w=__webpack_require__(8412);Object.defineProperty(t,"FeatureTable",{enumerable:!0,get:function(){return w.FeatureTable}});var x=__webpack_require__(5626);Object.defineProperty(t,"FeatureTableIndex",{enumerable:!0,get:function(){return x.FeatureTableIndex}});var C=__webpack_require__(4896);Object.defineProperty(t,"FeatureTableReader",{enumerable:!0,get:function(){return C.FeatureTableReader}});var M=__webpack_require__(6536);Object.defineProperty(t,"FeatureTableStyles",{enumerable:!0,get:function(){return M.FeatureTableStyles}});var S=__webpack_require__(297);Object.defineProperty(t,"FeatureTiles",{enumerable:!0,get:function(){return S.FeatureTiles}});var N=__webpack_require__(812);Object.defineProperty(t,"GeometryColumns",{enumerable:!0,get:function(){return N.GeometryColumns}});var O=__webpack_require__(1968);Object.defineProperty(t,"GeometryColumnsDao",{enumerable:!0,get:function(){return O.GeometryColumnsDao}});var A=__webpack_require__(857);Object.defineProperty(t,"GeometryData",{enumerable:!0,get:function(){return A.GeometryData}});var I=__webpack_require__(9211);Object.defineProperty(t,"GeometryType",{enumerable:!0,get:function(){return I.GeometryType}});var P=__webpack_require__(1191);Object.defineProperty(t,"GeoPackageAPI",{enumerable:!0,get:function(){return P.GeoPackageAPI}});var R=__webpack_require__(5116);Object.defineProperty(t,"GeoPackageConnection",{enumerable:!0,get:function(){return R.GeoPackageConnection}});var L=__webpack_require__(731);Object.defineProperty(t,"GeoPackageTileRetriever",{enumerable:!0,get:function(){return L.GeoPackageTileRetriever}});var D=__webpack_require__(4275);Object.defineProperty(t,"GeoPackageValidate",{enumerable:!0,get:function(){return D.GeoPackageValidate}});var k=__webpack_require__(8600);Object.defineProperty(t,"IconCache",{enumerable:!0,get:function(){return k.IconCache}});var F=__webpack_require__(4725);Object.defineProperty(t,"Icons",{enumerable:!0,get:function(){return F.Icons}});var U=__webpack_require__(2015);Object.defineProperty(t,"IconTable",{enumerable:!0,get:function(){return U.IconTable}});var B=__webpack_require__(9325);Object.defineProperty(t,"ImageUtils",{enumerable:!0,get:function(){return B.ImageUtils}});var j=__webpack_require__(6366);Object.defineProperty(t,"MediaTable",{enumerable:!0,get:function(){return j.MediaTable}});var G=__webpack_require__(3026);Object.defineProperty(t,"Metadata",{enumerable:!0,get:function(){return G.Metadata}});var W=__webpack_require__(663);Object.defineProperty(t,"MetadataDao",{enumerable:!0,get:function(){return W.MetadataDao}});var q=__webpack_require__(3501);Object.defineProperty(t,"MetadataExtension",{enumerable:!0,get:function(){return q.MetadataExtension}});var H=__webpack_require__(9173);Object.defineProperty(t,"MetadataReference",{enumerable:!0,get:function(){return H.MetadataReference}});var z=__webpack_require__(3060);Object.defineProperty(t,"NumberFeaturesTile",{enumerable:!0,get:function(){return z.NumberFeaturesTile}});var V=__webpack_require__(7403);Object.defineProperty(t,"OptionBuilder",{enumerable:!0,get:function(){return V.OptionBuilder}});var X=__webpack_require__(5211);Object.defineProperty(t,"Paint",{enumerable:!0,get:function(){return X.Paint}});var Y=__webpack_require__(5604);Object.defineProperty(t,"Projection",{enumerable:!0,get:function(){return Y.Projection}});var Z=__webpack_require__(1375);Object.defineProperty(t,"ProjectionConstants",{enumerable:!0,get:function(){return Z.ProjectionConstants}});var Q=__webpack_require__(1832);Object.defineProperty(t,"RelatedTablesExtension",{enumerable:!0,get:function(){return Q.RelatedTablesExtension}});var K=__webpack_require__(5859);Object.defineProperty(t,"RTreeIndex",{enumerable:!0,get:function(){return K.RTreeIndex}});var J=__webpack_require__(735);Object.defineProperty(t,"RTreeIndexDao",{enumerable:!0,get:function(){return J.RTreeIndexDao}});var $=__webpack_require__(8116);Object.defineProperty(t,"SchemaExtension",{enumerable:!0,get:function(){return $.SchemaExtension}});var tt=__webpack_require__(6667);Object.defineProperty(t,"ShadedFeaturesTile",{enumerable:!0,get:function(){return tt.ShadedFeaturesTile}});var et=__webpack_require__(4599);Object.defineProperty(t,"SimpleAttributesTable",{enumerable:!0,get:function(){return et.SimpleAttributesTable}});var nt=__webpack_require__(341);Object.defineProperty(t,"SpatialReferenceSystem",{enumerable:!0,get:function(){return nt.SpatialReferenceSystem}});var rt=__webpack_require__(8877);Object.defineProperty(t,"SqliteQueryBuilder",{enumerable:!0,get:function(){return rt.SqliteQueryBuilder}});var it=__webpack_require__(8138);Object.defineProperty(t,"StyleMappingTable",{enumerable:!0,get:function(){return it.StyleMappingTable}});var ot=__webpack_require__(7924);Object.defineProperty(t,"Styles",{enumerable:!0,get:function(){return ot.Styles}});var at=__webpack_require__(3934);Object.defineProperty(t,"StyleTable",{enumerable:!0,get:function(){return at.StyleTable}});var st=__webpack_require__(1459);Object.defineProperty(t,"TableCreator",{enumerable:!0,get:function(){return st.TableCreator}});var ut=__webpack_require__(3684);Object.defineProperty(t,"TileBoundingBoxUtils",{enumerable:!0,get:function(){return ut.TileBoundingBoxUtils}});var lt=__webpack_require__(8334);Object.defineProperty(t,"TileColumn",{enumerable:!0,get:function(){return lt.TileColumn}});var ct=__webpack_require__(1938);Object.defineProperty(t,"TileMatrix",{enumerable:!0,get:function(){return ct.TileMatrix}});var ht=__webpack_require__(5899);Object.defineProperty(t,"TileMatrixSet",{enumerable:!0,get:function(){return ht.TileMatrixSet}});var ft=__webpack_require__(4301);Object.defineProperty(t,"TileScaling",{enumerable:!0,get:function(){return ft.TileScaling}});var pt=__webpack_require__(2777);Object.defineProperty(t,"TileScalingType",{enumerable:!0,get:function(){return pt.TileScalingType}});var dt=__webpack_require__(8704);Object.defineProperty(t,"TileTable",{enumerable:!0,get:function(){return dt.TileTable}});var yt=__webpack_require__(824);Object.defineProperty(t,"TileUtilities",{enumerable:!0,get:function(){return yt.TileUtilities}});var mt=__webpack_require__(5865);Object.defineProperty(t,"UserColumn",{enumerable:!0,get:function(){return mt.UserColumn}});var gt=__webpack_require__(4668);Object.defineProperty(t,"UserDao",{enumerable:!0,get:function(){return gt.UserDao}});var _t=__webpack_require__(233);Object.defineProperty(t,"UserMappingTable",{enumerable:!0,get:function(){return _t.UserMappingTable}});var bt=__webpack_require__(2224);Object.defineProperty(t,"UserRow",{enumerable:!0,get:function(){return bt.UserRow}});var vt=__webpack_require__(8018);Object.defineProperty(t,"UserTable",{enumerable:!0,get:function(){return vt.UserTable}});var Tt=__webpack_require__(4880);Object.defineProperty(t,"UserTableReader",{enumerable:!0,get:function(){return Tt.UserTableReader}});var Et=__webpack_require__(7719);Object.defineProperty(t,"WebPExtension",{enumerable:!0,get:function(){return Et.WebPExtension}});var wt=__webpack_require__(2038);Object.defineProperty(t,"WKB",{enumerable:!0,get:function(){return wt.WKB}});var xt=__webpack_require__(922);Object.defineProperty(t,"SqliteAdapter",{enumerable:!0,get:function(){return xt.SqliteAdapter}});var Ct=__webpack_require__(5849);Object.defineProperty(t,"SqljsAdapter",{enumerable:!0,get:function(){return Ct.SqljsAdapter}});var Mt=__webpack_require__(7977);Object.defineProperty(t,"TileCreator",{enumerable:!0,get:function(){return Mt.TileCreator}});var St=__webpack_require__(3437);Object.defineProperty(t,"Canvas",{enumerable:!0,get:function(){return St.Canvas}});var Nt=__webpack_require__(8038);Object.defineProperty(t,"CanvasKitCanvasAdapter",{enumerable:!0,get:function(){return Nt.CanvasKitCanvasAdapter}});var Ot=__webpack_require__(342);Object.defineProperty(t,"OffscreenCanvasAdapter",{enumerable:!0,get:function(){return Ot.OffscreenCanvasAdapter}});var At=__webpack_require__(2807);Object.defineProperty(t,"HtmlCanvasAdapter",{enumerable:!0,get:function(){return At.HtmlCanvasAdapter}});var It=__webpack_require__(1150);Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return It.Context}}),It.Context.setupDefaultContext();var Pt=Ct.SqljsAdapter.setSqljsWasmLocateFile;t.setSqljsWasmLocateFile=Pt;var Rt=Nt.CanvasKitCanvasAdapter.setCanvasKitWasmLocateFile;t.setCanvasKitWasmLocateFile=Rt})(),__webpack_exports__})()})); //# sourceMappingURL=geopackage.min.js.map