From 36520d30ade8d973b112eb17494633495aff7686 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Tue, 24 Sep 2024 12:38:45 +0200 Subject: [PATCH] Updated documentation --- 1060.bundle.js | 3 +-- 1060.bundle.js.LICENSE.txt | 1 - 1103.bundle.js | 2 +- 1299.bundle.js | 2 +- 1365.bundle.js | 1 + 1730.bundle.js | 1 + 1901.bundle.js | 2 +- 2003.bundle.js | 2 +- 2099.bundle.js | 2 +- 2396.bundle.js | 2 +- 2729.bundle.js | 2 +- 2836.bundle.js | 2 +- 2883.bundle.js | 2 +- 290.bundle.js | 1 - 3075.bundle.js | 2 +- 4025.bundle.js | 2 +- 4629.bundle.js | 1 + 4783.bundle.js | 2 +- 4804.bundle.js | 2 +- 5645.bundle.js | 1 + 5806.bundle.js | 2 +- 6025.bundle.js | 2 +- 6214.bundle.js | 1 + 6537.bundle.js | 1 - 6782.bundle.js | 2 +- 7158.bundle.js | 1 + 7240.bundle.js | 2 +- 7379.bundle.js | 2 +- 7729.bundle.js | 1 - 7743.bundle.js | 2 +- 7985.bundle.js | 2 +- 8112.bundle.js | 1 + 9467.bundle.js | 1 - 9921.bundle.js | 1 - api/index.html | 4 ++-- bundle.js | 2 +- bundle.js.LICENSE.txt | 6 +++--- 37 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 1060.bundle.js.LICENSE.txt create mode 100644 1365.bundle.js create mode 100644 1730.bundle.js delete mode 100644 290.bundle.js create mode 100644 4629.bundle.js create mode 100644 5645.bundle.js create mode 100644 6214.bundle.js delete mode 100644 6537.bundle.js create mode 100644 7158.bundle.js delete mode 100644 7729.bundle.js create mode 100644 8112.bundle.js delete mode 100644 9467.bundle.js delete mode 100644 9921.bundle.js diff --git a/1060.bundle.js b/1060.bundle.js index 1026b57f..905eb7d7 100644 --- a/1060.bundle.js +++ b/1060.bundle.js @@ -1,2 +1 @@ -/*! For license information please see 1060.bundle.js.LICENSE.txt */ -(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1060],{4748:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},4537:(t,e,r)=>{t.exports.VectorTile=r(7054),r(8729),r(6241)},7054:(t,e,r)=>{"use strict";var i=r(6241);function n(t,e,r){if(3===t){var n=new i(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}t.exports=function(t,e){this.layers=t.readFields(n,{},e)}},8729:(t,e,r)=>{"use strict";var i=r(4748);function n(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(o,this,e)}function o(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(o--,1===n||2===n)s+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(s,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,o=0,s=1/0,a=-1/0,u=1/0,h=-1/0;t.pos>3}if(i--,1===r||2===r)(n+=t.readSVarint())a&&(a=n),(o+=t.readSVarint())h&&(h=o);else if(7!==r)throw new Error("unknown command "+r)}return[s,u,a,h]},n.prototype.toGeoJSON=function(t,e,r){var i,o,a=this.extent*Math.pow(2,r),u=this.extent*t,h=this.extent*e,l=this.loadGeometry(),d=n.types[this.type];function c(t){for(var e=0;e{"use strict";var i=r(8729);function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(o,this,e),this.length=this._features.length}function o(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}t.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new i(this._pbf,e,this.extent,this._keys,this._values)}},251:(t,e)=>{e.read=function(t,e,r,i,n){var o,s,a=8*n-i-1,u=(1<>1,l=-7,d=r?n-1:0,c=r?-1:1,f=t[e+d];for(d+=c,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+t[e+d],d+=c,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=i;l>0;s=256*s+t[e+d],d+=c,l-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=h}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,u,h=8*o-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(e*u-1)*Math.pow(2,n),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+f]=255&a,f+=p,a/=256,n-=8);for(s=s<0;t[r+f]=255&s,f+=p,s/=256,h-=8);t[r+f-p]|=128*y}},5335:(t,e,r)=>{"use strict";t.exports=n;var i=r(251);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var o=4294967296,s=1/o,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function u(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function l(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function d(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function F(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=F(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+F(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(i=(112&(n=o[r.pos++]))>>4,n<128)return h(t,i,e);if(i|=(127&(n=o[r.pos++]))<<3,n<128)return h(t,i,e);if(i|=(127&(n=o[r.pos++]))<<10,n<128)return h(t,i,e);if(i|=(127&(n=o[r.pos++]))<<17,n<128)return h(t,i,e);if(i|=(127&(n=o[r.pos++]))<<24,n<128)return h(t,i,e);if(i|=(1&(n=o[r.pos++]))<<31,n<128)return h(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,r){return a.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:u>223?3:u>191?2:1;if(n+l>r)break;1===l?u<128&&(h=u):2===l?128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)<=127&&(h=null):3===l?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((h=(15&u)<<12|(63&o)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===l&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,l=1):h>65535&&(h-=65536,i+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),i+=String.fromCharCode(h),n+=l}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=u(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,o=0;o55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&l(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,w,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},1060:(t,e,r)=>{"use strict";var i;r.r(e),r.d(e,{MBTilesFormat:()=>V,MBTilesRasterSource:()=>C,MBTilesVectorSource:()=>T,importMBTiles:()=>B}),globalThis.sqlite3Worker1Promiser=function t(e=t.defaultConfig){if(1===arguments.length&&"function"==typeof arguments[0]){const r=e;(e=Object.assign(Object.create(null),t.defaultConfig)).onready=r}else e=Object.assign(Object.create(null),t.defaultConfig,e);const r=Object.create(null),i=function(){},n=e.onerror||i,o=e.debug||i,s=e.generateMessageId?void 0:Object.create(null),a=e.generateMessageId||function(t){return t.type+"#"+(s[t.type]=(s[t.type]||0)+1)},u=(...t)=>{throw new Error(t.join(" "))};let h;return e.worker||(e.worker=t.defaultConfig.worker),"function"==typeof e.worker&&(e.worker=e.worker()),e.worker.onmessage=function(t){t=t.data,o("worker1.onmessage",t);let i=r[t.messageId];if(!i)return t&&"sqlite3-api"===t.type&&"worker1-ready"===t.result?void(e.onready&&e.onready()):(i=r[t.type],i&&i.onrow?void i.onrow(t):void(e.onunhandled?e.onunhandled(arguments[0]):n("sqlite3Worker1Promiser() unhandled worker message:",t)));switch(delete r[t.messageId],t.type){case"error":return void i.reject(t);case"open":h||(h=t.dbId);break;case"close":t.dbId===h&&(h=void 0)}try{i.resolve(t)}catch(t){i.reject(t)}},function(){let t;1===arguments.length?t=arguments[0]:2===arguments.length?(t=Object.create(null),t.type=arguments[0],t.args=arguments[1]):u("Invalid arugments for sqlite3Worker1Promiser()-created factory."),t.dbId||(t.dbId=h),t.messageId=a(t),t.departureTime=performance.now();const i=Object.create(null);let n;i.message=t,"exec"===t.type&&t.args&&("function"==typeof t.args.callback?(n=t.messageId+":row",i.onrow=t.args.callback,t.args.callback=n,r[n]=i):"string"==typeof t.args.callback&&u("exec callback may not be a string when using the Promise interface."));let s=new Promise((function(n,s){i.resolve=n,i.reject=s,r[t.messageId]=i,o("Posting",t.type,"message to Worker dbId="+(h||"default")+":",t),e.worker.postMessage(t)}));return n&&(s=s.finally((()=>delete r[n]))),s}},globalThis.sqlite3Worker1Promiser.defaultConfig={worker:function(){return new Worker(new URL(r.p+r.u(1901),r.b),{type:void 0})},onerror:(...t)=>console.error("worker1 promiser error",...t)};const n={timeout:2e4,maxPageSize:4096,cacheSize:1024,headers:{}};var o;!function(t){t[t.WORKMSG=16777215]="WORKMSG",t[t.HANDSHAKE=16777214]="HANDSHAKE"}(o=o||(o={}));const s="undefined"!=typeof SQLITE_DEBUG&&SQLITE_DEBUG||void 0!==(null===(i=void 0==={env:{RLAYERS_DEBUG:void 0}}?void 0:{RLAYERS_DEBUG:void 0})||void 0===i?void 0:i.SQLITE_DEBUG)&&{RLAYERS_DEBUG:void 0}.SQLITE_DEBUG||"",a=["threads","vfs","cache","http"],u={};for(const t of a)u[t]=s.includes(t)?console.debug.bind(console):()=>{};!function(){const t=new ArrayBuffer(2),e=new Uint8Array(t),r=new Uint16Array(t);if(e[0]=240,e[1]=13,61453==r[0])return u.threads("System is Big-Endian"),!1;if(3568==r[0])return u.threads("System is Little-Endian"),!0;throw new Error(`Failed determining endianness: ${r}`)}();var h=function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};function l(t){let e;return u.threads("Creating new SQLite thread",t),new Promise(((i,n)=>{const o=sqlite3Worker1Promiser({onready:()=>{i(o)},worker:()=>{try{e=new Worker(new URL(r.p+r.u(7985),r.b)),e.onerror=t=>console.error("Worker bootstrap failed",t);const i=null==t?void 0:t.http;return"shared"===(null==i?void 0:i.type)?i.createNewChannel().then((t=>{e.postMessage({httpChannel:t,httpOptions:i.options},[t.port])})):"sync"===(null==i?void 0:i.type)?e.postMessage({httpChannel:!0,httpOptions:i.options}):e.postMessage({}),e}catch(t){console.error("Failed to create SQLite worker",t),n(t)}}})})).then((t=>(t.close=()=>{e.terminate()},t)))}const d='SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers. Alternatively, if you do not intend to use concurrent connections, pass `sync` to `createHttpBackend` to explicitly create a synchronous HTTP backend and suppress this warning message.';function c(t){var e;return h(this,void 0,void 0,(function*(){const i=function(t){if(u.threads("Creating new HTTP VFS backend thread"),"undefined"==typeof SharedArrayBuffer||"sync"===(null==t?void 0:t.backendType)){if("shared"===(null==t?void 0:t.backendType))throw new Error(d);return"sync"!==(null==t?void 0:t.backendType)&&console.warn(d+" Falling back to the legacy HTTP backend."),{type:"sync",worker:null,options:t,createNewChannel:()=>{throw new Error("Sync backend does not support channels")},close:()=>Promise.resolve(),terminate:()=>{}}}let e=1;const i=new Worker(new URL(r.p+r.u(5806),r.b));i.postMessage({msg:"init",options:t});const o={};return i.onmessage=({data:t})=>{if(u.threads("Received control message reply",t),"ack"===t.msg)return o[t.id]?(u.threads("New HTTP VFS channel created",o),o[t.id].resolve({port:o[t.id].channel.port2,shm:t.shm}),clearTimeout(o[t.id].timeout),delete o[t.id].resolve,void delete o[t.id].timeout):void console.error("Invalid response received from backend",t)},{type:"shared",worker:i,options:t,createNewChannel:function(){u.threads("Creating a new HTTP VFS channel");const r=new MessageChannel,s=e++;return i.postMessage({msg:"handshake",port:r.port1,id:s},[r.port1]),new Promise(((e,i)=>{var a;const u=setTimeout((()=>{delete o[s],i("Timeout while waiting on backend")}),null!==(a=null==t?void 0:t.timeout)&&void 0!==a?a:n.timeout);o[s]={id:s,channel:r,resolve:e,timeout:u}}))},terminate:function(){i.terminate()},close:function(){return u.threads("Closing the HTTP VFS channel"),i.postMessage({msg:"close"}),new Promise(((e,r)=>{var o;const s=setTimeout((()=>{r("Timeout while waiting on backend")}),null!==(o=null==t?void 0:t.timeout)&&void 0!==o?o:n.timeout);i.onmessage=({data:t})=>{u.threads("Received close response",t),"ack"===t.msg&&void 0===t.id&&(e(),clearTimeout(s))}}))}}}(null==t?void 0:t.httpOptions),o=[],s=[];for(let r=0;r<(null!==(e=t.workers)&&void 0!==e?e:1);r++)s.push(l({http:i}).then((t=>o.push({worker:t,busy:null}))).then((()=>{})));return yield Promise.all(s),{backendType:i.type,open:t=>Promise.all(o.map((e=>e.worker("open",{filename:"file:"+encodeURI(t),vfs:"http"})))).then((()=>{})),close:()=>Promise.all(o.map((t=>t.worker.close()))).then((()=>i.close())),exec:function(t,e,r){return h(this,void 0,void 0,(function*(){let i;do{i=o.find((t=>!t.busy)),i||(yield Promise.race(o.map((t=>t.busy))).catch((()=>{})))}while(!i);const n=[];return i.busy=i.worker("exec",{sql:t,bind:e,rowMode:null==r?void 0:r.rowMode,callback:t=>{t.row&&n.push(t)}}).then((()=>{})).finally((()=>{if(!i)throw new Error("Lost worker pool");i.busy=null})),yield i.busy,n}))}}}))}var f,p=r(3407),y=r(915),w=r(6758),v=r(5620),g=r(5335),m=r(4537),b=r(3075),x=r(8217),F=r(5286),k=r(4778),P=r(8512),S=r(1078);const M="undefined"!=typeof OL_MBTILES_DEBUG&&OL_MBTILES_DEBUG||void 0!==(null===(f=void 0==={env:{RLAYERS_DEBUG:void 0}}?void 0:{RLAYERS_DEBUG:void 0})||void 0===f?void 0:f.OL_MBTILES_DEBUG)&&{RLAYERS_DEBUG:void 0}.OL_MBTILES_DEBUG?console.debug.bind(console):()=>{},_={jpg:{type:"raster",mime:"image/jpeg"},png:{type:"raster",mime:"image/png"},webp:{type:"raster",mime:"image/webp"},pbf:{type:"vector"},mvt:{type:"vector"}};function E(t){var e,r,i;return{workers:null!==(e=null==t?void 0:t.sqlWorkers)&&void 0!==e?e:4,httpOptions:{backendType:null==t?void 0:t.backendType,maxPageSize:null!==(r=null==t?void 0:t.maxSqlPageSize)&&void 0!==r?r:4096,cacheSize:null!==(i=null==t?void 0:t.sqlCacheSize)&&void 0!==i?i:4096}}}function B(t){const e=c(E(t));return e.then((e=>e.open(t.url).then((()=>e)))).then((t=>t.exec("SELECT name,value FROM metadata"))).then((t=>{if(t&&t.length){const e=t.reduce(((t,e)=>(t[e.row[0]]=e.row[1],t)),{});return M("Loaded metadata",e),e}throw new Error("Could not load metadata")})).then((r=>{var i,n,o,s,a,u,h,l,d;const c=Object.assign({},t),f=null===(n=null===(i=r.format)||void 0===i?void 0:i.toLowerCase)||void 0===n?void 0:n.call(i);_[f]||console.warn("Unknown tile format",f),c.projection=null!==(o=t.projection)&&void 0!==o?o:"EPSG:3857",c.attributions=null!==(s=r.attribution)&&void 0!==s?s:r.description,c.maxZoom=null!==(a=t.maxZoom)&&void 0!==a?a:+r.maxzoom,c.minZoom=null!==(u=t.minZoom)&&void 0!==u?u:+r.minzoom;const v=null===(l=null===(h=(0,p.Jt)(c.projection))||void 0===h?void 0:h.getExtent)||void 0===l?void 0:l.call(h),g=r.bounds,m=g?(0,p.DI)(g.split(",").map((t=>+t)),"EPSG:4326",c.projection):v;if("raster"===_[f].type){if(void 0===c.maxZoom||void 0===c.minZoom||void 0===v)throw new Error("Cannot determine tilegrid, need minZoom, maxZoom");const t=[(0,y.RG)(v)/256];for(let e=1;e<=c.maxZoom;e++)t.push(t[t.length-1]/2);const e=null!==(d=_[f].mime)&&void 0!==d?d:f;c.mime=e,c.tileGrid=new w.A({origin:[v[0],v[2]],extent:m,minZoom:c.minZoom,resolutions:t})}else c.extent=v;return c.pool=e,c.url=t.url,c})).catch((t=>e.then((t=>t.close())).then((()=>Promise.reject(t)))))}class V extends x.Ay{constructor(t){var e,r,i;super(),t=t||{},this.dataProjection=new F.A({code:"",units:"tile-pixels"}),this.featureClass_=t.featureClass?t.featureClass:k.Ay,this.geometryName_=null!==(e=t.geometryName)&&void 0!==e?e:"Geometry",this.layers_=null!==(r=t.layers)&&void 0!==r?r:null,this.idProperty_=t.idProperty,this.extent=null!==(i=t.extent)&&void 0!==i?i:4096,this.supportedMediaTypes=["application/vnd-mbtiles"]}readFeature(t,e){const r=t.properties;let i;this.idProperty_?(i=r[this.idProperty_],delete r[this.idProperty_]):i=t.id;const n=t.loadGeometry(),o=[],s=[],a=V.MBTypes[n.length>1?"multi":"mono"][t.type];if("Unknown"===a)return null;for(let t=0;t`${t.url}#${e[0]}:${e[1]}:${e[2]}`})),this.setTileLoadFunction(this.tileLoader.bind(this)),this.pool=null!==(e=t.pool)&&void 0!==e?e:c(E(t)).then((e=>e.open(t.url).then((()=>e))))}tileLoader(t,e){const r=t;M("loading tile",[r.tileCoord[0],r.tileCoord[1],r.tileCoord[2]]),r.setLoader(((t,e,i)=>{this.pool.then((t=>t.exec("SELECT tile_data FROM tiles WHERE zoom_level = $zoom AND tile_column = $col AND tile_row = $row",{$zoom:r.tileCoord[0],$col:r.tileCoord[1],$row:(1<{if(e&&e[0]&&e[0].row[0]){const n=r.getFormat().readFeatures(e[0].row[0],{extent:t,featureProjection:i});return r.setFeatures(n),void r.onLoad(n,i)}throw new Error(`No data for ${r.tileCoord}`)})).catch((t=>{M(t),r.onError()}))}))}disposeInternal(){return this.pool.then((t=>t.close()))}}class C extends P.A{constructor(t){var e;if(void 0===t.url&&void 0===t.pool)throw new Error("Must specify url");super(Object.assign(Object.assign({},t),{url:void 0,tileUrlFunction:e=>`${t.url}#${e[0]}:${e[1]}:${e[2]}`})),this.setTileLoadFunction(this.tileLoader.bind(this)),this.pool=null!==(e=t.pool)&&void 0!==e?e:c(E(t)).then((e=>e.open(t.url).then((()=>e)))),this.mime=t.mime}tileLoader(t,e){M("loading tile",[t.tileCoord[0],t.tileCoord[1],t.tileCoord[2]]);const r=t.getImage();this.pool.then((e=>e.exec("SELECT tile_data FROM tiles WHERE zoom_level = $zoom AND tile_column = $col AND tile_row = $row",{$zoom:t.tileCoord[0],$col:t.tileCoord[1],$row:(1<{if(!(e&&e[0]&&e[0].row[0]instanceof Uint8Array))throw new Error(`No data for ${t.tileCoord}`);{const t=new Blob([e[0].row[0]],{type:this.mime}),i=URL.createObjectURL(t);r.src=i}})).catch((e=>{M(e),t.setState(S.A.ERROR)}))}disposeInternal(){return this.pool.then((t=>t.close()))}}},8217:(t,e,r)=>{"use strict";r.d(e,{Ay:()=>y,Bs:()=>g,hX:()=>w,te:()=>m});var i=r(6717),n=r(4778),o=r(4294),s=r(1217),a=r(1064),u=r(503),h=r(6702),l=r(2871),d=r(4338),c=r(4087),f=r(3407),p=r(3402);const y=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=i.A,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let r=e.dataProjection?(0,f.Jt)(e.dataProjection):this.readProjection(t);e.extent&&r&&"tile-pixels"===r.getUnits()&&(r=(0,f.Jt)(r),r.setWorldExtent(e.extent)),e={dataProjection:r,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return(0,c.b0)()}readFeature(t,e){return(0,c.b0)()}readFeatures(t,e){return(0,c.b0)()}readGeometry(t,e){return(0,c.b0)()}readProjection(t){return(0,c.b0)()}writeFeature(t,e){return(0,c.b0)()}writeFeatures(t,e){return(0,c.b0)()}writeGeometry(t,e){return(0,c.b0)()}};function w(t,e,r){const i=r?(0,f.Jt)(r.featureProjection):null,n=r?(0,f.Jt)(r.dataProjection):null;let o=t;if(i&&n&&!(0,f.tI)(i,n)){e&&(o=t.clone());const r=e?i:n,s=e?n:i;"tile-pixels"===r.getUnits()?o.transform(r,s):o.applyTransform((0,f.RG)(r,s))}if(e&&r&&void 0!==r.decimals){const e=Math.pow(10,r.decimals),i=function(t){for(let r=0,i=t.length;rg({...t,geometry:e}))).flat();const i="MultiPolygon"===r.type?"Polygon":r.type;if("GeometryCollection"===i||"Circle"===i)throw new Error("Unsupported geometry type: "+i);const o=r.layout.length;return w(new n.Ay(i,"Polygon"===i?function(t,e,r){return Array.isArray(e[0])?((0,p.mb)(t,0,e,r)||(t=t.slice(),(0,p.NK)(t,0,e,r)),t):((0,p.PA)(t,0,e,r)||(t=t.slice(),(0,p.ug)(t,0,e,r)),t)}(r.flatCoordinates,r.ends,o):r.flatCoordinates,r.ends?.flat(),o,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function m(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map((t=>m(t,e)));return new d.A(r)}return w(new(0,v[t.type])(t.flatCoordinates,t.layout,t.ends),!1,e)}}}]); \ No newline at end of file +(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1060],{4748:e=>{"use strict";function t(e,t){this.x=e,this.y=t}e.exports=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,o=r*this.x+t*this.y;return this.x=n,this.y=o,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),o=t.x+r*(this.x-t.x)-n*(this.y-t.y),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e}},4537:(e,t,r)=>{e.exports.VectorTile=r(7054),r(8729),r(6241)},7054:(e,t,r)=>{"use strict";var n=r(6241);function o(e,t,r){if(3===e){var o=new n(r,r.readVarint()+r.pos);o.length&&(t[o.name]=o)}}e.exports=function(e,t){this.layers=e.readFields(o,{},t)}},8729:(e,t,r)=>{"use strict";var n=r(4748);function o(e,t,r,n,o){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(i,this,t)}function i(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos>3}if(i--,1===o||2===o)s+=e.readSVarint(),a+=e.readSVarint(),1===o&&(t&&l.push(t),t=[]),t.push(new n(s,a));else{if(7!==o)throw new Error("unknown command "+o);t&&t.push(t[0].clone())}}return t&&l.push(t),l},o.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,o=0,i=0,s=1/0,a=-1/0,l=1/0,u=-1/0;e.pos>3}if(n--,1===r||2===r)(o+=e.readSVarint())a&&(a=o),(i+=e.readSVarint())u&&(u=i);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,a,u]},o.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),l=this.extent*e,u=this.extent*t,d=this.loadGeometry(),c=o.types[this.type];function h(e){for(var t=0;t{"use strict";var n=r(8729);function o(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(i,this,t),this.length=this._features.length}function i(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}e.exports=o,o.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new n(this._pbf,t,this.extent,this._keys,this._values)}},1060:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{MBTilesFormat:()=>A,MBTilesRasterSource:()=>L,MBTilesVectorSource:()=>j,importMBTiles:()=>T}),globalThis.sqlite3Worker1Promiser=function e(t=e.defaultConfig){if(1===arguments.length&&"function"==typeof arguments[0]){const r=t;(t=Object.assign(Object.create(null),e.defaultConfig)).onready=r}else t=Object.assign(Object.create(null),e.defaultConfig,t);const r=Object.create(null),n=function(){},o=t.onerror||n,i=t.debug||n,s=t.generateMessageId?void 0:Object.create(null),a=t.generateMessageId||function(e){return e.type+"#"+(s[e.type]=(s[e.type]||0)+1)},l=(...e)=>{throw new Error(e.join(" "))};let u;return t.worker||(t.worker=e.defaultConfig.worker),"function"==typeof t.worker&&(t.worker=t.worker()),t.worker.onmessage=function(e){e=e.data,i("worker1.onmessage",e);let n=r[e.messageId];if(!n)return e&&"sqlite3-api"===e.type&&"worker1-ready"===e.result?void(t.onready&&t.onready()):(n=r[e.type],n&&n.onrow?void n.onrow(e):void(t.onunhandled?t.onunhandled(arguments[0]):o("sqlite3Worker1Promiser() unhandled worker message:",e)));switch(delete r[e.messageId],e.type){case"error":return void n.reject(e);case"open":u||(u=e.dbId);break;case"close":e.dbId===u&&(u=void 0)}try{n.resolve(e)}catch(e){n.reject(e)}},function(){let e;1===arguments.length?e=arguments[0]:2===arguments.length?(e=Object.create(null),e.type=arguments[0],e.args=arguments[1]):l("Invalid arugments for sqlite3Worker1Promiser()-created factory."),e.dbId||(e.dbId=u),e.messageId=a(e),e.departureTime=performance.now();const n=Object.create(null);let o;n.message=e,"exec"===e.type&&e.args&&("function"==typeof e.args.callback?(o=e.messageId+":row",n.onrow=e.args.callback,e.args.callback=o,r[o]=n):"string"==typeof e.args.callback&&l("exec callback may not be a string when using the Promise interface."));let s=new Promise((function(o,s){n.resolve=o,n.reject=s,r[e.messageId]=n,i("Posting",e.type,"message to Worker dbId="+(u||"default")+":",e),t.worker.postMessage(e)}));return o&&(s=s.finally((()=>delete r[o]))),s}},globalThis.sqlite3Worker1Promiser.defaultConfig={worker:function(){return new Worker(new URL(r.p+r.u(1901),r.b),{type:void 0})},onerror:(...e)=>console.error("worker1 promiser error",...e)};const o={timeout:2e4,maxPageSize:4096,cacheSize:1024,headers:{}};var i;!function(e){e[e.WORKMSG=16777215]="WORKMSG",e[e.HANDSHAKE=16777214]="HANDSHAKE"}(i=i||(i={}));const s="undefined"!=typeof SQLITE_DEBUG&&SQLITE_DEBUG||void 0!==(null===(n=void 0==={env:{RLAYERS_DEBUG:void 0}}?void 0:{RLAYERS_DEBUG:void 0})||void 0===n?void 0:n.SQLITE_DEBUG)&&{RLAYERS_DEBUG:void 0}.SQLITE_DEBUG||"",a=["threads","vfs","cache","http"],l={};for(const e of a)l[e]=s.includes(e)?console.debug.bind(console):()=>{};!function(){const e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);if(t[0]=240,t[1]=13,61453==r[0])return l.threads("System is Big-Endian"),!1;if(3568==r[0])return l.threads("System is Little-Endian"),!0;throw new Error(`Failed determining endianness: ${r}`)}();var u=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};function d(e){let t;return l.threads("Creating new SQLite thread",e),new Promise(((n,o)=>{const i=sqlite3Worker1Promiser({onready:()=>{n(i)},worker:()=>{try{t=new Worker(new URL(r.p+r.u(7985),r.b)),t.onerror=e=>console.error("Worker bootstrap failed",e);const n=null==e?void 0:e.http;return"shared"===(null==n?void 0:n.type)?n.createNewChannel().then((e=>{t.postMessage({httpChannel:e,httpOptions:n.options},[e.port])})):"sync"===(null==n?void 0:n.type)?t.postMessage({httpChannel:!0,httpOptions:n.options}):t.postMessage({}),t}catch(e){console.error("Failed to create SQLite worker",e),o(e)}}})})).then((e=>(e.close=()=>{t.terminate()},e)))}const c='SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers. Alternatively, if you do not intend to use concurrent connections, pass `sync` to `createHttpBackend` to explicitly create a synchronous HTTP backend and suppress this warning message.';function h(e){var t;return u(this,void 0,void 0,(function*(){const n=function(e){if(l.threads("Creating new HTTP VFS backend thread"),"undefined"==typeof SharedArrayBuffer||"sync"===(null==e?void 0:e.backendType)){if("shared"===(null==e?void 0:e.backendType))throw new Error(c);return"sync"!==(null==e?void 0:e.backendType)&&console.warn(c+" Falling back to the legacy HTTP backend."),{type:"sync",worker:null,options:e,createNewChannel:()=>{throw new Error("Sync backend does not support channels")},close:()=>Promise.resolve(),terminate:()=>{}}}let t=1;const n=new Worker(new URL(r.p+r.u(5806),r.b));n.postMessage({msg:"init",options:e});const i={};return n.onmessage=({data:e})=>{if(l.threads("Received control message reply",e),"ack"===e.msg)return i[e.id]?(l.threads("New HTTP VFS channel created",i),i[e.id].resolve({port:i[e.id].channel.port2,shm:e.shm}),clearTimeout(i[e.id].timeout),delete i[e.id].resolve,void delete i[e.id].timeout):void console.error("Invalid response received from backend",e)},{type:"shared",worker:n,options:e,createNewChannel:function(){l.threads("Creating a new HTTP VFS channel");const r=new MessageChannel,s=t++;return n.postMessage({msg:"handshake",port:r.port1,id:s},[r.port1]),new Promise(((t,n)=>{var a;const l=setTimeout((()=>{delete i[s],n("Timeout while waiting on backend")}),null!==(a=null==e?void 0:e.timeout)&&void 0!==a?a:o.timeout);i[s]={id:s,channel:r,resolve:t,timeout:l}}))},terminate:function(){n.terminate()},close:function(){return l.threads("Closing the HTTP VFS channel"),n.postMessage({msg:"close"}),new Promise(((t,r)=>{var i;const s=setTimeout((()=>{r("Timeout while waiting on backend")}),null!==(i=null==e?void 0:e.timeout)&&void 0!==i?i:o.timeout);n.onmessage=({data:e})=>{l.threads("Received close response",e),"ack"===e.msg&&void 0===e.id&&(t(),clearTimeout(s))}}))}}}(null==e?void 0:e.httpOptions),i=[],s=[];for(let r=0;r<(null!==(t=e.workers)&&void 0!==t?t:1);r++)s.push(d({http:n}).then((e=>i.push({worker:e,busy:null}))).then((()=>{})));return yield Promise.all(s),{backendType:n.type,open:e=>Promise.all(i.map((t=>t.worker("open",{filename:"file:"+encodeURI(e),vfs:"http"})))).then((()=>{})),close:()=>Promise.all(i.map((e=>e.worker.close()))).then((()=>n.close())),exec:function(e,t,r){return u(this,void 0,void 0,(function*(){let n;do{n=i.find((e=>!e.busy)),n||(yield Promise.race(i.map((e=>e.busy))).catch((()=>{})))}while(!n);const o=[];return n.busy=n.worker("exec",{sql:e,bind:t,rowMode:null==r?void 0:r.rowMode,callback:e=>{e.row&&o.push(e)}}).then((()=>{})).finally((()=>{if(!n)throw new Error("Lost worker pool");n.busy=null})),yield n.busy,o}))}}}))}var p,f=r(3407),y=r(915),m=r(6758),v=r(5923),g=r(8112),w=r(4537),b=r(3075),x=r(8217),_=r(5286),P=r(4778),k=r(8512),E=r(1078);const S="undefined"!=typeof OL_MBTILES_DEBUG&&OL_MBTILES_DEBUG||void 0!==(null===(p=void 0==={env:{RLAYERS_DEBUG:void 0}}?void 0:{RLAYERS_DEBUG:void 0})||void 0===p?void 0:p.OL_MBTILES_DEBUG)&&{RLAYERS_DEBUG:void 0}.OL_MBTILES_DEBUG?console.debug.bind(console):()=>{},M={jpg:{type:"raster",mime:"image/jpeg"},png:{type:"raster",mime:"image/png"},webp:{type:"raster",mime:"image/webp"},pbf:{type:"vector"},mvt:{type:"vector"}};function C(e){var t,r,n;return{workers:null!==(t=null==e?void 0:e.sqlWorkers)&&void 0!==t?t:4,httpOptions:{backendType:null==e?void 0:e.backendType,maxPageSize:null!==(r=null==e?void 0:e.maxSqlPageSize)&&void 0!==r?r:4096,cacheSize:null!==(n=null==e?void 0:e.sqlCacheSize)&&void 0!==n?n:4096}}}function T(e){const t=h(C(e));return t.then((t=>t.open(e.url).then((()=>t)))).then((e=>e.exec("SELECT name,value FROM metadata"))).then((e=>{if(e&&e.length){const t=e.reduce(((e,t)=>(e[t.row[0]]=t.row[1],e)),{});return S("Loaded metadata",t),t}throw new Error("Could not load metadata")})).then((r=>{var n,o,i,s,a,l,u,d,c;const h=Object.assign({},e),p=null===(o=null===(n=r.format)||void 0===n?void 0:n.toLowerCase)||void 0===o?void 0:o.call(n);M[p]||console.warn("Unknown tile format",p),h.projection=null!==(i=e.projection)&&void 0!==i?i:"EPSG:3857",h.attributions=null!==(s=r.attribution)&&void 0!==s?s:r.description,h.maxZoom=null!==(a=e.maxZoom)&&void 0!==a?a:+r.maxzoom,h.minZoom=null!==(l=e.minZoom)&&void 0!==l?l:+r.minzoom;const v=null===(d=null===(u=(0,f.Jt)(h.projection))||void 0===u?void 0:u.getExtent)||void 0===d?void 0:d.call(u),g=r.bounds,w=g?(0,f.DI)(g.split(",").map((e=>+e)),"EPSG:4326",h.projection):v;if("raster"===M[p].type){if(void 0===h.maxZoom||void 0===h.minZoom||void 0===v)throw new Error("Cannot determine tilegrid, need minZoom, maxZoom");const e=[(0,y.RG)(v)/256];for(let t=1;t<=h.maxZoom;t++)e.push(e[e.length-1]/2);const t=null!==(c=M[p].mime)&&void 0!==c?c:p;h.mime=t,h.tileGrid=new m.A({origin:[v[0],v[2]],extent:w,minZoom:h.minZoom,resolutions:e})}else h.extent=v;return h.pool=t,h.url=e.url,h})).catch((e=>t.then((e=>e.close())).then((()=>Promise.reject(e)))))}class A extends x.Ay{constructor(e){var t,r,n;super(),e=e||{},this.dataProjection=new _.A({code:"",units:"tile-pixels"}),this.featureClass_=e.featureClass?e.featureClass:P.Ay,this.geometryName_=null!==(t=e.geometryName)&&void 0!==t?t:"Geometry",this.layers_=null!==(r=e.layers)&&void 0!==r?r:null,this.idProperty_=e.idProperty,this.extent=null!==(n=e.extent)&&void 0!==n?n:4096,this.supportedMediaTypes=["application/vnd-mbtiles"]}readFeature(e,t){const r=e.properties;let n;this.idProperty_?(n=r[this.idProperty_],delete r[this.idProperty_]):n=e.id;const o=e.loadGeometry(),i=[],s=[],a=A.MBTypes[o.length>1?"multi":"mono"][e.type];if("Unknown"===a)return null;for(let e=0;e`${e.url}#${t[0]}:${t[1]}:${t[2]}`})),this.setTileLoadFunction(this.tileLoader.bind(this)),this.pool=null!==(t=e.pool)&&void 0!==t?t:h(C(e)).then((t=>t.open(e.url).then((()=>t))))}tileLoader(e,t){const r=e;S("loading tile",[r.tileCoord[0],r.tileCoord[1],r.tileCoord[2]]),r.setLoader(((e,t,n)=>{this.pool.then((e=>e.exec("SELECT tile_data FROM tiles WHERE zoom_level = $zoom AND tile_column = $col AND tile_row = $row",{$zoom:r.tileCoord[0],$col:r.tileCoord[1],$row:(1<{if(t&&t[0]&&t[0].row[0]){const o=r.getFormat().readFeatures(t[0].row[0],{extent:e,featureProjection:n});return r.setFeatures(o),void r.onLoad(o,n)}throw new Error(`No data for ${r.tileCoord}`)})).catch((e=>{S(e),r.onError()}))}))}disposeInternal(){return this.pool.then((e=>e.close()))}}class L extends k.A{constructor(e){var t;if(void 0===e.url&&void 0===e.pool)throw new Error("Must specify url");super(Object.assign(Object.assign({},e),{url:void 0,tileUrlFunction:t=>`${e.url}#${t[0]}:${t[1]}:${t[2]}`})),this.setTileLoadFunction(this.tileLoader.bind(this)),this.pool=null!==(t=e.pool)&&void 0!==t?t:h(C(e)).then((t=>t.open(e.url).then((()=>t)))),this.mime=e.mime}tileLoader(e,t){S("loading tile",[e.tileCoord[0],e.tileCoord[1],e.tileCoord[2]]);const r=e.getImage();this.pool.then((t=>t.exec("SELECT tile_data FROM tiles WHERE zoom_level = $zoom AND tile_column = $col AND tile_row = $row",{$zoom:e.tileCoord[0],$col:e.tileCoord[1],$row:(1<{if(!(t&&t[0]&&t[0].row[0]instanceof Uint8Array))throw new Error(`No data for ${e.tileCoord}`);{const e=new Blob([t[0].row[0]],{type:this.mime}),n=URL.createObjectURL(e);r.src=n}})).catch((t=>{S(t),e.setState(E.A.ERROR)}))}disposeInternal(){return this.pool.then((e=>e.close()))}}},8217:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>y,Bs:()=>g,hX:()=>m,te:()=>w});var n=r(6717),o=r(4778),i=r(4294),s=r(1217),a=r(1064),l=r(503),u=r(6702),d=r(2871),c=r(4338),h=r(4087),p=r(3407),f=r(3402);const y=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=n.A,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let r=t.dataProjection?(0,p.Jt)(t.dataProjection):this.readProjection(e);t.extent&&r&&"tile-pixels"===r.getUnits()&&(r=(0,p.Jt)(r),r.setWorldExtent(t.extent)),t={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return(0,h.b0)()}readFeature(e,t){return(0,h.b0)()}readFeatures(e,t){return(0,h.b0)()}readGeometry(e,t){return(0,h.b0)()}readProjection(e){return(0,h.b0)()}writeFeature(e,t){return(0,h.b0)()}writeFeatures(e,t){return(0,h.b0)()}writeGeometry(e,t){return(0,h.b0)()}};function m(e,t,r){const n=r?(0,p.Jt)(r.featureProjection):null,o=r?(0,p.Jt)(r.dataProjection):null;let i=e;if(n&&o&&!(0,p.tI)(n,o)){t&&(i=e.clone());const r=t?n:o,s=t?o:n;"tile-pixels"===r.getUnits()?i.transform(r,s):i.applyTransform((0,p.RG)(r,s))}if(t&&r&&void 0!==r.decimals){const t=Math.pow(10,r.decimals),n=function(e){for(let r=0,n=e.length;rg({...e,geometry:t}))).flat();const n="MultiPolygon"===r.type?"Polygon":r.type;if("GeometryCollection"===n||"Circle"===n)throw new Error("Unsupported geometry type: "+n);const i=r.layout.length;return m(new o.Ay(n,"Polygon"===n?function(e,t,r){return Array.isArray(t[0])?((0,f.mb)(e,0,t,r)||(e=e.slice(),(0,f.NK)(e,0,t,r)),e):((0,f.PA)(e,0,t,r)||(e=e.slice(),(0,f.ug)(e,0,t,r)),e)}(r.flatCoordinates,r.ends,i):r.flatCoordinates,r.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function w(e,t){if(!e)return null;if(Array.isArray(e)){const r=e.map((e=>w(e,t)));return new c.A(r)}return m(new(0,v[e.type])(e.flatCoordinates,e.layout,e.ends),!1,t)}}}]); \ No newline at end of file diff --git a/1060.bundle.js.LICENSE.txt b/1060.bundle.js.LICENSE.txt deleted file mode 100644 index 70277b0d..00000000 --- a/1060.bundle.js.LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/1103.bundle.js b/1103.bundle.js index fb7f6f10..f28129ef 100644 --- a/1103.bundle.js +++ b/1103.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1103],{1103:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var l=r(6540),a=r(6717),n=r(3407),c=r(1365),o=(r(5045),r(7240));const s=JSON.parse('{"type":"FeatureCollection","crs":{"properties":{"name":"EPSG:4326"},"type":"name"},"features":[{"type":"Feature","properties":{"d":1,"en":"Momtchil Momtchev
IT Consulting: GIS, Node, TCP/IP, Linux","i":"https://momtchil.momtchev.pro/wp-content/uploads/2018/08/ID_ever_small_icon32x32.jpg","u":"https://momtchil.momtchev.pro/"},"geometry":{"type":"Point","coordinates":[2.36401,48.820224]}}]}');function m(){const[e,t]=l.useState([]);return l.createElement("div",{className:"d-flex flex-row"},l.createElement(o.f9,{className:"example-map",initial:{center:(0,n.Rb)([2.364,48.82]),zoom:11}},l.createElement(o.ej,null),l.createElement(o.j9,{zIndex:10,features:new c.A({featureProjection:"EPSG:3857",featureClass:a.A}).readFeatures(s),onClick:(0,l.useCallback)((r=>{t([...e,r.target.get("en")].slice(-16))}),[e])},l.createElement(o.cq.RStyle,null,l.createElement(o.cq.RCircle,{radius:5},l.createElement(o.cq.RFill,{color:"blue"})))),l.createElement(o.j9,{zIndex:5,format:new c.A({featureProjection:"EPSG:3857",featureClass:a.A}),url:"https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson",onPointerEnter:(0,l.useCallback)((r=>{t([...e,"Entering "+r.target.get("nom")].slice(-16))}),[e])},l.createElement(o.cq.RStyle,null,l.createElement(o.cq.RStroke,{color:"#007bff",width:3}),l.createElement(o.cq.RFill,{color:"transparent"})))),l.createElement("div",{className:"mx-0 mt-0 mb-3 p-1 w-100 jumbotron shadow example-list"},l.createElement("p",null,"Your actions"),l.createElement("ul",{dangerouslySetInnerHTML:{__html:e.map((e=>`
  • ${e}
  • `)).join("")}})))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1103],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var l=e(1601),r=e.n(l),t=e(6314),a=e.n(t)()(r());a.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=a},5045:(n,o,e)=>{var l=e(5072),r=e.n(l),t=e(7825),a=e.n(t),i=e(7659),c=e.n(i),s=e(5056),u=e.n(s),p=e(540),b=e.n(p),d=e(1113),m=e.n(d),g=e(4096),x={};x.styleTagTransform=m(),x.setAttributes=u(),x.insert=c().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=b(),r()(g.A,x),g.A&&g.A.locals&&g.A.locals},1103:(n,o,e)=>{e.r(o),e.d(o,{default:()=>s});var l=e(6540),r=e(6717),t=e(3407),a=e(1365),i=(e(5045),e(7240));const c=JSON.parse('{"type":"FeatureCollection","crs":{"properties":{"name":"EPSG:4326"},"type":"name"},"features":[{"type":"Feature","properties":{"d":1,"en":"Momtchil Momtchev
    IT Consulting: GIS, Node, TCP/IP, Linux","i":"https://momtchil.momtchev.pro/wp-content/uploads/2018/08/ID_ever_small_icon32x32.jpg","u":"https://momtchil.momtchev.pro/"},"geometry":{"type":"Point","coordinates":[2.36401,48.820224]}}]}');function s(){const[n,o]=l.useState([]);return l.createElement("div",{className:"d-flex flex-row"},l.createElement(i.f9,{className:"example-map",initial:{center:(0,t.Rb)([2.364,48.82]),zoom:11}},l.createElement(i.ej,null),l.createElement(i.j9,{zIndex:10,features:new a.A({featureProjection:"EPSG:3857",featureClass:r.A}).readFeatures(c),onClick:(0,l.useCallback)((e=>{o([...n,e.target.get("en")].slice(-16))}),[n])},l.createElement(i.cq.RStyle,null,l.createElement(i.cq.RCircle,{radius:5},l.createElement(i.cq.RFill,{color:"blue"})))),l.createElement(i.j9,{zIndex:5,format:new a.A({featureProjection:"EPSG:3857",featureClass:r.A}),url:"https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson",onPointerEnter:(0,l.useCallback)((e=>{o([...n,"Entering "+e.target.get("nom")].slice(-16))}),[n])},l.createElement(i.cq.RStyle,null,l.createElement(i.cq.RStroke,{color:"#007bff",width:3}),l.createElement(i.cq.RFill,{color:"transparent"})))),l.createElement("div",{className:"mx-0 mt-0 mb-3 p-1 w-100 jumbotron shadow example-list"},l.createElement("p",null,"Your actions"),l.createElement("ul",{dangerouslySetInnerHTML:{__html:n.map((n=>`
  • ${n}
  • `)).join("")}})))}}}]); \ No newline at end of file diff --git a/1299.bundle.js b/1299.bundle.js index 0175c5bb..31727193 100644 --- a/1299.bundle.js +++ b/1299.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1299],{1299:(e,n,o)=>{o.r(n),o.d(n,{default:()=>t});const t="/**\n * This example shows how to extend RLayers to include support for your custom component\n */\n\nimport React from 'react';\nimport {fromLonLat} from 'ol/proj';\nimport {MapboxVector as VectorMapbox} from 'ol/layer';\n\nimport {RMap, RLayer, RLayerProps, RContextType} from 'rlayers';\n\n/**\n * The properties interface definition\n */\ninterface MyLayerMapboxProps extends RLayerProps {\n styleUrl: string;\n accessToken: string;\n}\n\n/**\n * A component wrapper for ol/layer/MapboxVector\n */\nclass MyLayerMapbox extends RLayer {\n ol: VectorMapbox;\n\n // Tiled layers must extend RLayerRaster, non-tiled vector layers must extend RLayerVector\n // This allows you to have the same features as RLayers built-in components\n // Completely custom layers must extend RLayer\n constructor(props: Readonly, context?: React.Context) {\n // You must call the parent constructor\n super(props, context);\n\n // You must create the this.ol object which must be compatible with the this.ol of the parent\n this.ol = new VectorMapbox({\n ...props\n });\n\n // You must enumerate all OpenLayers event sources here\n this.eventSources = [this.ol];\n\n // And call this function for the event handlers to work\n this.attachEventHandlers();\n }\n}\n\n/**\n * Using your custom component\n */\nexport default function Addon(): JSX.Element {\n return (\n \n \n \n );\n}\n"}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1299],{1299:(e,n,o)=>{o.r(n),o.d(n,{default:()=>t});const t="/**\n * This example shows how to extend RLayers to include support for your custom component\n */\n\nimport React from 'react';\nimport {fromLonLat} from 'ol/proj';\nimport {MapboxVectorLayer as VectorMapbox} from 'ol-mapbox-style';\n\nimport {RMap, RLayer, RLayerProps, RContextType} from 'rlayers';\n\n/**\n * The properties interface definition\n */\ninterface MyLayerMapboxProps extends RLayerProps {\n styleUrl: string;\n accessToken: string;\n}\n\n/**\n * A component wrapper for ol/layer/MapboxVector\n */\nclass MyLayerMapbox extends RLayer {\n ol: VectorMapbox;\n\n // Tiled layers must extend RLayerRaster, non-tiled vector layers must extend RLayerVector\n // This allows you to have the same features as RLayers built-in components\n // Completely custom layers must extend RLayer\n constructor(props: Readonly, context?: React.Context) {\n // You must call the parent constructor\n super(props, context);\n\n // You must create the this.ol object which must be compatible with the this.ol of the parent\n this.ol = new VectorMapbox({\n ...props\n });\n\n // You must enumerate all OpenLayers event sources here\n this.eventSources = [this.ol];\n\n // And call this function for the event handlers to work\n this.attachEventHandlers();\n }\n}\n\n/**\n * Using your custom component\n */\nexport default function Addon(): JSX.Element {\n return (\n \n \n \n );\n}\n"}}]); \ No newline at end of file diff --git a/1365.bundle.js b/1365.bundle.js new file mode 100644 index 00000000..647dfd39 --- /dev/null +++ b/1365.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[1365],{8217:(e,t,r)=>{r.d(t,{Ay:()=>g,Bs:()=>b,hX:()=>m,te:()=>P});var o=r(6717),n=r(4778),i=r(4294),a=r(1217),s=r(1064),u=r(503),c=r(6702),l=r(2871),d=r(4338),y=r(4087),p=r(3407),f=r(3402);const g=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=o.A,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let r=t.dataProjection?(0,p.Jt)(t.dataProjection):this.readProjection(e);t.extent&&r&&"tile-pixels"===r.getUnits()&&(r=(0,p.Jt)(r),r.setWorldExtent(t.extent)),t={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return(0,y.b0)()}readFeature(e,t){return(0,y.b0)()}readFeatures(e,t){return(0,y.b0)()}readGeometry(e,t){return(0,y.b0)()}readProjection(e){return(0,y.b0)()}writeFeature(e,t){return(0,y.b0)()}writeFeatures(e,t){return(0,y.b0)()}writeGeometry(e,t){return(0,y.b0)()}};function m(e,t,r){const o=r?(0,p.Jt)(r.featureProjection):null,n=r?(0,p.Jt)(r.dataProjection):null;let i=e;if(o&&n&&!(0,p.tI)(o,n)){t&&(i=e.clone());const r=t?o:n,a=t?n:o;"tile-pixels"===r.getUnits()?i.transform(r,a):i.applyTransform((0,p.RG)(r,a))}if(t&&r&&void 0!==r.decimals){const t=Math.pow(10,r.decimals),o=function(e){for(let r=0,o=e.length;rb({...e,geometry:t}))).flat();const o="MultiPolygon"===r.type?"Polygon":r.type;if("GeometryCollection"===o||"Circle"===o)throw new Error("Unsupported geometry type: "+o);const i=r.layout.length;return m(new n.Ay(o,"Polygon"===o?function(e,t,r){return Array.isArray(t[0])?((0,f.mb)(e,0,t,r)||(e=e.slice(),(0,f.NK)(e,0,t,r)),e):((0,f.PA)(e,0,t,r)||(e=e.slice(),(0,f.ug)(e,0,t,r)),e)}(r.flatCoordinates,r.ends,i):r.flatCoordinates,r.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function P(e,t){if(!e)return null;if(Array.isArray(e)){const r=e.map((e=>P(e,t)));return new d.A(r)}return m(new(0,h[e.type])(e.flatCoordinates,e.layout,e.ends),!1,t)}},1365:(e,t,r)=>{r.d(t,{A:()=>m});var o=r(6717),n=r(8217),i=r(4087);class a extends n.Ay{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(s(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(s(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return(0,i.b0)()}readFeaturesFromObject(e,t){return(0,i.b0)()}readGeometry(e,t){return this.readGeometryFromObject(s(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return(0,i.b0)()}readProjection(e){return this.readProjectionFromObject(s(e))}readProjectionFromObject(e){return(0,i.b0)()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return(0,i.b0)()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return(0,i.b0)()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return(0,i.b0)()}}function s(e){if("string"==typeof e){return JSON.parse(e)||null}return null!==e?e:null}const u=a;var c=r(4778),l=r(2497),d=r(2096),y=r(3407),p=r(3530);function f(e,t){if(!e)return null;let r;switch(e.type){case"Point":r=function(e){const t=e.coordinates;return{type:"Point",flatCoordinates:t,layout:(0,d.p0)(t.length)}}(e);break;case"LineString":r=function(e){const t=e.coordinates,r=t.flat();return{type:"LineString",flatCoordinates:r,ends:[r.length],layout:(0,d.p0)(t[0]?.length||2)}}(e);break;case"Polygon":r=function(e){const t=e.coordinates,r=[],o=t[0]?.[0]?.length;return{type:"Polygon",flatCoordinates:r,ends:(0,l.KG)(r,0,t,o),layout:(0,d.p0)(o)}}(e);break;case"MultiPoint":r=function(e){const t=e.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:(0,d.p0)(t[0]?.length||2)}}(e);break;case"MultiLineString":r=function(e){const t=e.coordinates,r=t[0]?.[0]?.length||2,o=[];return{type:"MultiLineString",flatCoordinates:o,ends:(0,l.KG)(o,0,t,r),layout:(0,d.p0)(r)}}(e);break;case"MultiPolygon":r=function(e){const t=e.coordinates,r=[],o=t[0]?.[0]?.[0].length||2;return{type:"MultiPolygon",flatCoordinates:r,ends:(0,l.d6)(r,0,t,o),layout:(0,d.p0)(o)}}(e);break;case"GeometryCollection":r=function(e){const t=e.geometries.map((function(e){return f(e)}));return t}(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type)}return r}function g(e,t){const r=(e=(0,n.hX)(e,!0,t)).getType();let o;switch(r){case"Point":o=function(e){return{type:"Point",coordinates:e.getCoordinates()}}(e);break;case"LineString":o=function(e){return{type:"LineString",coordinates:e.getCoordinates()}}(e);break;case"Polygon":o=function(e,t){let r;return t&&(r=t.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(r)}}(e,t);break;case"MultiPoint":o=function(e){return{type:"MultiPoint",coordinates:e.getCoordinates()}}(e);break;case"MultiLineString":o=function(e){return{type:"MultiLineString",coordinates:e.getCoordinates()}}(e);break;case"MultiPolygon":o=function(e,t){let r;return t&&(r=t.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(r)}}(e,t);break;case"GeometryCollection":o=function(e,t){delete(t=Object.assign({},t)).featureProjection;return{type:"GeometryCollection",geometries:e.getGeometriesArray().map((function(e){return g(e,t)}))}}(e,t);break;case"Circle":o={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return o}const m=class extends u{constructor(e){e=e||{},super(),this.dataProjection=(0,y.Jt)(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=(0,y.Jt)(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let r=null;r="Feature"===e.type?e:{type:"Feature",geometry:e,properties:null};const i=f(r.geometry);if(this.featureClass===c.Ay)return(0,n.Bs)({geometry:i,id:r.id,properties:r.properties},t);const a=new o.A;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&a.setGeometryName(r.geometry_name),a.setGeometry((0,n.te)(i,t)),"id"in r&&a.setId(r.id),r.properties&&a.setProperties(r.properties,!0),a}readFeaturesFromObject(e,t){let r=null;if("FeatureCollection"===e.type){r=[];const o=e.features;for(let e=0,n=o.length;e{i.d(s,{A:()=>r});var a=i(1601),h=i.n(a),e=i(6314),n=i.n(e)()(h());n.push([t.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const r=n},8721:(t,s,i)=>{i.d(s,{A:()=>ti});var a=6378137,h=.0066943799901413165,e=484813681109536e-20,n=Math.PI/2,r=1e-10,o=.017453292519943295,l=57.29577951308232,c=Math.PI/4,u=2*Math.PI,M=3.14159265359,d={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 f={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var p=/[\s_\-\/\(\)]/g;function m(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(p,""),e=-1;++e0?90:-90)):(t.lat0=P(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(h),h}function E(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?E[t]=y(arguments[1]):E[t]=S(arguments[1]):E[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?E.apply(s,t):E(t)}));if("string"==typeof t){if(t in E)return E[t]}else"EPSG"in t?E["EPSG:"+t.EPSG]=t:"ESRI"in t?E["ESRI:"+t.ESRI]=t:"IAU2000"in t?E["IAU2000:"+t.IAU2000]=t:console.log(t);return}}N.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;x.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case g: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}},N.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(b.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)},N.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=g)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=g,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},N.prototype.number=function(t){if(!w.test(t)){if(b.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},N.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},N.prototype.keyword=function(t){if(v.test(t))this.word+=t;else{if("["===t){var s=[];return s.push(this.word),this.level++,null===this.root?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,void(this.state=g)}if(!b.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},N.prototype.neutral=function(t){if(_.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(w.test(t))return this.word=t,void(this.state=3);if(!b.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},N.prototype.output=function(){for(;this.place90&&h*l<-90&&a*l>180&&a*l<-180)return null;if(Math.abs(Math.abs(h)-n)<=r)return null;if(this.sphere)s=this.x0+this.a*this.k0*G(a-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(c+.5*h));else{var e=Math.sin(h),o=L(this.e,h,e);s=this.x0+this.a*this.k0*G(a-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return t.x=s,t.y=i,t},inverse:function(t){var s,i,a=t.x-this.x0,h=t.y-this.y0;if(this.sphere)i=n-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var e=Math.exp(-h/(this.a*this.k0));if(-9999===(i=R(this.e,e)))return null}return s=G(this.long0+a/(this.a*this.k0)),t.x=s,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:B,inverse:B,names:["longlat","identity"]}],F={},D=[];function U(t,s){var i=D.length;return t.names?(D[i]=t,t.names.forEach((function(t){F[t.toLowerCase()]=i})),this):(console.log(s),!0)}const Q={start:function(){T.forEach(U)},add:U,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==F[s]&&D[F[s]]?D[F[s]]:void 0}};var W={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."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},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"}},J=W.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};W.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var X={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"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},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 H={};function K(t){if(0===t.length)return null;var s="@"===t[0];return s&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:t,mandatory:!s,grid:H[t]||null,isNull:!1}}function V(t){return t/3600*Math.PI/180}function Z(t,s,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(s,i)))}function Y(t){return t.map((function(t){return[V(t.longitudeShift),V(t.latitudeShift)]}))}function $(t,s,i){return{name:Z(t,s+8,s+16).trim(),parent:Z(t,s+24,s+24+8).trim(),lowerLatitude:t.getFloat64(s+72,i),upperLatitude:t.getFloat64(s+88,i),lowerLongitude:t.getFloat64(s+104,i),upperLongitude:t.getFloat64(s+120,i),latitudeInterval:t.getFloat64(s+136,i),longitudeInterval:t.getFloat64(s+152,i),gridNodeCount:t.getInt32(s+168,i)}}function tt(t,s,i,a){for(var h=s+176,e=[],n=0;n-1}))}(t)){var s=S(t);if(function(t){var s=m(t,"authority");if(s){var i=m(s,"epsg");return i&&q.indexOf(i)>-1}}(s))return A["EPSG:3857"];var i=function(t){var s=m(t,"extension");if(s)return m(s,"proj4")}(s);return i?y(i):s}return function(t){return"+"===t[0]}(t)?y(t):void 0}(t);if("object"==typeof i){var a=st.projections.get(i.projName);if(a){if(i.datumCode&&"none"!==i.datumCode){var h=m(X,i.datumCode);h&&(i.datum_params=i.datum_params||(h.towgs84?h.towgs84.split(","):null),i.ellps=h.ellipse,i.datumName=h.datumName?h.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var n,o,l,c,u,M,d=function(t,s,i,a,h){if(!t){var e=m(W,a);e||(e=J),t=e.a,s=e.b,i=e.rf}return i&&!s&&(s=(1-1/i)*t),(0===i||Math.abs(t-s)3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=e,o.datum_params[4]*=e,o.datum_params[5]*=e,o.datum_params[6]=o.datum_params[6]/1e6+1))),r&&(o.datum_type=3,o.grids=r),o.a=i,o.b=a,o.es=h,o.ep2=n,o}(i.datumCode,i.datum_params,d.a,d.b,f.es,f.ep2,p);O(this,i),O(this,a),this.a=d.a,this.b=d.b,this.rf=d.rf,this.sphere=d.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=g,this.init(),s(null,this)}else s("Could not get projection name from: "+t)}else s("Could not parse to valid json: "+t)}st.projections=Q,st.projections.start();const it=st;function at(t,s,i){var a,h,e,r,o=t.x,l=t.y,c=t.z?t.z:0;if(l<-n&&l>-1.001*n)l=-n;else if(l>n&&l<1.001*n)l=n;else{if(l<-n)return{x:-1/0,y:-1/0,z:t.z};if(l>n)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),h=Math.sin(l),r=Math.cos(l),e=h*h,{x:((a=i/Math.sqrt(1-s*e))+c)*r*Math.cos(o),y:(a+c)*r*Math.sin(o),z:(a*(1-s)+c)*h}}function ht(t,s,i,a){var h,e,n,r,o,l,c,u,M,d,f,p,m,y,g,x=t.x,_=t.y,v=t.z?t.z:0;if(h=Math.sqrt(x*x+_*_),e=Math.sqrt(x*x+_*_+v*v),h/i<1e-12){if(y=0,e/i<1e-12)return g=-a,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(_,x);n=v/e,u=(r=h/e)*(1-s)*(o=1/Math.sqrt(1-s*(2-s)*r*r)),M=n*o,m=0;do{m++,l=s*(c=i/Math.sqrt(1-s*M*M))/(c+(g=h*u+v*M-c*(1-s*M*M))),p=(f=n*(o=1/Math.sqrt(1-l*(2-l)*r*r)))*u-(d=r*(1-l)*o)*M,u=d,M=f}while(p*p>1e-24&&m<30);return{x:y,y:Math.atan(f/Math.abs(d)),z:g}}function et(t){return 1===t||2===t}function nt(t,s,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var a={x:-i.x,y:i.y},h={x:Number.NaN,y:Number.NaN},e=[];t:for(var n=0;na.y||f>a.x||y1e-12&&Math.abs(n.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=G(e.x+i.ll[0]),a.y=e.y+i.ll[1]}else isNaN(e.x)||(a.x=t.x+e.x,a.y=t.y+e.y);return a}function ot(t,s){var i,a={x:t.x/s.del[0],y:t.y/s.del[1]},h=Math.floor(a.x),e=Math.floor(a.y),n=a.x-1*h,r=a.y-1*e,o={x:Number.NaN,y:Number.NaN};if(h<0||h>=s.lim[0])return o;if(e<0||e>=s.lim[1])return o;i=e*s.lim[0]+h;var l=s.cvs[i][0],c=s.cvs[i][1];i++;var u=s.cvs[i][0],M=s.cvs[i][1];i+=s.lim[0];var d=s.cvs[i][0],f=s.cvs[i][1];i--;var p=s.cvs[i][0],m=s.cvs[i][1],y=n*r,g=n*(1-r),x=(1-n)*(1-r),_=(1-n)*r;return o.x=x*l+g*u+_*p+y*d,o.y=x*c+g*M+_*m+y*f,o}function lt(t,s,i){var a,h,e,n=i.x,r=i.y,o=i.z||0,l={};for(e=0;e<3;e++)if(!s||2!==e||void 0!==i.z)switch(0===e?(a=n,h=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(a=r,h=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(a=o,h="z"),t.axis[e]){case"e":case"n":l[h]=a;break;case"w":case"s":l[h]=-a;break;case"u":void 0!==i[h]&&(l.z=a);break;case"d":void 0!==i[h]&&(l.z=-a);break;default:return null}return l}function ct(t){var s={x:t[0],y:t[1]};return t.length>2&&(s.z=t[2]),t.length>3&&(s.m=t[3]),s}function ut(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 Mt(t,s,i,e){var n,r=void 0!==(i=Array.isArray(i)?ct(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(function(t){ut(t.x),ut(t.y)}(i),t.datum&&s.datum&&function(t,s){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==s.datumCode||(1===s.datum.datum_type||2===s.datum.datum_type||3===s.datum.datum_type)&&"WGS84"!==t.datumCode}(t,s)&&(i=Mt(t,n=new it("WGS84"),i,e),t=n),e&&"enu"!==t.axis&&(i=lt(t,!1,i)),"longlat"===t.projName)i={x:i.x*o,y:i.y*o,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=function(t,s,i){if(function(t,s){return t.datum_type===s.datum_type&&!(t.a!==s.a||Math.abs(t.es-s.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]:2!==t.datum_type||t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]&&t.datum_params[3]===s.datum_params[3]&&t.datum_params[4]===s.datum_params[4]&&t.datum_params[5]===s.datum_params[5]&&t.datum_params[6]===s.datum_params[6])}(t,s))return i;if(5===t.datum_type||5===s.datum_type)return i;var e=t.a,n=t.es;if(3===t.datum_type){if(0!==nt(t,!1,i))return;e=a,n=h}var r=s.a,o=s.b,l=s.es;return 3===s.datum_type&&(r=a,o=6356752.314,l=h),n!==l||e!==r||et(t.datum_type)||et(s.datum_type)?(i=at(i,n,e),et(t.datum_type)&&(i=function(t,s,i){if(1===s)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===s){var a=i[0],h=i[1],e=i[2],n=i[3],r=i[4],o=i[5],l=i[6];return{x:l*(t.x-o*t.y+r*t.z)+a,y:l*(o*t.x+t.y-n*t.z)+h,z:l*(-r*t.x+n*t.y+t.z)+e}}}(i,t.datum_type,t.datum_params)),et(s.datum_type)&&(i=function(t,s,i){if(1===s)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===s){var a=i[0],h=i[1],e=i[2],n=i[3],r=i[4],o=i[5],l=i[6],c=(t.x-a)/l,u=(t.y-h)/l,M=(t.z-e)/l;return{x:c+o*u-r*M,y:-o*c+u+n*M,z:r*c-n*u+M}}}(i,s.datum_type,s.datum_params)),i=ht(i,l,r,o),3!==s.datum_type||0===nt(s,!0,i)?i:void 0):i}(t.datum,s.datum,i))return s.from_greenwich&&(i={x:i.x-s.from_greenwich,y:i.y,z:i.z||0}),"longlat"===s.projName?i={x:i.x*l,y:i.y*l,z:i.z||0}:(i=s.forward(i),s.to_meter&&(i={x:i.x/s.to_meter,y:i.y/s.to_meter,z:i.z||0})),e&&"enu"!==s.axis?lt(s,!0,i):(i&&!r&&delete i.z,i)}var dt=it("WGS84");function ft(t,s,i,a){var h,e,n;return Array.isArray(i)?(h=Mt(t,s,i,a)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name?"number"==typeof h.z?[h.x,h.y,h.z].concat(i.slice(3)):[h.x,h.y,i[2]].concat(i.slice(3)):[h.x,h.y].concat(i.slice(2)):[h.x,h.y]):(e=Mt(t,s,i,a),2===(n=Object.keys(i)).length||n.forEach((function(a){if(void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name){if("x"===a||"y"===a||"z"===a)return}else if("x"===a||"y"===a)return;e[a]=i[a]})),e)}function pt(t){return t instanceof it?t:t.oProj?t.oProj:it(t)}const mt=function(t,s,i){t=pt(t);var a,h=!1;return void 0===s?(s=t,t=dt,h=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=dt,h=!0),s=pt(s),i?ft(t,s,i):(a={forward:function(i,a){return ft(t,s,i,a)},inverse:function(i,a){return ft(s,t,i,a)}},h&&(a.oProj=s),a)};var yt="AJSAJS",gt="AFAFAF",xt=65,_t=73,vt=79;const bt={forward:wt,inverse:function(t){var s=Pt(Et(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]},toPoint:Nt};function wt(t,s){return s=s||5,function(t,s){var i,a,h,e,n,r,o,l,c,u,M,d="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,u=t.northing,M=St(t.zoneNumber),i=Math.floor(c/1e5),a=Math.floor(u/1e5)%20,e=yt.charCodeAt(h=M-1),n=gt.charCodeAt(h),l=!1,(r=e+i-1)>90&&(r=r-90+xt-1,l=!0),(r===_t||e<_t&&r>_t||(r>_t||e<_t)&&l)&&r++,(r===vt||evt||(r>vt||e90&&(r=r-90+xt-1),(o=n+a)>86?(o=o-86+xt-1,l=!0):l=!1,(o===_t||n<_t&&o>_t||(o>_t||n<_t)&&l)&&o++,(o===vt||nvt||(o>vt||n86&&(o=o-86+xt-1),String.fromCharCode(r)+String.fromCharCode(o))+d.substr(d.length-5,s)+f.substr(f.length-5,s)}(function(t){var s,i,a,h,e,n,r,o=t.lat,l=t.lon,c=6378137,u=.00669438,M=.9996,d=kt(o),f=kt(l);r=Math.floor((l+180)/6)+1,180===l&&(r=60),o>=56&&o<64&&l>=3&&l<12&&(r=32),o>=72&&o<84&&(l>=0&&l<9?r=31:l>=9&&l<21?r=33:l>=21&&l<33?r=35:l>=33&&l<42&&(r=37)),n=kt(6*(r-1)-180+3),s=.006739496752268451,i=c/Math.sqrt(1-u*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),h=s*Math.cos(d)*Math.cos(d);var p,m,y=M*i*((e=Math.cos(d)*(f-n))+(1-a+h)*e*e*e/6+(5-18*a+a*a+72*h-58*s)*e*e*e*e*e/120)+5e5,g=M*(c*(.9983242984503243*d-.002514607064228144*Math.sin(2*d)+2639046602129982e-21*Math.sin(4*d)-3.418046101696858e-9*Math.sin(6*d))+i*Math.tan(d)*(e*e/2+(5-a+9*h+4*h*h)*e*e*e*e/24+(61-58*a+a*a+600*h-2.2240339282485886)*e*e*e*e*e*e/720));return o<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(y),zoneNumber:r,zoneLetter:(p=o,m="Z",84>=p&&p>=72?m="X":72>p&&p>=64?m="W":64>p&&p>=56?m="V":56>p&&p>=48?m="U":48>p&&p>=40?m="T":40>p&&p>=32?m="S":32>p&&p>=24?m="R":24>p&&p>=16?m="Q":16>p&&p>=8?m="P":8>p&&p>=0?m="N":0>p&&p>=-8?m="M":-8>p&&p>=-16?m="L":-16>p&&p>=-24?m="K":-24>p&&p>=-32?m="J":-32>p&&p>=-40?m="H":-40>p&&p>=-48?m="G":-48>p&&p>=-56?m="F":-56>p&&p>=-64?m="E":-64>p&&p>=-72?m="D":-72>p&&p>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),s)}function Nt(t){var s=Pt(Et(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function kt(t){return t*(Math.PI/180)}function Ct(t){return t/Math.PI*180}function Pt(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var e,n,r,o,l,c,u,M,d,f=.9996,p=6378137,m=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=i-5e5,x=s;a<"N"&&(x-=1e7),u=6*(h-1)-180+3,e=.006739496752268451,d=(M=x/f/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*M)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*M)+151*y*y*y/96*Math.sin(6*M),n=p/Math.sqrt(1-m*Math.sin(d)*Math.sin(d)),r=Math.tan(d)*Math.tan(d),o=e*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-m*Math.sin(d)*Math.sin(d),1.5),c=g/(n*f);var _=d-n*Math.tan(d)/l*(c*c/2-(5+3*r+10*o-4*o*o-9*e)*c*c*c*c/24+(61+90*r+298*o+45*r*r-1.6983531815716497-3*o*o)*c*c*c*c*c*c/720);_=Ct(_);var v,b=(c-(1+2*r+o)*c*c*c/6+(5-2*o+28*r-3*o*o+8*e+24*r*r)*c*c*c*c*c/120)/Math.cos(d);if(b=u+Ct(b),t.accuracy){var w=Pt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});v={top:w.lat,right:w.lon,bottom:_,left:b}}else v={lat:_,lon:b};return v}function St(t){var s=t%6;return 0===s&&(s=6),s}function Et(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var s,i=t.length,a=null,h="",e=0;!/[A-Z]/.test(s=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;h+=s,e++}var n=parseInt(h,10);if(0===e||e+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(e++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(e,e+=2);for(var o=St(n),l=function(t,s){for(var i=yt.charCodeAt(s-1),a=1e5,h=!1;i!==t.charCodeAt(0);){if(++i===_t&&i++,i===vt&&i++,i>90){if(h)throw"Bad character: "+t;i=xt,h=!0}a+=1e5}return a}(a.charAt(0),o),c=function(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=gt.charCodeAt(s-1),a=0,h=!1;i!==t.charCodeAt(0);){if(++i===_t&&i++,i===vt&&i++,i>86){if(h)throw"Bad character: "+t;i=xt,h=!0}a+=1e5}return a}(a.charAt(1),o);c0&&(M=1e5/Math.pow(10,p),d=t.substring(e,e+p),m=parseFloat(d)*M,f=t.substring(e+p),y=parseFloat(f)*M),{easting:m+l,northing:y+c,zoneLetter:r,zoneNumber:n,accuracy:M}}function At(t){var s;switch(t){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+t}function It(t,s,i){if(!(this instanceof It))return new It(t,s,i);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===s){var a=t.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=t,this.y=s,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}It.fromMGRS=function(t){return new It(Nt(t))},It.prototype.toMGRS=function(t){return wt([this.x,this.y],t)};const qt=It;var Ot=.046875,zt=.01953125,jt=.01068115234375;function Gt(t){var s=[];s[0]=1-t*(.25+t*(Ot+t*(zt+t*jt))),s[1]=t*(.75-t*(Ot+t*(zt+t*jt)));var i=t*t;return s[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,s[3]=i*(.3645833333333333-.005696614583333333*t),s[4]=i*t*.3076171875,s}function Lt(t,s,i,a){return i*=s,s*=s,a[0]*t-i*(a[1]+s*(a[2]+s*(a[3]+s*a[4])))}function Rt(t,s,i){for(var a=1/(1-s),h=t,e=20;e;--e){var n=Math.sin(h),o=1-s*n*n;if(h-=o=(Lt(h,n,Math.cos(h),i)-t)*(o*Math.sqrt(o))*a,Math.abs(o)r?Math.tan(e):0,p=Math.pow(f,2),m=Math.pow(p,2);s=1-this.es*Math.pow(o,2),c/=Math.sqrt(s);var y=Lt(e,o,l,this.en);i=this.a*(this.k0*c*(1+u/6*(1-p+M+u/20*(5-18*p+m+14*M-58*p*M+u/42*(61+179*m-m*p-479*p)))))+this.x0,a=this.a*(this.k0*(y-this.ml0+o*n*c/2*(1+u/12*(5-p+9*M+4*d+u/30*(61+m-58*p+270*M-330*p*M+u/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=l*Math.sin(n);if(Math.abs(Math.abs(g)-1)=1){if(g-1>r)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,e=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(i=Rt(s=this.ml0+o/this.k0,this.es,this.en),Math.abs(i)r?Math.tan(i):0,M=this.ep2*Math.pow(c,2),d=Math.pow(M,2),f=Math.pow(u,2),p=Math.pow(f,2);s=1-this.es*Math.pow(l,2);var m=e*Math.sqrt(s)/this.k0,y=Math.pow(m,2);a=i-(s*=u)*y/(1-this.es)*.5*(1-y/12*(5+3*f-9*M*f+M-4*d-y/30*(61+90*f-252*M*f+45*p+46*M-y/56*(1385+3633*f+4095*p+1574*p*f)))),h=G(this.long0+m*(1-y/6*(1+2*f+M-y/20*(5+28*f+24*p+8*M*f+6*M-y/42*(61+662*f+1320*p+720*p*f))))/c)}else a=n*j(o),h=0;else{var g=Math.exp(e/this.k0),x=.5*(g-1/g),_=this.lat0+o/this.k0,v=Math.cos(_);s=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(x,2))),a=Math.asin(s),o<0&&(a=-a),h=0===x&&0===v?0:G(Math.atan2(x,v)+this.long0)}return t.x=h,t.y=a,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Tt(t){var s=Math.exp(t);return(s-1/s)/2}function Ft(t,s){t=Math.abs(t),s=Math.abs(s);var i=Math.max(t,s),a=Math.min(t,s)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))}function Dt(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return s+i*Math.sin(2*s)}function Ut(t,s,i){for(var a,h,e=Math.sin(s),n=Math.cos(s),r=Tt(i),o=function(t){var s=Math.exp(t);return(s+1/s)/2}(i),l=2*n*o,c=-2*e*r,u=t.length-1,M=t[u],d=0,f=0,p=0;--u>=0;)a=f,h=d,M=l*(f=M)-a-c*(d=p)+t[u],p=c*f-h+l*d;return[(l=e*o)*M-(c=n*r)*p,l*p+c*M]}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&&(Bt.init.apply(this),this.forward=Bt.forward,this.inverse=Bt.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)),s=t/(2-t),i=s;this.cgb[0]=s*(2+s*(-2/3+s*(s*(116/45+s*(26/45+s*(-2854/675)))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+s*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+s*(-12686/2835)))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=i*(1237/630+s*(s*(-24832/14175)-2.4)),i*=s,this.cgb[4]=i*(4174/315+s*(-144838/6237)),this.cbg[4]=i*(-734/315+s*(109598/31185)),i*=s,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+s*(-1983433/1935360)))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=i*(49561/161280+s*(-179/168+s*(6601661/7257600))),i*=s,this.utg[4]=i*(-4583/161280+s*(108847/3991680)),this.gtu[4]=i*(34729/80640+s*(-3418889/1995840)),i*=s,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var a=Dt(this.cbg,this.lat0);this.Zb=-this.Qn*(a+function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i}(this.gtu,2*a))},forward:function(t){var s=G(t.x-this.long0),i=t.y;i=Dt(this.cbg,i);var a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*h),s=Math.atan2(e*h,Ft(a,h*n)),s=function(t){var s=Math.abs(t);return s=function(t){var s=1+t,i=s-1;return 0===i?t:t*Math.log(s)/i}(s*(1+s/(Ft(1,s)+1))),t<0?-s:s}(Math.tan(s));var r,o,l=Ut(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],Math.abs(s)<=2.623395162778?(r=this.a*(this.Qn*s)+this.x0,o=this.a*(this.Qn*i+this.Zb)+this.y0):(r=1/0,o=1/0),t.x=r,t.y=o,t},inverse:function(t){var s,i,a=(t.x-this.x0)*(1/this.a),h=(t.y-this.y0)*(1/this.a);if(h=(h-this.Zb)/this.Qn,a/=this.Qn,Math.abs(a)<=2.623395162778){var e=Ut(this.utg,2*h,2*a);h+=e[0],a+=e[1],a=Math.atan(Tt(a));var n=Math.sin(h),r=Math.cos(h),o=Math.sin(a),l=Math.cos(a);h=Math.atan2(n*l,Ft(o,l*r)),s=G((a=Math.atan2(o,l*r))+this.long0),i=Dt(this.cgb,h)}else s=1/0,i=1/0;return t.x=s,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},Wt={init:function(){var t=function(t,s){if(void 0===t){if((t=Math.floor(30*(G(s)+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)*o,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,s){return Math.pow((1-t)/(1+t),s)}const Xt={init:function(){var t=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*s*s/(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 s=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+c),this.C)*Jt(this.e*Math.sin(i),this.ratexp))-n,t.x=this.C*s,t},inverse:function(t){for(var s=t.x/this.C,i=t.y,a=Math.pow(Math.tan(.5*i+c)/this.K,1/this.C),h=20;h>0&&(i=2*Math.atan(a*Jt(this.e*Math.sin(t.y),-.5*this.e))-n,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]},Ht={init:function(){Xt.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 s,i,a,h;return t.x=G(t.x-this.long0),Xt.forward.apply(this,[t]),s=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*i*a),t.x=h*i*Math.sin(t.x),t.y=h*(this.cosc0*s-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var s,i,a,h,e;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,e=Ft(t.x,t.y)){var n=2*Math.atan2(e,this.R2);s=Math.sin(n),i=Math.cos(n),h=Math.asin(i*this.sinc0+t.y*s*this.cosc0/e),a=Math.atan2(t.x*s,e*this.cosc0*i-t.y*this.sinc0*s)}else h=this.phic0,a=0;return t.x=a,t.y=h,Xt.inverse.apply(this,[t]),t.x=G(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Kt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,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)<=r&&(this.k0=.5*(1+j(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=r&&(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)<=r&&Math.abs(Math.cos(this.lat_ts))>r&&(this.k0=.5*this.cons*z(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/L(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=z(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,e,o,l=t.x,c=t.y,u=Math.sin(c),M=Math.cos(c),d=G(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=r&&Math.abs(c+this.lat0)<=r?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*u+this.coslat0*M*Math.cos(d)),t.x=this.a*s*M*Math.sin(d)+this.x0,t.y=this.a*s*(this.coslat0*u-this.sinlat0*M*Math.cos(d))+this.y0,t):(i=2*Math.atan(this.ssfn_(c,u,this.e))-n,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=r?(e=L(this.e,c*this.con,this.con*u),o=2*this.a*this.k0*e/this.cons,t.x=this.x0+o*Math.sin(l-this.long0),t.y=this.y0-this.con*o*Math.cos(l-this.long0),t):(Math.abs(this.sinlat0)0?G(this.long0+Math.atan2(t.x,-1*t.y)):G(this.long0+Math.atan2(t.x,t.y)):G(this.long0+Math.atan2(t.x*Math.sin(l),o*this.coslat0*Math.cos(l)-t.y*this.sinlat0*Math.sin(l))),t.x=s,t.y=i,t)}if(Math.abs(this.coslat0)<=r){if(o<=r)return i=this.lat0,s=this.long0,t.x=s,t.y=i,t;t.x*=this.con,t.y*=this.con,a=o*this.cons/(2*this.a*this.k0),i=this.con*R(this.e,a),s=this.con*G(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,o<=r?e=this.X0:(e=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/o),s=G(this.long0+Math.atan2(t.x*Math.sin(h),o*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),i=-1*R(this.e,Math.tan(.5*(n+e)));return t.x=s,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,s,i){return s*=i,Math.tan(.5*(n+t))*Math.pow((1-s)/(1+s),.5*i)}},Vt={init:function(){var t=this.lat0;this.lambda0=this.long0;var s=Math.sin(t),i=this.a,a=1/this.rf,h=2*a-Math.pow(a,2),e=this.e=Math.sqrt(h);this.R=this.k0*i*Math.sqrt(1-h)/(1-h*Math.pow(s,2)),this.alpha=Math.sqrt(1+h/(1-h)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(s/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),r=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*s)/(1-e*s));this.K=n-this.alpha*r+this.alpha*e/2*o},forward:function(t){var s=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(s+i)+this.K,h=2*(Math.atan(Math.exp(a))-Math.PI/4),e=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(e)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(e))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(e));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*n+this.x0,t},inverse:function(t){for(var s=t.x-this.x0,i=t.y-this.y0,a=s/this.R,h=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),e=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(a)),n=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(h))),r=this.lambda0+n/this.alpha,o=0,l=e,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/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(o))-Math.PI/2}return t.x=r,t.y=l,t},names:["somerc"]};var Zt=1e-7;const Yt={init:function(){var t,s,i,a,h,e,l,M,d,f,p,m,y,g=0,x=0,_=0,v=0,b=0,w=0,N=0;this.no_off=(y="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(y)),this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),k&&(N=this.alpha),C&&(g=this.rectified_grid_angle*o),k||C)x=this.longc;else if(_=this.long1,b=this.lat1,v=this.long2,w=this.lat2,Math.abs(b-w)<=Zt||(t=Math.abs(b))<=Zt||Math.abs(t-n)<=Zt||Math.abs(Math.abs(this.lat0)-n)<=Zt||Math.abs(Math.abs(w)-n)<=Zt)throw new Error;var P=1-this.es;s=Math.sqrt(P),Math.abs(this.lat0)>r?(M=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*M*M,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*s/t,(h=(a=this.B*s/(i*Math.sqrt(t)))*a-1)<=0?h=0:(h=Math.sqrt(h),this.lat0<0&&(h=-h)),this.E=h+=a,this.E*=Math.pow(L(this.e,this.lat0,M),this.B)):(this.B=1/s,this.A=this.k0,this.E=a=h=1),k||C?(k?(p=Math.asin(Math.sin(N)/a),C||(g=N)):(p=g,N=Math.asin(a*Math.sin(p))),this.lam0=x-Math.asin(.5*(h-1/h)*Math.tan(p))/this.B):(e=Math.pow(L(this.e,b,Math.sin(b)),this.B),l=Math.pow(L(this.e,w,Math.sin(w)),this.B),h=this.E/e,d=(l-e)/(l+e),f=((f=this.E*this.E)-l*e)/(f+l*e),(t=_-v)<-Math.pi?v-=u:t>Math.pi&&(v+=u),this.lam0=G(.5*(_+v)-Math.atan(f*Math.tan(.5*this.B*(_-v))/d)/this.B),p=Math.atan(2*Math.sin(this.B*G(_-this.lam0))/(h-1/h)),g=N=Math.asin(a*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),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(a*a-1)/Math.cos(N))),this.lat0<0&&(this.u_0=-this.u_0)),h=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(c-h)),this.v_pole_s=this.ArB*Math.log(Math.tan(c+h))},forward:function(t){var s,i,a,h,e,o,l,c,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-n)>r){if(s=.5*((e=this.E/Math.pow(L(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/e)),i=.5*(e+o),h=Math.sin(this.B*t.x),a=(s*this.singam-h*this.cosgam)/i,Math.abs(Math.abs(a)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(u.x=l,u.y=c):(l-=this.u_0,u.x=c*this.cosrot+l*this.sinrot,u.y=l*this.cosrot-c*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var s,i,a,h,e,o,l,c={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,s=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,s=t.y*this.cosrot+t.x*this.sinrot+this.u_0),h=.5*((a=Math.exp(-this.BrA*i))-1/a),e=.5*(a+1/a),l=((o=Math.sin(this.BrA*s))*this.cosgam+h*this.singam)/e,Math.abs(Math.abs(l)-1)r?this.ns=Math.log(a/o)/Math.log(h/l):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=r&&(i=j(i)*(n-2e-10));var a,h,e=Math.abs(Math.abs(i)-n);if(e>r)a=L(this.e,i,Math.sin(i)),h=this.a*this.f0*Math.pow(a,this.ns);else{if((e=i*this.ns)<=0)return null;h=0}var o=this.ns*G(s-this.long0);return t.x=this.k0*(h*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-h*Math.cos(o))+this.y0,t},inverse:function(t){var s,i,a,h,e,r=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(r*r+o*o),i=1):(s=-Math.sqrt(r*r+o*o),i=-1);var l=0;if(0!==s&&(l=Math.atan2(i*r,i*o)),0!==s||this.ns>0){if(i=1/this.ns,a=Math.pow(s/(this.a*this.f0),i),-9999===(h=R(this.e,a)))return null}else h=-n;return e=G(l/this.ns+this.long0),t.x=e,t.y=h,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)"]},ts={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 s,i,a,h,e,n,r,o=t.x,l=t.y,c=G(o-this.long0);return s=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/s)-this.s45),a=-c*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),e=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(h)),n=this.n*e,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/2+this.s45),this.n),t.y=r*Math.cos(n)/1,t.x=r*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var s,i,a,h,e,n,r,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x)/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/e,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(h)),i=Math.asin(Math.cos(a)*Math.sin(h)/Math.cos(s)),t.x=this.long0-i/this.alfa,n=s,r=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(r=1),n=t.y,l+=1}while(0===r&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function ss(t,s,i,a,h){return t*h-s*Math.sin(2*h)+i*Math.sin(4*h)-a*Math.sin(6*h)}function is(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function as(t){return.375*t*(1+.25*t*(1+.46875*t))}function hs(t){return.05859375*t*t*(1+.75*t)}function es(t){return t*t*t*(35/3072)}function ns(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)}function rs(t){return Math.abs(t)1e-7?(1-t*t)*(s/(1-(i=t*s)*i)-.5/t*Math.log((1-i)/(1+i))):2*s}const us={init:function(){var t,s=Math.abs(this.lat0);if(Math.abs(s-n)0)switch(this.qp=cs(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var s,i=[];return i[0]=.3333333333333333*t,s=t*t,i[0]+=.17222222222222222*s,i[1]=.06388888888888888*s,s*=t,i[0]+=.10257936507936508*s,i[1]+=.0664021164021164*s,i[2]=.016415012942191543*s,i}(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=cs(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 s,i,a,h,e,o,l,u,M,d,f=t.x,p=t.y;if(f=G(f-this.long0),this.sphere){if(e=Math.sin(p),d=Math.cos(p),a=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+d*a:1+this.sinph0*e+this.cosph0*d*a)<=r)return null;s=(i=Math.sqrt(2/i))*d*Math.sin(f),i*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*d*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(p+this.lat0)=0?(s=(M=Math.sqrt(o))*h,i=a*(this.mode===this.S_POLE?M:-M)):s=i=0}}return t.x=this.a*s+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,o,l,c,u,M,d=t.x/this.a,f=t.y/this.a;if(this.sphere){var p,m=0,y=0;if((i=.5*(p=Math.sqrt(d*d+f*f)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(i),m=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=r?0:Math.asin(f*y/p),d*=y,f=m*p;break;case this.OBLIQ:i=Math.abs(p)<=r?this.lat0:Math.asin(m*this.sinph0+f*y*this.cosph0/p),d*=y*this.cosph0,f=(m-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:f=-f,i=n-i;break;case this.S_POLE:i-=n}s=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,f):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,f*=this.dd,(o=Math.sqrt(d*d+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const ds={init:function(){Math.abs(this.lat1+this.lat2)r?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 s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=cs(this.e3,this.sin_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*G(s-this.long0),n=h*Math.sin(e)+this.x0,r=this.rh-h*Math.cos(e)+this.y0;return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),h=0,0!==s&&(h=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,this.sphere?n=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,n=this.phi1z(this.e3,i)),e=G(h/this.ns0+this.long0),t.x=e,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,s){var i,a,h,e,n=Ms(.5*s);if(t0||Math.abs(e)<=r?(n=this.x0+1*this.a*i*Math.sin(a)/e,o=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)/e):(n=this.x0+this.infinity_dist*i*Math.sin(a),o=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=o,t},inverse:function(t){var s,i,a,h,e,n;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,(s=Math.sqrt(t.x*t.x+t.y*t.y))?(h=Math.atan2(s,this.rc),i=Math.sin(h),n=Ms((a=Math.cos(h))*this.sin_p14+t.y*i*this.cos_p14/s),e=Math.atan2(t.x*i,s*this.cos_p14*a-t.y*this.sin_p14*i),e=G(this.long0+e)):(n=this.phic0,e=0),t.x=e,t.y=n,t},names:["gnom"]},ps={init:function(){this.sphere||(this.k0=z(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var s,i,a=t.x,h=t.y,e=G(a-this.long0);if(this.sphere)s=this.x0+this.a*e*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var n=cs(this.e,Math.sin(h));s=this.x0+this.a*this.k0*e,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t},inverse:function(t){var s,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(s=G(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=function(t,s){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(s)-i)<1e-6)return s<0?-1*n:n;for(var a,h,e,r,o=Math.asin(.5*s),l=0;l<30;l++)if(h=Math.sin(o),e=Math.cos(o),r=t*h,o+=a=Math.pow(1-r*r,2)/(2*e)*(s/(1-t*t)-h/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),Math.abs(a)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),s=G(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t},names:["cea"]},ms={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 s=t.x,i=t.y,a=G(s-this.long0),h=rs(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var s=t.x,i=t.y;return t.x=G(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=rs(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},ys={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=is(this.es),this.e1=as(this.es),this.e2=hs(this.es),this.e3=es(this.es),this.ml0=this.a*ss(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=G(h-this.long0);if(a=n*Math.sin(e),this.sphere)Math.abs(e)<=r?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(e),i=this.a*(rs(e-this.lat0)+(1-Math.cos(a))/Math.tan(e)));else if(Math.abs(e)<=r)s=this.a*n,i=-1*this.ml0;else{var o=ns(this.a,this.e,Math.sin(e))/Math.tan(e);s=o*Math.sin(a),i=this.a*ss(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+o*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){var s,i,a,h,e,n,o,l,c;if(a=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=r)s=G(a/this.a+this.long0),i=0;else{var u;for(n=this.lat0+h/this.a,o=a*a/this.a/this.a+n*n,l=n,e=20;e;--e)if(l+=c=-1*(n*(l*(u=Math.tan(l))+1)-l-.5*(l*l+o)*u)/((l-n)/u-1),Math.abs(c)<=r){i=l;break}s=G(this.long0+Math.asin(a*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(h+this.ml0)<=r)i=0,s=G(this.long0+a/this.a);else{var M,d,f,p,m;for(n=(this.ml0+h)/this.a,o=a*a/this.a/this.a+n*n,l=n,e=20;e;--e)if(m=this.e*Math.sin(l),M=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*ss(this.e0,this.e1,this.e2,this.e3,l),f=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=(n*(M*(p=d/this.a)+1)-p-.5*M*(p*p+o))/(this.es*Math.sin(2*l)*(p*p+o-2*n*p)/(4*M)+(n-p)*(M*f-2/Math.sin(2*l))-f),Math.abs(c)<=r){i=l;break}M=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=G(this.long0+Math.asin(a*M/this.a)/Math.sin(i))}return t.x=s,t.y=i,t},names:["Polyconic","poly"]},gs={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 s,i=t.x,a=t.y-this.lat0,h=i-this.long0,n=a/e*1e-5,r=h,o=1,l=0;for(s=1;s<=10;s++)o*=n,l+=this.A[s]*o;var c,u=l,M=r,d=1,f=0,p=0,m=0;for(s=1;s<=6;s++)c=f*u+d*M,d=d*u-f*M,f=c,p=p+this.B_re[s]*d-this.B_im[s]*f,m=m+this.B_im[s]*d+this.B_re[s]*f;return t.x=m*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var s,i,a=t.x,h=t.y,n=a-this.x0,r=(h-this.y0)/this.a,o=n/this.a,l=1,c=0,u=0,M=0;for(s=1;s<=6;s++)i=c*r+l*o,l=l*r-c*o,c=i,u=u+this.C_re[s]*l-this.C_im[s]*c,M=M+this.C_im[s]*l+this.C_re[s]*c;for(var d=0;d.999999999999&&(i=.999999999999),s=Math.asin(i);var a=G(this.long0+t.x/(.900316316158*this.a*Math.cos(s)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*s+Math.sin(2*s))/Math.PI,Math.abs(i)>1&&(i=1);var h=Math.asin(i);return t.x=a,t.y=h,t},names:["Mollweide","moll"]},bs={init:function(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1);var e=0;return 0!==i&&(e=Math.atan2(s*t.x,s*t.y)),this.sphere?(h=G(this.long0+e/this.ns),a=rs(this.g-i/this.a),t.x=h,t.y=a,t):(a=os(this.g-i/this.a,this.e0,this.e1,this.e2,this.e3),h=G(this.long0+e/this.ns),t.x=h,t.y=a,t)},names:["Equidistant_Conic","eqdc"]},ws={init:function(){this.R=this.a},forward:function(t){var s,i,a=t.x,h=t.y,e=G(a-this.long0);Math.abs(h)<=r&&(s=this.x0+this.R*e,i=this.y0);var o=Ms(2*Math.abs(h/Math.PI));(Math.abs(e)<=r||Math.abs(Math.abs(h)-n)<=r)&&(s=this.x0,i=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var l=.5*Math.abs(Math.PI/e-e/Math.PI),c=l*l,u=Math.sin(o),M=Math.cos(o),d=M/(u+M-1),f=d*d,p=d*(2/u-1),m=p*p,y=Math.PI*this.R*(l*(d-m)+Math.sqrt(c*(d-m)*(d-m)-(m+c)*(f-m)))/(m+c);e<0&&(y=-y),s=this.x0+y;var g=c+d;return y=Math.PI*this.R*(p*g-l*Math.sqrt((m+c)*(c+1)-g*g))/(m+c),i=h>=0?this.y0+y:this.y0-y,t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h,e,n,o,l,c,u,M,d;return t.x-=this.x0,t.y-=this.y0,M=Math.PI*this.R,e=(a=t.x/M)*a+(h=t.y/M)*h,M=3*(h*h/(l=-2*(n=-Math.abs(h)*(1+e))+1+2*h*h+e*e)+(2*(o=n-2*h*h+a*a)*o*o/l/l/l-9*n*o/l/l)/27)/(c=(n-o*o/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(M)>1&&(M=M>=0?1:-1),d=Math.acos(M)/3,i=t.y>=0?(-u*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI:-(-u*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI,s=Math.abs(a)2*n*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),e=this.long0,Math.abs(s)<=r?o=this.lat0:(o=Ms(h*this.sin_p12+t.y*a*this.cos_p12/s),l=Math.abs(this.lat0)-n,e=Math.abs(l)<=r?this.lat0>=0?G(this.long0+Math.atan2(t.x,-t.y)):G(this.long0-Math.atan2(-t.x,t.y)):G(this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=e,t.y=o,t}return c=is(this.es),u=as(this.es),M=hs(this.es),d=es(this.es),Math.abs(this.sin_p12-1)<=r?(o=os(((f=this.a*ss(c,u,M,d,n))-(s=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,c,u,M,d),e=G(this.long0+Math.atan2(t.x,-1*t.y)),t.x=e,t.y=o,t):Math.abs(this.sin_p12+1)<=r?(f=this.a*ss(c,u,M,d,n),o=os(((s=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,c,u,M,d),e=G(this.long0+Math.atan2(t.x,t.y)),t.x=e,t.y=o,t):(s=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=ns(this.a,this.e,this.sin_p12),g=Math.cos(y),_=-(x=this.e*this.cos_p12*g)*x/(1-this.es),v=3*this.es*(1-_)*this.sin_p12*this.cos_p12*g/(1-this.es),N=1-_*(w=(b=s/p)-_*(1+_)*Math.pow(b,3)/6-v*(1+3*_)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,m=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*g),e=G(this.long0+Math.asin(Math.sin(y)*Math.sin(w)/Math.cos(m))),k=Math.sin(m),o=Math.atan2((k-this.es*N*this.sin_p12)*Math.tan(m),k*(1-this.es)),t.x=e,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},ks={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,o,l=t.x,c=t.y;return a=G(l-this.long0),s=Math.sin(c),i=Math.cos(c),h=Math.cos(a),((e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=r)&&(n=1*this.a*i*Math.sin(a),o=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=o,t},inverse:function(t){var s,i,a,h,e,o,l;return t.x-=this.x0,t.y-=this.y0,i=Ms((s=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),a=Math.sin(i),h=Math.cos(i),o=this.long0,Math.abs(s)<=r?(l=this.lat0,t.x=o,t.y=l,t):(l=Ms(h*this.sin_p14+t.y*a*this.cos_p14/s),e=Math.abs(this.lat0)-n,Math.abs(e)<=r?(o=this.lat0>=0?G(this.long0+Math.atan2(t.x,-t.y)):G(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=l,t):(o=G(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a)),t.x=o,t.y=l,t))},names:["ortho"]};function Cs(t,s,i,a){var h;return tc&&h<=n+c?(a.value=2,h-=n):h>n+c||h<=-(n+c)?(a.value=3,h=h>=0?h-M:h+M):(a.value=4,h+=n)),h}function Ps(t,s){var i=t+s;return i<-M?i+=u:i>+M&&(i-=u),i}const Ss={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>=n-c/2?this.face=5:this.lat0<=-(n-c/2)?this.face=6:Math.abs(this.long0)<=c?this.face=1:Math.abs(this.long0)<=n+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 s,i,a,h,e,r,o={x:0,y:0},l={value:0};if(t.x-=this.long0,s=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,5===this.face)h=n-s,i>=c&&i<=n+c?(l.value=1,a=i-n):i>n+c||i<=-(n+c)?(l.value=2,a=i>0?i-M:i+M):i>-(n+c)&&i<=-c?(l.value=3,a=i+n):(l.value=4,a=i);else if(6===this.face)h=n+s,i>=c&&i<=n+c?(l.value=1,a=-i+n):i=-c?(l.value=2,a=-i):i<-c&&i>=-(n+c)?(l.value=3,a=-i-n):(l.value=4,a=i>0?-i+M:-i-M);else{var u,d,f,p,m,y;2===this.face?i=Ps(i,+n):3===this.face?i=Ps(i,+M):4===this.face&&(i=Ps(i,-n)),p=Math.sin(s),m=Math.cos(s),y=Math.sin(i),u=m*Math.cos(i),d=m*y,f=p,1===this.face?a=Cs(h=Math.acos(u),f,d,l):2===this.face?a=Cs(h=Math.acos(d),f,-u,l):3===this.face?a=Cs(h=Math.acos(-u),f,-d,l):4===this.face?a=Cs(h=Math.acos(-d),f,u,l):(h=a=0,l.value=1)}return r=Math.atan(12/M*(a+Math.acos(Math.sin(a)*Math.cos(c))-n)),e=Math.sqrt((1-Math.cos(h))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(a))))),2===l.value?r+=n:3===l.value?r+=M:4===l.value&&(r+=1.5*M),o.x=e*Math.cos(r),o.y=e*Math.sin(r),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var s,i,a,h,e,r,o,l,c,u,d,f,p={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=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,s-=n):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=3,s=s<0?s+M:s-M):(m.value=4,s+=n),c=M/12*Math.tan(s),e=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),r=Math.atan(e),(o=1-(a=Math.cos(s))*a*(h=Math.tan(i))*h*(1-Math.cos(Math.atan(1/Math.cos(r)))))<-1?o=-1:o>1&&(o=1),5===this.face)l=Math.acos(o),p.phi=n-l,1===m.value?p.lam=r+n:2===m.value?p.lam=r<0?r+M:r-M:3===m.value?p.lam=r-n:p.lam=r;else if(6===this.face)l=Math.acos(o),p.phi=l-n,1===m.value?p.lam=-r+n:2===m.value?p.lam=-r:3===m.value?p.lam=-r-n:p.lam=r<0?-r-M:-r+M;else{var y,g,x;c=(y=o)*y,g=(c+=(x=c>=1?0:Math.sqrt(1-c)*Math.sin(r))*x)>=1?0:Math.sqrt(1-c),2===m.value?(c=g,g=-x,x=c):3===m.value?(g=-g,x=-x):4===m.value&&(c=g,g=x,x=-c),2===this.face?(c=y,y=-g,g=c):3===this.face?(y=-y,g=-g):4===this.face&&(c=y,y=g,g=-c),p.phi=Math.acos(-x)-n,p.lam=Math.atan2(g,y),2===this.face?p.lam=Ps(p.lam,-n):3===this.face?p.lam=Ps(p.lam,-M):4===this.face&&(p.lam=Ps(p.lam,+n))}return 0!==this.es&&(u=p.phi<0?1:0,d=Math.tan(p.phi),f=this.b/Math.sqrt(d*d+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var Es=[[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]],As=[[-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]],Is=.8487,qs=1.3523,Os=l/5,zs=1/Os,js=function(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))};const Gs={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 s=G(t.x-this.long0),i=Math.abs(t.y),a=Math.floor(i*Os);a<0?a=0:a>=18&&(a=17);var h={x:js(Es[a],i=l*(i-zs*a))*s,y:js(As[a],i)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*Is+this.x0,h.y=h.y*this.a*qs+this.y0,h},inverse:function(t){var s={x:(t.x-this.x0)/(this.a*Is),y:Math.abs(t.y-this.y0)/(this.a*qs)};if(s.y>=1)s.x/=Es[18][0],s.y=t.y<0?-n:n;else{var i=Math.floor(18*s.y);for(i<0?i=0:i>=18&&(i=17);;)if(As[i][0]>s.y)--i;else{if(!(As[i+1][0]<=s.y))break;++i}var a=As[i],h=5*(s.y-a[0])/(As[i+1][0]-a[0]);h=function(t,s,i,a){for(var h=s;a;--a){var e=t(h);if(h-=e,Math.abs(e)<1e-10)break}return h}((function(t){return(js(a,t)-s.y)/function(t,s){return t[1]+s*(2*t[2]+3*s*t[3])}(a,t)}),h,0,100),s.x/=js(Es[i],h),s.y=(5*i+h)*o,t.y<0&&(s.y=-s.y)}return s.x=G(s.x+this.long0),s},names:["Robinson","robin"]},Ls={init:function(){this.name="geocent"},forward:function(t){return at(t,this.es,this.a)},inverse:function(t){return ht(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Rs={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 Bs={init:function(){if(Object.keys(Rs).forEach(function(t){if(void 0===this[t])this[t]=Rs[t].def;else{if(Rs[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Rs[t].num&&(this[t]=parseFloat(this[t]))}Rs[t].degrees&&(this[t]=this[t]*o)}.bind(this)),Math.abs(Math.abs(this.lat0)-n)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,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var s,i,a,h,e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x);switch(this.mode){case 3:i=this.sinph0*e+this.cosph0*n*r;break;case 2:i=n*r;break;case 1:i=-e;break;case 0:i=e}switch(s=(i=this.pn1/(this.p-i))*n*Math.sin(t.x),this.mode){case 3:i*=this.cosph0*e-this.sinph0*n*r;break;case 2:i*=e;break;case 0:i*=-n*r;break;case 1:i*=n*r}return h=1/((a=i*this.cg+s*this.sg)*this.sw*this.h1+this.cw),s=(s*this.cg-i*this.sg)*this.cw*h,i=a*h,t.x=s*this.a,t.y=i*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var s,i,a,h={x:t.x,y:t.y};a=1/(this.pn1-t.y*this.sw),s=this.pn1*t.x*a,i=this.pn1*t.y*this.cw*a,t.x=s*this.cg+i*this.sg,t.y=i*this.cg-s*this.sg;var e=Ft(t.x,t.y);if(Math.abs(e)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,s=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=s,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 s,i,a,h,e=t.x,n=t.y;if(e-=this.long0,"ellipse"===this.shape){n=Math.atan(this.radius_p2*Math.tan(n));var r=this.radius_p/Ft(this.radius_p*Math.cos(n),Math.sin(n));if(i=r*Math.cos(e)*Math.cos(n),a=r*Math.sin(e)*Math.cos(n),h=r*Math.sin(n),(this.radius_g-i)*i-a*a-h*h*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(a/Ft(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(a/s),t.y=this.radius_g_1*Math.atan(h/Ft(a,s)))}else"sphere"===this.shape&&(s=Math.cos(n),i=Math.cos(e)*s,a=Math.sin(e)*s,h=Math.sin(n),s=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(a/Ft(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(a/s),t.y=this.radius_g_1*Math.atan(h/Ft(a,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var s,i,a,h,e=-1,n=0,r=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Ft(1,r)):(n=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Ft(1,n));var o=r/this.radius_p;if(s=n*n+o*o+e*e,(a=(i=2*this.radius_g*e)*i-4*s*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-i-Math.sqrt(a))/(2*s),e=this.radius_g+h*e,n*=h,r*=h,t.x=Math.atan2(n,e),t.y=Math.atan(r*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+n*n)),s=n*n+r*r+e*e,(a=(i=2*this.radius_g*e)*i-4*s*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-i-Math.sqrt(a))/(2*s),e=this.radius_g+h*e,n*=h,r*=h,t.x=Math.atan2(n,e),t.y=Math.atan(r*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Fs=1.340264,Ds=-.081106,Us=893e-6,Qs=.003796,Ws=Math.sqrt(3)/2;const Js={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var s=G(t.x-this.long0),i=t.y,a=Math.asin(Ws*Math.sin(i)),h=a*a,e=h*h*h;return t.x=s*Math.cos(a)/(Ws*(Fs+3*Ds*h+e*(7*Us+9*Qs*h))),t.y=a*(Fs+Ds*h+e*(Us+Qs*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var s,i,a,h,e=t.y;for(h=0;h<12&&(e-=a=(e*(Fs+Ds*(s=e*e)+(i=s*s*s)*(Us+Qs*s))-t.y)/(Fs+3*Ds*s+i*(7*Us+9*Qs*s)),!(Math.abs(a)<1e-9));++h);return i=(s=e*e)*s*s,t.x=Ws*t.x*(Fs+3*Ds*s+i*(7*Us+9*Qs*s))/Math.cos(e),t.y=Math.asin(Math.sin(e)/Ws),t.x=G(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};var Xs=1e-10;function Hs(t){var s,i,a,h=G(t.x-(this.long0||0)),e=t.y;return s=this.am1+this.m1-Lt(e,i=Math.sin(e),a=Math.cos(e),this.en),i=a*h/(s*Math.sqrt(1-this.es*i*i)),t.x=s*Math.sin(i),t.y=this.am1-s*Math.cos(i),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Ks(t){var s,i,a,h;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,i=Ft(t.x,t.y=this.am1-t.y),h=Rt(this.am1+this.m1-i,this.es,this.en),(s=Math.abs(h))Xs?(t.x=i*Math.sin(s=a*Math.cos(h)/i),t.y=this.cphi1-i*Math.cos(s)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Zs(t){var s,i;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var a=Ft(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-a,Math.abs(i)>n)throw new Error;return s=Math.abs(Math.abs(i)-n)<=Xs?0:a*Math.atan2(t.x,t.y)/Math.cos(i),t.x=G(s+(this.long0||0)),t.y=rs(i),t}const Ys={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)=n?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Zs,this.forward=Vs)},names:["bonne","Bonne (Werner lat_1=90)"]};var $s;mt.defaultDatum="WGS84",mt.Proj=it,mt.WGS84=new mt.Proj("WGS84"),mt.Point=qt,mt.toPoint=ct,mt.defs=A,mt.nadgrid=function(t,s){var i=new DataView(s),a=function(t){var s=t.getInt32(8,!1);return 11!==s&&(11!==(s=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),h=function(t,s){return{nFields:t.getInt32(8,s),nSubgridFields:t.getInt32(24,s),nSubgrids:t.getInt32(40,s),shiftType:Z(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,s),fromSemiMinorAxis:t.getFloat64(136,s),toSemiMajorAxis:t.getFloat64(152,s),toSemiMinorAxis:t.getFloat64(168,s)}}(i,a),e=function(t,s,i){for(var a=176,h=[],e=0;e{var a=i(5072),h=i.n(a),e=i(7825),n=i.n(e),r=i(7659),o=i.n(r),l=i(5056),c=i.n(l),u=i(540),M=i.n(u),d=i(1113),f=i.n(d),p=i(4096),m={};m.styleTagTransform=f(),m.setAttributes=c(),m.insert=o().bind(null,"head"),m.domAPI=n(),m.insertStyleElement=M(),h()(p.A,m),p.A&&p.A.locals&&p.A.locals},4078:(t,s,i)=>{i.d(s,{kz:()=>r});var a=i(5286),h=i(3407),e=i(3158);let n=null;function r(t){n=t;const s=Object.keys(t.defs),i=s.length;let r,o;for(r=0;r{"use strict";var e={8168:(e,t,r)=>{e.exports=r.p+"4fb34c1567962ff5a6c9.wasm"}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.m=e,r.u=e=>e+".bundle.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b=self.location+"";var n,s=(n="file:///home/mmom/src/rlayers/node_modules/sqlite-wasm-http/deps/dist/sqlite3-bundler-friendly.mjs",function(e={}){var t,s,i=e;i.ready=new Promise(((e,r)=>{t=e,s=r})),["_malloc","_free","_realloc","_sqlite3_aggregate_context","_sqlite3_auto_extension","_sqlite3_bind_blob","_sqlite3_bind_double","_sqlite3_bind_int","_sqlite3_bind_int64","_sqlite3_bind_null","_sqlite3_bind_parameter_count","_sqlite3_bind_parameter_index","_sqlite3_bind_pointer","_sqlite3_bind_text","_sqlite3_busy_handler","_sqlite3_busy_timeout","_sqlite3_cancel_auto_extension","_sqlite3_changes","_sqlite3_changes64","_sqlite3_clear_bindings","_sqlite3_close_v2","_sqlite3_collation_needed","_sqlite3_column_blob","_sqlite3_column_bytes","_sqlite3_column_count","_sqlite3_column_double","_sqlite3_column_int","_sqlite3_column_int64","_sqlite3_column_name","_sqlite3_column_text","_sqlite3_column_type","_sqlite3_column_value","_sqlite3_commit_hook","_sqlite3_compileoption_get","_sqlite3_compileoption_used","_sqlite3_complete","_sqlite3_context_db_handle","_sqlite3_create_collation","_sqlite3_create_collation_v2","_sqlite3_create_function","_sqlite3_create_function_v2","_sqlite3_create_module","_sqlite3_create_module_v2","_sqlite3_create_window_function","_sqlite3_data_count","_sqlite3_db_filename","_sqlite3_db_handle","_sqlite3_db_name","_sqlite3_db_status","_sqlite3_declare_vtab","_sqlite3_deserialize","_sqlite3_drop_modules","_sqlite3_errcode","_sqlite3_errmsg","_sqlite3_error_offset","_sqlite3_errstr","_sqlite3_exec","_sqlite3_expanded_sql","_sqlite3_extended_errcode","_sqlite3_extended_result_codes","_sqlite3_file_control","_sqlite3_finalize","_sqlite3_free","_sqlite3_get_auxdata","_sqlite3_initialize","_sqlite3_keyword_count","_sqlite3_keyword_name","_sqlite3_keyword_check","_sqlite3_last_insert_rowid","_sqlite3_libversion","_sqlite3_libversion_number","_sqlite3_limit","_sqlite3_malloc","_sqlite3_malloc64","_sqlite3_msize","_sqlite3_open","_sqlite3_open_v2","_sqlite3_overload_function","_sqlite3_prepare_v2","_sqlite3_prepare_v3","_sqlite3_preupdate_blobwrite","_sqlite3_preupdate_count","_sqlite3_preupdate_depth","_sqlite3_preupdate_hook","_sqlite3_preupdate_new","_sqlite3_preupdate_old","_sqlite3_progress_handler","_sqlite3_randomness","_sqlite3_realloc","_sqlite3_realloc64","_sqlite3_reset","_sqlite3_reset_auto_extension","_sqlite3_result_blob","_sqlite3_result_double","_sqlite3_result_error","_sqlite3_result_error_code","_sqlite3_result_error_nomem","_sqlite3_result_error_toobig","_sqlite3_result_int","_sqlite3_result_int64","_sqlite3_result_null","_sqlite3_result_pointer","_sqlite3_result_subtype","_sqlite3_result_text","_sqlite3_result_zeroblob","_sqlite3_result_zeroblob64","_sqlite3_rollback_hook","_sqlite3_serialize","_sqlite3_set_authorizer","_sqlite3_set_auxdata","_sqlite3_set_last_insert_rowid","_sqlite3_shutdown","_sqlite3_sourceid","_sqlite3_sql","_sqlite3_status","_sqlite3_status64","_sqlite3_step","_sqlite3_stmt_isexplain","_sqlite3_stmt_readonly","_sqlite3_stmt_status","_sqlite3_strglob","_sqlite3_stricmp","_sqlite3_strlike","_sqlite3_strnicmp","_sqlite3_table_column_metadata","_sqlite3_total_changes","_sqlite3_total_changes64","_sqlite3_trace_v2","_sqlite3_txn_state","_sqlite3_update_hook","_sqlite3_uri_boolean","_sqlite3_uri_int64","_sqlite3_uri_key","_sqlite3_uri_parameter","_sqlite3_user_data","_sqlite3_value_blob","_sqlite3_value_bytes","_sqlite3_value_double","_sqlite3_value_dup","_sqlite3_value_free","_sqlite3_value_frombind","_sqlite3_value_int","_sqlite3_value_int64","_sqlite3_value_nochange","_sqlite3_value_numeric_type","_sqlite3_value_pointer","_sqlite3_value_subtype","_sqlite3_value_text","_sqlite3_value_type","_sqlite3_vfs_find","_sqlite3_vfs_register","_sqlite3_vfs_unregister","_sqlite3_vtab_collation","_sqlite3_vtab_distinct","_sqlite3_vtab_in","_sqlite3_vtab_in_first","_sqlite3_vtab_in_next","_sqlite3_vtab_nochange","_sqlite3_vtab_on_conflict","_sqlite3_vtab_rhs_value","_sqlite3changegroup_add","_sqlite3changegroup_add_strm","_sqlite3changegroup_delete","_sqlite3changegroup_new","_sqlite3changegroup_output","_sqlite3changegroup_output_strm","_sqlite3changeset_apply","_sqlite3changeset_apply_strm","_sqlite3changeset_apply_v2","_sqlite3changeset_apply_v2_strm","_sqlite3changeset_concat","_sqlite3changeset_concat_strm","_sqlite3changeset_conflict","_sqlite3changeset_finalize","_sqlite3changeset_fk_conflicts","_sqlite3changeset_invert","_sqlite3changeset_invert_strm","_sqlite3changeset_new","_sqlite3changeset_next","_sqlite3changeset_old","_sqlite3changeset_op","_sqlite3changeset_pk","_sqlite3changeset_start","_sqlite3changeset_start_strm","_sqlite3changeset_start_v2","_sqlite3changeset_start_v2_strm","_sqlite3session_attach","_sqlite3session_changeset","_sqlite3session_changeset_size","_sqlite3session_changeset_strm","_sqlite3session_config","_sqlite3session_create","_sqlite3session_delete","_sqlite3session_diff","_sqlite3session_enable","_sqlite3session_indirect","_sqlite3session_isempty","_sqlite3session_memory_used","_sqlite3session_object_config","_sqlite3session_patchset","_sqlite3session_patchset_strm","_sqlite3session_table_filter","_sqlite3_wasm_pstack_ptr","_sqlite3_wasm_pstack_restore","_sqlite3_wasm_pstack_alloc","_sqlite3_wasm_pstack_remaining","_sqlite3_wasm_pstack_quota","_sqlite3_wasm_db_error","_sqlite3_wasm_test_struct","_sqlite3_wasm_enum_json","_sqlite3_wasm_vfs_unlink","_sqlite3_wasm_db_vfs","_sqlite3_wasm_db_reset","_sqlite3_wasm_db_export_chunked","_sqlite3_wasm_db_serialize","_sqlite3_wasm_vfs_create_file","_sqlite3_wasm_posix_create_file","_sqlite3_wasm_kvvfsMakeKeyOnPstack","_sqlite3_wasm_kvvfs_methods","_sqlite3_wasm_vtab_config","_sqlite3_wasm_db_config_ip","_sqlite3_wasm_db_config_pii","_sqlite3_wasm_db_config_s","_sqlite3_wasm_config_i","_sqlite3_wasm_config_ii","_sqlite3_wasm_config_j","_sqlite3_wasm_init_wasmfs","_sqlite3_wasm_test_intptr","_sqlite3_wasm_test_voidptr","_sqlite3_wasm_test_int64_max","_sqlite3_wasm_test_int64_min","_sqlite3_wasm_test_int64_times2","_sqlite3_wasm_test_int64_minmax","_sqlite3_wasm_test_int64ptr","_sqlite3_wasm_test_stack_overflow","_sqlite3_wasm_test_str_hello","_sqlite3_wasm_SQLTester_strglob","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>G("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>G("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));const o=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,o.debugModule("globalThis.location =",globalThis.location);const a="emscripten-bug-17951";i[a]=function e(t,r){t.env.foo=function(){};const n=i.locateFile(e.uri,void 0===g?"":g);o.debugModule("instantiateWasm() uri =",n);const s=()=>fetch(n,{credentials:"same-origin"});return(WebAssembly.instantiateStreaming?async()=>WebAssembly.instantiateStreaming(s(),t).then((e=>r(e.instance,e.module))):async()=>s().then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,t))).then((e=>r(e.instance,e.module))))(),{}},i[a].uri="sqlite3.wasm";var l=Object.assign({},i),c="./this.program",_="object"==typeof window,u="function"==typeof importScripts,d="object"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions&&"string"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions.node,f=!_&&!d&&!u;if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var p,m,h,g="";if(f){if("function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(p=read),h=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,"binary");return O("object"==typeof t),t},m=(e,t,r)=>{setTimeout((()=>t(h(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():G()),"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!_&&!u)throw new Error("environment detection error");if(u?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),m=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var b,y,q,w=i.print||console.log.bind(console),E=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,b="fetchSettings",Object.getOwnPropertyDescriptor(i,b)&&G(`\`Module.${b}\` was supplied but \`${b}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,Z("arguments","arguments_"),i.thisProgram&&(c=i.thisProgram),Z("thisProgram","thisProgram"),i.quit&&i.quit,Z("quit","quit_"),O(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),O(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),O(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),O(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),O(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Z("asm","wasmExports"),Z("read","read_"),Z("readAsync","readAsync"),Z("readBinary","readBinary"),Z("setWindowTitle","setWindowTitle"),O(!d,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),O(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(y=i.wasmBinary),Z("wasmBinary","wasmBinary"),i.noExitRuntime,Z("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&G("no native wasm support detected");var S,A,x,T,I,k,F=!1;function O(e,t){e||G("Assertion failed"+(t?": "+t:""))}function P(){var e=q.buffer;i.HEAP8=S=new Int8Array(e),i.HEAP16=x=new Int16Array(e),i.HEAPU8=A=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=T=new Int32Array(e),i.HEAPU32=I=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=k=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}O(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),O("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var L=i.INITIAL_MEMORY||16777216;function C(){if(!F){var e=We();0==e&&(e+=4);var t=I[e>>2],r=I[e+4>>2];34821223==t&&2310721022==r||G(`Stack overflow! Stack cookie has been overwritten at ${se(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${se(r)} ${se(t)}`),1668509029!=I[0]&&G("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Z("INITIAL_MEMORY","INITIAL_MEMORY"),O(L>=524288,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+L+"! (STACK_SIZE=524288)"),q=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:L/65536,maximum:32768}),P(),O((L=q.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],D=[],R=[],M=!1;O(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var j=0,U=null,B=null,z={};function W(e){for(var t=e;;){if(!z[e])return e;e=t+Math.random()}}function H(e){j++,i.monitorRunDependencies&&i.monitorRunDependencies(j),e?(O(!z[e]),z[e]=1,null===U&&"undefined"!=typeof setInterval&&(U=setInterval((()=>{if(F)return clearInterval(U),void(U=null);var e=!1;for(var t in z)e||(e=!0,E("still waiting on run dependencies:")),E(`dependency: ${t}`);e&&E("(end of list)")}),1e4))):E("warning: run dependency added without ID")}function Q(e){if(j--,i.monitorRunDependencies&&i.monitorRunDependencies(j),e?(O(z[e]),delete z[e]):E("warning: run dependency removed without ID"),0==j&&(null!==U&&(clearInterval(U),U=null),B)){var t=B;B=null,t()}}function G(e){i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),F=!0;var t=new WebAssembly.RuntimeError(e);throw s(t),t}var V,$;function K(e){return e.startsWith("data:application/octet-stream;base64,")}function J(e){return function(){O(M,`native function \`${e}\` called before runtime initialization`);var t=Re[e];return O(t,`exported native function \`${e}\` not found`),t.apply(null,arguments)}}function Y(e){if(e==V&&y)return new Uint8Array(y);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}function X(e,t,r){return function(e){return y||!_&&!u||"function"!=typeof fetch?Promise.resolve().then((()=>Y(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>Y(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{E(`failed to asynchronously prepare wasm: ${e}`),V.startsWith("file://")&&E(`warning: Loading from a file URI (${V}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),G(e)}))}function Z(e,t,r=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){G(`\`Module.${e}\` has been replaced by \`${t}\``+(r?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function ee(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function te(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){ie("`"+e+"` is not longer defined by emscripten. "+t)}})}function re(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),G(t)}})}i.locateFile?K(V="sqlite3.wasm")||($=V,V=i.locateFile?i.locateFile($,g):g+$):V=new URL(r(8168),r.b).href,te("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),te("asm","Please use wasmExports instead");var ne=e=>{for(;e.length>0;)e.shift()(i)},se=e=>(O("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ie=e=>{ie.shown||(ie.shown={}),ie.shown[e]||(ie.shown[e]=1,E(e))},oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var s=e[n];"."===s?e.splice(n,1):".."===s?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),r="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);G("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),le={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ee.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=oe.isAbs(n)}return(t?"/":"")+(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=le.resolve(e).substr(1),t=le.resolve(t).substr(1);for(var n=r(e.split("/")),s=r(t.split("/")),i=Math.min(n.length,s.length),o=i,a=0;a{for(var n=t+r,s=t;e[s]&&!(s>=n);)++s;if(s-t>16&&e.buffer&&ce)return ce.decode(e.subarray(t,s));for(var i="";t>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i},ue=[],de=e=>{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},fe=(e,t,r,n)=>{if(O("string"==typeof e),!(n>0))return 0;for(var s=r,i=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;a>1114111&&ie("Invalid Unicode code point "+se(a)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-s};function pe(e,t,r){var n=r>0?r:de(e)+1,s=new Array(n),i=fe(e,s,0,s.length);return t&&(s.length=i),s}var me,he={ttys:[],init(){},shutdown(){},register(e,t){he.ttys[e]={input:[],output:[],ops:t},Ee.registerDevice(e,he.stream_ops)},stream_ops:{open(e){var t=he.ttys[e.node.rdev];if(!t)throw new Ee.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,s){if(!e.tty||!e.tty.ops.get_char)throw new Ee.ErrnoError(60);for(var i=0,o=0;o(()=>{if(!ue.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ue=pe(e,!0)}return ue.shift()})(),put_char(e,t){null===t||10===t?(w(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(_e(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(E(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(E(_e(e.output,0)),e.output=[])}}},ge=e=>{e=((e,t)=>(O(t,"alignment argument is required"),Math.ceil(e/t)*t))(e,65536);var t=Be(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},be={ops_table:null,mount:e=>be.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ee.isBlkdev(r)||Ee.isFIFO(r))throw new Ee.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:Ee.chrdev_stream_ops}});var s=Ee.createNode(e,t,r,n);return Ee.isDir(s.mode)?(s.node_ops=be.ops_table.dir.node,s.stream_ops=be.ops_table.dir.stream,s.contents={}):Ee.isFile(s.mode)?(s.node_ops=be.ops_table.file.node,s.stream_ops=be.ops_table.file.stream,s.usedBytes=0,s.contents=null):Ee.isLink(s.mode)?(s.node_ops=be.ops_table.link.node,s.stream_ops=be.ops_table.link.stream):Ee.isChrdev(s.mode)&&(s.node_ops=be.ops_table.chrdev.node,s.stream_ops=be.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ee.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ee.isDir(e.mode)?t.size=4096:Ee.isFile(e.mode)?t.size=e.usedBytes:Ee.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup(e,t){throw Ee.genericErrors[44]},mknod:(e,t,r,n)=>be.createNode(e,t,r,n),rename(e,t,r){if(Ee.isDir(e.mode)){var n;try{n=Ee.lookupNode(t,r)}catch(e){}if(n)for(var s in n.contents)throw new Ee.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ee.lookupNode(e,t);for(var n in r.contents)throw new Ee.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=be.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ee.isLink(e.mode))throw new Ee.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,s){var i=e.node.contents;if(s>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-s,n);if(O(o>=0),o>8&&i.subarray)t.set(i.subarray(s,s+o),r);else for(var a=0;a0||r+t(be.stream_ops.write(e,t,0,n,r,!1),0)}},ye=i.preloadPlugins||[],qe=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},ve={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},we={},Ee={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=le.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ee.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ee.root,s="/",i=0;i40)throw new Ee.ErrnoError(32)}}return{path:s,node:n}},getPath(e){for(var t;;){if(Ee.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n>>0)%Ee.nameTable.length},hashAddNode(e){var t=Ee.hashName(e.parent.id,e.name);e.name_next=Ee.nameTable[t],Ee.nameTable[t]=e},hashRemoveNode(e){var t=Ee.hashName(e.parent.id,e.name);if(Ee.nameTable[t]===e)Ee.nameTable[t]=e.name_next;else for(var r=Ee.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ee.mayLookup(e);if(r)throw new Ee.ErrnoError(r,e);for(var n=Ee.hashName(e.id,t),s=Ee.nameTable[n];s;s=s.name_next){var i=s.name;if(s.parent.id===e.id&&i===t)return s}return Ee.lookup(e,t)},createNode(e,t,r,n){O("object"==typeof e);var s=new Ee.FSNode(e,t,r,n);return Ee.hashAddNode(s),s},destroyNode(e){Ee.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ee.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ee.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,t){try{return Ee.lookupNode(e,t),20}catch(e){}return Ee.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ee.lookupNode(e,t)}catch(e){return e.errno}var s=Ee.nodePermissions(e,"wx");if(s)return s;if(r){if(!Ee.isDir(n.mode))return 54;if(Ee.isRoot(n)||Ee.getPath(n)===Ee.cwd())return 10}else if(Ee.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ee.isLink(e.mode)?32:Ee.isDir(e.mode)&&("r"!==Ee.flagsToPermissionString(t)||512&t)?31:Ee.nodePermissions(e,Ee.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ee.MAX_OPEN_FDS;e++)if(!Ee.streams[e])return e;throw new Ee.ErrnoError(33)},getStreamChecked(e){var t=Ee.getStream(e);if(!t)throw new Ee.ErrnoError(8);return t},getStream:e=>Ee.streams[e],createStream:(e,t=-1)=>(Ee.FSStream||(Ee.FSStream=function(){this.shared={}},Ee.FSStream.prototype={},Object.defineProperties(Ee.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ee.FSStream,e),-1==t&&(t=Ee.nextfd()),e.fd=t,Ee.streams[t]=e,e),closeStream(e){Ee.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ee.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Ee.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ee.devices[e]={stream_ops:t}},getDevice:e=>Ee.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ee.syncFSRequests++,Ee.syncFSRequests>1&&E(`warning: ${Ee.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ee.getMounts(Ee.root.mount),n=0;function s(e){return O(Ee.syncFSRequests>0),Ee.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,s(e));++n>=r.length&&s(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,r){if("string"==typeof e)throw e;var n,s="/"===r,i=!r;if(s&&Ee.root)throw new Ee.ErrnoError(10);if(!s&&!i){var o=Ee.lookupPath(r,{follow_mount:!1});if(r=o.path,n=o.node,Ee.isMountpoint(n))throw new Ee.ErrnoError(10);if(!Ee.isDir(n.mode))throw new Ee.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(a);return l.mount=a,a.root=l,s?Ee.root=l:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),l},unmount(e){var t=Ee.lookupPath(e,{follow_mount:!1});if(!Ee.isMountpoint(t.node))throw new Ee.ErrnoError(28);var r=t.node,n=r.mounted,s=Ee.getMounts(n);Object.keys(Ee.nameTable).forEach((e=>{for(var t=Ee.nameTable[e];t;){var r=t.name_next;s.includes(t.mount)&&Ee.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);O(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Ee.lookupPath(e,{parent:!0}).node,s=oe.basename(e);if(!s||"."===s||".."===s)throw new Ee.ErrnoError(28);var i=Ee.mayCreate(n,s);if(i)throw new Ee.ErrnoError(i);if(!n.node_ops.mknod)throw new Ee.ErrnoError(63);return n.node_ops.mknod(n,s,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ee.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ee.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",s=0;s(void 0===r&&(r=t,t=438),t|=8192,Ee.mknod(e,t,r)),symlink(e,t){if(!le.resolve(e))throw new Ee.ErrnoError(44);var r=Ee.lookupPath(t,{parent:!0}).node;if(!r)throw new Ee.ErrnoError(44);var n=oe.basename(t),s=Ee.mayCreate(r,n);if(s)throw new Ee.ErrnoError(s);if(!r.node_ops.symlink)throw new Ee.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,s=oe.dirname(e),i=oe.dirname(t),o=oe.basename(e),a=oe.basename(t);if(r=Ee.lookupPath(e,{parent:!0}).node,n=Ee.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ee.ErrnoError(44);if(r.mount!==n.mount)throw new Ee.ErrnoError(75);var l,c=Ee.lookupNode(r,o),_=le.relative(e,i);if("."!==_.charAt(0))throw new Ee.ErrnoError(28);if("."!==(_=le.relative(t,s)).charAt(0))throw new Ee.ErrnoError(55);try{l=Ee.lookupNode(n,a)}catch(e){}if(c!==l){var u=Ee.isDir(c.mode),d=Ee.mayDelete(r,o,u);if(d)throw new Ee.ErrnoError(d);if(d=l?Ee.mayDelete(n,a,u):Ee.mayCreate(n,a))throw new Ee.ErrnoError(d);if(!r.node_ops.rename)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(c)||l&&Ee.isMountpoint(l))throw new Ee.ErrnoError(10);if(n!==r&&(d=Ee.nodePermissions(r,"w")))throw new Ee.ErrnoError(d);Ee.hashRemoveNode(c);try{r.node_ops.rename(c,n,a)}catch(e){throw e}finally{Ee.hashAddNode(c)}}},rmdir(e){var t=Ee.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=Ee.lookupNode(t,r),s=Ee.mayDelete(t,r,!0);if(s)throw new Ee.ErrnoError(s);if(!t.node_ops.rmdir)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.rmdir(t,r),Ee.destroyNode(n)},readdir(e){var t=Ee.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ee.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ee.lookupPath(e,{parent:!0}).node;if(!t)throw new Ee.ErrnoError(44);var r=oe.basename(e),n=Ee.lookupNode(t,r),s=Ee.mayDelete(t,r,!1);if(s)throw new Ee.ErrnoError(s);if(!t.node_ops.unlink)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.unlink(t,r),Ee.destroyNode(n)},readlink(e){var t=Ee.lookupPath(e).node;if(!t)throw new Ee.ErrnoError(44);if(!t.node_ops.readlink)throw new Ee.ErrnoError(28);return le.resolve(Ee.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ee.lookupPath(e,{follow:!t}).node;if(!r)throw new Ee.ErrnoError(44);if(!r.node_ops.getattr)throw new Ee.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ee.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ee.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ee.chmod(e,t,!0)},fchmod(e,t){var r=Ee.getStreamChecked(e);Ee.chmod(r.node,t)},chown(e,t,r,n){var s;if(!(s="string"==typeof e?Ee.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,r){Ee.chown(e,t,r,!0)},fchown(e,t,r){var n=Ee.getStreamChecked(e);Ee.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ee.ErrnoError(28);var r;if(!(r="string"==typeof e?Ee.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);if(Ee.isDir(r.mode))throw new Ee.ErrnoError(31);if(!Ee.isFile(r.mode))throw new Ee.ErrnoError(28);var n=Ee.nodePermissions(r,"w");if(n)throw new Ee.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ee.getStreamChecked(e);if(!(2097155&r.flags))throw new Ee.ErrnoError(28);Ee.truncate(r.node,t)},utime(e,t,r){var n=Ee.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ee.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=oe.normalize(e);try{n=Ee.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(n){if(128&t)throw new Ee.ErrnoError(20)}else n=Ee.mknod(e,r,0),s=!0;if(!n)throw new Ee.ErrnoError(44);if(Ee.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ee.isDir(n.mode))throw new Ee.ErrnoError(54);if(!s){var o=Ee.mayOpen(n,t);if(o)throw new Ee.ErrnoError(o)}512&t&&!s&&Ee.truncate(n,0),t&=-131713;var a=Ee.createStream({node:n,path:Ee.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(Ee.readFiles||(Ee.readFiles={}),e in Ee.readFiles||(Ee.readFiles[e]=1)),a},close(e){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ee.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ee.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ee.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,s){if(O(r>=0),n<0||s<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(1==(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.read)throw new Ee.ErrnoError(28);var i=void 0!==s;if(i){if(!e.seekable)throw new Ee.ErrnoError(70)}else s=e.position;var o=e.stream_ops.read(e,t,r,n,s);return i||(e.position+=o),o},write(e,t,r,n,s,i){if(O(r>=0),n<0||s<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.write)throw new Ee.ErrnoError(28);e.seekable&&1024&e.flags&&Ee.llseek(e,0,2);var o=void 0!==s;if(o){if(!e.seekable)throw new Ee.ErrnoError(70)}else s=e.position;var a=e.stream_ops.write(e,t,r,n,s,i);return o||(e.position+=a),a},allocate(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(t<0||r<=0)throw new Ee.ErrnoError(28);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(!Ee.isFile(e.node.mode)&&!Ee.isDir(e.node.mode))throw new Ee.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ee.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,s){if(2&n&&!(2&s)&&2!=(2097155&e.flags))throw new Ee.ErrnoError(2);if(1==(2097155&e.flags))throw new Ee.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ee.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,s)},msync:(e,t,r,n,s)=>(O(r>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,s):0),munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ee.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ee.open(e,t.flags),s=Ee.stat(e).size,i=new Uint8Array(s);return Ee.read(n,i,0,s,0),"utf8"===t.encoding?r=_e(i,0):"binary"===t.encoding&&(r=i),Ee.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ee.open(e,r.flags,r.mode);if("string"==typeof t){var s=new Uint8Array(de(t)+1),i=fe(t,s,0,s.length);Ee.write(n,s,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ee.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ee.close(n)},cwd:()=>Ee.currentPath,chdir(e){var t=Ee.lookupPath(e,{follow:!0});if(null===t.node)throw new Ee.ErrnoError(44);if(!Ee.isDir(t.node.mode))throw new Ee.ErrnoError(54);var r=Ee.nodePermissions(t.node,"x");if(r)throw new Ee.ErrnoError(r);Ee.currentPath=t.path},createDefaultDirectories(){Ee.mkdir("/tmp"),Ee.mkdir("/home"),Ee.mkdir("/home/web_user")},createDefaultDevices(){Ee.mkdir("/dev"),Ee.registerDevice(Ee.makedev(1,3),{read:()=>0,write:(e,t,r,n,s)=>n}),Ee.mkdev("/dev/null",Ee.makedev(1,3)),he.register(Ee.makedev(5,0),he.default_tty_ops),he.register(Ee.makedev(6,0),he.default_tty1_ops),Ee.mkdev("/dev/tty",Ee.makedev(5,0)),Ee.mkdev("/dev/tty1",Ee.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ae(e).byteLength),e[--t]);Ee.createDevice("/dev","random",r),Ee.createDevice("/dev","urandom",r),Ee.mkdir("/dev/shm"),Ee.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ee.mkdir("/proc");var e=Ee.mkdir("/proc/self");Ee.mkdir("/proc/self/fd"),Ee.mount({mount(){var t=Ee.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ee.getStreamChecked(r),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return s.parent=s,s}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?Ee.createDevice("/dev","stdin",i.stdin):Ee.symlink("/dev/tty","/dev/stdin"),i.stdout?Ee.createDevice("/dev","stdout",null,i.stdout):Ee.symlink("/dev/tty","/dev/stdout"),i.stderr?Ee.createDevice("/dev","stderr",null,i.stderr):Ee.symlink("/dev/tty1","/dev/stderr");var e=Ee.open("/dev/stdin",0),t=Ee.open("/dev/stdout",1),r=Ee.open("/dev/stderr",1);O(0===e.fd,`invalid handle for stdin (${e.fd})`),O(1===t.fd,`invalid handle for stdout (${t.fd})`),O(2===r.fd,`invalid handle for stderr (${r.fd})`)},ensureErrnoError(){Ee.ErrnoError||(Ee.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){for(var t in this.errno=e,we)if(we[t]===e){this.code=t;break}},this.setErrno(e),this.message=ve[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var t,r=(t=e,ie("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),t);return e===r?e:r+" ["+e+"]"})))},Ee.ErrnoError.prototype=new Error,Ee.ErrnoError.prototype.constructor=Ee.ErrnoError,[44].forEach((e=>{Ee.genericErrors[e]=new Ee.ErrnoError(e),Ee.genericErrors[e].stack=""})))},staticInit(){Ee.ensureErrnoError(),Ee.nameTable=new Array(4096),Ee.mount(be,{},"/"),Ee.createDefaultDirectories(),Ee.createDefaultDevices(),Ee.createSpecialDirectories(),Ee.filesystems={MEMFS:be}},init(e,t,r){O(!Ee.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Ee.init.initialized=!0,Ee.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,Ee.createStandardStreams()},quit(){Ee.init.initialized=!1,Ue(0);for(var e=0;ethis.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),s=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;s||(o=n);var a=this;a.setDataGetter((e=>{var t=e*o,s=(e+1)*o-1;if(s=Math.min(s,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var s=new XMLHttpRequest;if(s.open("GET",r,!1),n!==o&&s.setRequestHeader("Range","bytes="+e+"-"+t),s.responseType="arraybuffer",s.overrideMimeType&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.send(null),!(s.status>=200&&s.status<300||304===s.status))throw new Error("Couldn't load "+r+". Status: "+s.status);return void 0!==s.response?new Uint8Array(s.response||[]):pe(s.responseText||"",!0)})(t,s)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&n||(o=n=1,n=this.getter(0).length,o=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var o=new i;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:o}}else a={isDevice:!1,url:r};var l=Ee.createFile(e,t,a,n,s);a.contents?l.contents=a.contents:a.url&&(l.contents=null,l.url=a.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function _(e,t,r,n,s){var i=e.node.contents;if(s>=i.length)return 0;var o=Math.min(i.length-s,n);if(O(o>=0),i.slice)for(var a=0;a{var t=l.stream_ops[e];c[e]=function(){return Ee.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,r,n,s)=>(Ee.forceLoadFile(l),_(e,t,r,n,s)),c.mmap=(e,t,r,n,s)=>{Ee.forceLoadFile(l);var i=ge(t);if(!i)throw new Ee.ErrnoError(48);return _(e,S,i,t,r),{ptr:i,allocated:!0}},l.stream_ops=c,l},absolutePath(){G("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){G("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){G("FS.createLink has been removed; use FS.symlink instead")},joinPath(){G("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){G("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){G("FS.standardizePath has been removed; use PATH.normalize instead")}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(oe.isAbs(t))return t;var n;if(n=-100===e?Ee.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ee.ErrnoError(44);return n}return oe.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(Ee.getPath(e.node)))return-54;throw e}T[r>>2]=n.dev,T[r+4>>2]=n.mode,I[r+8>>2]=n.nlink,T[r+12>>2]=n.uid,T[r+16>>2]=n.gid,T[r+20>>2]=n.rdev,k[r+24>>3]=BigInt(n.size),T[r+32>>2]=4096,T[r+36>>2]=n.blocks;var s=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return k[r+40>>3]=BigInt(Math.floor(s/1e3)),I[r+48>>2]=s%1e3*1e3,k[r+56>>3]=BigInt(Math.floor(i/1e3)),I[r+64>>2]=i%1e3*1e3,k[r+72>>3]=BigInt(Math.floor(o/1e3)),I[r+80>>2]=o%1e3*1e3,k[r+88>>3]=BigInt(n.ino),0},doMsync(e,t,r,n,s){if(!Ee.isFile(t.node.mode))throw new Ee.ErrnoError(43);if(2&n)return 0;var i=A.slice(e,e+r);Ee.msync(t,i,s,r,n)},varargs:void 0,get(){O(null!=Se.varargs);var e=T[+Se.varargs>>2];return Se.varargs+=4,e},getp:()=>Se.get(),getStr(e){var t=(e=>(O("number"==typeof e),e?_e(A,e,void 0):""))(e);return t},getStreamFromFD:e=>Ee.getStreamChecked(e)},Ae=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),xe=(e,t,r)=>(O("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),fe(e,A,t,r)),Te=e=>I[e>>2]+4294967296*T[e+4>>2],Ie=[0,31,60,91,121,152,182,213,244,274,305,335],ke=[0,31,59,90,120,151,181,212,243,273,304,334],Fe=e=>{var t=de(e)+1,r=je(t);return r&&xe(e,r,t),r};me=()=>performance.now();var Oe=e=>{var t=q.buffer,r=(e-t.byteLength+65535)/65536;try{return q.grow(r),P(),1}catch(r){E(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${r}`)}},Pe={},Le=()=>{if(!Le.strings){var 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",_:c||"./this.program"};for(var t in Pe)void 0===Pe[t]?delete e[t]:e[t]=Pe[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Le.strings=r}return Le.strings},Ce=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ee.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Ce.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Ee.isDir(this.mode)}},isDevice:{get:function(){return Ee.isChrdev(this.mode)}}}),Ee.FSNode=Ce,Ee.createPreloadedFile=(e,t,r,n,s,i,o,a,l,c)=>{var _=t?le.resolve(oe.join2(e,t)):e,u=W(`cp ${_}`);function d(r){function d(r){c&&c(),a||((e,t,r,n,s,i)=>{Ee.createDataFile(e,t,r,n,s,i)})(e,t,r,n,s,l),i&&i(),Q(u)}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var s=!1;return ye.forEach((i=>{s||i.canHandle(t)&&(i.handle(e,t,r,n),s=!0)})),s})(r,_,d,(()=>{o&&o(),Q(u)}))||d(r)}H(u),"string"==typeof r?((e,t,r)=>{var n=W(`al ${e}`);m(e,(t=>{O(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),n&&Q(n)}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&H(n)})(r,0,o):d(r)},Ee.staticInit(),we={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var Ne,De={__syscall_chmod:function(e,t){try{return e=Se.getStr(e),Ee.chmod(e,t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_faccessat:function(e,t,r,n){try{if(t=Se.getStr(t),O(0===n),t=Se.calculateAt(e,t),-8&r)return-28;var s=Ee.lookupPath(t,{follow:!0}).node;if(!s)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&Ee.nodePermissions(s,i)?-2:0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchmod:function(e,t){try{return Ee.fchmod(e,t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchown32:function(e,t,r){try{return Ee.fchown(e,t,r),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fcntl64:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 0:if((s=Se.get())<0)return-28;for(;Ee.streams[s];)s++;return Ee.createStream(n,s).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var s=Se.get();return n.flags|=s,0;case 5:return s=Se.getp(),x[s+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Me()>>2]=28,-1}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var r=Se.getStreamFromFD(e);return Se.doStat(Ee.stat,r.path,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t){t=Ae(t);try{return isNaN(t)?61:(Ee.ftruncate(e,t),0)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_getcwd:function(e,t){try{if(0===t)return-28;var r=Ee.cwd(),n=de(r)+1;return t>2]=s.c_iflag||0,T[i+4>>2]=s.c_oflag||0,T[i+8>>2]=s.c_cflag||0,T[i+12>>2]=s.c_lflag||0;for(var o=0;o<32;o++)S[i+o+17|0]=s.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Se.getp();var a=T[i>>2],l=T[i+4>>2],c=T[i+8>>2],_=T[i+12>>2],u=[];for(o=0;o<32;o++)u.push(S[i+o+17|0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:a,c_oflag:l,c_cflag:c,c_lflag:_,c_cc:u})}return 0;case 21519:return n.tty?(i=Se.getp(),T[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Se.getp(),Ee.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var d=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Se.getp(),x[i>>1]=d[0],x[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(Ee.lstat,e,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_mkdirat:function(e,t,r){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),"/"===(t=oe.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Ee.mkdir(t,r,0),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,r,n){try{t=Se.getStr(t);var s=256&n,i=4096&n;return O(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),t=Se.calculateAt(e,t,i),Se.doStat(s?Ee.lstat:Ee.stat,t,r)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,r,n){Se.varargs=n;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var s=n?Se.get():0;return Ee.open(t,r,s).fd}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_readlinkat:function(e,t,r,n){try{if(t=Se.getStr(t),t=Se.calculateAt(e,t),n<=0)return-28;var s=Ee.readlink(t),i=Math.min(n,de(s)),o=S[r+i];return xe(s,r,n+1),S[r+i]=o,i}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Se.getStr(e),Ee.rmdir(e),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(Ee.stat,e,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,r){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),0===r?Ee.unlink(t):512===r?Ee.rmdir(t):G("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_utimensat:function(e,t,r,n){try{if(t=Se.getStr(t),O(0===n),t=Se.calculateAt(e,t,!0),r){var s=Te(r),i=T[r+8>>2];o=1e3*s+i/1e6,a=1e3*(s=Te(r+=16))+(i=T[r+8>>2])/1e6}else var o=Date.now(),a=o;return Ee.utime(t,o,a),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_emscripten_get_now_is_monotonic:()=>!0,_localtime_js:function(e,t){e=Ae(e);var r=new Date(1e3*e);T[t>>2]=r.getSeconds(),T[t+4>>2]=r.getMinutes(),T[t+8>>2]=r.getHours(),T[t+12>>2]=r.getDate(),T[t+16>>2]=r.getMonth(),T[t+20>>2]=r.getFullYear()-1900,T[t+24>>2]=r.getDay();var n=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?ke:Ie)[e.getMonth()]+e.getDate()-1})(r);T[t+28>>2]=n,T[t+36>>2]=-60*r.getTimezoneOffset();var s=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),o=s.getTimezoneOffset(),a=0|(i!=o&&r.getTimezoneOffset()==Math.min(o,i));T[t+32>>2]=a},_mmap_js:function(e,t,r,n,s,i,o){s=Ae(s);try{if(isNaN(s))return 61;var a=Se.getStreamFromFD(n),l=Ee.mmap(a,e,s,t,r),c=l.ptr;return T[i>>2]=l.allocated,I[o>>2]=c,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_munmap_js:function(e,t,r,n,s,i){i=Ae(i);try{if(isNaN(i))return 61;var o=Se.getStreamFromFD(s);2&r&&Se.doMsync(e,o,t,n,i),Ee.munmap(o)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_tzset_js:(e,t,r)=>{var n=(new Date).getFullYear(),s=new Date(n,0,1),i=new Date(n,6,1),o=s.getTimezoneOffset(),a=i.getTimezoneOffset(),l=Math.max(o,a);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[e>>2]=60*l,T[t>>2]=Number(o!=a);var _=c(s),u=c(i),d=Fe(_),f=Fe(u);a>2]=d,I[r+4>>2]=f):(I[r>>2]=f,I[r+4>>2]=d)},emscripten_date_now:()=>Date.now(),emscripten_get_now:me,emscripten_memcpy_js:(e,t,r)=>A.copyWithin(e,t,t+r),emscripten_resize_heap:e=>{var t=A.length;O((e>>>=0)>t);var r=2147483648;if(e>r)return E(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var n,s=1;s<=4;s*=2){var i=t*(1+.2/s);i=Math.min(i,e+100663296);var o=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(Oe(o))return!0}return E(`Failed to grow the heap from ${t} bytes to ${o} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var r=0;return Le().forEach(((n,s)=>{var i=t+r;I[e+4*s>>2]=i,((e,t)=>{for(var r=0;r{var r=Le();I[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),I[t>>2]=n,0},fd_close:function(e){try{var t=Se.getStreamFromFD(e);return Ee.close(t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,t){try{var r=Se.getStreamFromFD(e),n=r.tty?2:Ee.isDir(r.mode)?3:Ee.isLink(r.mode)?7:4;return S[0|t]=n,x[t+2>>1]=0,k[t+8>>3]=BigInt(0),k[t+16>>3]=BigInt(0),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,t,r,n){try{var s=((e,t,r,n)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=Ee.read(e,S,o,a,n);if(l<0)return-1;if(s+=l,l>2]=s,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,r,n){t=Ae(t);try{if(isNaN(t))return 61;var s=Se.getStreamFromFD(e);return Ee.llseek(s,t,r),k[n>>3]=BigInt(s.position),s.getdents&&0===t&&0===r&&(s.getdents=null),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Se.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,t,r,n){try{var s=((e,t,r,n)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=Ee.write(e,S,o,a,n);if(l<0)return-1;s+=l,void 0!==n&&(n+=l)}return s})(Se.getStreamFromFD(e),t,r);return I[n>>2]=s,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},memory:q},Re=function(){var e={env:De,wasi_snapshot_preview1:De};function t(e,t){var r;return r=(Re=e.exports).__wasm_call_ctors,D.unshift(r),Q("wasm-instantiate"),Re}H("wasm-instantiate");var r,n,o,a,l=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){E(`Module.instantiateWasm callback failed with error: ${e}`),s(e)}return(r=y,n=V,o=e,a=function(e){O(i===l,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),l=null,t(e.instance)},r||"function"!=typeof WebAssembly.instantiateStreaming||K(n)||"function"!=typeof fetch?X(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return E(`wasm streaming compile failed: ${e}`),E("falling back to ArrayBuffer instantiation"),X(n,o,a)}))))).catch(s),{}}(),Me=(J("__wasm_call_ctors"),i._sqlite3_status64=J("sqlite3_status64"),i._sqlite3_status=J("sqlite3_status"),i._sqlite3_db_status=J("sqlite3_db_status"),i._sqlite3_msize=J("sqlite3_msize"),i._sqlite3_vfs_find=J("sqlite3_vfs_find"),i._sqlite3_initialize=J("sqlite3_initialize"),i._sqlite3_vfs_register=J("sqlite3_vfs_register"),i._sqlite3_vfs_unregister=J("sqlite3_vfs_unregister"),i._sqlite3_malloc=J("sqlite3_malloc"),i._sqlite3_malloc64=J("sqlite3_malloc64"),i._sqlite3_free=J("sqlite3_free"),i._sqlite3_realloc=J("sqlite3_realloc"),i._sqlite3_realloc64=J("sqlite3_realloc64"),i._sqlite3_value_int64=J("sqlite3_value_int64"),i._sqlite3_value_double=J("sqlite3_value_double"),i._sqlite3_value_text=J("sqlite3_value_text"),i._sqlite3_randomness=J("sqlite3_randomness"),i._sqlite3_stricmp=J("sqlite3_stricmp"),i._sqlite3_strnicmp=J("sqlite3_strnicmp"),J("__errno_location")),je=(i._sqlite3_serialize=J("sqlite3_serialize"),i._sqlite3_prepare_v2=J("sqlite3_prepare_v2"),i._sqlite3_step=J("sqlite3_step"),i._sqlite3_column_int64=J("sqlite3_column_int64"),i._sqlite3_column_int=J("sqlite3_column_int"),i._sqlite3_finalize=J("sqlite3_finalize"),i._sqlite3_file_control=J("sqlite3_file_control"),i._sqlite3_reset=J("sqlite3_reset"),i._sqlite3_value_int=J("sqlite3_value_int"),i._sqlite3_deserialize=J("sqlite3_deserialize"),i._sqlite3_clear_bindings=J("sqlite3_clear_bindings"),i._sqlite3_value_blob=J("sqlite3_value_blob"),i._sqlite3_value_bytes=J("sqlite3_value_bytes"),i._sqlite3_value_subtype=J("sqlite3_value_subtype"),i._sqlite3_value_pointer=J("sqlite3_value_pointer"),i._sqlite3_value_type=J("sqlite3_value_type"),i._sqlite3_value_nochange=J("sqlite3_value_nochange"),i._sqlite3_value_frombind=J("sqlite3_value_frombind"),i._sqlite3_value_dup=J("sqlite3_value_dup"),i._sqlite3_value_free=J("sqlite3_value_free"),i._sqlite3_result_blob=J("sqlite3_result_blob"),i._sqlite3_result_error_toobig=J("sqlite3_result_error_toobig"),i._sqlite3_result_error_nomem=J("sqlite3_result_error_nomem"),i._sqlite3_result_double=J("sqlite3_result_double"),i._sqlite3_result_error=J("sqlite3_result_error"),i._sqlite3_result_int=J("sqlite3_result_int"),i._sqlite3_result_int64=J("sqlite3_result_int64"),i._sqlite3_result_null=J("sqlite3_result_null"),i._sqlite3_result_pointer=J("sqlite3_result_pointer"),i._sqlite3_result_subtype=J("sqlite3_result_subtype"),i._sqlite3_result_text=J("sqlite3_result_text"),i._sqlite3_result_zeroblob=J("sqlite3_result_zeroblob"),i._sqlite3_result_zeroblob64=J("sqlite3_result_zeroblob64"),i._sqlite3_result_error_code=J("sqlite3_result_error_code"),i._sqlite3_sql=J("sqlite3_sql"),i._sqlite3_user_data=J("sqlite3_user_data"),i._sqlite3_context_db_handle=J("sqlite3_context_db_handle"),i._sqlite3_vtab_nochange=J("sqlite3_vtab_nochange"),i._sqlite3_vtab_in_first=J("sqlite3_vtab_in_first"),i._sqlite3_vtab_in_next=J("sqlite3_vtab_in_next"),i._sqlite3_aggregate_context=J("sqlite3_aggregate_context"),i._sqlite3_get_auxdata=J("sqlite3_get_auxdata"),i._sqlite3_set_auxdata=J("sqlite3_set_auxdata"),i._sqlite3_column_count=J("sqlite3_column_count"),i._sqlite3_data_count=J("sqlite3_data_count"),i._sqlite3_column_blob=J("sqlite3_column_blob"),i._sqlite3_column_bytes=J("sqlite3_column_bytes"),i._sqlite3_column_double=J("sqlite3_column_double"),i._sqlite3_column_text=J("sqlite3_column_text"),i._sqlite3_column_value=J("sqlite3_column_value"),i._sqlite3_column_type=J("sqlite3_column_type"),i._sqlite3_column_name=J("sqlite3_column_name"),i._sqlite3_bind_blob=J("sqlite3_bind_blob"),i._sqlite3_bind_double=J("sqlite3_bind_double"),i._sqlite3_bind_int=J("sqlite3_bind_int"),i._sqlite3_bind_int64=J("sqlite3_bind_int64"),i._sqlite3_bind_null=J("sqlite3_bind_null"),i._sqlite3_bind_pointer=J("sqlite3_bind_pointer"),i._sqlite3_bind_text=J("sqlite3_bind_text"),i._sqlite3_bind_parameter_count=J("sqlite3_bind_parameter_count"),i._sqlite3_bind_parameter_index=J("sqlite3_bind_parameter_index"),i._sqlite3_db_handle=J("sqlite3_db_handle"),i._sqlite3_stmt_readonly=J("sqlite3_stmt_readonly"),i._sqlite3_stmt_isexplain=J("sqlite3_stmt_isexplain"),i._sqlite3_stmt_status=J("sqlite3_stmt_status"),i._sqlite3_expanded_sql=J("sqlite3_expanded_sql"),i._sqlite3_preupdate_old=J("sqlite3_preupdate_old"),i._sqlite3_preupdate_count=J("sqlite3_preupdate_count"),i._sqlite3_preupdate_depth=J("sqlite3_preupdate_depth"),i._sqlite3_preupdate_blobwrite=J("sqlite3_preupdate_blobwrite"),i._sqlite3_preupdate_new=J("sqlite3_preupdate_new"),i._sqlite3_value_numeric_type=J("sqlite3_value_numeric_type"),i._sqlite3_errmsg=J("sqlite3_errmsg"),i._sqlite3_set_authorizer=J("sqlite3_set_authorizer"),i._sqlite3_strglob=J("sqlite3_strglob"),i._sqlite3_strlike=J("sqlite3_strlike"),i._sqlite3_exec=J("sqlite3_exec"),i._sqlite3_auto_extension=J("sqlite3_auto_extension"),i._sqlite3_cancel_auto_extension=J("sqlite3_cancel_auto_extension"),i._sqlite3_reset_auto_extension=J("sqlite3_reset_auto_extension"),i._sqlite3_prepare_v3=J("sqlite3_prepare_v3"),i._sqlite3_create_module=J("sqlite3_create_module"),i._sqlite3_create_module_v2=J("sqlite3_create_module_v2"),i._sqlite3_drop_modules=J("sqlite3_drop_modules"),i._sqlite3_declare_vtab=J("sqlite3_declare_vtab"),i._sqlite3_vtab_on_conflict=J("sqlite3_vtab_on_conflict"),i._sqlite3_vtab_collation=J("sqlite3_vtab_collation"),i._sqlite3_vtab_in=J("sqlite3_vtab_in"),i._sqlite3_vtab_rhs_value=J("sqlite3_vtab_rhs_value"),i._sqlite3_vtab_distinct=J("sqlite3_vtab_distinct"),i._sqlite3_keyword_name=J("sqlite3_keyword_name"),i._sqlite3_keyword_count=J("sqlite3_keyword_count"),i._sqlite3_keyword_check=J("sqlite3_keyword_check"),i._sqlite3_complete=J("sqlite3_complete"),i._sqlite3_libversion=J("sqlite3_libversion"),i._sqlite3_libversion_number=J("sqlite3_libversion_number"),i._sqlite3_shutdown=J("sqlite3_shutdown"),i._sqlite3_last_insert_rowid=J("sqlite3_last_insert_rowid"),i._sqlite3_set_last_insert_rowid=J("sqlite3_set_last_insert_rowid"),i._sqlite3_changes64=J("sqlite3_changes64"),i._sqlite3_changes=J("sqlite3_changes"),i._sqlite3_total_changes64=J("sqlite3_total_changes64"),i._sqlite3_total_changes=J("sqlite3_total_changes"),i._sqlite3_txn_state=J("sqlite3_txn_state"),i._sqlite3_close_v2=J("sqlite3_close_v2"),i._sqlite3_busy_handler=J("sqlite3_busy_handler"),i._sqlite3_progress_handler=J("sqlite3_progress_handler"),i._sqlite3_busy_timeout=J("sqlite3_busy_timeout"),i._sqlite3_create_function=J("sqlite3_create_function"),i._sqlite3_create_function_v2=J("sqlite3_create_function_v2"),i._sqlite3_create_window_function=J("sqlite3_create_window_function"),i._sqlite3_overload_function=J("sqlite3_overload_function"),i._sqlite3_trace_v2=J("sqlite3_trace_v2"),i._sqlite3_commit_hook=J("sqlite3_commit_hook"),i._sqlite3_update_hook=J("sqlite3_update_hook"),i._sqlite3_rollback_hook=J("sqlite3_rollback_hook"),i._sqlite3_preupdate_hook=J("sqlite3_preupdate_hook"),i._sqlite3_error_offset=J("sqlite3_error_offset"),i._sqlite3_errcode=J("sqlite3_errcode"),i._sqlite3_extended_errcode=J("sqlite3_extended_errcode"),i._sqlite3_errstr=J("sqlite3_errstr"),i._sqlite3_limit=J("sqlite3_limit"),i._sqlite3_open=J("sqlite3_open"),i._sqlite3_open_v2=J("sqlite3_open_v2"),i._sqlite3_create_collation=J("sqlite3_create_collation"),i._sqlite3_create_collation_v2=J("sqlite3_create_collation_v2"),i._sqlite3_collation_needed=J("sqlite3_collation_needed"),i._sqlite3_table_column_metadata=J("sqlite3_table_column_metadata"),i._sqlite3_extended_result_codes=J("sqlite3_extended_result_codes"),i._sqlite3_uri_parameter=J("sqlite3_uri_parameter"),i._sqlite3_uri_key=J("sqlite3_uri_key"),i._sqlite3_uri_boolean=J("sqlite3_uri_boolean"),i._sqlite3_uri_int64=J("sqlite3_uri_int64"),i._sqlite3_db_name=J("sqlite3_db_name"),i._sqlite3_db_filename=J("sqlite3_db_filename"),i._sqlite3_compileoption_used=J("sqlite3_compileoption_used"),i._sqlite3_compileoption_get=J("sqlite3_compileoption_get"),i._sqlite3session_diff=J("sqlite3session_diff"),i._sqlite3session_attach=J("sqlite3session_attach"),i._sqlite3session_create=J("sqlite3session_create"),i._sqlite3session_delete=J("sqlite3session_delete"),i._sqlite3session_table_filter=J("sqlite3session_table_filter"),i._sqlite3session_changeset=J("sqlite3session_changeset"),i._sqlite3session_changeset_strm=J("sqlite3session_changeset_strm"),i._sqlite3session_patchset_strm=J("sqlite3session_patchset_strm"),i._sqlite3session_patchset=J("sqlite3session_patchset"),i._sqlite3session_enable=J("sqlite3session_enable"),i._sqlite3session_indirect=J("sqlite3session_indirect"),i._sqlite3session_isempty=J("sqlite3session_isempty"),i._sqlite3session_memory_used=J("sqlite3session_memory_used"),i._sqlite3session_object_config=J("sqlite3session_object_config"),i._sqlite3session_changeset_size=J("sqlite3session_changeset_size"),i._sqlite3changeset_start=J("sqlite3changeset_start"),i._sqlite3changeset_start_v2=J("sqlite3changeset_start_v2"),i._sqlite3changeset_start_strm=J("sqlite3changeset_start_strm"),i._sqlite3changeset_start_v2_strm=J("sqlite3changeset_start_v2_strm"),i._sqlite3changeset_next=J("sqlite3changeset_next"),i._sqlite3changeset_op=J("sqlite3changeset_op"),i._sqlite3changeset_pk=J("sqlite3changeset_pk"),i._sqlite3changeset_old=J("sqlite3changeset_old"),i._sqlite3changeset_new=J("sqlite3changeset_new"),i._sqlite3changeset_conflict=J("sqlite3changeset_conflict"),i._sqlite3changeset_fk_conflicts=J("sqlite3changeset_fk_conflicts"),i._sqlite3changeset_finalize=J("sqlite3changeset_finalize"),i._sqlite3changeset_invert=J("sqlite3changeset_invert"),i._sqlite3changeset_invert_strm=J("sqlite3changeset_invert_strm"),i._sqlite3changeset_apply_v2=J("sqlite3changeset_apply_v2"),i._sqlite3changeset_apply=J("sqlite3changeset_apply"),i._sqlite3changeset_apply_v2_strm=J("sqlite3changeset_apply_v2_strm"),i._sqlite3changeset_apply_strm=J("sqlite3changeset_apply_strm"),i._sqlite3changegroup_new=J("sqlite3changegroup_new"),i._sqlite3changegroup_add=J("sqlite3changegroup_add"),i._sqlite3changegroup_output=J("sqlite3changegroup_output"),i._sqlite3changegroup_add_strm=J("sqlite3changegroup_add_strm"),i._sqlite3changegroup_output_strm=J("sqlite3changegroup_output_strm"),i._sqlite3changegroup_delete=J("sqlite3changegroup_delete"),i._sqlite3changeset_concat=J("sqlite3changeset_concat"),i._sqlite3changeset_concat_strm=J("sqlite3changeset_concat_strm"),i._sqlite3session_config=J("sqlite3session_config"),i._sqlite3_sourceid=J("sqlite3_sourceid"),i._sqlite3_wasm_pstack_ptr=J("sqlite3_wasm_pstack_ptr"),i._sqlite3_wasm_pstack_restore=J("sqlite3_wasm_pstack_restore"),i._sqlite3_wasm_pstack_alloc=J("sqlite3_wasm_pstack_alloc"),i._sqlite3_wasm_pstack_remaining=J("sqlite3_wasm_pstack_remaining"),i._sqlite3_wasm_pstack_quota=J("sqlite3_wasm_pstack_quota"),i._sqlite3_wasm_db_error=J("sqlite3_wasm_db_error"),i._sqlite3_wasm_test_struct=J("sqlite3_wasm_test_struct"),i._sqlite3_wasm_enum_json=J("sqlite3_wasm_enum_json"),i._sqlite3_wasm_vfs_unlink=J("sqlite3_wasm_vfs_unlink"),i._sqlite3_wasm_db_vfs=J("sqlite3_wasm_db_vfs"),i._sqlite3_wasm_db_reset=J("sqlite3_wasm_db_reset"),i._sqlite3_wasm_db_export_chunked=J("sqlite3_wasm_db_export_chunked"),i._sqlite3_wasm_db_serialize=J("sqlite3_wasm_db_serialize"),i._sqlite3_wasm_vfs_create_file=J("sqlite3_wasm_vfs_create_file"),i._sqlite3_wasm_posix_create_file=J("sqlite3_wasm_posix_create_file"),i._sqlite3_wasm_kvvfsMakeKeyOnPstack=J("sqlite3_wasm_kvvfsMakeKeyOnPstack"),i._sqlite3_wasm_kvvfs_methods=J("sqlite3_wasm_kvvfs_methods"),i._sqlite3_wasm_vtab_config=J("sqlite3_wasm_vtab_config"),i._sqlite3_wasm_db_config_ip=J("sqlite3_wasm_db_config_ip"),i._sqlite3_wasm_db_config_pii=J("sqlite3_wasm_db_config_pii"),i._sqlite3_wasm_db_config_s=J("sqlite3_wasm_db_config_s"),i._sqlite3_wasm_config_i=J("sqlite3_wasm_config_i"),i._sqlite3_wasm_config_ii=J("sqlite3_wasm_config_ii"),i._sqlite3_wasm_config_j=J("sqlite3_wasm_config_j"),i._sqlite3_wasm_init_wasmfs=J("sqlite3_wasm_init_wasmfs"),i._sqlite3_wasm_test_intptr=J("sqlite3_wasm_test_intptr"),i._sqlite3_wasm_test_voidptr=J("sqlite3_wasm_test_voidptr"),i._sqlite3_wasm_test_int64_max=J("sqlite3_wasm_test_int64_max"),i._sqlite3_wasm_test_int64_min=J("sqlite3_wasm_test_int64_min"),i._sqlite3_wasm_test_int64_times2=J("sqlite3_wasm_test_int64_times2"),i._sqlite3_wasm_test_int64_minmax=J("sqlite3_wasm_test_int64_minmax"),i._sqlite3_wasm_test_int64ptr=J("sqlite3_wasm_test_int64ptr"),i._sqlite3_wasm_test_stack_overflow=J("sqlite3_wasm_test_stack_overflow"),i._sqlite3_wasm_test_str_hello=J("sqlite3_wasm_test_str_hello"),i._sqlite3_wasm_SQLTester_strglob=J("sqlite3_wasm_SQLTester_strglob"),i._malloc=J("malloc")),Ue=(i._free=J("free"),i._realloc=J("realloc"),i._fflush=J("fflush")),Be=J("emscripten_builtin_memalign"),ze=()=>(ze=Re.emscripten_stack_init)(),We=()=>(We=Re.emscripten_stack_get_end)();function He(){function e(){Ne||(Ne=!0,i.calledRun=!0,F||(O(!M),M=!0,C(),i.noFSInit||Ee.init.initialized||Ee.init(),Ee.ignorePermissions=!1,he.init(),ne(D),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),O(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(C(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),R.unshift(e);var e;ne(R)}()))}var r;j>0||(ze(),O(!(3&(r=We()))),0==r&&(r+=4),I[r>>2]=34821223,I[r+4>>2]=2310721022,I[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),N.unshift(e);var e;ne(N)}(),j>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e(),C()))}if(J("stackSave"),J("stackRestore"),J("stackAlloc"),i.wasmMemory=q,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","handleAllocatorInit","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",r=e;r.startsWith("_")||(r="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+r+"')",ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ie(t)}}),re(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","keepRuntimeAlive","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","asyncLoad","alignMemory","mmapAlloc","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToNewUTF8","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"].forEach(re),B=function e(){Ne||He(),Ne||(B=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return He(),i.postRun||(i.postRun=[]),i.postRun.push((function(e){if(globalThis.sqlite3ApiBootstrap=function t(r=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return console.warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const n=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:void 0!==e?!!e.HEAPU64:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},r||{});Object.assign(n,{allocExportName:n.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:n.useStdAlloc?"free":"sqlite3_free",reallocExportName:n.useStdAlloc?"realloc":"sqlite3_realloc"},n),["exports","memory","wasmfsOpfsDir"].forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e]())}));const s=Object.create(null),i=Object.create(null),o=e=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(e)||"Unknown result code #"+e;class a extends Error{constructor(...e){let t;if(e.length)if("number"==typeof(r=e[0])&&r===(0|r))if(t=e[0],1===e.length)super(o(e[0]));else{const r=o(t);"object"==typeof e[1]?super(r,e[1]):(e[0]=r+":",super(e.join(" ")))}else 2===e.length&&"object"==typeof e[1]?super(...e):super(e.join(" "));var r;this.resultCode=t||s.SQLITE_ERROR,this.name="SQLite3Error"}}a.toss=(...e)=>{throw new a(...e)};const l=a.toss;n.wasmfsOpfsDir&&!/^\/[^/]+$/.test(n.wasmfsOpfsDir)&&l("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const c=e=>"bigint"!=typeof e&&!!(e===(0|e)&&e<=2147483647&&e>=-2147483648),_="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,u=e=>e.buffer instanceof _,d=(e,t,r)=>u(e)?e.slice(t,r):e.subarray(t,r),f=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),p=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),m=e=>f(e)||l("Value is not of a supported TypedArray type."),h=new TextDecoder("utf-8"),g=function(e,t,r){return h.decode(d(e,t,r))},b=function(e){return p(e)?g(e instanceof ArrayBuffer?new Uint8Array(e):e):Array.isArray(e)?e.join(""):(i.isPtr(e)&&(e=i.cstrToJs(e)),e)};class y extends Error{constructor(...e){2===e.length&&"object"==typeof e[1]?super(...e):e.length?super(e.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}y.toss=(...e)=>{throw new y(...e)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(e,t,r,n,s,i,o,a,l)=>{},sqlite3_create_function:(e,t,r,n,s,i,o,a)=>{},sqlite3_create_window_function:(e,t,r,n,s,i,o,a,l,c)=>{},sqlite3_prepare_v3:(e,t,r,n,s,i)=>{},sqlite3_prepare_v2:(e,t,r,n,s)=>{},sqlite3_exec:(e,t,r,n,s)=>{},sqlite3_randomness:(e,t)=>{}});const q={affirmBindableTypedArray:m,flexibleString:b,bigIntFits32:e=>e>=-2147483648n&&e<=0x7fffffffn,bigIntFits64:function e(t){return e._max||(e._max=BigInt("0x7fffffffffffffff"),e._min=~e._max),t>=e._min&&t<=e._max},bigIntFitsDouble:function e(t){return e._min||(e._min=Number.MIN_SAFE_INTEGER,e._max=Number.MAX_SAFE_INTEGER),t>=e._min&&t<=e._max},isBindableTypedArray:f,isInt32:c,isSQLableTypedArray:p,isTypedArray:e=>!!(e&&e.constructor&&c(e.constructor.BYTES_PER_ELEMENT))&&e,typedArrayToString:g,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:u,toss:function(...e){throw new Error(e.join(" "))},toss3:l,typedArrayPart:d,affirmDbHeader:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));15>e.byteLength&&l("Input does not contain an SQLite3 database header.");for(let t=0;t<15;++t)"SQLite format 3".charCodeAt(t)!==e[t]&&l("Input does not contain an SQLite3 database header.")},affirmIsDb:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const t=e.byteLength;(t<512||t%512!=0)&&l("Byte array size",t,"is invalid for an SQLite3 db."),q.affirmDbHeader(e)}};Object.assign(i,{ptrSizeof:n.wasmPtrSizeof||4,ptrIR:n.wasmPtrIR||"i32",bigIntEnabled:!!n.bigIntEnabled,exports:n.exports||l("Missing API config.exports (WASM module exports)."),memory:n.memory||n.exports.memory||l("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),i.allocFromTypedArray=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e)),m(e);const t=i.alloc(e.byteLength||1);return i.heapForSize(e.constructor).set(e.byteLength?e:[0],t),t};{const e=n.allocExportName,t=n.deallocExportName,r=n.reallocExportName;for(const n of[e,t,r])i.exports[n]instanceof Function||l("Missing required exports[",n,"] function.");i.alloc=function e(t){return e.impl(t)||y.toss("Failed to allocate",t," bytes.")},i.alloc.impl=i.exports[e],i.realloc=function e(t,r){const n=e.impl(t,r);return r?n||y.toss("Failed to reallocate",r," bytes."):0},i.realloc.impl=i.exports[r],i.dealloc=i.exports[t]}let w;if(i.compileOptionUsed=function e(t){if(!arguments.length){if(e._result)return e._result;e._opt||(e._rx=/^([^=]+)=(.+)/,e._rxInt=/^-?\d+$/,e._opt=function(t,r){const n=e._rx.exec(t);r[0]=n?n[1]:t,r[1]=!n||(e._rxInt.test(n[2])?+n[2]:n[2])});const t={},r=[0,0];let n,i=0;for(;n=s.sqlite3_compileoption_get(i++);)e._opt(n,r),t[r[0]]=r[1];return e._result=t}if(Array.isArray(t)){const e={};return t.forEach((t=>{e[t]=s.sqlite3_compileoption_used(t)})),e}return"object"==typeof t?(Object.keys(t).forEach((e=>{t[e]=s.sqlite3_compileoption_used(e)})),t):"string"==typeof t&&!!s.sqlite3_compileoption_used(t)},i.pstack=Object.assign(Object.create(null),{restore:i.exports.sqlite3_wasm_pstack_restore,alloc:function(e){return"string"!=typeof e||(e=i.sizeofIR(e))||y.toss("Invalid value for pstack.alloc(",arguments[0],")"),i.exports.sqlite3_wasm_pstack_alloc(e)||y.toss("Could not allocate",e,"bytes from the pstack.")},allocChunks:function(e,t){"string"!=typeof t||(t=i.sizeofIR(t))||y.toss("Invalid size value for allocChunks(",arguments[1],")");const r=i.pstack.alloc(e*t),n=[];let s=0,o=0;for(;s1===e?i.pstack.alloc(t?8:i.ptrSizeof):i.pstack.allocChunks(e,t?8:i.ptrSizeof),call:function(e){const t=i.pstack.pointer;try{return e(S)}finally{i.pstack.restore(t)}}}),Object.defineProperties(i.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_remaining}}),s.sqlite3_randomness=(...e)=>{if(1===e.length&&q.isTypedArray(e[0])&&1===e[0].BYTES_PER_ELEMENT){const t=e[0];if(0===t.byteLength)return i.exports.sqlite3_randomness(0,0),t;const r=i.pstack.pointer;try{let e=t.byteLength,r=0;const n=i.exports.sqlite3_randomness,s=i.heap8u(),o=e<512?e:512,a=i.pstack.alloc(o);do{const i=e>o?o:e;n(i,a),t.set(d(s,a,a+i),r),e-=i,r+=i}while(e>0)}catch(e){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",e)}finally{i.pstack.restore(r)}return t}i.exports.sqlite3_randomness(...e)},s.sqlite3_wasmfs_opfs_dir=function(){if(void 0!==w)return w;const e=n.wasmfsOpfsDir;if(!(e&&globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle))return w="";try{return w=e&&0===i.xCallWrapped("sqlite3_wasm_init_wasmfs","i32",["string"],e)?e:""}catch(e){return w=""}},s.sqlite3_wasmfs_filename_is_persistent=function(e){const t=s.sqlite3_wasmfs_opfs_dir();return!(!t||!e)&&e.startsWith(t+"/")},s.sqlite3_js_db_uses_vfs=function(e,t,r=0){try{const n=s.sqlite3_vfs_find(t);return!!n&&(e?n===s.sqlite3_js_db_vfs(e,r)&&n:n===s.sqlite3_vfs_find(0)&&n)}catch(e){return!1}},s.sqlite3_js_vfs_list=function(){const e=[];let t=s.sqlite3_vfs_find(0);for(;t;){const r=new s.sqlite3_vfs(t);e.push(i.cstrToJs(r.$zName)),t=r.$pNext,r.dispose()}return e},s.sqlite3_js_db_export=function(e,t=0){(e=i.xWrap.testConvertArg("sqlite3*",e))||l("Invalid sqlite3* argument."),i.bigIntEnabled||l("BigInt64 support is not enabled.");const r=i.scopedAllocPush();let n;try{const r=i.scopedAlloc(8+i.ptrSizeof),s=r+8,o=t?i.isPtr(t)?t:i.scopedAllocCString(""+t):0;let a=i.exports.sqlite3_wasm_db_serialize(e,o,s,r,0);a&&l("Database serialization failed with code",S.capi.sqlite3_js_rc_str(a)),n=i.peekPtr(s);const c=i.peek(r,"i64");return a=c?i.heap8u().slice(n,n+Number(c)):new Uint8Array,a}finally{n&&i.exports.sqlite3_free(n),i.scopedAllocPop(r)}},s.sqlite3_js_db_vfs=(e,t=0)=>i.sqlite3_wasm_db_vfs(e,t),s.sqlite3_js_aggregate_context=(e,t)=>s.sqlite3_aggregate_context(e,t)||(t?y.toss("Cannot allocate",t,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(e,t,r){let n;t&&i.isPtr(t)?n=t:t instanceof ArrayBuffer||t instanceof Uint8Array?(n=i.allocFromTypedArray(t),(arguments.length<3||!q.isInt32(r)||r<0)&&(r=t.byteLength)):a.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!q.isInt32(r)||r<0)&&a.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const t=i.sqlite3_wasm_posix_create_file(e,n,r);t&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(t))}finally{i.dealloc(n)}},s.sqlite3_js_vfs_create_file=function(e,t,r,o){let l;n.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options."),r?(i.isPtr(r)?l=r:r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r instanceof Uint8Array?(l=i.allocFromTypedArray(r),(arguments.length<4||!q.isInt32(o)||o<0)&&(o=r.byteLength)):a.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):l=0,(!q.isInt32(o)||o<0)&&(i.dealloc(l),a.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const r=i.sqlite3_wasm_vfs_create_file(e,t,l,o);r&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(r))}finally{i.dealloc(l)}},s.sqlite3_js_sql_to_string=e=>{if("string"==typeof e)return e;const t=b(v);return t===v?void 0:t},q.isUIThread()){const e=function(e){const t=Object.create(null);return t.prefix="kvvfs-"+e,t.stores=[],"session"!==e&&""!==e||t.stores.push(globalThis.sessionStorage),"local"!==e&&""!==e||t.stores.push(globalThis.localStorage),t};s.sqlite3_js_kvvfs_clear=function(t=""){let r=0;const n=e(t);return n.stores.forEach((e=>{const t=[];let s;for(s=0;se.removeItem(t))),r+=t.length})),r},s.sqlite3_js_kvvfs_size=function(t=""){let r=0;const n=e(t);return n.stores.forEach((e=>{let t;for(t=0;tE(e,t,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(e,t)=>E(e,t,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(e,t)=>E(e,t,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(e,t)=>E(e,t,"sqlite3changeset_old");const S={WasmAllocError:y,SQLite3Error:a,capi:s,util:q,wasm:i,config:n,version:Object.create(null),client:void 0,asyncPostInit:async function e(){if(e.isReady instanceof Promise)return e.isReady;let r=t.initializersAsync;delete t.initializersAsync;const s=async()=>(S.__isUnderTest||(delete S.util,delete S.StructBinder),S),i=e=>{throw n.error("an async sqlite3 initializer failed:",e),e};if(!r||!r.length)return e.isReady=s().catch(i);r=r.map((e=>e instanceof Function?async t=>e(S):e)),r.push(s);let o=Promise.resolve(S);for(;r.length;)o=o.then(r.shift());return e.isReady=o.catch(i)},scriptInfo:void 0};try{t.initializers.forEach((e=>{e(S)}))}catch(e){throw console.error("sqlite3 bootstrap initializer threw:",e),e}return delete t.initializers,t.sqlite3=S,S},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(e){void 0===e.bigIntEnabled&&(e.bigIntEnabled=!!globalThis.BigInt64Array);const t=(...e)=>{throw new Error(e.join(" "))};e.exports||Object.defineProperty(e,"exports",{enumerable:!0,configurable:!0,get:()=>e.instance&&e.instance.exports});const r=e.pointerIR||"i32",n=e.ptrSizeof="i32"===r?4:"i64"===r?8:t("Unhandled ptrSizeof:",r),s=Object.create(null);s.heapSize=0,s.memory=null,s.freeFuncIndexes=[],s.scopedAlloc=[],s.utf8Decoder=new TextDecoder,s.utf8Encoder=new TextEncoder("utf-8"),e.sizeofIR=e=>{switch(e){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return n;default:return(""+e).endsWith("*")?n:void 0}};const i=function(){if(s.memory){if(s.heapSize===s.memory.buffer.byteLength)return s}else s.memory=e.memory instanceof WebAssembly.Memory?e.memory:e.exports.memory;const t=s.memory.buffer;return s.HEAP8=new Int8Array(t),s.HEAP8U=new Uint8Array(t),s.HEAP16=new Int16Array(t),s.HEAP16U=new Uint16Array(t),s.HEAP32=new Int32Array(t),s.HEAP32U=new Uint32Array(t),e.bigIntEnabled&&(s.HEAP64=new BigInt64Array(t),s.HEAP64U=new BigUint64Array(t)),s.HEAP32F=new Float32Array(t),s.HEAP64F=new Float64Array(t),s.heapSize=t.byteLength,s};e.heap8=()=>i().HEAP8,e.heap8u=()=>i().HEAP8U,e.heap16=()=>i().HEAP16,e.heap16u=()=>i().HEAP16U,e.heap32=()=>i().HEAP32,e.heap32u=()=>i().HEAP32U,e.heapForSize=function(r,n=!0){const o=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();switch(r){case Int8Array:return o.HEAP8;case Uint8Array:return o.HEAP8U;case Int16Array:return o.HEAP16;case Uint16Array:return o.HEAP16U;case Int32Array:return o.HEAP32;case Uint32Array:return o.HEAP32U;case 8:return n?o.HEAP8U:o.HEAP8;case 16:return n?o.HEAP16U:o.HEAP16;case 32:return n?o.HEAP32U:o.HEAP32;case 64:if(o.HEAP64)return n?o.HEAP64U:o.HEAP64;break;default:if(e.bigIntEnabled){if(r===globalThis.BigUint64Array)return o.HEAP64U;if(r===globalThis.BigInt64Array)return o.HEAP64;break}}t("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},e.functionTable=function(){return e.exports.__indirect_function_table},e.functionEntry=function(t){const r=e.functionTable();return t>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(t){const r=e._.rxJSig.exec(t);return r?r[2]:t.substr(1)},letterType:r=>e._.sigTypes[r]||t("Invalid signature letter:",r),pushSigType:(t,r)=>t.push(e._.typeCodes[e._.letterType(r)])}),"string"==typeof r){const e=n;n=r,r=e}const s=e._.sigParams(n),i=[1,96];e._.uleb128Encode(i,"push",s.length);for(const t of s)e._.pushSigType(i,t);return"v"===n[0]?i.push(0):(i.push(1),e._.pushSigType(i,n[0])),e._.uleb128Encode(i,"unshift",i.length),i.unshift(0,97,115,109,1,0,0,0,1),i.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(i)),{e:{f:r}}).exports.f};const o=function(r,n,i){if(i&&!s.scopedAlloc.length&&t("No scopedAllocPush() scope is active."),"string"==typeof r){const e=n;n=r,r=e}"string"==typeof n&&r instanceof Function||t("Invalid arguments: expecting (function,signature) or (signature,function).");const o=e.functionTable(),a=o.length;let l;for(;s.freeFuncIndexes.length&&(l=s.freeFuncIndexes.pop(),o.get(l));)l=null;l||(l=a,o.grow(1));try{return o.set(l,r),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l),l}catch(e){if(!(e instanceof TypeError))throw l===a&&s.freeFuncIndexes.push(a),e}try{const t=e.jsFuncToWasm(r,n);o.set(l,t),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l)}catch(e){throw l===a&&s.freeFuncIndexes.push(a),e}return l};e.installFunction=(e,t)=>o(e,t,!1),e.scopedInstallFunction=(e,t)=>o(e,t,!0),e.uninstallFunction=function(t){if(!t&&0!==t)return;const r=s.freeFuncIndexes,n=e.functionTable();r.push(t);const i=n.get(t);return n.set(t,null),i},e.peek=function(n,o="i8"){o.endsWith("*")&&(o=r);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i(),l=Array.isArray(n)?[]:void 0;let c;do{switch(l&&(n=arguments[0].shift()),o){case"i1":case"i8":c=a.HEAP8[0|n];break;case"i16":c=a.HEAP16[n>>1];break;case"i32":c=a.HEAP32[n>>2];break;case"float":case"f32":c=a.HEAP32F[n>>2];break;case"double":case"f64":c=Number(a.HEAP64F[n>>3]);break;case"i64":if(e.bigIntEnabled){c=BigInt(a.HEAP64[n>>3]);break}default:t("Invalid type for peek():",o)}l&&l.push(c)}while(l&&arguments[0].length);return l||c},e.poke=function(e,n,o="i8"){o.endsWith("*")&&(o=r);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();for(const r of Array.isArray(e)?e:[e])switch(o){case"i1":case"i8":a.HEAP8[0|r]=n;continue;case"i16":a.HEAP16[r>>1]=n;continue;case"i32":a.HEAP32[r>>2]=n;continue;case"float":case"f32":a.HEAP32F[r>>2]=n;continue;case"double":case"f64":a.HEAP64F[r>>3]=n;continue;case"i64":if(a.HEAP64){a.HEAP64[r>>3]=BigInt(n);continue}default:t("Invalid type for poke(): "+o)}return this},e.peekPtr=(...t)=>e.peek(1===t.length?t[0]:t,r),e.pokePtr=(t,n=0)=>e.poke(t,n,r),e.peek8=(...t)=>e.peek(1===t.length?t[0]:t,"i8"),e.poke8=(t,r)=>e.poke(t,r,"i8"),e.peek16=(...t)=>e.peek(1===t.length?t[0]:t,"i16"),e.poke16=(t,r)=>e.poke(t,r,"i16"),e.peek32=(...t)=>e.peek(1===t.length?t[0]:t,"i32"),e.poke32=(t,r)=>e.poke(t,r,"i32"),e.peek64=(...t)=>e.peek(1===t.length?t[0]:t,"i64"),e.poke64=(t,r)=>e.poke(t,r,"i64"),e.peek32f=(...t)=>e.peek(1===t.length?t[0]:t,"f32"),e.poke32f=(t,r)=>e.poke(t,r,"f32"),e.peek64f=(...t)=>e.peek(1===t.length?t[0]:t,"f64"),e.poke64f=(t,r)=>e.poke(t,r,"f64"),e.getMemValue=e.peek,e.getPtrValue=e.peekPtr,e.setMemValue=e.poke,e.setPtrValue=e.pokePtr,e.isPtr32=e=>"number"==typeof e&&e===(0|e)&&e>=0,e.isPtr=e.isPtr32,e.cstrlen=function(t){if(!t||!e.isPtr(t))return null;const r=i().HEAP8U;let n=t;for(;0!==r[n];++n);return n-t};const a="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer;e.cstrToJs=function(t){const r=e.cstrlen(t);return r?(n=i().HEAP8U,o=t,l=t+r,s.utf8Decoder.decode(n.buffer instanceof a?n.slice(o,l):n.subarray(o,l))):null===r?r:"";var n,o,l},e.jstrlen=function(e){if("string"!=typeof e)return null;const t=e.length;let r=0;for(let n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++n)),t<=127?++r:r+=t<=2047?2:t<=65535?3:4}return r},e.jstrcpy=function(e,r,n=0,s=-1,i=!0){if(r&&(r instanceof Int8Array||r instanceof Uint8Array)||t("jstrcpy() target must be an Int8Array or Uint8Array."),s<0&&(s=r.length-n),!(s>0&&n>=0))return 0;let o=0,a=e.length;const l=n,c=n+s-(i?1:0);for(;o=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++o)),t<=127){if(n>=c)break;r[n++]=t}else if(t<=2047){if(n+1>=c)break;r[n++]=192|t>>6,r[n++]=128|63&t}else if(t<=65535){if(n+2>=c)break;r[n++]=224|t>>12,r[n++]=128|t>>6&63,r[n++]=128|63&t}else{if(n+3>=c)break;r[n++]=240|t>>18,r[n++]=128|t>>12&63,r[n++]=128|t>>6&63,r[n++]=128|63&t}}return i&&(r[n++]=0),n-l},e.cstrncpy=function(r,n,s){if(r&&n||t("cstrncpy() does not accept NULL strings."),s<0)s=e.cstrlen(strPtr)+1;else if(!(s>0))return 0;const i=e.heap8u();let o,a=0;for(;as.utf8Encoder.encode(t?e+"\0":e);const l=(e,r)=>{e.alloc instanceof Function&&e.dealloc instanceof Function||t("Object is missing alloc() and/or dealloc() function(s)","required by",r+"().")},c=function(t,r,n,o){if(l(e,o),"string"!=typeof t)return null;{const e=s.utf8Encoder.encode(t),o=n(e.length+1),a=i().HEAP8U;return a.set(e,o),a[o+e.length]=0,r?[o,e.length]:o}};e.allocCString=(t,r=!1)=>c(t,r,e.alloc,"allocCString()"),e.scopedAllocPush=function(){l(e,"scopedAllocPush");const t=[];return s.scopedAlloc.push(t),t},e.scopedAllocPop=function(r){l(e,"scopedAllocPop");const n=arguments.length?s.scopedAlloc.indexOf(r):s.scopedAlloc.length-1;n<0&&t("Invalid state object for scopedAllocPop()."),0===arguments.length&&(r=s.scopedAlloc[n]),s.scopedAlloc.splice(n,1);for(let t;t=r.pop();)e.functionEntry(t)?e.uninstallFunction(t):e.dealloc(t)},e.scopedAlloc=function(r){s.scopedAlloc.length||t("No scopedAllocPush() scope is active.");const n=e.alloc(r);return s.scopedAlloc[s.scopedAlloc.length-1].push(n),n},Object.defineProperty(e.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>s.scopedAlloc.length,set:()=>t("The 'active' property is read-only.")}),e.scopedAllocCString=(t,r=!1)=>c(t,r,e.scopedAlloc,"scopedAllocCString()");const _=function(t,r){const n=e[t?"scopedAlloc":"alloc"]((r.length+1)*e.ptrSizeof);let s=0;return r.forEach((r=>{e.pokePtr(n+e.ptrSizeof*s++,e[t?"scopedAllocCString":"allocCString"](""+r))})),e.pokePtr(n+e.ptrSizeof*s,0),n};e.scopedAllocMainArgv=e=>_(!0,e),e.allocMainArgv=e=>_(!1,e),e.cArgvToJs=(t,r)=>{const n=[];for(let s=0;su(e,t,"alloc"),e.scopedAllocPtr=(e=1,t=!0)=>u(e,t,"scopedAlloc"),e.xGet=function(r){return e.exports[r]||t("Cannot find exported symbol:",r)};const d=(e,r)=>t(e+"() requires",r,"argument(s).");e.xCall=function(r,...n){const s=e.xGet(r);return s instanceof Function||t("Exported symbol",r,"is not a function."),s.length!==n.length&&d(r,s.length),2===arguments.length&&Array.isArray(arguments[1])?s.apply(null,arguments[1]):s.apply(null,n)},s.xWrap=Object.create(null),s.xWrap.convert=Object.create(null),s.xWrap.convert.arg=new Map,s.xWrap.convert.result=new Map;const f=s.xWrap.convert.arg,p=s.xWrap.convert.result;e.bigIntEnabled&&f.set("i64",(e=>BigInt(e)));const m="i32"===r?e=>0|e:e=>BigInt(e)|BigInt(0);f.set("i32",m).set("i16",(e=>65535&e)).set("i8",(e=>255&e)).set("f32",(e=>Number(e).valueOf())).set("float",f.get("f32")).set("f64",f.get("f32")).set("double",f.get("f64")).set("int",f.get("i32")).set("null",(e=>e)).set(null,f.get("null")).set("**",m).set("*",m),p.set("*",m).set("pointer",m).set("number",(e=>Number(e))).set("void",(e=>{})).set("null",(e=>e)).set(null,p.get("null"));{const n=["i8","i16","i32","int","f32","float","f64","double"];e.bigIntEnabled&&n.push("i64");const s=f.get(r);for(const e of n)f.set(e+"*",s),p.set(e+"*",s),p.set(e,f.get(e)||t("Missing arg converter:",e))}const h=function(t){return"string"==typeof t?e.scopedAllocCString(t):t?m(t):null};f.set("string",h).set("utf8",h).set("pointer",h),p.set("string",(t=>e.cstrToJs(t))).set("utf8",p.get("string")).set("string:dealloc",(t=>{try{return t?e.cstrToJs(t):null}finally{e.dealloc(t)}})).set("utf8:dealloc",p.get("string:dealloc")).set("json",(t=>JSON.parse(e.cstrToJs(t)))).set("json:dealloc",(t=>{try{return t?JSON.parse(e.cstrToJs(t)):null}finally{e.dealloc(t)}}));const g=class{constructor(e){this.name=e.name||"unnamed adapter"}convertArg(e,r,n){t("AbstractArgAdapter must be subclassed.")}};f.FuncPtrAdapter=class r extends g{constructor(e){super(e),f.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",e),this.name=e.name||"unnamed",this.signature=e.signature,e.contextKey instanceof Function&&(this.contextKey=e.contextKey,e.bindScope||(e.bindScope="context")),this.bindScope=e.bindScope||t("FuncPtrAdapter options requires a bindScope (explicit or implied)."),r.bindScopes.indexOf(e.bindScope)<0&&t("Invalid options.bindScope ("+e.bindMod+") for FuncPtrAdapter. Expecting one of: ("+r.bindScopes.join(", ")+")"),this.isTransient="transient"===this.bindScope,this.isContext="context"===this.bindScope,this.isPermanent="permanent"===this.bindScope,this.singleton="singleton"===this.bindScope?[]:void 0,this.callProxy=e.callProxy instanceof Function?e.callProxy:void 0}contextKey(e,t){return this}contextMap(e){const t=this.__cmap||(this.__cmap=new Map);let r=t.get(e);return void 0===r&&t.set(e,r=[]),r}convertArg(t,n,i){let a=this.singleton;if(!a&&this.isContext&&(a=this.contextMap(this.contextKey(n,i))),a&&a[0]===t)return a[1];if(t instanceof Function){this.callProxy&&(t=this.callProxy(t));const e=o(t,this.signature,this.isTransient);if(r.debugFuncInstall&&r.debugOut("FuncPtrAdapter installed",this,this.contextKey(n,i),"@"+e,t),a){if(a[1]){r.debugFuncInstall&&r.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(n,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}}a[0]=t,a[1]=e}return e}if(e.isPtr(t)||null==t){if(a&&a[1]&&a[1]!==t){r.debugFuncInstall&&r.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(n,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}a[0]=a[1]=0|t}return t||0}throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},f.FuncPtrAdapter.warnOnUse=!1,f.FuncPtrAdapter.debugFuncInstall=!1,f.FuncPtrAdapter.debugOut=console.debug.bind(console),f.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const b=e=>f.get(e)||t("Argument adapter not found:",e),y=e=>p.get(e)||t("Result adapter not found:",e);s.xWrap.convertArg=(e,...t)=>b(e)(...t),s.xWrap.convertArgNoCheck=(e,...t)=>f.get(e)(...t),s.xWrap.convertResult=(e,t)=>null===e?t:e?y(e)(t):void 0,s.xWrap.convertResultNoCheck=(e,t)=>null===e?t:e?p.get(e)(t):void 0,e.xWrap=function(r,n,...i){3===arguments.length&&Array.isArray(arguments[2])&&(i=arguments[2]),e.isPtr(r)&&(r=e.functionEntry(r)||t("Function pointer not found in WASM function table."));const o=r instanceof Function,a=o?r:e.xGet(r);if(o&&(r=a.name||"unnamed function"),i.length!==a.length&&d(r,a.length),null===n&&0===a.length)return a;null!=n&&y(n);for(const e of i)e instanceof g?f.set(e,((...t)=>e.convertArg(...t))):b(e);const l=s.xWrap;return 0===a.length?(...e)=>e.length?d(r,a.length):l.convertResult(n,a.call(null)):function(...t){t.length!==a.length&&d(r,a.length);const s=e.scopedAllocPush();try{for(const e in t)t[e]=l.convertArgNoCheck(i[e],t[e],t,e);return l.convertResultNoCheck(n,a.apply(null,t))}finally{e.scopedAllocPop(s)}}};const q=function(e,r,n,s,i,o){if("string"==typeof n){if(1===r)return o.get(n);if(2===r)return s?(s instanceof Function||t(i,"requires a function argument."),o.set(n,s),e):(o.get(n),e)}t("Invalid arguments to",i)};return e.xWrap.resultAdapter=function e(t,r){return q(e,arguments.length,t,r,"resultAdapter()",p)},e.xWrap.argAdapter=function e(t,r){return q(e,arguments.length,t,r,"argAdapter()",f)},e.xWrap.FuncPtrAdapter=f.FuncPtrAdapter,e.xCallWrapped=function(t,r,n,...s){return Array.isArray(arguments[3])&&(s=arguments[3]),e.xWrap(t,r,n||[]).apply(null,s||[])},e.xWrap.testConvertArg=s.xWrap.convertArg,e.xWrap.testConvertResult=s.xWrap.convertResult,e},globalThis.WhWasmUtilInstaller.yawl=function(e){const t=()=>fetch(e.uri,{credentials:"same-origin"}),r=this,n=function(t){if(e.wasmUtilTarget){const n=(...e)=>{throw new Error(e.join(" "))},s=e.wasmUtilTarget;if(s.module=t.module,s.instance=t.instance,s.instance.exports.memory||(s.memory=e.imports&&e.imports.env&&e.imports.env.memory||n("Missing 'memory' object!")),!s.alloc&&t.instance.exports.malloc){const e=t.instance.exports;s.alloc=function(t){return e.malloc(t)||n("Allocation of",t,"bytes failed.")},s.dealloc=function(t){e.free(t)}}r(s)}return e.onload&&e.onload(t,e),t};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(t(),e.imports||{}).then(n)}:function(){return t().then((e=>e.arrayBuffer())).then((t=>WebAssembly.instantiate(t,e.imports||{}))).then(n)}}.bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function e(t){const r=(...e)=>{throw new Error(e.join(" "))};t.heap instanceof WebAssembly.Memory||t.heap instanceof Function||r("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach((function(e){t[e]instanceof Function||r("Config option '"+e+"' must be a function.")}));const n=e,s=t.heap instanceof Function?t.heap:()=>new Uint8Array(t.heap.buffer),i=t.alloc,o=t.dealloc,a=t.log||console.log.bind(console),l=t.memberPrefix||"",c=t.memberSuffix||"",_=void 0===t.bigIntEnabled?!!globalThis.BigInt64Array:!!t.bigIntEnabled,u=globalThis.BigInt,d=globalThis.BigInt64Array,f=t.ptrSizeof||4,p=t.ptrIR||"i32";n.debugFlags||(n.__makeDebugFlags=function(e=null){e&&e.__flags&&(e=e.__flags);const t=function e(t){return 0===arguments.length?e.__flags:(t<0?(delete e.__flags.getter,delete e.__flags.setter,delete e.__flags.alloc,delete e.__flags.dealloc):(e.__flags.getter=!!(1&t),e.__flags.setter=!!(2&t),e.__flags.alloc=!!(4&t),e.__flags.dealloc=!!(8&t)),e._flags)};return Object.defineProperty(t,"__flags",{iterable:!1,writable:!1,value:Object.create(e)}),e||t(0),t},n.debugFlags=n.__makeDebugFlags());const m=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),h=e=>(e=>"("===e[1])(e)?"p":e[0],g=function(e){switch(h(e)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return p;case"j":return"i64";case"f":return"float";case"d":return"double"}r("Unhandled signature IR:",e)},b=d?()=>!0:()=>r("BigInt64Array is not available."),y=(e,t)=>e+"::"+t,q=new WeakMap,v="(pointer-is-external)",w=function(e,t,r){if(r||(r=q.get(t)),r){if(q.delete(t),Array.isArray(t.ondispose)){let n;for(;n=t.ondispose.shift();)try{n instanceof Function?n.call(t):n instanceof D?n.dispose():"number"==typeof n&&o(n)}catch(t){console.warn("ondispose() for",e.structName,"@",r,"threw. NOT propagating it.",t)}}else if(t.ondispose instanceof Function)try{t.ondispose()}catch(t){console.warn("ondispose() for",e.structName,"@",r,"threw. NOT propagating it.",t)}delete t.ondispose,e.debugFlags.__flags.dealloc&&a("debug.dealloc:",t[v]?"EXTERNAL":"",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+r),t[v]||o(r)}},E=e=>({configurable:!1,writable:!1,iterable:!1,value:e}),S=function(e,t,n){let o=!n;n?Object.defineProperty(t,v,E(n)):(n=i(e.structInfo.sizeof))||r("Allocation of",e.structName,"structure failed.");try{e.debugFlags.__flags.alloc&&a("debug.alloc:",o?"":"EXTERNAL",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+n),o&&s().fill(0,n,n+e.structInfo.sizeof),q.set(t,n)}catch(r){throw w(e,t,n),r}},A=E((e=>l+e+c)),x=function(e,t,n=!0){let s=e.members[t];if(!s&&(l||c)){for(const r of Object.values(e.members))if(r.key===t){s=r;break}!s&&n&&r(y(e.name,t),"is not a mapped struct member.")}return s},T=function e(t,r,n=!1){e._||(e._=e=>e.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const s=x(t.structInfo,r,!0);return n?e._(s.signature):s.signature},I={configurable:!1,enumerable:!1,get:function(){return q.get(this)},set:()=>r("Cannot assign the 'pointer' property of a struct.")},k=E((function(){const e=[];for(const t of Object.keys(this.structInfo.members))e.push(this.memberKey(t));return e})),F=new TextDecoder("utf-8"),O=new TextEncoder,P="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,L=function(e){"s"!==e.signature&&r("Invalid member type signature for C-string value:",JSON.stringify(e))},C=function(e,...t){e.ondispose?Array.isArray(e.ondispose)||(e.ondispose=[e.ondispose]):e.ondispose=[],e.ondispose.push(...t)},N=function(e){const t=O.encode(e),n=i(t.length+1);n||r("Allocation error while duplicating string:",e);const o=s();return o.set(t,n),o[n+t.length]=0,n},D=function(e,t){arguments[2]!==E&&r("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:E(e),structInfo:E(t)})};D.prototype=Object.create(null,{dispose:E((function(){w(this.constructor,this)})),lookupMember:E((function(e,t=!0){return x(this.structInfo,e,t)})),memberToJsString:E((function(e){return function(e,t){const r=x(e.structInfo,t,!0);L(r);const n=e[r.key];if(!n)return null;let i=n;const o=s();for(;0!==o[i];++i);return n===i?"":(a=o,l=n,c=i,F.decode(a.buffer instanceof P?a.slice(l,c):a.subarray(l,c)));var a,l,c}(this,e)})),memberIsString:E((function(e,t=!0){return function(e,t,r=!1){const n=x(e.structInfo,t,r);return!(!n||1!==n.signature.length||"s"!==n.signature[0])&&n}(this,e,t)})),memberKey:A,memberKeys:k,memberSignature:E((function(e,t=!1){return T(this,e,t)})),memoryDump:E((function(){const e=this.pointer;return e?new Uint8Array(s().slice(e,e+this.structInfo.sizeof)):null})),pointer:I,setMemberCString:E((function(e,t){return function(e,t,r){const n=x(e.structInfo,t,!0);L(n);const s=N(r);return e[n.key]=s,C(e,s),e}(this,e,t)}))}),Object.assign(D.prototype,{addOnDispose:function(...e){return C(this,...e),this}}),Object.defineProperties(D,{allocCString:E(N),isA:E((e=>e instanceof D)),hasExternalPointer:E((e=>e instanceof D&&!!e[v])),memberKey:A});const R=e=>Number.isFinite(e)||e instanceof(u||Number),M=function e(t,n,i){if(!e._){e._={getters:{},setters:{},sw:{}};const t=["i","c","C","p","P","s","f","d","v()"];_&&t.push("j"),t.forEach((function(t){e._.getters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"getInt32";case 8:return b()&&"getBigInt64"}break;case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return b()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}r("Unhandled DataView getter for signature:",e)}(t),e._.setters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"setInt32";case 8:return b()&&"setBigInt64"}break;case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return b()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}r("Unhandled DataView setter for signature:",e)}(t),e._.sw[t]=function(e){switch(h(e)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return b()&&u;case"p":case"P":case"s":switch(f){case 4:return Number;case 8:return b()&&u}}r("Unhandled DataView set wrapper for signature:",e)}(t)}));const n=/^[ipPsjfdcC]$/,s=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;e.sigCheck=function(e,t,i,o){Object.prototype.hasOwnProperty.call(e,i)&&r(e.structName,"already has a property named",i+"."),n.test(o)||s.test(o)||r("Malformed signature for",y(e.structName,t)+":",o)}}const o=t.memberKey(n);e.sigCheck(t.prototype,n,o,i.signature),i.key=o,i.name=n;const l=h(i.signature),c=y(t.prototype.structName,o),d=t.prototype.debugFlags.__flags,p=Object.create(null);var q,v;p.configurable=!1,p.enumerable=!1,p.get=function(){d.getter&&a("debug.getter:",e._.getters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof);let t=new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.getters[l]](0,m);return d.getter&&a("debug.getter:",c,"result =",t),t},i.readOnly?p.set=(q=t.prototype.structName,v=o,()=>r(y(q,v),"is read-only.")):p.set=function(t){if(d.setter&&a("debug.setter:",e._.setters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof,t),this.pointer||r("Cannot set struct property on disposed instance."),null===t)t=0;else for(;!R(t);){if("P"===i.signature&&t instanceof D){t=t.pointer||0,d.setter&&a("debug.setter:",c,"resolved to",t);break}r("Invalid value for pointer-type",c+".")}new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.setters[l]](0,e._.sw[l](t),m)},Object.defineProperty(t.prototype,o,p)},j=function e(t,s){1===arguments.length?t=(s=t).name:s.name||(s.name=t),t||r("Struct name is required.");let i=!1;Object.keys(s.members).forEach((e=>{const n=s.members[e];n.sizeof?1===n.sizeof?"c"===n.signature||"C"===n.signature||r("Unexpected sizeof==1 member",y(s.name,e),"with signature",n.signature):(0!=n.sizeof%4&&(console.warn("Invalid struct member description =",n,"from",s),r(t,"member",e,"sizeof is not aligned. sizeof="+n.sizeof)),0!=n.offset%4&&(console.warn("Invalid struct member description =",n,"from",s),r(t,"member",e,"offset is not aligned. offset="+n.offset))):r(t,"member",e,"is missing sizeof."),(!i||i.offsete instanceof a)),memberKey:A,memberKeys:k,methodInfoForKey:E((function(e){})),structInfo:E(s),structName:E(t)}),a.prototype=new D(t,s,E),Object.defineProperties(a.prototype,{debugFlags:o,constructor:E(a)}),Object.keys(s.members).forEach((e=>M(a,e,s.members[e]))),a};return j.StructType=D,j.config=t,j.allocCString=N,j.debugFlags||(j.debugFlags=n.__makeDebugFlags(n.debugFlags)),j},globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...e)=>{throw new Error(e.join(" "))},r=(e.SQLite3Error.toss,e.capi),n=e.wasm,s=e.util;if(globalThis.WhWasmUtilInstaller(n),delete globalThis.WhWasmUtilInstaller,n.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new n.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:e=>{let t;return(s,i,o,a)=>{try{const r=n.cArgvToJs(i,o);return t||(t=n.cArgvToJs(i,a)),0|e(r,t)}catch(e){return e.resultCode||r.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_codes","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_progress_handler",void 0,["sqlite3*","int",new n.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_set_authorizer","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(e,t)=>e[0],callProxy:e=>(t,s,i,o,a,l)=>{try{return i=i&&n.cstrToJs(i),o=o&&n.cstrToJs(o),a=a&&n.cstrToJs(a),l=l&&n.cstrToJs(l),e(t,s,i,o,a,l)||0}catch(e){return e.resultCode||r.SQLITE_ERROR}}}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*",new n.xWrap.FuncPtrAdapter({name:"xDestroyAuxData",signature:"v(*)",contextKey:(e,t)=>e[0]})]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_isexplain","int",["sqlite3_stmt*"]],["sqlite3_stmt_readonly","int",["sqlite3_stmt*"]],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new n.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],n.exports.sqlite3_activate_see instanceof Function&&n.bindingSignatures.push(["sqlite3_key","int","sqlite3*","string","int"],["sqlite3_key_v2","int","sqlite3*","string","*","int"],["sqlite3_rekey","int","sqlite3*","string","int"],["sqlite3_rekey_v2","int","sqlite3*","string","*","int"],["sqlite3_activate_see",void 0,"string"]),n.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:e=>e[0],callProxy:e=>(t,r,s,i,o,a,l)=>{e(t,r,s,n.cstrToJs(i),n.cstrToJs(o),a,l)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:e=>e[0],callProxy:e=>(t,r,s,i,o)=>{e(t,r,n.cstrToJs(s),n.cstrToJs(i),o)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]],n.bigIntEnabled&&n.exports.sqlite3changegroup_add){const e={signature:"i(ps)",callProxy:e=>(t,s)=>{try{return 0|e(t,n.cstrToJs(s))}catch(e){return e.resultCode||r.SQLITE_ERROR}}};n.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new n.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xFilter",...e,contextKey:(e,t)=>e[0]}),"*"]])}n.bindingSignatures.wasm=[["sqlite3_wasm_db_reset","int","sqlite3*"],["sqlite3_wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3_wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3_wasm_posix_create_file","int","string","*","int"],["sqlite3_wasm_vfs_unlink","int","sqlite3_vfs*","string"]],e.StructBinder=globalThis.Jaccwabyt({heap:n.heap8u,alloc:n.alloc,dealloc:n.dealloc,bigIntEnabled:n.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const i=n.xWrap.argAdapter("string");n.xWrap.argAdapter("string:flexible",(e=>i(s.flexibleString(e)))),n.xWrap.argAdapter("string:static",function(e){return n.isPtr(e)?e:this[e=""+e]||(this[e]=n.allocCString(e))}.bind(Object.create(null)));const o=n.xWrap.argAdapter("*"),a=function(){};n.xWrap.argAdapter("sqlite3_filename",o)("sqlite3_context*",o)("sqlite3_value*",o)("void*",o)("sqlite3_changegroup*",o)("sqlite3_changeset_iter*",o)("sqlite3_session*",o)("sqlite3_stmt*",(t=>o(t instanceof(e?.oo1?.Stmt||a)?t.pointer:t)))("sqlite3*",(t=>o(t instanceof(e?.oo1?.DB||a)?t.pointer:t)))("sqlite3_index_info*",(e=>o(e instanceof(r.sqlite3_index_info||a)?e.pointer:e)))("sqlite3_module*",(e=>o(e instanceof(r.sqlite3_module||a)?e.pointer:e)))("sqlite3_vfs*",(t=>"string"==typeof t?r.sqlite3_vfs_find(t)||e.SQLite3Error.toss(r.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",t):o(t instanceof(r.sqlite3_vfs||a)?t.pointer:t)));const l=n.xWrap.resultAdapter("*");n.xWrap.resultAdapter("sqlite3*",l)("sqlite3_context*",l)("sqlite3_stmt*",l)("sqlite3_value*",l)("sqlite3_vfs*",l)("void*",l),0===n.exports.sqlite3_step.length&&(n.xWrap.doArgcCheck=!1,e.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const e of n.bindingSignatures)r[e[0]]=n.xWrap.apply(null,e);for(const e of n.bindingSignatures.wasm)n[e[0]]=n.xWrap.apply(null,e);const c=function(e){return()=>t(e+"() is unavailable due to lack","of BigInt support in this build.")};for(const e of n.bindingSignatures.int64)r[e[0]]=n.bigIntEnabled?n.xWrap.apply(null,e):c(e[0]);if(delete n.bindingSignatures,n.exports.sqlite3_wasm_db_error){const t=n.xWrap("sqlite3_wasm_db_error","int","sqlite3*","int","string");s.sqlite3_wasm_db_error=function(n,s,i){return s instanceof e.WasmAllocError?(s=r.SQLITE_NOMEM,i=0):s instanceof Error&&(i=i||""+s,s=s.resultCode||r.SQLITE_ERROR),n?t(n,s,i):s}}else s.sqlite3_wasm_db_error=function(e,t,r){return console.warn("sqlite3_wasm_db_error() is not exported.",arguments),t}}{const i=n.xCall("sqlite3_wasm_enum_json");i||t("Maintenance required: increase sqlite3_wasm_enum_json()'s","static buffer size!"),n.ctype=JSON.parse(n.cstrToJs(i));const o=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];n.bigIntEnabled&&o.push("serialize","session","vtab");for(const e of o)for(const t of Object.entries(n.ctype[e]))r[t[0]]=t[1];n.functionEntry(r.SQLITE_WASM_DEALLOC)||t("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+r.SQLITE_WASM_DEALLOC+").");const a=Object.create(null);for(const e of["resultCodes"])for(const t of Object.entries(n.ctype[e]))a[t[1]]=t[0];r.sqlite3_js_rc_str=e=>a[e];const l=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!s.isUIThread(),sqlite3_index_info:!n.bigIntEnabled,sqlite3_index_constraint:!n.bigIntEnabled,sqlite3_index_orderby:!n.bigIntEnabled,sqlite3_index_constraint_usage:!n.bigIntEnabled});for(const t of n.ctype.structs)l[t.name]||(r[t.name]=e.StructBinder(t));if(r.sqlite3_index_info){for(const e of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])r.sqlite3_index_info[e]=r[e],delete r[e];r.sqlite3_vtab_config=n.xWrap("sqlite3_wasm_vtab_config","int",["sqlite3*","int","int"])}}const i=(e,t,n)=>s.sqlite3_wasm_db_error(e,r.SQLITE_MISUSE,t+"() requires "+n+" argument"+(1===n?"":"s")+"."),o=e=>s.sqlite3_wasm_db_error(e,r.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),a=e=>n.xWrap.argAdapter("sqlite3*")(e),l=e=>n.isPtr(e)?n.cstrToJs(e):e,c=function(e,t){e=a(e);let r=this.dbMap.get(e);return t?(!r&&t>0&&this.dbMap.set(e,r=Object.create(null)),r):(this.dbMap.delete(e),r)}.bind(Object.assign(Object.create(null),{dbMap:new Map}));c.addCollation=function(e,t){const r=c(e,1);r.collation||(r.collation=new Set),r.collation.add(l(t).toLowerCase())},c._addUDF=function(e,t,r,n){t=l(t).toLowerCase();let s=n.get(t);s||n.set(t,s=new Set),s.add(r<0?-1:r)},c.addFunction=function(e,t,r){const n=c(e,1);n.udf||(n.udf=new Map),this._addUDF(e,t,r,n.udf)},c.addWindowFunc=function(e,t,r){const n=c(e,1);n.wudf||(n.wudf=new Map),this._addUDF(e,t,r,n.wudf)},c.cleanup=function(e){const t=[e=a(e)];for(const e of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const s=n.exports[e];t.length=s.length;try{r[e](...t)}catch(r){console.warn("close-time call of",e+"(",t,") threw:",r)}}const s=c(e,0);if(!s)return;if(s.collation){for(const t of s.collation)try{r.sqlite3_create_collation_v2(e,t,r.SQLITE_UTF8,0,0,0)}catch(e){}delete s.collation}let i;for(i=0;i<2;++i){const t=i?s.wudf:s.udf;if(!t)continue;const n=i?r.sqlite3_create_window_function:r.sqlite3_create_function_v2;for(const s of t){const t=s[0],o=s[1],a=[e,t,0,r.SQLITE_UTF8,0,0,0,0,0];i&&a.push(0);for(const e of o)try{a[2]=e,n.apply(null,a)}catch(e){}o.clear()}t.clear()}delete s.udf,delete s.wudf};{const e=n.xWrap("sqlite3_close_v2","int","sqlite3*");r.sqlite3_close_v2=function(t){if(1!==arguments.length)return i(t,"sqlite3_close_v2",1);if(t)try{c.cleanup(t)}catch(e){}return e(t)}}if(r.sqlite3session_table_filter){const e=n.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);r.sqlite3session_delete=function(t){if(1!==arguments.length)return i(pDb,"sqlite3session_delete",1);t&&r.sqlite3session_table_filter(t,0,0),e(t)}}{const e=(e,t)=>"argv["+t+"]:"+e[0]+":"+n.cstrToJs(e[1]).toLowerCase(),t=n.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new n.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:e}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:e})]);r.sqlite3_create_collation_v2=function(e,n,a,l,_,u){if(6!==arguments.length)return i(e,"sqlite3_create_collation_v2",6);if(15&a){if(r.SQLITE_UTF8!==(15&a))return o(e)}else a|=r.SQLITE_UTF8;try{const r=t(e,n,a,l,_,u);return 0===r&&_ instanceof Function&&c.addCollation(e,n),r}catch(t){return s.sqlite3_wasm_db_error(e,t)}},r.sqlite3_create_collation=(e,t,n,s,o)=>5===arguments.length?r.sqlite3_create_collation_v2(e,t,n,s,o,0):i(e,"sqlite3_create_collation",5)}{const e=function(e,t){return e[0]+":"+(e[2]<0?-1:e[2])+":"+t+":"+n.cstrToJs(e[1]).toLowerCase()},t=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,n,s)=>{try{e(t,...r.sqlite3_values_to_js(n,s))}catch(e){r.sqlite3_result_error_js(t,e)}}},xFinalAndValue:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{r.sqlite3_result_js(t,e(t))}catch(e){r.sqlite3_result_error_js(t,e)}}},xFunc:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,n,s)=>{try{r.sqlite3_result_js(t,e(t,...r.sqlite3_values_to_js(n,s)))}catch(e){r.sqlite3_result_error_js(t,e)}}},xDestroy:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{e(t)}catch(e){console.error("UDF xDestroy method threw:",e)}}}}),a=n.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new n.xWrap.FuncPtrAdapter({name:"xFunc",...t.xFunc}),new n.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]),l=n.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new n.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xValue",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xInverse",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]);r.sqlite3_create_function_v2=function e(t,n,l,_,u,d,f,p,m){if(e.length!==arguments.length)return i(t,"sqlite3_create_function_v2",e.length);if(15&_){if(r.SQLITE_UTF8!==(15&_))return o(t)}else _|=r.SQLITE_UTF8;try{const e=a(t,n,l,_,u,d,f,p,m);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function)&&c.addFunction(t,n,l),e}catch(e){return console.error("sqlite3_create_function_v2() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},r.sqlite3_create_function=function e(t,n,s,o,a,l,c,_){return e.length===arguments.length?r.sqlite3_create_function_v2(t,n,s,o,a,l,c,_,0):i(t,"sqlite3_create_function",e.length)},r.sqlite3_create_window_function=function e(t,n,a,_,u,d,f,p,m,h){if(e.length!==arguments.length)return i(t,"sqlite3_create_window_function",e.length);if(15&_){if(r.SQLITE_UTF8!==(15&_))return o(t)}else _|=r.SQLITE_UTF8;try{const e=l(t,n,a,_,u,d,f,p,m,h);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function||h instanceof Function)&&c.addWindowFunc(t,n,a),e}catch(e){return console.error("sqlite3_create_window_function() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},r.sqlite3_create_function_v2.udfSetResult=r.sqlite3_create_function.udfSetResult=r.sqlite3_create_window_function.udfSetResult=r.sqlite3_result_js,r.sqlite3_create_function_v2.udfConvertArgs=r.sqlite3_create_function.udfConvertArgs=r.sqlite3_create_window_function.udfConvertArgs=r.sqlite3_values_to_js,r.sqlite3_create_function_v2.udfSetError=r.sqlite3_create_function.udfSetError=r.sqlite3_create_window_function.udfSetError=r.sqlite3_result_error_js}{const e=(e,t)=>("string"==typeof e?t=-1:s.isSQLableTypedArray(e)?(t=e.byteLength,e=s.typedArrayToString(e instanceof ArrayBuffer?new Uint8Array(e):e)):Array.isArray(e)&&(e=e.join(""),t=-1),[e,t]),t={basic:n.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:n.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};r.sqlite3_prepare_v3=function n(o,a,l,c,_,u){if(n.length!==arguments.length)return i(o,"sqlite3_prepare_v3",n.length);const[d,f]=e(a,l);switch(typeof d){case"string":return t.basic(o,d,f,c,_,null);case"number":return t.full(o,d,f,c,_,u);default:return s.sqlite3_wasm_db_error(o,r.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},r.sqlite3_prepare_v2=function e(t,n,s,o,a){return e.length===arguments.length?r.sqlite3_prepare_v3(t,n,s,0,o,a):i(t,"sqlite3_prepare_v2",e.length)}}{const e=n.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),t=n.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);r.sqlite3_bind_text=function t(o,a,l,c,_){if(t.length!==arguments.length)return i(r.sqlite3_db_handle(o),"sqlite3_bind_text",t.length);if(n.isPtr(l)||null===l)return e(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(pMem)&&(l=pMem.join(""));try{if(s.isSQLableTypedArray(l))u=n.allocFromTypedArray(l),d=l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");[u,d]=n.allocCString(l)}return e(o,a,u,d,r.SQLITE_WASM_DEALLOC)}catch(e){return n.dealloc(u),s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),e)}},r.sqlite3_bind_blob=function e(o,a,l,c,_){if(e.length!==arguments.length)return i(r.sqlite3_db_handle(o),"sqlite3_bind_blob",e.length);if(n.isPtr(l)||null===l)return t(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(l)&&(l=l.join(""));try{if(s.isBindableTypedArray(l))u=n.allocFromTypedArray(l),d=c>=0?c:l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");[u,d]=n.allocCString(l)}return t(o,a,u,d,r.SQLITE_WASM_DEALLOC)}catch(e){return n.dealloc(u),s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),e)}}}r.sqlite3_config=function(e,...t){if(arguments.length<2)return r.SQLITE_MISUSE;switch(e){case r.SQLITE_CONFIG_COVERING_INDEX_SCAN:case r.SQLITE_CONFIG_MEMSTATUS:case r.SQLITE_CONFIG_SMALL_MALLOC:case r.SQLITE_CONFIG_SORTERREF_SIZE:case r.SQLITE_CONFIG_STMTJRNL_SPILL:case r.SQLITE_CONFIG_URI:return n.exports.sqlite3_wasm_config_i(e,t[0]);case r.SQLITE_CONFIG_LOOKASIDE:return n.exports.sqlite3_wasm_config_ii(e,t[0],t[1]);case r.SQLITE_CONFIG_MEMDB_MAXSIZE:return n.exports.sqlite3_wasm_config_j(e,t[0]);case r.SQLITE_CONFIG_GETMALLOC:case r.SQLITE_CONFIG_GETMUTEX:case r.SQLITE_CONFIG_GETPCACHE2:case r.SQLITE_CONFIG_GETPCACHE:case r.SQLITE_CONFIG_HEAP:case r.SQLITE_CONFIG_LOG:case r.SQLITE_CONFIG_MALLOC:case r.SQLITE_CONFIG_MMAP_SIZE:case r.SQLITE_CONFIG_MULTITHREAD:case r.SQLITE_CONFIG_MUTEX:case r.SQLITE_CONFIG_PAGECACHE:case r.SQLITE_CONFIG_PCACHE2:case r.SQLITE_CONFIG_PCACHE:case r.SQLITE_CONFIG_PCACHE_HDRSZ:case r.SQLITE_CONFIG_PMASZ:case r.SQLITE_CONFIG_SERIALIZED:case r.SQLITE_CONFIG_SINGLETHREAD:case r.SQLITE_CONFIG_SQLLOG:case r.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return r.SQLITE_NOTFOUND}};{const e=new Set;r.sqlite3_auto_extension=function(t){if(t instanceof Function)t=n.installFunction("i(ppp)",t);else if(1!==arguments.length||!n.isPtr(t))return r.SQLITE_MISUSE;const s=n.exports.sqlite3_auto_extension(t);return t!==arguments[0]&&(0===s?e.add(t):n.uninstallFunction(t)),s},r.sqlite3_cancel_auto_extension=function(e){return e&&1===arguments.length&&n.isPtr(e)?n.exports.sqlite3_cancel_auto_extension(e):0},r.sqlite3_reset_auto_extension=function(){n.exports.sqlite3_reset_auto_extension();for(const t of e)n.uninstallFunction(t);e.clear()}}const _=r.sqlite3_vfs_find("kvvfs");if(_)if(s.isUIThread()){const e=new r.sqlite3_kvvfs_methods(n.exports.sqlite3_wasm_kvvfs_methods());delete r.sqlite3_kvvfs_methods;const t=n.exports.sqlite3_wasm_kvvfsMakeKeyOnPstack,s=n.pstack,i=e=>115===n.peek(e)?sessionStorage:localStorage,o={xRead:(e,r,o,a)=>{const l=s.pointer,c=n.scopedAllocPush();try{const s=t(e,r);if(!s)return-3;const l=n.cstrToJs(s),c=i(e).getItem(l);if(!c)return-1;const _=c.length;if(a<=0)return _;if(1===a)return n.poke(o,0),_;const u=n.scopedAllocCString(c);return a>_+1&&(a=_+1),n.heap8u().copyWithin(o,u,u+a-1),n.poke(o+a-1,0),a-1}catch(e){return console.error("kvstorageRead()",e),-2}finally{s.restore(l),n.scopedAllocPop(c)}},xWrite:(e,o,a)=>{const l=s.pointer;try{const r=t(e,o);if(!r)return 1;const s=n.cstrToJs(r);return i(e).setItem(s,n.cstrToJs(a)),0}catch(e){return console.error("kvstorageWrite()",e),r.SQLITE_IOERR}finally{s.restore(l)}},xDelete:(e,o)=>{const a=s.pointer;try{const r=t(e,o);return r?(i(e).removeItem(n.cstrToJs(r)),0):1}catch(e){return console.error("kvstorageDelete()",e),r.SQLITE_IOERR}finally{s.restore(a)}}};for(const t of Object.keys(o))e[e.memberKey(t)]=n.installFunction(e.memberSignature(t),o[t])}else r.sqlite3_vfs_unregister(_);n.xWrap.FuncPtrAdapter.warnOnUse=!0})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.version={libVersion:"3.44.2",libVersionNumber:3044002,sourceId:"2023-11-24 11:41:44 ebead0e7230cd33bcec9f95d2183069565b9e709bf745c9b5db65cc0cbf92c0f",downloadVersion:3440200}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...t)=>{throw new e.SQLite3Error(...t)},r=e.capi,n=e.wasm,s=e.util,i=new WeakMap,o=new WeakMap,a=(e,t,r)=>{const n=Object.getOwnPropertyDescriptor(e,t);return n?n.value:r},l=function(e,n){return n&&(e instanceof d&&(e=e.pointer),t(n,"sqlite3 result code",n+":",e?r.sqlite3_errmsg(e):r.sqlite3_errstr(n))),arguments[0]},c=n.installFunction("i(ippp)",function(e,t,s,i){r.SQLITE_TRACE_STMT===e&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+t+":",n.cstrToJs(i))}.bind({counter:0})),_=Object.create(null),u=function s(...a){if(!s._name2vfs){s._name2vfs=Object.create(null);const e="function"==typeof importScripts&&(e=>t("The VFS for",e,"is only available in the main window thread."));s._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:e||(()=>"local")},s._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:e||(()=>"session")}}const u=s.normalizeArgs(...a);let d=u.filename,f=u.vfs,p=u.flags;("string"!=typeof d&&"number"!=typeof d||"string"!=typeof p||f&&"string"!=typeof f&&"number"!=typeof f)&&(e.config.error("Invalid DB ctor args",u,arguments),t("Invalid arguments for DB constructor."));let m="number"==typeof d?n.cstrToJs(d):d;const h=s._name2vfs[m];h&&(f=h.vfs,d=m=h.filename(m));let g,b=0;p.indexOf("c")>=0&&(b|=r.SQLITE_OPEN_CREATE|r.SQLITE_OPEN_READWRITE),p.indexOf("w")>=0&&(b|=r.SQLITE_OPEN_READWRITE),0===b&&(b|=r.SQLITE_OPEN_READONLY),b|=r.SQLITE_OPEN_EXRESCODE;const y=n.pstack.pointer;try{const e=n.pstack.allocPtr();let t=r.sqlite3_open_v2(d,e,b,f||0);g=n.peekPtr(e),l(g,t),r.sqlite3_extended_result_codes(g,1),p.indexOf("t")>=0&&r.sqlite3_trace_v2(g,r.SQLITE_TRACE_STMT,c,g)}catch(e){throw g&&r.sqlite3_close_v2(g),e}finally{n.pstack.restore(y)}this.filename=m,i.set(this,g),o.set(this,Object.create(null));try{const n=r.sqlite3_js_db_vfs(g);n||t("Internal error: cannot get VFS for new db handle.");const s=_[n];s instanceof Function?s(this,e):s&&l(g,r.sqlite3_exec(g,s,0,0,0))}catch(e){throw this.close(),e}};u.setVfsPostOpenSql=function(e,t){_[e]=t},u.normalizeArgs=function(e=":memory:",t="c",r=null){const n={};return 1===arguments.length&&arguments[0]&&"object"==typeof arguments[0]?(Object.assign(n,arguments[0]),void 0===n.flags&&(n.flags="c"),void 0===n.vfs&&(n.vfs=null),void 0===n.filename&&(n.filename=":memory:")):(n.filename=e,n.flags=t,n.vfs=r),n};const d=function(...e){u.apply(this,e)};d.dbCtorHelper=u;const f={null:1,number:2,string:3,boolean:4,blob:5};f[void 0],f.null,n.bigIntEnabled&&(f.bigint=f.number);const p=function(){f!==arguments[2]&&t(r.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],i.set(this,arguments[1]),this.parameterCount=r.sqlite3_bind_parameter_count(this.pointer)},m=function(e){return e.pointer||t("DB has been closed."),e},h=function(e,r){return(r!==(0|r)||r<0||r>=e.columnCount)&&t("Column index",r,"is out of range."),e},g=(e,t,r,...n)=>{const s=e.prepare(t);try{const e=s.bind(r).step()?s.get(...n):void 0;return s.reset(),e}finally{s.finalize()}},b=(e,t,r,n)=>e.exec({sql:t,bind:r,rowMode:n,returnValue:"resultRows"});d.checkRc=(e,t)=>l(e,t),d.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return m(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch(e){}const e=this.pointer;if(Object.keys(o.get(this)).forEach(((e,t)=>{if(t&&t.pointer)try{t.finalize()}catch(e){}})),i.delete(this),o.delete(this),r.sqlite3_close_v2(e),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch(e){}delete this.filename}},changes:function(e=!1,t=!1){const n=m(this).pointer;return e?t?r.sqlite3_total_changes64(n):r.sqlite3_total_changes(n):t?r.sqlite3_changes64(n):r.sqlite3_changes(n)},dbFilename:function(e="main"){return r.sqlite3_db_filename(m(this).pointer,e)},dbName:function(e=0){return r.sqlite3_db_name(m(this).pointer,e)},dbVfsName:function(e=0){let t;const s=r.sqlite3_js_db_vfs(m(this).pointer,e);if(s){const e=new r.sqlite3_vfs(s);try{t=n.cstrToJs(e.$zName)}finally{e.dispose()}}return t},prepare:function(e){m(this);const s=n.pstack.pointer;let i,a;try{i=n.pstack.alloc(8),d.checkRc(this,r.sqlite3_prepare_v2(this.pointer,e,-1,i,null)),a=n.peekPtr(i)}finally{n.pstack.restore(s)}a||t("Cannot prepare empty SQL.");const l=new p(this,a,f);return o.get(this)[a]=l,l},exec:function(){m(this);const e=function(e,n){const i=Object.create(null);switch(i.opt=Object.create(null),n.length){case 1:"string"==typeof n[0]||s.isSQLableTypedArray(n[0])||Array.isArray(n[0])?i.sql=n[0]:n[0]&&"object"==typeof n[0]&&(i.opt=n[0],i.sql=i.opt.sql);break;case 2:i.sql=n[0],i.opt=n[1];break;default:t("Invalid argument count for exec().")}i.sql=s.flexibleString(i.sql),"string"!=typeof i.sql&&t("Missing SQL argument or unsupported SQL value type.");const o=i.opt;switch(o.returnValue){case"resultRows":o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows;break;case"saveSql":o.saveSql||(o.saveSql=[]),i.returnVal=()=>o.saveSql;break;case void 0:case"this":i.returnVal=()=>e;break;default:t("Invalid returnValue value:",o.returnValue)}if(o.callback||o.returnValue||void 0===o.rowMode||(o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows),o.callback||o.resultRows)switch(void 0===o.rowMode?"array":o.rowMode){case"object":i.cbArg=e=>e.get(Object.create(null));break;case"array":i.cbArg=e=>e.get([]);break;case"stmt":Array.isArray(o.resultRows)&&t("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),i.cbArg=e=>e;break;default:if(s.isInt32(o.rowMode)){i.cbArg=e=>e.get(o.rowMode);break}if("string"==typeof o.rowMode&&o.rowMode.length>1&&"$"===o.rowMode[0]){const e=o.rowMode.substr(1);i.cbArg=n=>{const s=n.get(Object.create(null))[e];return void 0===s?t(r.SQLITE_NOTFOUND,"exec(): unknown result column:",e):s};break}t("Invalid rowMode:",o.rowMode)}return i}(this,arguments);if(!e.sql)return t("exec() requires an SQL string.");const i=e.opt,o=i.callback,a=Array.isArray(i.resultRows)?i.resultRows:void 0;let l,c=i.bind,_=!!(e.cbArg||i.columnNames||a);const u=n.scopedAllocPush(),h=Array.isArray(i.saveSql)?i.saveSql:void 0;try{const t=s.isSQLableTypedArray(e.sql);let u=t?e.sql.byteLength:n.jstrlen(e.sql);const m=n.scopedAlloc(2*n.ptrSizeof+(u+1)),g=m+n.ptrSizeof;let b=g+n.ptrSizeof;const y=b+u;for(t?n.heap8().set(e.sql,b):n.jstrcpy(e.sql,n.heap8(),b,u,!1),n.poke(b+u,0);b&&n.peek(b,"i8");){n.pokePtr([m,g],0),d.checkRc(this,r.sqlite3_prepare_v3(this.pointer,b,u,0,m,g));const t=n.peekPtr(m);if(b=n.peekPtr(g),u=y-b,t){if(h&&h.push(r.sqlite3_sql(t).trim()),l=new p(this,t,f),c&&l.parameterCount&&(l.bind(c),c=null),_&&l.columnCount){let t=Array.isArray(i.columnNames)?0:1;if(_=!1,e.cbArg||a){for(;l.step();l._lockedByExec=!1){0==t++&&l.getColumnNames(i.columnNames),l._lockedByExec=!0;const r=e.cbArg(l);if(a&&a.push(r),o&&!1===o.call(i,r,l))break}l._lockedByExec=!1}0===t&&l.getColumnNames(i.columnNames)}else l.step();l.reset().finalize(),l=null}}}finally{n.scopedAllocPop(u),l&&(delete l._lockedByExec,l.finalize())}return e.returnVal()},createFunction:function(e,n,i){const o=e=>e instanceof Function;switch(arguments.length){case 1:e=(i=e).name,n=i.xFunc||0;break;case 2:o(n)||(n=(i=n).xFunc||0)}i||(i={}),"string"!=typeof e&&t("Invalid arguments: missing function name.");let l=i.xStep||0,c=i.xFinal||0;const _=i.xValue||0,u=i.xInverse||0;let f;o(n)?(f=!1,(o(l)||o(c))&&t("Ambiguous arguments: scalar or aggregate?"),l=c=null):o(l)?(o(c)||t("Missing xFinal() callback for aggregate or window UDF."),n=null):o(c)?t("Missing xStep() callback for aggregate or window UDF."):t("Missing function-type properties."),!1===f?(o(_)||o(u))&&t("xValue and xInverse are not permitted for non-window UDFs."):o(_)?(o(u)||t("xInverse must be provided if xValue is."),f=!0):o(u)&&t("xValue must be provided if xInverse is.");const p=i.pApp;null==p||"number"==typeof p&&s.isInt32(p)||t("Invalid value for pApp property. Must be a legal WASM pointer value.");const m=i.xDestroy||0;m&&!o(m)&&t("xDestroy property must be a function.");let h=0;a(i,"deterministic")&&(h|=r.SQLITE_DETERMINISTIC),a(i,"directOnly")&&(h|=r.SQLITE_DIRECTONLY),a(i,"innocuous")&&(h|=r.SQLITE_INNOCUOUS),e=e.toLowerCase();const g=n||l,b=a(i,"arity"),y="number"==typeof b?b:g.length?g.length-1:0;let q;return q=f?r.sqlite3_create_window_function(this.pointer,e,y,r.SQLITE_UTF8|h,p||0,l,c,_,u,m):r.sqlite3_create_function_v2(this.pointer,e,y,r.SQLITE_UTF8|h,p||0,n,l,c,m),d.checkRc(this,q),this},selectValue:function(e,t,r){return g(this,e,t,0,r)},selectValues:function(e,t,r){const n=this.prepare(e),s=[];try{for(n.bind(t);n.step();)s.push(n.get(0,r));n.reset()}finally{n.finalize()}return s},selectArray:function(e,t){return g(this,e,t,[])},selectObject:function(e,t){return g(this,e,t,{})},selectArrays:function(e,t){return b(this,e,t,"array")},selectObjects:function(e,t){return b(this,e,t,"object")},openStatementCount:function(){return this.pointer?Object.keys(o.get(this)).length:0},transaction:function(e){let n="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&t(r.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),n+=" "+arguments[0],e=arguments[1]),m(this).exec(n);try{const t=e(this);return this.exec("COMMIT"),t}catch(e){throw this.exec("ROLLBACK"),e}},savepoint:function(e){m(this).exec("SAVEPOINT oo1");try{const t=e(this);return this.exec("RELEASE oo1"),t}catch(e){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),e}},checkRc:function(e){return l(this,e)}};const y=function(e){return e.pointer||t("Stmt has been closed."),e},q=function(e){return function(e){let t=f[null==e?"null":typeof e];switch(t){case f.boolean:case f.null:case f.number:case f.string:return t;case f.bigint:if(n.bigIntEnabled)return t;default:return s.isBindableTypedArray(e)?f.blob:void 0}}(e)||t("Unsupported bind() argument type:",typeof e)},v=function(e,r){return e._lockedByExec&&t("Operation is illegal when statement is locked:",r),e},w=function i(o,a,l,c){v(y(o),"bind()"),i._||(i._tooBigInt=e=>t("BigInt value is too big to store without precision loss:",e),i._={string:function(e,t,s,i){const[o,a]=n.allocCString(s,!0);return(i?r.sqlite3_bind_blob:r.sqlite3_bind_text)(e.pointer,t,o,a,r.SQLITE_WASM_DEALLOC)}}),q(c),a=function(e,n){const i="number"==typeof n?n:r.sqlite3_bind_parameter_index(e.pointer,n);return 0!==i&&s.isInt32(i)?(i<1||i>e.parameterCount)&&t("Bind index",n,"is out of range."):t("Invalid bind() parameter name: "+n),i}(o,a);let _=0;switch(null==c?f.null:l){case f.null:_=r.sqlite3_bind_null(o.pointer,a);break;case f.string:_=i._.string(o,a,c,!1);break;case f.number:{let e;s.isInt32(c)?e=r.sqlite3_bind_int:"bigint"==typeof c?s.bigIntFits64(c)?n.bigIntEnabled?e=r.sqlite3_bind_int64:s.bigIntFitsDouble(c)?(c=Number(c),e=r.sqlite3_bind_double):i._tooBigInt(c):i._tooBigInt(c):(c=Number(c),e=n.bigIntEnabled&&Number.isInteger(c)?r.sqlite3_bind_int64:r.sqlite3_bind_double),_=e(o.pointer,a,c);break}case f.boolean:_=r.sqlite3_bind_int(o.pointer,a,c?1:0);break;case f.blob:{if("string"==typeof c){_=i._.string(o,a,c,!0);break}c instanceof ArrayBuffer?c=new Uint8Array(c):s.isBindableTypedArray(c)||t("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const e=n.alloc(c.byteLength||1);n.heap8().set(c.byteLength?c:[0],e),_=r.sqlite3_bind_blob(o.pointer,a,e,c.byteLength,r.SQLITE_WASM_DEALLOC);break}default:e.config.warn("Unsupported bind() argument type:",c),t("Unsupported bind() argument type: "+typeof c)}return _&&d.checkRc(o.db.pointer,_),o._mayGet=!1,o};p.prototype={finalize:function(){if(this.pointer){v(this,"finalize()");const e=r.sqlite3_finalize(this.pointer);return delete o.get(this.db)[this.pointer],i.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,e}},clearBindings:function(){return v(y(this),"clearBindings()"),r.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(e){v(this,"reset()"),e&&this.clearBindings();const t=r.sqlite3_reset(y(this).pointer);return this._mayGet=!1,l(this.db,t),this},bind:function(){let e,r;switch(y(this),arguments.length){case 1:e=1,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:t("Invalid bind() arguments.")}return void 0===r?this:(this.parameterCount||t("This statement has no bindable parameters."),this._mayGet=!1,null===r?w(this,e,f.null,r):Array.isArray(r)?(1!==arguments.length&&t("When binding an array, an index argument is not permitted."),r.forEach(((e,t)=>w(this,t+1,q(e),e))),this):(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),"object"!=typeof r||s.isBindableTypedArray(r)?w(this,e,q(r),r):(1!==arguments.length&&t("When binding an object, an index argument is not permitted."),Object.keys(r).forEach((e=>w(this,e,q(r[e]),r[e]))),this)))},bindAsBlob:function(e,r){y(this),1===arguments.length&&(r=e,e=1);const n=q(r);return f.string!==n&&f.blob!==n&&f.null!==n&&t("Invalid value type for bindAsBlob()"),w(this,e,f.blob,r)},step:function(){v(this,"step()");const t=r.sqlite3_step(y(this).pointer);switch(t){case r.SQLITE_DONE:return this._mayGet=!1;case r.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,e.config.warn("sqlite3_step() rc=",t,r.sqlite3_js_rc_str(t),"SQL =",r.sqlite3_sql(this.pointer)),d.checkRc(this.db.pointer,t)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const e=this.step();return this.reset(),e}finally{try{this.finalize()}catch(e){}}},get:function(e,i){if(y(this)._mayGet||t("Stmt.step() has not (recently) returned true."),Array.isArray(e)){let t=0;const r=this.columnCount;for(;t=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t).valueOf():t}{const n=r.sqlite3_column_double(this.pointer,e);return(n>Number.MAX_SAFE_INTEGER||nt("The pointer property is read-only.")};Object.defineProperty(p.prototype,"pointer",e),Object.defineProperty(d.prototype,"pointer",e)}if(Object.defineProperty(p.prototype,"columnCount",{enumerable:!1,get:function(){return r.sqlite3_column_count(this.pointer)},set:()=>t("The columnCount property is read-only.")}),e.oo1={DB:d,Stmt:p},s.isUIThread()){e.oo1.JsStorageDb=function(e="session"){"session"!==e&&"local"!==e&&t("JsStorageDb db name must be one of 'session' or 'local'."),u.call(this,{filename:e,flags:"c",vfs:"kvvfs"})};const n=e.oo1.JsStorageDb;n.prototype=Object.create(d.prototype),n.clearStorage=r.sqlite3_js_kvvfs_clear,n.prototype.clearStorage=function(){return n.clearStorage(m(this).filename)},n.storageSize=r.sqlite3_js_kvvfs_size,n.prototype.storageSize=function(){return n.storageSize(m(this).filename)}}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.initWorker1API=function(){const e=(...e)=>{throw new Error(e.join(" "))};globalThis.WorkerGlobalScope instanceof Function||e("initWorker1API() must be run from a Worker thread.");const t=this.sqlite3||e("Missing this.sqlite3 object."),r=t.oo1.DB,n=function(e){let t=s.idMap.get(e);return t||(t="db#"+ ++s.idSeq+"@"+e.pointer,s.idMap.set(e,t),t)},s={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(e){const t=new r(e);return this.dbs[n(t)]=t,this.dbList.indexOf(t)<0&&this.dbList.push(t),t},close:function(e,r){if(e){delete this.dbs[n(e)];const s=e.filename,i=t.wasm.sqlite3_wasm_db_vfs(e.pointer,0);e.close();const o=this.dbList.indexOf(e);o>=0&&this.dbList.splice(o,1),r&&s&&i&&t.wasm.sqlite3_wasm_vfs_unlink(i,s)}},post:function(e,t){t&&t.length?(globalThis.postMessage(e,Array.from(t)),t.length=0):globalThis.postMessage(e)},dbs:Object.create(null),getDb:function(t,r=!0){return this.dbs[t]||(r?e("Unknown (or closed) DB ID:",t):void 0)}},i=function(t,r=!0){const n=s.getDb(t.dbId,!1)||s.dbList[0];return r?function(t=s.dbList[0]){return t&&t.pointer?t:e("DB is not opened.")}(n):n},o={open:function(r){const i=Object.create(null),o=r.args||Object.create(null);o.simulateError&&e("Throwing because of simulateError flag.");const a=Object.create(null);let l,c;var _;if(i.vfs=o.vfs,""===(_=o.filename)||":"===_[0]?i.filename=o.filename||"":(i.filename=o.filename,l=o.byteArray,l&&(c=function(e){const r=/^file:.+(vfs=(\w+))/.exec(e);return t.capi.sqlite3_vfs_find(r?r[2]:0)}(o.filename))),c){let e;try{e=t.wasm.allocFromTypedArray(l);const r=t.wasm.sqlite3_wasm_vfs_create_file(c,i.filename,e,l.byteLength);r&&t.SQLite3Error.toss(r)}catch(e){throw new t.SQLite3Error(e.name+" creating "+o.filename+": "+e.message,{cause:e})}finally{e&&t.wasm.dealloc(e)}}const u=s.open(i);return a.filename=u.filename,a.persistent=!!t.capi.sqlite3_js_db_uses_vfs(u.pointer,"opfs"),a.dbId=n(u),a.vfs=u.dbVfsName(),a},close:function(e){const t=i(e,!1),r={filename:t&&t.filename};if(t){const r=!(!e.args||"object"!=typeof e.args||!e.args.unlink);s.close(t,r)}return r},exec:function(t){const r="string"==typeof t.args?{sql:t.args}:t.args||Object.create(null);"stmt"===r.rowMode?e("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):r.sql||e("'exec' requires input SQL.");const n=i(t);(r.callback||Array.isArray(r.resultRows))&&(n._blobXfer=s.xfer);const o=r.callback;let a=0;const l=!!r.columnNames;"string"==typeof o&&(l||(r.columnNames=[]),r.callback=function(e,t){s.post({type:o,columnNames:r.columnNames,rowNumber:++a,row:e},s.xfer)});try{const e=r.countChanges?n.changes(!0,64===r.countChanges):void 0;n.exec(r),void 0!==e&&(r.changeCount=n.changes(!0,64===r.countChanges)-e),r.callback instanceof Function&&(r.callback=o,s.post({type:o,columnNames:r.columnNames,rowNumber:null,row:void 0}))}finally{delete n._blobXfer,r.callback&&(r.callback=o)}return r},"config-get":function(){const e=Object.create(null),r=t.config;return["bigIntEnabled"].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)&&(e[t]=r[t])})),e.version=t.version,e.vfsList=t.capi.sqlite3_js_vfs_list(),e.opfsEnabled=!!t.opfs,e},export:function(e){const r=i(e),n={byteArray:t.capi.sqlite3_js_db_export(r.pointer),filename:r.filename,mimetype:"application/x-sqlite3"};return s.xfer.push(n.byteArray.buffer),n},toss:function(t){e("Testing worker exception")},"opfs-tree":async function(r){return t.opfs||e("OPFS support is unavailable."),await t.opfs.treeList()}};globalThis.onmessage=async function(t){let r,i=(t=t.data).dbId,a=t.type;const l=performance.now();try{o.hasOwnProperty(a)&&o[a]instanceof Function?r=await o[a](t):e("Unknown db worker message type:",t.type)}catch(e){a="error",r={operation:t.type,message:e.message,errorClass:e.name,input:t},e.stack&&(r.stack="string"==typeof e.stack?e.stack.split(/\n\s*/):e.stack)}i||(i=r.dbId||s.dbList[0]&&n(s.dbList[0])),s.post({type:a,dbId:i,messageId:t.messageId,workerReceivedTime:l,workerRespondTime:performance.now(),departureTime:t.departureTime,result:r},s.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}.bind({sqlite3:e})})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.wasm,r=e.capi,n=e.util.toss3,s=Object.create(null),i=Object.create(null),o=e.StructBinder;e.vfs=s,e.vtab=i;const a=r.sqlite3_index_info;a.prototype.nthConstraint=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const r=this.$aConstraint+a.sqlite3_index_constraint.structInfo.sizeof*e;return t?r:new a.sqlite3_index_constraint(r)},a.prototype.nthConstraintUsage=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const r=this.$aConstraintUsage+a.sqlite3_index_constraint_usage.structInfo.sizeof*e;return t?r:new a.sqlite3_index_constraint_usage(r)},a.prototype.nthOrderBy=function(e,t=!1){if(e<0||e>=this.$nOrderBy)return!1;const r=this.$aOrderBy+a.sqlite3_index_orderby.structInfo.sizeof*e;return t?r:new a.sqlite3_index_orderby(r)};const l=function e(r,s,i,a=e.installMethodArgcCheck){if(r instanceof o.StructType?i instanceof Function||t.isPtr(i)||n("Usage errror: expecting a Function or WASM pointer to one."):n("Usage error: target object is-not-a StructType."),1===arguments.length)return(t,n)=>e(r,t,n,a);e.argcProxy||(e.argcProxy=function(e,t,r,s){return function(...i){return r.length!==arguments.length&&n("Argument mismatch for",e.structInfo.name+"::"+t+": Native signature is:",s),r.apply(this,i)}},e.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach(((e,r)=>{if("number"==typeof e)try{t.uninstallFunction(e)}catch(e){}})),delete this.ondispose.__removeFuncList)});const l=r.memberSignature(s);l.length<2&&n("Member",s,"does not have a function pointer signature:",l);const c=r.memberKey(s),_=a&&!t.isPtr(i)?e.argcProxy(r,c,i,l):i;if(t.isPtr(_))_&&!t.functionEntry(_)&&n("Pointer",_,"is not a WASM function table entry."),r[c]=_;else{const n=t.installFunction(_,r.memberSignature(s,!0));r[c]=n,r.ondispose&&r.ondispose.__removeFuncList||(r.addOnDispose("ondispose.__removeFuncList handler",e.removeFuncList),r.ondispose.__removeFuncList=[]),r.ondispose.__removeFuncList.push(c,n)}return(t,n)=>e(r,t,n,a)};l.installMethodArgcCheck=!1;const c=function(e,t,r=l.installMethodArgcCheck){const n=new Map;for(const s of Object.keys(t)){const i=t[s],o=n.get(i);if(o){const t=e.memberKey(s);e[t]=e[e.memberKey(o)]}else l(e,s,i,r),n.set(i,s)}return e};o.StructType.prototype.installMethod=function(e,t,r=l.installMethodArgcCheck){return arguments.length<3&&e&&"object"==typeof e?c(this,...arguments):l(this,...arguments)},o.StructType.prototype.installMethods=function(e,t=l.installMethodArgcCheck){return c(this,e,t)},r.sqlite3_vfs.prototype.registerVfs=function(t=!1){this instanceof e.capi.sqlite3_vfs||n("Expecting a sqlite3_vfs-type argument.");const s=r.sqlite3_vfs_register(this,t?1:0);return s&&n("sqlite3_vfs_register(",this,") failed with rc",s),this.pointer!==r.sqlite3_vfs_find(this.$zName)&&n("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},s.installVfs=function(e){let r=0;const s=["io","vfs"];for(const n of s){const s=e[n];s&&(++r,c(s.struct,s.methods,!!s.applyArgcCheck),"vfs"===n&&(s.struct.$zName||"string"!=typeof s.name||s.struct.addOnDispose(s.struct.$zName=t.allocCString(s.name)),s.struct.registerVfs(!!s.asDefault)))}return r||n("Misuse: installVfs() options object requires at least","one of:",s),this};const _=function(r,n){const s=function(r,n){return function(s,i=!1){if(0===arguments.length&&(s=new n),s instanceof n)return this.set(s.pointer,s),s;t.isPtr(s)||e.SQLite3Error.toss("Invalid argument to",r+"()");let o=this.get(s);return i&&this.delete(s),o}.bind(new Map)}(r,n);return Object.assign(Object.create(null),{StructType:n,create:e=>{const r=s();return t.pokePtr(e,r.pointer),r},get:e=>s(e),unget:e=>s(e,!0),dispose:e=>{const t=s(e,!0);t&&t.dispose()}})};i.xVtab=_("xVtab",r.sqlite3_vtab),i.xCursor=_("xCursor",r.sqlite3_vtab_cursor),i.xIndexInfo=e=>new r.sqlite3_index_info(e),i.xError=function t(n,s,i){if(t.errorReporter instanceof Function)try{t.errorReporter("sqlite3_module::"+n+"(): "+s.message)}catch(e){}let o;return s instanceof e.WasmAllocError?o=r.SQLITE_NOMEM:arguments.length>2?o=i:s instanceof e.SQLite3Error&&(o=s.resultCode),o||r.SQLITE_ERROR},i.xError.errorReporter=console.error.bind(console),i.xRowid=(e,r)=>t.poke(e,r,"i64"),i.setupModule=function(s){let o=!1;const a=this instanceof r.sqlite3_module?this:s.struct||(o=new r.sqlite3_module);try{const r=s.methods||n("Missing 'methods' object.");for(const e of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const t=e[0],n=e[1];!0===r[t]?r[t]=r[n]:!0===r[n]&&(r[n]=r[t])}if(s.catchExceptions){const n=function(r,n){return["xConnect","xCreate"].indexOf(r)>=0?function(s,o,a,l,c,_){try{return n(...arguments)||0}catch(n){return n instanceof e.WasmAllocError||(t.dealloc(t.peekPtr(_)),t.pokePtr(_,t.allocCString(n.message))),i.xError(r,n)}}:function(...e){try{return n(...e)||0}catch(e){return i.xError(r,e)}}},s=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],o=Object.create(null);for(const e of s){const t=r[e];t instanceof Function&&("xConnect"===e&&r.xCreate===t?o[e]=r.xCreate:"xCreate"===e&&r.xConnect===t?o[e]=r.xConnect:o[e]=n(e,t))}c(a,o,!1)}else c(a,r,!!s.applyArgcCheck);if(0===a.$iVersion){let e;e="number"==typeof s.iVersion?s.iVersion:a.$xShadowName?3:a.$xSavePoint||a.$xRelease||a.$xRollbackTo?2:1,a.$iVersion=e}}catch(e){throw o&&o.dispose(),e}return a},r.sqlite3_module.prototype.setupModule=function(e){return i.setupModule.call(this,e)}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=function t(n){if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if("undefined"==typeof WorkerGlobalScope)return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!(globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&navigator?.storage?.getDirectory))return Promise.reject(new Error("Missing required OPFS APIs."));n&&"object"==typeof n||(n=Object.create(null));const s=new URL(globalThis.location.href).searchParams;if(s.has("opfs-disable"))return Promise.resolve(e);void 0===n.verbose&&(n.verbose=s.has("opfs-verbose")?+s.get("opfs-verbose")||2:1),void 0===n.sanityChecks&&(n.sanityChecks=s.has("opfs-sanity-check")),void 0===n.proxyUri&&(n.proxyUri=t.defaultProxyUri),"function"==typeof n.proxyUri&&(n.proxyUri=n.proxyUri());const i=new Promise((function(t,s){const i=[e.config.error,e.config.warn,e.config.log],o=(e,...t)=>{n.verbose>e&&i[e]("OPFS syncer:",...t)},a=(...e)=>o(2,...e),l=(...e)=>o(1,...e),c=(...e)=>o(0,...e),_=e.util.toss,u=e.capi,d=e.util,f=e.wasm,p=u.sqlite3_vfs,m=u.sqlite3_file,h=u.sqlite3_io_methods,g=Object.create(null);g.metrics={dump:function(){let t,r=0,n=0,s=0;for(t in x.opIds){const e=T[t];r+=e.count,n+=e.time,s+=e.wait,e.avgTime=e.count&&e.time?e.time/e.count:0,e.avgWait=e.count&&e.wait?e.wait/e.count:0}e.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",T,"\nTotal of",r,"op(s) for",n,"ms (incl. "+s+" ms of waiting on the async side)"),e.config.log("Serialization metrics:",T.s11n),E.postMessage({type:"opfs-async-metrics"})},reset:function(){let e;for(e in x.opIds)(t=T[e]=Object.create(null)).count=t.time=t.wait=0;var t;let r=T.s11n=Object.create(null);r=r.serialize=Object.create(null),r.count=r.time=0,r=T.s11n.deserialize=Object.create(null),r.count=r.time=0}};const b=new h,y=(new p).addOnDispose((()=>b.dispose()));let q;const v=e=>(q=!0,y.dispose(),s(e)),w=()=>(q=!1,t(e)),E=new Worker(new URL(r.p+r.u(892),r.b));setTimeout((()=>{void 0===q&&v(new Error("Timeout while waiting for OPFS async proxy worker."))}),4e3),E._originalOnError=E.onerror,E.onerror=function(e){c("Error initializing OPFS asyncer:",e),v(new Error("Loading OPFS async Worker failed for unknown reasons."))};const S=u.sqlite3_vfs_find(null),A=S?new p(S):null;b.$iVersion=1,y.$iVersion=2,y.$szOsFile=u.sqlite3_file.structInfo.sizeof,y.$mxPathname=1024,y.$zName=f.allocCString("opfs"),y.$xDlOpen=y.$xDlError=y.$xDlSym=y.$xDlClose=null,y.addOnDispose("$zName",y.$zName,"cleanup default VFS wrapper",(()=>A?A.dispose():null));const x=Object.create(null);x.verbose=n.verbose,x.littleEndian=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]})(),x.asyncIdleWaitTime=150,x.asyncS11nExceptions=1,x.fileBufferSize=65536,x.sabS11nOffset=x.fileBufferSize,x.sabS11nSize=2*y.$mxPathname,x.sabIO=new SharedArrayBuffer(x.fileBufferSize+x.sabS11nSize),x.opIds=Object.create(null);const T=Object.create(null);{let e=0;x.opIds.whichOp=e++,x.opIds.rc=e++,x.opIds.xAccess=e++,x.opIds.xClose=e++,x.opIds.xDelete=e++,x.opIds.xDeleteNoWait=e++,x.opIds.xFileSize=e++,x.opIds.xLock=e++,x.opIds.xOpen=e++,x.opIds.xRead=e++,x.opIds.xSleep=e++,x.opIds.xSync=e++,x.opIds.xTruncate=e++,x.opIds.xUnlock=e++,x.opIds.xWrite=e++,x.opIds.mkdir=e++,x.opIds["opfs-async-metrics"]=e++,x.opIds["opfs-async-shutdown"]=e++,x.opIds.retry=e++,x.sabOP=new SharedArrayBuffer(4*e),g.metrics.reset()}x.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_PENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach((e=>{void 0===(x.sq3Codes[e]=u[e])&&_("Maintenance required: not found:",e)})),x.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,defaultUnlockAsap:!1});const I=(e,...t)=>{const r=x.opIds[e]||_("Invalid op ID:",e);x.s11n.serialize(...t),Atomics.store(x.sabOPView,x.opIds.rc,-1),Atomics.store(x.sabOPView,x.opIds.whichOp,r),Atomics.notify(x.sabOPView,x.opIds.whichOp);const n=performance.now();Atomics.wait(x.sabOPView,x.opIds.rc,-1);const s=Atomics.load(x.sabOPView,x.opIds.rc);if(T[e].wait+=performance.now()-n,s&&x.asyncS11nExceptions){const t=x.s11n.deserialize();t&&c(e+"() async error:",...t)}return s};g.debug={asyncShutdown:()=>{l("Shutting down OPFS async listener. The OPFS VFS will no longer work."),I("opfs-async-shutdown")},asyncRestart:()=>{l("Attempting to restart OPFS VFS async listener. Might work, might not."),E.postMessage({type:"opfs-async-restart"})}};const k=function e(t=16){e._chars||(e._n=(e._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789").length);const r=[];let n=0;for(;n{O.start=performance.now(),O.op=e,++T[e].count},L=()=>T[O.op].time+=performance.now()-O.start,C={xCheckReservedLock:function(e,t){const r=F[e];return f.poke(t,r.lockType?1:0,"i32"),0},xClose:function(e){P("xClose");let t=0;const r=F[e];return r&&(delete F[e],t=I("xClose",e),r.sq3File&&r.sq3File.dispose()),L(),t},xDeviceCharacteristics:function(e){return u.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,r){return u.SQLITE_NOTFOUND},xFileSize:function(e,t){P("xFileSize");let r=I("xFileSize",e);if(0==r)try{const e=x.s11n.deserialize()[0];f.poke(t,e,"i64")}catch(e){c("Unexpected error reading xFileSize() result:",e),r=x.sq3Codes.SQLITE_IOERR}return L(),r},xLock:function(e,t){P("xLock");const r=F[e];let n=0;return r.lockType?r.lockType=t:(n=I("xLock",e,t),0===n&&(r.lockType=t)),L(),n},xRead:function(e,t,r,n){P("xRead");const s=F[e];let i;try{i=I("xRead",e,r,Number(n)),0!==i&&u.SQLITE_IOERR_SHORT_READ!==i||f.heap8u().set(s.sabView.subarray(0,r),t)}catch(e){c("xRead(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_READ}return L(),i},xSync:function(e,t){P("xSync"),++T.xSync.count;const r=I("xSync",e,t);return L(),r},xTruncate:function(e,t){P("xTruncate");const r=I("xTruncate",e,Number(t));return L(),r},xUnlock:function(e,t){P("xUnlock");const r=F[e];let n=0;return u.SQLITE_LOCK_NONE===t&&r.lockType&&(n=I("xUnlock",e,t)),0===n&&(r.lockType=t),L(),n},xWrite:function(e,t,r,n){P("xWrite");const s=F[e];let i;try{s.sabView.set(f.heap8u().subarray(t,t+r)),i=I("xWrite",e,r,Number(n))}catch(e){c("xWrite(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_WRITE}return L(),i}},N={xAccess:function(e,t,r,n){P("xAccess");const s=I("xAccess",f.cstrToJs(t));return f.poke(n,s?0:1,"i32"),L(),0},xCurrentTime:function(e,t){return f.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return f.poke(t,21086676e7+(new Date).getTime(),"i64"),0},xDelete:function(e,t,r){P("xDelete");const n=I("xDelete",f.cstrToJs(t),r,!1);return L(),n},xFullPathname:function(e,t,r,n){return f.cstrncpy(n,t,r)!!e)):r},g.getDirForFilename=async function(e,t=!1){const r=g.getResolvedPath(e,!0),n=r.pop();let s=g.rootDirectory;for(const e of r)e&&(s=await s.getDirectoryHandle(e,{create:!!t}));return[s,n]},g.mkdir=async function(e){try{return await g.getDirForFilename(e+"/filepart",!0),!0}catch(e){return!1}},g.entryExists=async function(e){try{const[t,r]=await g.getDirForFilename(e);return await t.getFileHandle(r),!0}catch(e){return!1}},g.randomFilename=k,g.registerVfs=(e=!1)=>f.exports.sqlite3_vfs_register(y.pointer,e?1:0),g.treeList=async function(){const e=Object.create(null);return await async function e(t,r){r.name=t.name,r.dirs=[],r.files=[];for await(const n of t.values())if("directory"===n.kind){const t=Object.create(null);r.dirs.push(t),await e(n,t)}else r.files.push(n.name)}(g.rootDirectory,e),e},g.rmfr=async function(){const e=g.rootDirectory,t={recurse:!0};for await(const r of e.values())e.removeEntry(r.name,t)},g.unlink=async function(e,t=!1,r=!1){try{const[r,n]=await g.getDirForFilename(e,!1);return await r.removeEntry(n,{recursive:t}),!0}catch(e){if(r)throw new Error("unlink(",arguments[0],") failed: "+e.message,{cause:e});return!1}},g.traverse=async function(e){const t={recursive:!0,directory:g.rootDirectory};"function"==typeof e&&(e={callback:e}),async function t(r,n){for await(const s of r.values()){if(!1===e.callback(s,r,n))return!1;if(e.recursive&&"directory"===s.kind&&!1===await t(s,n+1))break}}((e=Object.assign(t,e||{})).directory,0)},g.importDb=async function(e,t){if(t instanceof Function)return async function(e,t){const[r,n]=await g.getDirForFilename(e,!0),s=await r.getFileHandle(n,{create:!0});let i,o=await s.createSyncAccessHandle(),a=0,l=!1;try{for(o.truncate(0);void 0!==(i=await t());)i instanceof ArrayBuffer&&(i=new Uint8Array(i)),0===a&&i.byteLength>=15&&(d.affirmDbHeader(i),l=!0),o.write(i,{at:a}),a+=i.byteLength;if((a<512||0!=a%512)&&_("Input size",a,"is not correct for an SQLite database."),!l){const e=new Uint8Array(20);o.read(e,{at:0}),d.affirmDbHeader(e)}return o.write(new Uint8Array([1,1]),{at:18}),a}catch(e){throw await o.close(),o=void 0,await r.removeEntry(n).catch((()=>{})),e}finally{o&&await o.close()}}(e,t);t instanceof ArrayBuffer&&(t=new Uint8Array(t)),d.affirmIsDb(t);const r=t.byteLength,[n,s]=await g.getDirForFilename(e,!0);let i,o=0;try{const e=await n.getFileHandle(s,{create:!0});return i=await e.createSyncAccessHandle(),i.truncate(0),o=i.write(t,{at:0}),o!=r&&_("Expected to write "+r+" bytes but wrote "+o+"."),i.write(new Uint8Array([1,1]),{at:18}),o}catch(e){throw i&&(await i.close(),i=void 0),await n.removeEntry(s).catch((()=>{})),e}finally{i&&await i.close()}},e.oo1){const t=function(...t){const r=e.oo1.DB.dbCtorHelper.normalizeArgs(...t);r.vfs=y.$zName,e.oo1.DB.dbCtorHelper.call(this,r)};t.prototype=Object.create(e.oo1.DB.prototype),e.oo1.OpfsDb=t,t.importDb=g.importDb,e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(y.pointer,(function(e,t){t.capi.sqlite3_busy_timeout(e,1e4),t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}E.onmessage=function({data:t}){switch(t.type){case"opfs-unavailable":v(new Error(t.payload.join(" ")));break;case"opfs-async-loaded":E.postMessage({type:"opfs-async-init",args:x});break;case"opfs-async-inited":if(!0===q)break;try{e.vfs.installVfs({io:{struct:b,methods:C},vfs:{struct:y,methods:N}}),x.sabOPView=new Int32Array(x.sabOP),x.sabFileBufView=new Uint8Array(x.sabIO,0,x.fileBufferSize),x.sabS11nView=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),(()=>{if(x.s11n)return x.s11n;const e=new TextDecoder,t=new TextEncoder("utf-8"),r=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),n=new DataView(x.sabIO,x.sabS11nOffset,x.sabS11nSize);x.s11n=Object.create(null);const s=Object.create(null);s.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},s.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},s.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},s.string={id:4};const i=e=>s[typeof e]||_("Maintenance required: this value type cannot be serialized.",e),o=e=>{switch(e){case s.number.id:return s.number;case s.bigint.id:return s.bigint;case s.boolean.id:return s.boolean;case s.string.id:return s.string;default:_("Invalid type ID:",e)}};x.s11n.deserialize=function(t=!1){++T.s11n.deserialize.count;const s=performance.now(),i=r[0],a=i?[]:null;if(i){const t=[];let s,l,c,_=1;for(s=0;s{E.onerror=E._originalOnError,delete E._originalOnError,e.opfs=g,g.rootDirectory=t,a("End of OPFS sqlite3_vfs setup.",y),w()})).catch(v):w()}catch(e){c(e),v(e)}break;default:{const e="Unexpected message from the OPFS async worker: "+JSON.stringify(t);c(e),v(new Error(e));break}}}}));return i};t.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push((async e=>{try{let r=t.defaultProxyUri;return e.scriptInfo.sqlite3Dir&&(t.defaultProxyUri=e.scriptInfo.sqlite3Dir+r),t().catch((t=>{e.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",t.message)}))}catch(t){return e.config.error("installOpfsVfs() exception:",t),Promise.reject(t)}}))})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.util.toss,r=e.util.toss3,n=Object.create(null),s=e.capi,i=e.util,o=e.wasm,a=4096,l=s.SQLITE_OPEN_MAIN_DB|s.SQLITE_OPEN_MAIN_JOURNAL|s.SQLITE_OPEN_SUPER_JOURNAL|s.SQLITE_OPEN_WAL,c=".opaque",_=()=>Math.random().toString(36).slice(2),u=new TextDecoder,d=new TextEncoder,f=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2}),p=[e.config.error,e.config.warn,e.config.log],m=(e.config.log,e.config.warn),h=(e.config.error,new Map),g=e=>h.get(e),b=(e,t)=>{t?h.set(e,t):h.delete(e)},y=new Map,q=e=>y.get(e),v=(e,t)=>{t?y.set(e,t):y.delete(e)},w={xCheckReservedLock:function(e,t){const r=q(e);return r.log("xCheckReservedLock"),r.storeErr(),o.poke32(t,1),0},xClose:function(e){const t=q(e);t.storeErr();const r=t.getOFileForS3File(e);if(r)try{t.log(`xClose ${r.path}`),t.mapS3FileToOFile(e,!1),r.sah.flush(),r.flags&s.SQLITE_OPEN_DELETEONCLOSE&&t.deletePath(r.path)}catch(e){return t.storeErr(e,s.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(e){return s.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,r){return s.SQLITE_NOTFOUND},xFileSize:function(e,t){const r=q(e);r.log("xFileSize");const n=r.getOFileForS3File(e).sah.getSize()-a;return o.poke64(t,BigInt(n)),0},xLock:function(e,t){const r=q(e);return r.log(`xLock ${t}`),r.storeErr(),r.getOFileForS3File(e).lockType=t,0},xRead:function(e,t,r,n){const i=q(e);i.storeErr();const l=i.getOFileForS3File(e);i.log(`xRead ${l.path} ${r} @ ${n}`);try{const e=l.sah.read(o.heap8u().subarray(t,t+r),{at:a+Number(n)});return et&&o.poke8(r+t-1,0)}catch(i){return s.SQLITE_NOMEM}finally{o.scopedAllocPop(e)}}return i?i.sqlite3Rc||s.SQLITE_IOERR:0},xOpen:function(e,r,n,i,a){const l=g(e);try{l.log(`xOpen ${o.cstrToJs(r)} ${i}`);const e=r&&o.peek8(r)?l.getPath(r):_();let c=l.getSAHForPath(e);!c&&i&s.SQLITE_OPEN_CREATE&&(l.getFileCount()b(n.pointer,0))),a&&(n.$xRandomness=a.$xRandomness,n.$xSleep=a.$xSleep,a.dispose()),n.$xRandomness||S.xRandomness||(S.xRandomness=function(e,t,r){const n=o.heap8u();let s=0;for(;s0),e.vfs.installVfs({vfs:{struct:n,methods:S}}),n}(this.vfsName),b(this.#c.pointer,this),this.vfsDir=t.directory||"."+this.vfsName,this.#l=new DataView(this.#a.buffer,this.#a.byteOffset),this.isReady=this.reset(!!(t.clearOnInit??f.clearOnInit)).then((()=>{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(t.initialCapacity||f.initialCapacity)}))}#u(e,...t){this.#_>e&&p[e](this.vfsName+":",...t)}log(...e){this.#u(2,...e)}warn(...e){this.#u(1,...e)}error(...e){this.#u(0,...e)}getVfs(){return this.#c}getCapacity(){return this.#n.size}getFileCount(){return this.#s.size}getFileNames(){const e=[],t=this.#s.keys();for(const r of t)e.push(r);return e}async addCapacity(e){for(let t=0;t{try{const n=await r.createSyncAccessHandle();if(this.#n.set(n,t),e)n.truncate(a),this.setAssociatedPath(n,"",0);else{const e=this.getAssociatedPath(n);e?this.#s.set(e,n):this.#i.add(n)}}catch(e){throw this.storeErr(e),this.releaseAccessHandles(),e}})))}getAssociatedPath(e){e.read(this.#a,{at:0});const t=this.#l.getUint32(512);if(this.#a[0]&&(t&s.SQLITE_OPEN_DELETEONCLOSE||!(t&l)))return m(`Removing file with unexpected flags ${t.toString(16)}`,this.#a),this.setAssociatedPath(e,"",0),"";const r=new Uint32Array(2);e.read(r,{at:516});const n=this.computeDigest(this.#a);if(r.every(((e,t)=>e===n[t]))){const t=this.#a.findIndex((e=>0===e));return 0===t&&e.truncate(a),t?u.decode(this.#a.subarray(0,t)):""}return m("Disassociating file with bad digest."),this.setAssociatedPath(e,"",0),""}setAssociatedPath(e,r,n){const s=d.encodeInto(r,this.#a);512<=s.written+1&&t("Path too long:",r),this.#a.fill(0,s.written,512),this.#l.setUint32(512,n);const i=this.computeDigest(this.#a);e.write(this.#a,{at:0}),e.write(i,{at:516}),e.flush(),r?(this.#s.set(r,e),this.#i.delete(e)):(e.truncate(a),this.#i.add(e))}computeDigest(e){let t=3735928559,r=1103547991;for(const n of e)t=31*t+307*n,r=31*r+307*n;return new Uint32Array([t>>>0,r>>>0])}async reset(e){await this.isReady;let t,r=await navigator.storage.getDirectory();for(const e of this.vfsDir.split("/"))e&&(t=r,r=await r.getDirectoryHandle(e,{create:!0}));return this.#e=r,this.#r=t,this.#t=await this.#e.getDirectoryHandle(c,{create:!0}),this.releaseAccessHandles(),this.acquireAccessHandles(e)}getPath(e){return o.isPtr(e)&&(e=o.cstrToJs(e)),(e instanceof URL?e:new URL(e,"file://localhost/")).pathname}deletePath(e){const t=this.#s.get(e);return t&&(this.#s.delete(e),this.setAssociatedPath(t,"",0)),!!t}storeErr(e,t){return e&&(e.sqlite3Rc=t||s.SQLITE_IOERR,this.error(e)),this.$error=e,t}popErr(){const e=this.$error;return this.$error=void 0,e}nextAvailableSAH(){const[e]=this.#i.keys();return e}getOFileForS3File(e){return this.#o.get(e)}mapS3FileToOFile(e,t){t?(this.#o.set(e,t),v(e,this)):(this.#o.delete(e),v(e,!1))}hasFilename(e){return this.#s.has(e)}getSAHForPath(e){return this.#s.get(e)}async removeVfs(){if(!this.#c.pointer||!this.#t)return!1;s.sqlite3_vfs_unregister(this.#c.pointer),this.#c.dispose();try{this.releaseAccessHandles(),await this.#e.removeEntry(c,{recursive:!0}),this.#t=void 0,await this.#r.removeEntry(this.#e.name,{recursive:!0}),this.#e=this.#r=void 0}catch(t){e.config.error(this.vfsName,"removeVfs() failed:",t)}return!0}exportFile(e){const r=this.#s.get(e)||t("File not found:",e),n=r.getSize()-a,s=new Uint8Array(n>0?n:0);if(n>0){const e=r.read(s,{at:a});e!=n&&t("Expected to read "+n+" bytes but read "+e+".")}return s}async importDbChunked(e,r){const n=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to.");n.truncate(0);let o,l=0,c=!1;try{for(;void 0!==(o=await r());)o instanceof ArrayBuffer&&(o=new Uint8Array(o)),0===l&&o.byteLength>=15&&(i.affirmDbHeader(o),c=!0),n.write(o,{at:a+l}),l+=o.byteLength;if((l<512||0!=l%512)&&t("Input size",l,"is not correct for an SQLite database."),!c){const e=new Uint8Array(20);n.read(e,{at:0}),i.affirmDbHeader(e)}n.write(new Uint8Array([1,1]),{at:4114})}catch(e){throw this.setAssociatedPath(n,"",0),e}return this.setAssociatedPath(n,e,s.SQLITE_OPEN_MAIN_DB),l}importDb(e,r){if(r instanceof ArrayBuffer)r=new Uint8Array(r);else if(r instanceof Function)return this.importDbChunked(e,r);const n=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to."),i=r.byteLength;(i<512||i%512!=0)&&t("Byte array size is invalid for an SQLite db.");for(let e=0;e<15;++e)"SQLite format 3".charCodeAt(e)!==r[e]&&t("Input does not contain an SQLite database header.");const o=n.write(r,{at:a});return o!=i?(this.setAssociatedPath(n,"",0),t("Expected to write "+i+" bytes but wrote "+o+".")):(n.write(new Uint8Array([1,1]),{at:4114}),this.setAssociatedPath(n,e,s.SQLITE_OPEN_MAIN_DB)),o}}class x{#d;constructor(e){this.#d=e,this.vfsName=e.vfsName}async addCapacity(e){return this.#d.addCapacity(e)}async reduceCapacity(e){return this.#d.reduceCapacity(e)}getCapacity(){return this.#d.getCapacity(this.#d)}getFileCount(){return this.#d.getFileCount()}getFileNames(){return this.#d.getFileNames()}async reserveMinimumCapacity(e){const t=this.#d.getCapacity();return t{const e=await navigator.storage.getDirectory(),r=".opfs-sahpool-sync-check-"+_(),n=await e.getFileHandle(r,{create:!0}),s=(await n.createSyncAccessHandle()).close();return await s,await e.removeEntry(r),s?.then&&t("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0})().then((async function(){if(r.$testThrowInInit)throw r.$testThrowInInit;const t=new A(r);return t.isReady.then((async()=>{const r=new x(t);if(e.oo1){const n=e.oo1,s=t.getVfs(),i=function(...e){const t=n.DB.dbCtorHelper.normalizeArgs(...e);t.vfs=s.$zName,n.DB.dbCtorHelper.call(this,t)};i.prototype=Object.create(n.DB.prototype),r.OpfsSAHPoolDb=i,n.DB.dbCtorHelper.setVfsPostOpenSql(s.pointer,(function(e,t){t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}return t.log("VFS initialized."),r})).catch((async e=>(await t.removeVfs().catch((()=>{})),e)))})).catch((e=>n[s]=Promise.reject(e))):n[s]=Promise.reject(new Error("Missing required OPFS APIs."))}})),void 0!==e){const t=Object.assign(Object.create(null),{exports:void 0===Re?e.asm:Re,memory:e.wasmMemory},globalThis.sqlite3ApiConfig||{});let r;globalThis.sqlite3ApiConfig=t;try{r=globalThis.sqlite3ApiBootstrap()}catch(e){throw console.error("sqlite3ApiBootstrap() error:",e),e}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}e.sqlite3=r}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")})),e.ready});const i=function(){const e=s;if(!e)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const t=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:globalThis?.document?.currentScript,isWorker:"undefined"!=typeof WorkerGlobalScope,location:globalThis.location,urlParams:globalThis?.location?.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(t.debugModule=t.urlParams.has("sqlite3.debugModule")?(...e)=>console.warn("sqlite3.debugModule:",...e):()=>{},t.urlParams.has("sqlite3.dir"))t.sqlite3Dir=t.urlParams.get("sqlite3.dir")+"/";else if(t.moduleScript){const e=t.moduleScript.src.split("/");e.pop(),t.sqlite3Dir=e.join("/")+"/"}if(globalThis.sqlite3InitModule=function r(...n){return e(...n).then((e=>{const n=e.sqlite3;n.scriptInfo=t,r.__isUnderTest&&(n.__isUnderTest=!0);const s=n.asyncPostInit;return delete n.asyncPostInit,s()})).catch((e=>{throw console.error("Exception loading sqlite3 module:",e),e}))},globalThis.sqlite3InitModule.ready=e.ready,globalThis.sqlite3InitModuleState.moduleScript){const e=globalThis.sqlite3InitModuleState;let t=e.moduleScript.src.split("/");t.pop(),e.scriptDir=t.join("/")+"/"}return t.debugModule("sqlite3InitModuleState =",t),globalThis.sqlite3InitModule}();(s=i)().then((e=>e.initWorker1API()))})(); \ No newline at end of file +(()=>{"use strict";var e={8168:(e,t,r)=>{e.exports=r.p+"4fb34c1567962ff5a6c9.wasm"}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.m=e,r.u=e=>e+".bundle.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var s=n.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b=self.location+"";var n,s=(n="file:///home/mmom/src/rlayers/node_modules/sqlite-wasm-http/deps/dist/sqlite3-bundler-friendly.mjs",function(e={}){var t,s,i=e;i.ready=new Promise(((e,r)=>{t=e,s=r})),["_malloc","_free","_realloc","_sqlite3_aggregate_context","_sqlite3_auto_extension","_sqlite3_bind_blob","_sqlite3_bind_double","_sqlite3_bind_int","_sqlite3_bind_int64","_sqlite3_bind_null","_sqlite3_bind_parameter_count","_sqlite3_bind_parameter_index","_sqlite3_bind_pointer","_sqlite3_bind_text","_sqlite3_busy_handler","_sqlite3_busy_timeout","_sqlite3_cancel_auto_extension","_sqlite3_changes","_sqlite3_changes64","_sqlite3_clear_bindings","_sqlite3_close_v2","_sqlite3_collation_needed","_sqlite3_column_blob","_sqlite3_column_bytes","_sqlite3_column_count","_sqlite3_column_double","_sqlite3_column_int","_sqlite3_column_int64","_sqlite3_column_name","_sqlite3_column_text","_sqlite3_column_type","_sqlite3_column_value","_sqlite3_commit_hook","_sqlite3_compileoption_get","_sqlite3_compileoption_used","_sqlite3_complete","_sqlite3_context_db_handle","_sqlite3_create_collation","_sqlite3_create_collation_v2","_sqlite3_create_function","_sqlite3_create_function_v2","_sqlite3_create_module","_sqlite3_create_module_v2","_sqlite3_create_window_function","_sqlite3_data_count","_sqlite3_db_filename","_sqlite3_db_handle","_sqlite3_db_name","_sqlite3_db_status","_sqlite3_declare_vtab","_sqlite3_deserialize","_sqlite3_drop_modules","_sqlite3_errcode","_sqlite3_errmsg","_sqlite3_error_offset","_sqlite3_errstr","_sqlite3_exec","_sqlite3_expanded_sql","_sqlite3_extended_errcode","_sqlite3_extended_result_codes","_sqlite3_file_control","_sqlite3_finalize","_sqlite3_free","_sqlite3_get_auxdata","_sqlite3_initialize","_sqlite3_keyword_count","_sqlite3_keyword_name","_sqlite3_keyword_check","_sqlite3_last_insert_rowid","_sqlite3_libversion","_sqlite3_libversion_number","_sqlite3_limit","_sqlite3_malloc","_sqlite3_malloc64","_sqlite3_msize","_sqlite3_open","_sqlite3_open_v2","_sqlite3_overload_function","_sqlite3_prepare_v2","_sqlite3_prepare_v3","_sqlite3_preupdate_blobwrite","_sqlite3_preupdate_count","_sqlite3_preupdate_depth","_sqlite3_preupdate_hook","_sqlite3_preupdate_new","_sqlite3_preupdate_old","_sqlite3_progress_handler","_sqlite3_randomness","_sqlite3_realloc","_sqlite3_realloc64","_sqlite3_reset","_sqlite3_reset_auto_extension","_sqlite3_result_blob","_sqlite3_result_double","_sqlite3_result_error","_sqlite3_result_error_code","_sqlite3_result_error_nomem","_sqlite3_result_error_toobig","_sqlite3_result_int","_sqlite3_result_int64","_sqlite3_result_null","_sqlite3_result_pointer","_sqlite3_result_subtype","_sqlite3_result_text","_sqlite3_result_zeroblob","_sqlite3_result_zeroblob64","_sqlite3_rollback_hook","_sqlite3_serialize","_sqlite3_set_authorizer","_sqlite3_set_auxdata","_sqlite3_set_last_insert_rowid","_sqlite3_shutdown","_sqlite3_sourceid","_sqlite3_sql","_sqlite3_status","_sqlite3_status64","_sqlite3_step","_sqlite3_stmt_isexplain","_sqlite3_stmt_readonly","_sqlite3_stmt_status","_sqlite3_strglob","_sqlite3_stricmp","_sqlite3_strlike","_sqlite3_strnicmp","_sqlite3_table_column_metadata","_sqlite3_total_changes","_sqlite3_total_changes64","_sqlite3_trace_v2","_sqlite3_txn_state","_sqlite3_update_hook","_sqlite3_uri_boolean","_sqlite3_uri_int64","_sqlite3_uri_key","_sqlite3_uri_parameter","_sqlite3_user_data","_sqlite3_value_blob","_sqlite3_value_bytes","_sqlite3_value_double","_sqlite3_value_dup","_sqlite3_value_free","_sqlite3_value_frombind","_sqlite3_value_int","_sqlite3_value_int64","_sqlite3_value_nochange","_sqlite3_value_numeric_type","_sqlite3_value_pointer","_sqlite3_value_subtype","_sqlite3_value_text","_sqlite3_value_type","_sqlite3_vfs_find","_sqlite3_vfs_register","_sqlite3_vfs_unregister","_sqlite3_vtab_collation","_sqlite3_vtab_distinct","_sqlite3_vtab_in","_sqlite3_vtab_in_first","_sqlite3_vtab_in_next","_sqlite3_vtab_nochange","_sqlite3_vtab_on_conflict","_sqlite3_vtab_rhs_value","_sqlite3changegroup_add","_sqlite3changegroup_add_strm","_sqlite3changegroup_delete","_sqlite3changegroup_new","_sqlite3changegroup_output","_sqlite3changegroup_output_strm","_sqlite3changeset_apply","_sqlite3changeset_apply_strm","_sqlite3changeset_apply_v2","_sqlite3changeset_apply_v2_strm","_sqlite3changeset_concat","_sqlite3changeset_concat_strm","_sqlite3changeset_conflict","_sqlite3changeset_finalize","_sqlite3changeset_fk_conflicts","_sqlite3changeset_invert","_sqlite3changeset_invert_strm","_sqlite3changeset_new","_sqlite3changeset_next","_sqlite3changeset_old","_sqlite3changeset_op","_sqlite3changeset_pk","_sqlite3changeset_start","_sqlite3changeset_start_strm","_sqlite3changeset_start_v2","_sqlite3changeset_start_v2_strm","_sqlite3session_attach","_sqlite3session_changeset","_sqlite3session_changeset_size","_sqlite3session_changeset_strm","_sqlite3session_config","_sqlite3session_create","_sqlite3session_delete","_sqlite3session_diff","_sqlite3session_enable","_sqlite3session_indirect","_sqlite3session_isempty","_sqlite3session_memory_used","_sqlite3session_object_config","_sqlite3session_patchset","_sqlite3session_patchset_strm","_sqlite3session_table_filter","_sqlite3_wasm_pstack_ptr","_sqlite3_wasm_pstack_restore","_sqlite3_wasm_pstack_alloc","_sqlite3_wasm_pstack_remaining","_sqlite3_wasm_pstack_quota","_sqlite3_wasm_db_error","_sqlite3_wasm_test_struct","_sqlite3_wasm_enum_json","_sqlite3_wasm_vfs_unlink","_sqlite3_wasm_db_vfs","_sqlite3_wasm_db_reset","_sqlite3_wasm_db_export_chunked","_sqlite3_wasm_db_serialize","_sqlite3_wasm_vfs_create_file","_sqlite3_wasm_posix_create_file","_sqlite3_wasm_kvvfsMakeKeyOnPstack","_sqlite3_wasm_kvvfs_methods","_sqlite3_wasm_vtab_config","_sqlite3_wasm_db_config_ip","_sqlite3_wasm_db_config_pii","_sqlite3_wasm_db_config_s","_sqlite3_wasm_config_i","_sqlite3_wasm_config_ii","_sqlite3_wasm_config_j","_sqlite3_wasm_init_wasmfs","_sqlite3_wasm_test_intptr","_sqlite3_wasm_test_voidptr","_sqlite3_wasm_test_int64_max","_sqlite3_wasm_test_int64_min","_sqlite3_wasm_test_int64_times2","_sqlite3_wasm_test_int64_minmax","_sqlite3_wasm_test_int64ptr","_sqlite3_wasm_test_stack_overflow","_sqlite3_wasm_test_str_hello","_sqlite3_wasm_SQLTester_strglob","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>$("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>$("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));const o=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,o.debugModule("globalThis.location =",globalThis.location);const a="emscripten-bug-17951";i[a]=function e(t,r){t.env.foo=function(){};const n=i.locateFile(e.uri,void 0===g?"":g);o.debugModule("instantiateWasm() uri =",n);const s=()=>fetch(n,{credentials:"same-origin"});return(WebAssembly.instantiateStreaming?async()=>WebAssembly.instantiateStreaming(s(),t).then((e=>r(e.instance,e.module))):async()=>s().then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,t))).then((e=>r(e.instance,e.module))))(),{}},i[a].uri="sqlite3.wasm";var l=Object.assign({},i),c="./this.program",_="object"==typeof window,u="function"==typeof importScripts,d="object"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions&&"string"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions.node,f=!_&&!d&&!u;if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var p,m,h,g="";if(f){if("function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(p=read),h=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,"binary");return O("object"==typeof t),t},m=(e,t,r)=>{setTimeout((()=>t(h(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():$()),"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!_&&!u)throw new Error("environment detection error");if(u?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),m=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var b,y,q,w=i.print||console.log.bind(console),E=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,b="fetchSettings",Object.getOwnPropertyDescriptor(i,b)&&$(`\`Module.${b}\` was supplied but \`${b}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,Z("arguments","arguments_"),i.thisProgram&&(c=i.thisProgram),Z("thisProgram","thisProgram"),i.quit&&i.quit,Z("quit","quit_"),O(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),O(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),O(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),O(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),O(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Z("asm","wasmExports"),Z("read","read_"),Z("readAsync","readAsync"),Z("readBinary","readBinary"),Z("setWindowTitle","setWindowTitle"),O(!d,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),O(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(y=i.wasmBinary),Z("wasmBinary","wasmBinary"),i.noExitRuntime,Z("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&$("no native wasm support detected");var S,A,x,T,I,k,F=!1;function O(e,t){e||$("Assertion failed"+(t?": "+t:""))}function P(){var e=q.buffer;i.HEAP8=S=new Int8Array(e),i.HEAP16=x=new Int16Array(e),i.HEAPU8=A=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=T=new Int32Array(e),i.HEAPU32=I=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=k=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}O(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),O("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var L=i.INITIAL_MEMORY||16777216;function C(){if(!F){var e=We();0==e&&(e+=4);var t=I[e>>2],r=I[e+4>>2];34821223==t&&2310721022==r||$(`Stack overflow! Stack cookie has been overwritten at ${se(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${se(r)} ${se(t)}`),1668509029!=I[0]&&$("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Z("INITIAL_MEMORY","INITIAL_MEMORY"),O(L>=524288,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+L+"! (STACK_SIZE=524288)"),q=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:L/65536,maximum:32768}),P(),O((L=q.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],D=[],R=[],M=!1;O(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var j,U,B=0,z=null,W=null,H={};function Q(e){for(var t=e;;){if(!H[e])return e;e=t+Math.random()}}function G(e){B++,i.monitorRunDependencies&&i.monitorRunDependencies(B),e?(O(!H[e]),H[e]=1,null===z&&"undefined"!=typeof setInterval&&(z=setInterval((()=>{if(F)return clearInterval(z),void(z=null);var e=!1;for(var t in H)e||(e=!0,E("still waiting on run dependencies:")),E(`dependency: ${t}`);e&&E("(end of list)")}),1e4))):E("warning: run dependency added without ID")}function V(e){if(B--,i.monitorRunDependencies&&i.monitorRunDependencies(B),e?(O(H[e]),delete H[e]):E("warning: run dependency removed without ID"),0==B&&(null!==z&&(clearInterval(z),z=null),W)){var t=W;W=null,t()}}function $(e){i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),F=!0;var t=new WebAssembly.RuntimeError(e);throw s(t),t}function K(e){return e.startsWith("data:application/octet-stream;base64,")}function J(e){return function(){O(M,`native function \`${e}\` called before runtime initialization`);var t=Re[e];return O(t,`exported native function \`${e}\` not found`),t.apply(null,arguments)}}function Y(e){if(e==j&&y)return new Uint8Array(y);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}function X(e,t,r){return function(e){return y||!_&&!u||"function"!=typeof fetch?Promise.resolve().then((()=>Y(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>Y(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{E(`failed to asynchronously prepare wasm: ${e}`),j.startsWith("file://")&&E(`warning: Loading from a file URI (${j}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),$(e)}))}function Z(e,t,r=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){$(`\`Module.${e}\` has been replaced by \`${t}\``+(r?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function ee(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function te(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){ie("`"+e+"` is not longer defined by emscripten. "+t)}})}function re(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),$(t)}})}i.locateFile?K(j="sqlite3.wasm")||(U=j,j=i.locateFile?i.locateFile(U,g):g+U):j=new URL(r(8168),r.b).href,te("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),te("asm","Please use wasmExports instead");var ne=e=>{for(;e.length>0;)e.shift()(i)},se=e=>(O("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ie=e=>{ie.shown||(ie.shown={}),ie.shown[e]||(ie.shown[e]=1,E(e))},oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var s=e[n];"."===s?e.splice(n,1):".."===s?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),r="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);$("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),le={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ee.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=oe.isAbs(n)}return(t?"/":"")+(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=le.resolve(e).substr(1),t=le.resolve(t).substr(1);for(var n=r(e.split("/")),s=r(t.split("/")),i=Math.min(n.length,s.length),o=i,a=0;a{for(var n=t+r,s=t;e[s]&&!(s>=n);)++s;if(s-t>16&&e.buffer&&ce)return ce.decode(e.subarray(t,s));for(var i="";t>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i},ue=[],de=e=>{for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t},fe=(e,t,r,n)=>{if(O("string"==typeof e),!(n>0))return 0;for(var s=r,i=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;a>1114111&&ie("Invalid Unicode code point "+se(a)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-s};function pe(e,t,r){var n=r>0?r:de(e)+1,s=new Array(n),i=fe(e,s,0,s.length);return t&&(s.length=i),s}var me,he={ttys:[],init(){},shutdown(){},register(e,t){he.ttys[e]={input:[],output:[],ops:t},Ee.registerDevice(e,he.stream_ops)},stream_ops:{open(e){var t=he.ttys[e.node.rdev];if(!t)throw new Ee.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,s){if(!e.tty||!e.tty.ops.get_char)throw new Ee.ErrnoError(60);for(var i=0,o=0;o(()=>{if(!ue.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ue=pe(e,!0)}return ue.shift()})(),put_char(e,t){null===t||10===t?(w(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(_e(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(E(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(E(_e(e.output,0)),e.output=[])}}},ge=e=>{e=((e,t)=>(O(t,"alignment argument is required"),Math.ceil(e/t)*t))(e,65536);var t=Be(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},be={ops_table:null,mount:e=>be.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Ee.isBlkdev(r)||Ee.isFIFO(r))throw new Ee.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:Ee.chrdev_stream_ops}});var s=Ee.createNode(e,t,r,n);return Ee.isDir(s.mode)?(s.node_ops=be.ops_table.dir.node,s.stream_ops=be.ops_table.dir.stream,s.contents={}):Ee.isFile(s.mode)?(s.node_ops=be.ops_table.file.node,s.stream_ops=be.ops_table.file.stream,s.usedBytes=0,s.contents=null):Ee.isLink(s.mode)?(s.node_ops=be.ops_table.link.node,s.stream_ops=be.ops_table.link.stream):Ee.isChrdev(s.mode)&&(s.node_ops=be.ops_table.chrdev.node,s.stream_ops=be.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Ee.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Ee.isDir(e.mode)?t.size=4096:Ee.isFile(e.mode)?t.size=e.usedBytes:Ee.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup(e,t){throw Ee.genericErrors[44]},mknod:(e,t,r,n)=>be.createNode(e,t,r,n),rename(e,t,r){if(Ee.isDir(e.mode)){var n;try{n=Ee.lookupNode(t,r)}catch(e){}if(n)for(var s in n.contents)throw new Ee.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Ee.lookupNode(e,t);for(var n in r.contents)throw new Ee.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=be.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Ee.isLink(e.mode))throw new Ee.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,s){var i=e.node.contents;if(s>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-s,n);if(O(o>=0),o>8&&i.subarray)t.set(i.subarray(s,s+o),r);else for(var a=0;a0||r+t(be.stream_ops.write(e,t,0,n,r,!1),0)}},ye=i.preloadPlugins||[],qe=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},ve={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},we={},Ee={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=le.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ee.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ee.root,s="/",i=0;i40)throw new Ee.ErrnoError(32)}}return{path:s,node:n}},getPath(e){for(var t;;){if(Ee.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n>>0)%Ee.nameTable.length},hashAddNode(e){var t=Ee.hashName(e.parent.id,e.name);e.name_next=Ee.nameTable[t],Ee.nameTable[t]=e},hashRemoveNode(e){var t=Ee.hashName(e.parent.id,e.name);if(Ee.nameTable[t]===e)Ee.nameTable[t]=e.name_next;else for(var r=Ee.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ee.mayLookup(e);if(r)throw new Ee.ErrnoError(r,e);for(var n=Ee.hashName(e.id,t),s=Ee.nameTable[n];s;s=s.name_next){var i=s.name;if(s.parent.id===e.id&&i===t)return s}return Ee.lookup(e,t)},createNode(e,t,r,n){O("object"==typeof e);var s=new Ee.FSNode(e,t,r,n);return Ee.hashAddNode(s),s},destroyNode(e){Ee.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Ee.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Ee.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,t){try{return Ee.lookupNode(e,t),20}catch(e){}return Ee.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Ee.lookupNode(e,t)}catch(e){return e.errno}var s=Ee.nodePermissions(e,"wx");if(s)return s;if(r){if(!Ee.isDir(n.mode))return 54;if(Ee.isRoot(n)||Ee.getPath(n)===Ee.cwd())return 10}else if(Ee.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ee.isLink(e.mode)?32:Ee.isDir(e.mode)&&("r"!==Ee.flagsToPermissionString(t)||512&t)?31:Ee.nodePermissions(e,Ee.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ee.MAX_OPEN_FDS;e++)if(!Ee.streams[e])return e;throw new Ee.ErrnoError(33)},getStreamChecked(e){var t=Ee.getStream(e);if(!t)throw new Ee.ErrnoError(8);return t},getStream:e=>Ee.streams[e],createStream:(e,t=-1)=>(Ee.FSStream||(Ee.FSStream=function(){this.shared={}},Ee.FSStream.prototype={},Object.defineProperties(Ee.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Ee.FSStream,e),-1==t&&(t=Ee.nextfd()),e.fd=t,Ee.streams[t]=e,e),closeStream(e){Ee.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ee.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Ee.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ee.devices[e]={stream_ops:t}},getDevice:e=>Ee.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ee.syncFSRequests++,Ee.syncFSRequests>1&&E(`warning: ${Ee.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ee.getMounts(Ee.root.mount),n=0;function s(e){return O(Ee.syncFSRequests>0),Ee.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,s(e));++n>=r.length&&s(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,r){if("string"==typeof e)throw e;var n,s="/"===r,i=!r;if(s&&Ee.root)throw new Ee.ErrnoError(10);if(!s&&!i){var o=Ee.lookupPath(r,{follow_mount:!1});if(r=o.path,n=o.node,Ee.isMountpoint(n))throw new Ee.ErrnoError(10);if(!Ee.isDir(n.mode))throw new Ee.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(a);return l.mount=a,a.root=l,s?Ee.root=l:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),l},unmount(e){var t=Ee.lookupPath(e,{follow_mount:!1});if(!Ee.isMountpoint(t.node))throw new Ee.ErrnoError(28);var r=t.node,n=r.mounted,s=Ee.getMounts(n);Object.keys(Ee.nameTable).forEach((e=>{for(var t=Ee.nameTable[e];t;){var r=t.name_next;s.includes(t.mount)&&Ee.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);O(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Ee.lookupPath(e,{parent:!0}).node,s=oe.basename(e);if(!s||"."===s||".."===s)throw new Ee.ErrnoError(28);var i=Ee.mayCreate(n,s);if(i)throw new Ee.ErrnoError(i);if(!n.node_ops.mknod)throw new Ee.ErrnoError(63);return n.node_ops.mknod(n,s,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ee.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ee.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",s=0;s(void 0===r&&(r=t,t=438),t|=8192,Ee.mknod(e,t,r)),symlink(e,t){if(!le.resolve(e))throw new Ee.ErrnoError(44);var r=Ee.lookupPath(t,{parent:!0}).node;if(!r)throw new Ee.ErrnoError(44);var n=oe.basename(t),s=Ee.mayCreate(r,n);if(s)throw new Ee.ErrnoError(s);if(!r.node_ops.symlink)throw new Ee.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,s=oe.dirname(e),i=oe.dirname(t),o=oe.basename(e),a=oe.basename(t);if(r=Ee.lookupPath(e,{parent:!0}).node,n=Ee.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ee.ErrnoError(44);if(r.mount!==n.mount)throw new Ee.ErrnoError(75);var l,c=Ee.lookupNode(r,o),_=le.relative(e,i);if("."!==_.charAt(0))throw new Ee.ErrnoError(28);if("."!==(_=le.relative(t,s)).charAt(0))throw new Ee.ErrnoError(55);try{l=Ee.lookupNode(n,a)}catch(e){}if(c!==l){var u=Ee.isDir(c.mode),d=Ee.mayDelete(r,o,u);if(d)throw new Ee.ErrnoError(d);if(d=l?Ee.mayDelete(n,a,u):Ee.mayCreate(n,a))throw new Ee.ErrnoError(d);if(!r.node_ops.rename)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(c)||l&&Ee.isMountpoint(l))throw new Ee.ErrnoError(10);if(n!==r&&(d=Ee.nodePermissions(r,"w")))throw new Ee.ErrnoError(d);Ee.hashRemoveNode(c);try{r.node_ops.rename(c,n,a)}catch(e){throw e}finally{Ee.hashAddNode(c)}}},rmdir(e){var t=Ee.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=Ee.lookupNode(t,r),s=Ee.mayDelete(t,r,!0);if(s)throw new Ee.ErrnoError(s);if(!t.node_ops.rmdir)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.rmdir(t,r),Ee.destroyNode(n)},readdir(e){var t=Ee.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ee.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ee.lookupPath(e,{parent:!0}).node;if(!t)throw new Ee.ErrnoError(44);var r=oe.basename(e),n=Ee.lookupNode(t,r),s=Ee.mayDelete(t,r,!1);if(s)throw new Ee.ErrnoError(s);if(!t.node_ops.unlink)throw new Ee.ErrnoError(63);if(Ee.isMountpoint(n))throw new Ee.ErrnoError(10);t.node_ops.unlink(t,r),Ee.destroyNode(n)},readlink(e){var t=Ee.lookupPath(e).node;if(!t)throw new Ee.ErrnoError(44);if(!t.node_ops.readlink)throw new Ee.ErrnoError(28);return le.resolve(Ee.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ee.lookupPath(e,{follow:!t}).node;if(!r)throw new Ee.ErrnoError(44);if(!r.node_ops.getattr)throw new Ee.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ee.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Ee.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Ee.chmod(e,t,!0)},fchmod(e,t){var r=Ee.getStreamChecked(e);Ee.chmod(r.node,t)},chown(e,t,r,n){var s;if(!(s="string"==typeof e?Ee.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,r){Ee.chown(e,t,r,!0)},fchown(e,t,r){var n=Ee.getStreamChecked(e);Ee.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Ee.ErrnoError(28);var r;if(!(r="string"==typeof e?Ee.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ee.ErrnoError(63);if(Ee.isDir(r.mode))throw new Ee.ErrnoError(31);if(!Ee.isFile(r.mode))throw new Ee.ErrnoError(28);var n=Ee.nodePermissions(r,"w");if(n)throw new Ee.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ee.getStreamChecked(e);if(!(2097155&r.flags))throw new Ee.ErrnoError(28);Ee.truncate(r.node,t)},utime(e,t,r){var n=Ee.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ee.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=oe.normalize(e);try{n=Ee.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(n){if(128&t)throw new Ee.ErrnoError(20)}else n=Ee.mknod(e,r,0),s=!0;if(!n)throw new Ee.ErrnoError(44);if(Ee.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ee.isDir(n.mode))throw new Ee.ErrnoError(54);if(!s){var o=Ee.mayOpen(n,t);if(o)throw new Ee.ErrnoError(o)}512&t&&!s&&Ee.truncate(n,0),t&=-131713;var a=Ee.createStream({node:n,path:Ee.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(Ee.readFiles||(Ee.readFiles={}),e in Ee.readFiles||(Ee.readFiles[e]=1)),a},close(e){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ee.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ee.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ee.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,s){if(O(r>=0),n<0||s<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(1==(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.read)throw new Ee.ErrnoError(28);var i=void 0!==s;if(i){if(!e.seekable)throw new Ee.ErrnoError(70)}else s=e.position;var o=e.stream_ops.read(e,t,r,n,s);return i||(e.position+=o),o},write(e,t,r,n,s,i){if(O(r>=0),n<0||s<0)throw new Ee.ErrnoError(28);if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(Ee.isDir(e.node.mode))throw new Ee.ErrnoError(31);if(!e.stream_ops.write)throw new Ee.ErrnoError(28);e.seekable&&1024&e.flags&&Ee.llseek(e,0,2);var o=void 0!==s;if(o){if(!e.seekable)throw new Ee.ErrnoError(70)}else s=e.position;var a=e.stream_ops.write(e,t,r,n,s,i);return o||(e.position+=a),a},allocate(e,t,r){if(Ee.isClosed(e))throw new Ee.ErrnoError(8);if(t<0||r<=0)throw new Ee.ErrnoError(28);if(!(2097155&e.flags))throw new Ee.ErrnoError(8);if(!Ee.isFile(e.node.mode)&&!Ee.isDir(e.node.mode))throw new Ee.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ee.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,s){if(2&n&&!(2&s)&&2!=(2097155&e.flags))throw new Ee.ErrnoError(2);if(1==(2097155&e.flags))throw new Ee.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ee.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,s)},msync:(e,t,r,n,s)=>(O(r>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,s):0),munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ee.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Ee.open(e,t.flags),s=Ee.stat(e).size,i=new Uint8Array(s);return Ee.read(n,i,0,s,0),"utf8"===t.encoding?r=_e(i,0):"binary"===t.encoding&&(r=i),Ee.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Ee.open(e,r.flags,r.mode);if("string"==typeof t){var s=new Uint8Array(de(t)+1),i=fe(t,s,0,s.length);Ee.write(n,s,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ee.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ee.close(n)},cwd:()=>Ee.currentPath,chdir(e){var t=Ee.lookupPath(e,{follow:!0});if(null===t.node)throw new Ee.ErrnoError(44);if(!Ee.isDir(t.node.mode))throw new Ee.ErrnoError(54);var r=Ee.nodePermissions(t.node,"x");if(r)throw new Ee.ErrnoError(r);Ee.currentPath=t.path},createDefaultDirectories(){Ee.mkdir("/tmp"),Ee.mkdir("/home"),Ee.mkdir("/home/web_user")},createDefaultDevices(){Ee.mkdir("/dev"),Ee.registerDevice(Ee.makedev(1,3),{read:()=>0,write:(e,t,r,n,s)=>n}),Ee.mkdev("/dev/null",Ee.makedev(1,3)),he.register(Ee.makedev(5,0),he.default_tty_ops),he.register(Ee.makedev(6,0),he.default_tty1_ops),Ee.mkdev("/dev/tty",Ee.makedev(5,0)),Ee.mkdev("/dev/tty1",Ee.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ae(e).byteLength),e[--t]);Ee.createDevice("/dev","random",r),Ee.createDevice("/dev","urandom",r),Ee.mkdir("/dev/shm"),Ee.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ee.mkdir("/proc");var e=Ee.mkdir("/proc/self");Ee.mkdir("/proc/self/fd"),Ee.mount({mount(){var t=Ee.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Ee.getStreamChecked(r),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return s.parent=s,s}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?Ee.createDevice("/dev","stdin",i.stdin):Ee.symlink("/dev/tty","/dev/stdin"),i.stdout?Ee.createDevice("/dev","stdout",null,i.stdout):Ee.symlink("/dev/tty","/dev/stdout"),i.stderr?Ee.createDevice("/dev","stderr",null,i.stderr):Ee.symlink("/dev/tty1","/dev/stderr");var e=Ee.open("/dev/stdin",0),t=Ee.open("/dev/stdout",1),r=Ee.open("/dev/stderr",1);O(0===e.fd,`invalid handle for stdin (${e.fd})`),O(1===t.fd,`invalid handle for stdout (${t.fd})`),O(2===r.fd,`invalid handle for stderr (${r.fd})`)},ensureErrnoError(){Ee.ErrnoError||(Ee.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){for(var t in this.errno=e,we)if(we[t]===e){this.code=t;break}},this.setErrno(e),this.message=ve[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var t,r=(t=e,ie("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),t);return e===r?e:r+" ["+e+"]"})))},Ee.ErrnoError.prototype=new Error,Ee.ErrnoError.prototype.constructor=Ee.ErrnoError,[44].forEach((e=>{Ee.genericErrors[e]=new Ee.ErrnoError(e),Ee.genericErrors[e].stack=""})))},staticInit(){Ee.ensureErrnoError(),Ee.nameTable=new Array(4096),Ee.mount(be,{},"/"),Ee.createDefaultDirectories(),Ee.createDefaultDevices(),Ee.createSpecialDirectories(),Ee.filesystems={MEMFS:be}},init(e,t,r){O(!Ee.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Ee.init.initialized=!0,Ee.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,Ee.createStandardStreams()},quit(){Ee.init.initialized=!1,Ue(0);for(var e=0;ethis.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),s=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;s||(o=n);var a=this;a.setDataGetter((e=>{var t=e*o,s=(e+1)*o-1;if(s=Math.min(s,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var s=new XMLHttpRequest;if(s.open("GET",r,!1),n!==o&&s.setRequestHeader("Range","bytes="+e+"-"+t),s.responseType="arraybuffer",s.overrideMimeType&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.send(null),!(s.status>=200&&s.status<300||304===s.status))throw new Error("Couldn't load "+r+". Status: "+s.status);return void 0!==s.response?new Uint8Array(s.response||[]):pe(s.responseText||"",!0)})(t,s)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&n||(o=n=1,n=this.getter(0).length,o=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var o=new i;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:o}}else a={isDevice:!1,url:r};var l=Ee.createFile(e,t,a,n,s);a.contents?l.contents=a.contents:a.url&&(l.contents=null,l.url=a.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function _(e,t,r,n,s){var i=e.node.contents;if(s>=i.length)return 0;var o=Math.min(i.length-s,n);if(O(o>=0),i.slice)for(var a=0;a{var t=l.stream_ops[e];c[e]=function(){return Ee.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,r,n,s)=>(Ee.forceLoadFile(l),_(e,t,r,n,s)),c.mmap=(e,t,r,n,s)=>{Ee.forceLoadFile(l);var i=ge(t);if(!i)throw new Ee.ErrnoError(48);return _(e,S,i,t,r),{ptr:i,allocated:!0}},l.stream_ops=c,l},absolutePath(){$("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){$("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){$("FS.createLink has been removed; use FS.symlink instead")},joinPath(){$("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){$("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){$("FS.standardizePath has been removed; use PATH.normalize instead")}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(oe.isAbs(t))return t;var n;if(n=-100===e?Ee.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ee.ErrnoError(44);return n}return oe.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(Ee.getPath(e.node)))return-54;throw e}T[r>>2]=n.dev,T[r+4>>2]=n.mode,I[r+8>>2]=n.nlink,T[r+12>>2]=n.uid,T[r+16>>2]=n.gid,T[r+20>>2]=n.rdev,k[r+24>>3]=BigInt(n.size),T[r+32>>2]=4096,T[r+36>>2]=n.blocks;var s=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return k[r+40>>3]=BigInt(Math.floor(s/1e3)),I[r+48>>2]=s%1e3*1e3,k[r+56>>3]=BigInt(Math.floor(i/1e3)),I[r+64>>2]=i%1e3*1e3,k[r+72>>3]=BigInt(Math.floor(o/1e3)),I[r+80>>2]=o%1e3*1e3,k[r+88>>3]=BigInt(n.ino),0},doMsync(e,t,r,n,s){if(!Ee.isFile(t.node.mode))throw new Ee.ErrnoError(43);if(2&n)return 0;var i=A.slice(e,e+r);Ee.msync(t,i,s,r,n)},varargs:void 0,get(){O(null!=Se.varargs);var e=T[+Se.varargs>>2];return Se.varargs+=4,e},getp:()=>Se.get(),getStr(e){var t=(e=>(O("number"==typeof e),e?_e(A,e,void 0):""))(e);return t},getStreamFromFD:e=>Ee.getStreamChecked(e)},Ae=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),xe=(e,t,r)=>(O("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),fe(e,A,t,r)),Te=e=>I[e>>2]+4294967296*T[e+4>>2],Ie=[0,31,60,91,121,152,182,213,244,274,305,335],ke=[0,31,59,90,120,151,181,212,243,273,304,334],Fe=e=>{var t=de(e)+1,r=je(t);return r&&xe(e,r,t),r};me=()=>performance.now();var Oe=e=>{var t=q.buffer,r=(e-t.byteLength+65535)/65536;try{return q.grow(r),P(),1}catch(r){E(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${r}`)}},Pe={},Le=()=>{if(!Le.strings){var 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",_:c||"./this.program"};for(var t in Pe)void 0===Pe[t]?delete e[t]:e[t]=Pe[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Le.strings=r}return Le.strings},Ce=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ee.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Ce.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Ee.isDir(this.mode)}},isDevice:{get:function(){return Ee.isChrdev(this.mode)}}}),Ee.FSNode=Ce,Ee.createPreloadedFile=(e,t,r,n,s,i,o,a,l,c)=>{var _=t?le.resolve(oe.join2(e,t)):e,u=Q(`cp ${_}`);function d(r){function d(r){c&&c(),a||((e,t,r,n,s,i)=>{Ee.createDataFile(e,t,r,n,s,i)})(e,t,r,n,s,l),i&&i(),V(u)}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var s=!1;return ye.forEach((i=>{s||i.canHandle(t)&&(i.handle(e,t,r,n),s=!0)})),s})(r,_,d,(()=>{o&&o(),V(u)}))||d(r)}G(u),"string"==typeof r?((e,t,r)=>{var n=Q(`al ${e}`);m(e,(t=>{O(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),n&&V(n)}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&G(n)})(r,0,o):d(r)},Ee.staticInit(),we={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var Ne,De={__syscall_chmod:function(e,t){try{return e=Se.getStr(e),Ee.chmod(e,t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_faccessat:function(e,t,r,n){try{if(t=Se.getStr(t),O(0===n),t=Se.calculateAt(e,t),-8&r)return-28;var s=Ee.lookupPath(t,{follow:!0}).node;if(!s)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&Ee.nodePermissions(s,i)?-2:0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchmod:function(e,t){try{return Ee.fchmod(e,t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchown32:function(e,t,r){try{return Ee.fchown(e,t,r),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fcntl64:function(e,t,r){Se.varargs=r;try{var n=Se.getStreamFromFD(e);switch(t){case 0:if((s=Se.get())<0)return-28;for(;Ee.streams[s];)s++;return Ee.createStream(n,s).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var s=Se.get();return n.flags|=s,0;case 5:return s=Se.getp(),x[s+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Me()>>2]=28,-1}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var r=Se.getStreamFromFD(e);return Se.doStat(Ee.stat,r.path,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t){t=Ae(t);try{return isNaN(t)?61:(Ee.ftruncate(e,t),0)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_getcwd:function(e,t){try{if(0===t)return-28;var r=Ee.cwd(),n=de(r)+1;return t>2]=s.c_iflag||0,T[i+4>>2]=s.c_oflag||0,T[i+8>>2]=s.c_cflag||0,T[i+12>>2]=s.c_lflag||0;for(var o=0;o<32;o++)S[i+o+17|0]=s.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Se.getp();var a=T[i>>2],l=T[i+4>>2],c=T[i+8>>2],_=T[i+12>>2],u=[];for(o=0;o<32;o++)u.push(S[i+o+17|0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:a,c_oflag:l,c_cflag:c,c_lflag:_,c_cc:u})}return 0;case 21519:return n.tty?(i=Se.getp(),T[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Se.getp(),Ee.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var d=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Se.getp(),x[i>>1]=d[0],x[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(Ee.lstat,e,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_mkdirat:function(e,t,r){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),"/"===(t=oe.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Ee.mkdir(t,r,0),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,r,n){try{t=Se.getStr(t);var s=256&n,i=4096&n;return O(!(n&=-6401),`unknown flags in __syscall_newfstatat: ${n}`),t=Se.calculateAt(e,t,i),Se.doStat(s?Ee.lstat:Ee.stat,t,r)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,r,n){Se.varargs=n;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var s=n?Se.get():0;return Ee.open(t,r,s).fd}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_readlinkat:function(e,t,r,n){try{if(t=Se.getStr(t),t=Se.calculateAt(e,t),n<=0)return-28;var s=Ee.readlink(t),i=Math.min(n,de(s)),o=S[r+i];return xe(s,r,n+1),S[r+i]=o,i}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Se.getStr(e),Ee.rmdir(e),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(Ee.stat,e,t)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,r){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),0===r?Ee.unlink(t):512===r?Ee.rmdir(t):$("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_utimensat:function(e,t,r,n){try{if(t=Se.getStr(t),O(0===n),t=Se.calculateAt(e,t,!0),r){var s=Te(r),i=T[r+8>>2];o=1e3*s+i/1e6,a=1e3*(s=Te(r+=16))+(i=T[r+8>>2])/1e6}else var o=Date.now(),a=o;return Ee.utime(t,o,a),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_emscripten_get_now_is_monotonic:()=>!0,_localtime_js:function(e,t){e=Ae(e);var r=new Date(1e3*e);T[t>>2]=r.getSeconds(),T[t+4>>2]=r.getMinutes(),T[t+8>>2]=r.getHours(),T[t+12>>2]=r.getDate(),T[t+16>>2]=r.getMonth(),T[t+20>>2]=r.getFullYear()-1900,T[t+24>>2]=r.getDay();var n=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?ke:Ie)[e.getMonth()]+e.getDate()-1})(r);T[t+28>>2]=n,T[t+36>>2]=-60*r.getTimezoneOffset();var s=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),o=s.getTimezoneOffset(),a=0|(i!=o&&r.getTimezoneOffset()==Math.min(o,i));T[t+32>>2]=a},_mmap_js:function(e,t,r,n,s,i,o){s=Ae(s);try{if(isNaN(s))return 61;var a=Se.getStreamFromFD(n),l=Ee.mmap(a,e,s,t,r),c=l.ptr;return T[i>>2]=l.allocated,I[o>>2]=c,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_munmap_js:function(e,t,r,n,s,i){i=Ae(i);try{if(isNaN(i))return 61;var o=Se.getStreamFromFD(s);2&r&&Se.doMsync(e,o,t,n,i),Ee.munmap(o)}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return-e.errno}},_tzset_js:(e,t,r)=>{var n=(new Date).getFullYear(),s=new Date(n,0,1),i=new Date(n,6,1),o=s.getTimezoneOffset(),a=i.getTimezoneOffset(),l=Math.max(o,a);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[e>>2]=60*l,T[t>>2]=Number(o!=a);var _=c(s),u=c(i),d=Fe(_),f=Fe(u);a>2]=d,I[r+4>>2]=f):(I[r>>2]=f,I[r+4>>2]=d)},emscripten_date_now:()=>Date.now(),emscripten_get_now:me,emscripten_memcpy_js:(e,t,r)=>A.copyWithin(e,t,t+r),emscripten_resize_heap:e=>{var t=A.length;O((e>>>=0)>t);var r=2147483648;if(e>r)return E(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var n,s=1;s<=4;s*=2){var i=t*(1+.2/s);i=Math.min(i,e+100663296);var o=Math.min(r,(n=Math.max(e,i))+(65536-n%65536)%65536);if(Oe(o))return!0}return E(`Failed to grow the heap from ${t} bytes to ${o} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var r=0;return Le().forEach(((n,s)=>{var i=t+r;I[e+4*s>>2]=i,((e,t)=>{for(var r=0;r{var r=Le();I[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),I[t>>2]=n,0},fd_close:function(e){try{var t=Se.getStreamFromFD(e);return Ee.close(t),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,t){try{var r=Se.getStreamFromFD(e),n=r.tty?2:Ee.isDir(r.mode)?3:Ee.isLink(r.mode)?7:4;return S[0|t]=n,x[t+2>>1]=0,k[t+8>>3]=BigInt(0),k[t+16>>3]=BigInt(0),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,t,r,n){try{var s=((e,t,r,n)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=Ee.read(e,S,o,a,n);if(l<0)return-1;if(s+=l,l>2]=s,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,r,n){t=Ae(t);try{if(isNaN(t))return 61;var s=Se.getStreamFromFD(e);return Ee.llseek(s,t,r),k[n>>3]=BigInt(s.position),s.getdents&&0===t&&0===r&&(s.getdents=null),0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Se.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,t,r,n){try{var s=((e,t,r,n)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=Ee.write(e,S,o,a,n);if(l<0)return-1;s+=l,void 0!==n&&(n+=l)}return s})(Se.getStreamFromFD(e),t,r);return I[n>>2]=s,0}catch(e){if(void 0===Ee||"ErrnoError"!==e.name)throw e;return e.errno}},memory:q},Re=function(){var e={env:De,wasi_snapshot_preview1:De};function t(e,t){var r;return r=(Re=e.exports).__wasm_call_ctors,D.unshift(r),V("wasm-instantiate"),Re}G("wasm-instantiate");var r,n,o,a,l=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){E(`Module.instantiateWasm callback failed with error: ${e}`),s(e)}return(r=y,n=j,o=e,a=function(e){O(i===l,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),l=null,t(e.instance)},r||"function"!=typeof WebAssembly.instantiateStreaming||K(n)||"function"!=typeof fetch?X(n,o,a):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return E(`wasm streaming compile failed: ${e}`),E("falling back to ArrayBuffer instantiation"),X(n,o,a)}))))).catch(s),{}}(),Me=(J("__wasm_call_ctors"),i._sqlite3_status64=J("sqlite3_status64"),i._sqlite3_status=J("sqlite3_status"),i._sqlite3_db_status=J("sqlite3_db_status"),i._sqlite3_msize=J("sqlite3_msize"),i._sqlite3_vfs_find=J("sqlite3_vfs_find"),i._sqlite3_initialize=J("sqlite3_initialize"),i._sqlite3_vfs_register=J("sqlite3_vfs_register"),i._sqlite3_vfs_unregister=J("sqlite3_vfs_unregister"),i._sqlite3_malloc=J("sqlite3_malloc"),i._sqlite3_malloc64=J("sqlite3_malloc64"),i._sqlite3_free=J("sqlite3_free"),i._sqlite3_realloc=J("sqlite3_realloc"),i._sqlite3_realloc64=J("sqlite3_realloc64"),i._sqlite3_value_int64=J("sqlite3_value_int64"),i._sqlite3_value_double=J("sqlite3_value_double"),i._sqlite3_value_text=J("sqlite3_value_text"),i._sqlite3_randomness=J("sqlite3_randomness"),i._sqlite3_stricmp=J("sqlite3_stricmp"),i._sqlite3_strnicmp=J("sqlite3_strnicmp"),J("__errno_location")),je=(i._sqlite3_serialize=J("sqlite3_serialize"),i._sqlite3_prepare_v2=J("sqlite3_prepare_v2"),i._sqlite3_step=J("sqlite3_step"),i._sqlite3_column_int64=J("sqlite3_column_int64"),i._sqlite3_column_int=J("sqlite3_column_int"),i._sqlite3_finalize=J("sqlite3_finalize"),i._sqlite3_file_control=J("sqlite3_file_control"),i._sqlite3_reset=J("sqlite3_reset"),i._sqlite3_value_int=J("sqlite3_value_int"),i._sqlite3_deserialize=J("sqlite3_deserialize"),i._sqlite3_clear_bindings=J("sqlite3_clear_bindings"),i._sqlite3_value_blob=J("sqlite3_value_blob"),i._sqlite3_value_bytes=J("sqlite3_value_bytes"),i._sqlite3_value_subtype=J("sqlite3_value_subtype"),i._sqlite3_value_pointer=J("sqlite3_value_pointer"),i._sqlite3_value_type=J("sqlite3_value_type"),i._sqlite3_value_nochange=J("sqlite3_value_nochange"),i._sqlite3_value_frombind=J("sqlite3_value_frombind"),i._sqlite3_value_dup=J("sqlite3_value_dup"),i._sqlite3_value_free=J("sqlite3_value_free"),i._sqlite3_result_blob=J("sqlite3_result_blob"),i._sqlite3_result_error_toobig=J("sqlite3_result_error_toobig"),i._sqlite3_result_error_nomem=J("sqlite3_result_error_nomem"),i._sqlite3_result_double=J("sqlite3_result_double"),i._sqlite3_result_error=J("sqlite3_result_error"),i._sqlite3_result_int=J("sqlite3_result_int"),i._sqlite3_result_int64=J("sqlite3_result_int64"),i._sqlite3_result_null=J("sqlite3_result_null"),i._sqlite3_result_pointer=J("sqlite3_result_pointer"),i._sqlite3_result_subtype=J("sqlite3_result_subtype"),i._sqlite3_result_text=J("sqlite3_result_text"),i._sqlite3_result_zeroblob=J("sqlite3_result_zeroblob"),i._sqlite3_result_zeroblob64=J("sqlite3_result_zeroblob64"),i._sqlite3_result_error_code=J("sqlite3_result_error_code"),i._sqlite3_sql=J("sqlite3_sql"),i._sqlite3_user_data=J("sqlite3_user_data"),i._sqlite3_context_db_handle=J("sqlite3_context_db_handle"),i._sqlite3_vtab_nochange=J("sqlite3_vtab_nochange"),i._sqlite3_vtab_in_first=J("sqlite3_vtab_in_first"),i._sqlite3_vtab_in_next=J("sqlite3_vtab_in_next"),i._sqlite3_aggregate_context=J("sqlite3_aggregate_context"),i._sqlite3_get_auxdata=J("sqlite3_get_auxdata"),i._sqlite3_set_auxdata=J("sqlite3_set_auxdata"),i._sqlite3_column_count=J("sqlite3_column_count"),i._sqlite3_data_count=J("sqlite3_data_count"),i._sqlite3_column_blob=J("sqlite3_column_blob"),i._sqlite3_column_bytes=J("sqlite3_column_bytes"),i._sqlite3_column_double=J("sqlite3_column_double"),i._sqlite3_column_text=J("sqlite3_column_text"),i._sqlite3_column_value=J("sqlite3_column_value"),i._sqlite3_column_type=J("sqlite3_column_type"),i._sqlite3_column_name=J("sqlite3_column_name"),i._sqlite3_bind_blob=J("sqlite3_bind_blob"),i._sqlite3_bind_double=J("sqlite3_bind_double"),i._sqlite3_bind_int=J("sqlite3_bind_int"),i._sqlite3_bind_int64=J("sqlite3_bind_int64"),i._sqlite3_bind_null=J("sqlite3_bind_null"),i._sqlite3_bind_pointer=J("sqlite3_bind_pointer"),i._sqlite3_bind_text=J("sqlite3_bind_text"),i._sqlite3_bind_parameter_count=J("sqlite3_bind_parameter_count"),i._sqlite3_bind_parameter_index=J("sqlite3_bind_parameter_index"),i._sqlite3_db_handle=J("sqlite3_db_handle"),i._sqlite3_stmt_readonly=J("sqlite3_stmt_readonly"),i._sqlite3_stmt_isexplain=J("sqlite3_stmt_isexplain"),i._sqlite3_stmt_status=J("sqlite3_stmt_status"),i._sqlite3_expanded_sql=J("sqlite3_expanded_sql"),i._sqlite3_preupdate_old=J("sqlite3_preupdate_old"),i._sqlite3_preupdate_count=J("sqlite3_preupdate_count"),i._sqlite3_preupdate_depth=J("sqlite3_preupdate_depth"),i._sqlite3_preupdate_blobwrite=J("sqlite3_preupdate_blobwrite"),i._sqlite3_preupdate_new=J("sqlite3_preupdate_new"),i._sqlite3_value_numeric_type=J("sqlite3_value_numeric_type"),i._sqlite3_errmsg=J("sqlite3_errmsg"),i._sqlite3_set_authorizer=J("sqlite3_set_authorizer"),i._sqlite3_strglob=J("sqlite3_strglob"),i._sqlite3_strlike=J("sqlite3_strlike"),i._sqlite3_exec=J("sqlite3_exec"),i._sqlite3_auto_extension=J("sqlite3_auto_extension"),i._sqlite3_cancel_auto_extension=J("sqlite3_cancel_auto_extension"),i._sqlite3_reset_auto_extension=J("sqlite3_reset_auto_extension"),i._sqlite3_prepare_v3=J("sqlite3_prepare_v3"),i._sqlite3_create_module=J("sqlite3_create_module"),i._sqlite3_create_module_v2=J("sqlite3_create_module_v2"),i._sqlite3_drop_modules=J("sqlite3_drop_modules"),i._sqlite3_declare_vtab=J("sqlite3_declare_vtab"),i._sqlite3_vtab_on_conflict=J("sqlite3_vtab_on_conflict"),i._sqlite3_vtab_collation=J("sqlite3_vtab_collation"),i._sqlite3_vtab_in=J("sqlite3_vtab_in"),i._sqlite3_vtab_rhs_value=J("sqlite3_vtab_rhs_value"),i._sqlite3_vtab_distinct=J("sqlite3_vtab_distinct"),i._sqlite3_keyword_name=J("sqlite3_keyword_name"),i._sqlite3_keyword_count=J("sqlite3_keyword_count"),i._sqlite3_keyword_check=J("sqlite3_keyword_check"),i._sqlite3_complete=J("sqlite3_complete"),i._sqlite3_libversion=J("sqlite3_libversion"),i._sqlite3_libversion_number=J("sqlite3_libversion_number"),i._sqlite3_shutdown=J("sqlite3_shutdown"),i._sqlite3_last_insert_rowid=J("sqlite3_last_insert_rowid"),i._sqlite3_set_last_insert_rowid=J("sqlite3_set_last_insert_rowid"),i._sqlite3_changes64=J("sqlite3_changes64"),i._sqlite3_changes=J("sqlite3_changes"),i._sqlite3_total_changes64=J("sqlite3_total_changes64"),i._sqlite3_total_changes=J("sqlite3_total_changes"),i._sqlite3_txn_state=J("sqlite3_txn_state"),i._sqlite3_close_v2=J("sqlite3_close_v2"),i._sqlite3_busy_handler=J("sqlite3_busy_handler"),i._sqlite3_progress_handler=J("sqlite3_progress_handler"),i._sqlite3_busy_timeout=J("sqlite3_busy_timeout"),i._sqlite3_create_function=J("sqlite3_create_function"),i._sqlite3_create_function_v2=J("sqlite3_create_function_v2"),i._sqlite3_create_window_function=J("sqlite3_create_window_function"),i._sqlite3_overload_function=J("sqlite3_overload_function"),i._sqlite3_trace_v2=J("sqlite3_trace_v2"),i._sqlite3_commit_hook=J("sqlite3_commit_hook"),i._sqlite3_update_hook=J("sqlite3_update_hook"),i._sqlite3_rollback_hook=J("sqlite3_rollback_hook"),i._sqlite3_preupdate_hook=J("sqlite3_preupdate_hook"),i._sqlite3_error_offset=J("sqlite3_error_offset"),i._sqlite3_errcode=J("sqlite3_errcode"),i._sqlite3_extended_errcode=J("sqlite3_extended_errcode"),i._sqlite3_errstr=J("sqlite3_errstr"),i._sqlite3_limit=J("sqlite3_limit"),i._sqlite3_open=J("sqlite3_open"),i._sqlite3_open_v2=J("sqlite3_open_v2"),i._sqlite3_create_collation=J("sqlite3_create_collation"),i._sqlite3_create_collation_v2=J("sqlite3_create_collation_v2"),i._sqlite3_collation_needed=J("sqlite3_collation_needed"),i._sqlite3_table_column_metadata=J("sqlite3_table_column_metadata"),i._sqlite3_extended_result_codes=J("sqlite3_extended_result_codes"),i._sqlite3_uri_parameter=J("sqlite3_uri_parameter"),i._sqlite3_uri_key=J("sqlite3_uri_key"),i._sqlite3_uri_boolean=J("sqlite3_uri_boolean"),i._sqlite3_uri_int64=J("sqlite3_uri_int64"),i._sqlite3_db_name=J("sqlite3_db_name"),i._sqlite3_db_filename=J("sqlite3_db_filename"),i._sqlite3_compileoption_used=J("sqlite3_compileoption_used"),i._sqlite3_compileoption_get=J("sqlite3_compileoption_get"),i._sqlite3session_diff=J("sqlite3session_diff"),i._sqlite3session_attach=J("sqlite3session_attach"),i._sqlite3session_create=J("sqlite3session_create"),i._sqlite3session_delete=J("sqlite3session_delete"),i._sqlite3session_table_filter=J("sqlite3session_table_filter"),i._sqlite3session_changeset=J("sqlite3session_changeset"),i._sqlite3session_changeset_strm=J("sqlite3session_changeset_strm"),i._sqlite3session_patchset_strm=J("sqlite3session_patchset_strm"),i._sqlite3session_patchset=J("sqlite3session_patchset"),i._sqlite3session_enable=J("sqlite3session_enable"),i._sqlite3session_indirect=J("sqlite3session_indirect"),i._sqlite3session_isempty=J("sqlite3session_isempty"),i._sqlite3session_memory_used=J("sqlite3session_memory_used"),i._sqlite3session_object_config=J("sqlite3session_object_config"),i._sqlite3session_changeset_size=J("sqlite3session_changeset_size"),i._sqlite3changeset_start=J("sqlite3changeset_start"),i._sqlite3changeset_start_v2=J("sqlite3changeset_start_v2"),i._sqlite3changeset_start_strm=J("sqlite3changeset_start_strm"),i._sqlite3changeset_start_v2_strm=J("sqlite3changeset_start_v2_strm"),i._sqlite3changeset_next=J("sqlite3changeset_next"),i._sqlite3changeset_op=J("sqlite3changeset_op"),i._sqlite3changeset_pk=J("sqlite3changeset_pk"),i._sqlite3changeset_old=J("sqlite3changeset_old"),i._sqlite3changeset_new=J("sqlite3changeset_new"),i._sqlite3changeset_conflict=J("sqlite3changeset_conflict"),i._sqlite3changeset_fk_conflicts=J("sqlite3changeset_fk_conflicts"),i._sqlite3changeset_finalize=J("sqlite3changeset_finalize"),i._sqlite3changeset_invert=J("sqlite3changeset_invert"),i._sqlite3changeset_invert_strm=J("sqlite3changeset_invert_strm"),i._sqlite3changeset_apply_v2=J("sqlite3changeset_apply_v2"),i._sqlite3changeset_apply=J("sqlite3changeset_apply"),i._sqlite3changeset_apply_v2_strm=J("sqlite3changeset_apply_v2_strm"),i._sqlite3changeset_apply_strm=J("sqlite3changeset_apply_strm"),i._sqlite3changegroup_new=J("sqlite3changegroup_new"),i._sqlite3changegroup_add=J("sqlite3changegroup_add"),i._sqlite3changegroup_output=J("sqlite3changegroup_output"),i._sqlite3changegroup_add_strm=J("sqlite3changegroup_add_strm"),i._sqlite3changegroup_output_strm=J("sqlite3changegroup_output_strm"),i._sqlite3changegroup_delete=J("sqlite3changegroup_delete"),i._sqlite3changeset_concat=J("sqlite3changeset_concat"),i._sqlite3changeset_concat_strm=J("sqlite3changeset_concat_strm"),i._sqlite3session_config=J("sqlite3session_config"),i._sqlite3_sourceid=J("sqlite3_sourceid"),i._sqlite3_wasm_pstack_ptr=J("sqlite3_wasm_pstack_ptr"),i._sqlite3_wasm_pstack_restore=J("sqlite3_wasm_pstack_restore"),i._sqlite3_wasm_pstack_alloc=J("sqlite3_wasm_pstack_alloc"),i._sqlite3_wasm_pstack_remaining=J("sqlite3_wasm_pstack_remaining"),i._sqlite3_wasm_pstack_quota=J("sqlite3_wasm_pstack_quota"),i._sqlite3_wasm_db_error=J("sqlite3_wasm_db_error"),i._sqlite3_wasm_test_struct=J("sqlite3_wasm_test_struct"),i._sqlite3_wasm_enum_json=J("sqlite3_wasm_enum_json"),i._sqlite3_wasm_vfs_unlink=J("sqlite3_wasm_vfs_unlink"),i._sqlite3_wasm_db_vfs=J("sqlite3_wasm_db_vfs"),i._sqlite3_wasm_db_reset=J("sqlite3_wasm_db_reset"),i._sqlite3_wasm_db_export_chunked=J("sqlite3_wasm_db_export_chunked"),i._sqlite3_wasm_db_serialize=J("sqlite3_wasm_db_serialize"),i._sqlite3_wasm_vfs_create_file=J("sqlite3_wasm_vfs_create_file"),i._sqlite3_wasm_posix_create_file=J("sqlite3_wasm_posix_create_file"),i._sqlite3_wasm_kvvfsMakeKeyOnPstack=J("sqlite3_wasm_kvvfsMakeKeyOnPstack"),i._sqlite3_wasm_kvvfs_methods=J("sqlite3_wasm_kvvfs_methods"),i._sqlite3_wasm_vtab_config=J("sqlite3_wasm_vtab_config"),i._sqlite3_wasm_db_config_ip=J("sqlite3_wasm_db_config_ip"),i._sqlite3_wasm_db_config_pii=J("sqlite3_wasm_db_config_pii"),i._sqlite3_wasm_db_config_s=J("sqlite3_wasm_db_config_s"),i._sqlite3_wasm_config_i=J("sqlite3_wasm_config_i"),i._sqlite3_wasm_config_ii=J("sqlite3_wasm_config_ii"),i._sqlite3_wasm_config_j=J("sqlite3_wasm_config_j"),i._sqlite3_wasm_init_wasmfs=J("sqlite3_wasm_init_wasmfs"),i._sqlite3_wasm_test_intptr=J("sqlite3_wasm_test_intptr"),i._sqlite3_wasm_test_voidptr=J("sqlite3_wasm_test_voidptr"),i._sqlite3_wasm_test_int64_max=J("sqlite3_wasm_test_int64_max"),i._sqlite3_wasm_test_int64_min=J("sqlite3_wasm_test_int64_min"),i._sqlite3_wasm_test_int64_times2=J("sqlite3_wasm_test_int64_times2"),i._sqlite3_wasm_test_int64_minmax=J("sqlite3_wasm_test_int64_minmax"),i._sqlite3_wasm_test_int64ptr=J("sqlite3_wasm_test_int64ptr"),i._sqlite3_wasm_test_stack_overflow=J("sqlite3_wasm_test_stack_overflow"),i._sqlite3_wasm_test_str_hello=J("sqlite3_wasm_test_str_hello"),i._sqlite3_wasm_SQLTester_strglob=J("sqlite3_wasm_SQLTester_strglob"),i._malloc=J("malloc")),Ue=(i._free=J("free"),i._realloc=J("realloc"),i._fflush=J("fflush")),Be=J("emscripten_builtin_memalign"),ze=()=>(ze=Re.emscripten_stack_init)(),We=()=>(We=Re.emscripten_stack_get_end)();function He(){function e(){Ne||(Ne=!0,i.calledRun=!0,F||(O(!M),M=!0,C(),i.noFSInit||Ee.init.initialized||Ee.init(),Ee.ignorePermissions=!1,he.init(),ne(D),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),O(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(C(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),R.unshift(e);var e;ne(R)}()))}var r;B>0||(ze(),O(!(3&(r=We()))),0==r&&(r+=4),I[r>>2]=34821223,I[r+4>>2]=2310721022,I[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),N.unshift(e);var e;ne(N)}(),B>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e(),C()))}if(J("stackSave"),J("stackRestore"),J("stackAlloc"),i.wasmMemory=q,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","handleAllocatorInit","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",r=e;r.startsWith("_")||(r="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+r+"')",ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ie(t)}}),re(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","keepRuntimeAlive","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","asyncLoad","alignMemory","mmapAlloc","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToNewUTF8","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"].forEach(re),W=function e(){Ne||He(),Ne||(W=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return He(),i.postRun||(i.postRun=[]),i.postRun.push((function(e){if(globalThis.sqlite3ApiBootstrap=function t(r=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return console.warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const n=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:void 0!==e?!!e.HEAPU64:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},r||{});Object.assign(n,{allocExportName:n.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:n.useStdAlloc?"free":"sqlite3_free",reallocExportName:n.useStdAlloc?"realloc":"sqlite3_realloc"},n),["exports","memory","wasmfsOpfsDir"].forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e]())}));const s=Object.create(null),i=Object.create(null),o=e=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(e)||"Unknown result code #"+e;class a extends Error{constructor(...e){let t;if(e.length)if("number"==typeof(r=e[0])&&r===(0|r))if(t=e[0],1===e.length)super(o(e[0]));else{const r=o(t);"object"==typeof e[1]?super(r,e[1]):(e[0]=r+":",super(e.join(" ")))}else 2===e.length&&"object"==typeof e[1]?super(...e):super(e.join(" "));var r;this.resultCode=t||s.SQLITE_ERROR,this.name="SQLite3Error"}}a.toss=(...e)=>{throw new a(...e)};const l=a.toss;n.wasmfsOpfsDir&&!/^\/[^/]+$/.test(n.wasmfsOpfsDir)&&l("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const c=e=>"bigint"!=typeof e&&!!(e===(0|e)&&e<=2147483647&&e>=-2147483648),_="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,u=e=>e.buffer instanceof _,d=(e,t,r)=>u(e)?e.slice(t,r):e.subarray(t,r),f=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),p=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),m=e=>f(e)||l("Value is not of a supported TypedArray type."),h=new TextDecoder("utf-8"),g=function(e,t,r){return h.decode(d(e,t,r))},b=function(e){return p(e)?g(e instanceof ArrayBuffer?new Uint8Array(e):e):Array.isArray(e)?e.join(""):(i.isPtr(e)&&(e=i.cstrToJs(e)),e)};class y extends Error{constructor(...e){2===e.length&&"object"==typeof e[1]?super(...e):e.length?super(e.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}y.toss=(...e)=>{throw new y(...e)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(e,t,r,n,s,i,o,a,l)=>{},sqlite3_create_function:(e,t,r,n,s,i,o,a)=>{},sqlite3_create_window_function:(e,t,r,n,s,i,o,a,l,c)=>{},sqlite3_prepare_v3:(e,t,r,n,s,i)=>{},sqlite3_prepare_v2:(e,t,r,n,s)=>{},sqlite3_exec:(e,t,r,n,s)=>{},sqlite3_randomness:(e,t)=>{}});const q={affirmBindableTypedArray:m,flexibleString:b,bigIntFits32:e=>e>=-2147483648n&&e<=0x7fffffffn,bigIntFits64:function e(t){return e._max||(e._max=BigInt("0x7fffffffffffffff"),e._min=~e._max),t>=e._min&&t<=e._max},bigIntFitsDouble:function e(t){return e._min||(e._min=Number.MIN_SAFE_INTEGER,e._max=Number.MAX_SAFE_INTEGER),t>=e._min&&t<=e._max},isBindableTypedArray:f,isInt32:c,isSQLableTypedArray:p,isTypedArray:e=>!!(e&&e.constructor&&c(e.constructor.BYTES_PER_ELEMENT))&&e,typedArrayToString:g,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:u,toss:function(...e){throw new Error(e.join(" "))},toss3:l,typedArrayPart:d,affirmDbHeader:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));15>e.byteLength&&l("Input does not contain an SQLite3 database header.");for(let t=0;t<15;++t)"SQLite format 3".charCodeAt(t)!==e[t]&&l("Input does not contain an SQLite3 database header.")},affirmIsDb:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const t=e.byteLength;(t<512||t%512!=0)&&l("Byte array size",t,"is invalid for an SQLite3 db."),q.affirmDbHeader(e)}};Object.assign(i,{ptrSizeof:n.wasmPtrSizeof||4,ptrIR:n.wasmPtrIR||"i32",bigIntEnabled:!!n.bigIntEnabled,exports:n.exports||l("Missing API config.exports (WASM module exports)."),memory:n.memory||n.exports.memory||l("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),i.allocFromTypedArray=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e)),m(e);const t=i.alloc(e.byteLength||1);return i.heapForSize(e.constructor).set(e.byteLength?e:[0],t),t};{const e=n.allocExportName,t=n.deallocExportName,r=n.reallocExportName;for(const n of[e,t,r])i.exports[n]instanceof Function||l("Missing required exports[",n,"] function.");i.alloc=function e(t){return e.impl(t)||y.toss("Failed to allocate",t," bytes.")},i.alloc.impl=i.exports[e],i.realloc=function e(t,r){const n=e.impl(t,r);return r?n||y.toss("Failed to reallocate",r," bytes."):0},i.realloc.impl=i.exports[r],i.dealloc=i.exports[t]}let w;if(i.compileOptionUsed=function e(t){if(!arguments.length){if(e._result)return e._result;e._opt||(e._rx=/^([^=]+)=(.+)/,e._rxInt=/^-?\d+$/,e._opt=function(t,r){const n=e._rx.exec(t);r[0]=n?n[1]:t,r[1]=!n||(e._rxInt.test(n[2])?+n[2]:n[2])});const t={},r=[0,0];let n,i=0;for(;n=s.sqlite3_compileoption_get(i++);)e._opt(n,r),t[r[0]]=r[1];return e._result=t}if(Array.isArray(t)){const e={};return t.forEach((t=>{e[t]=s.sqlite3_compileoption_used(t)})),e}return"object"==typeof t?(Object.keys(t).forEach((e=>{t[e]=s.sqlite3_compileoption_used(e)})),t):"string"==typeof t&&!!s.sqlite3_compileoption_used(t)},i.pstack=Object.assign(Object.create(null),{restore:i.exports.sqlite3_wasm_pstack_restore,alloc:function(e){return"string"!=typeof e||(e=i.sizeofIR(e))||y.toss("Invalid value for pstack.alloc(",arguments[0],")"),i.exports.sqlite3_wasm_pstack_alloc(e)||y.toss("Could not allocate",e,"bytes from the pstack.")},allocChunks:function(e,t){"string"!=typeof t||(t=i.sizeofIR(t))||y.toss("Invalid size value for allocChunks(",arguments[1],")");const r=i.pstack.alloc(e*t),n=[];let s=0,o=0;for(;s1===e?i.pstack.alloc(t?8:i.ptrSizeof):i.pstack.allocChunks(e,t?8:i.ptrSizeof),call:function(e){const t=i.pstack.pointer;try{return e(S)}finally{i.pstack.restore(t)}}}),Object.defineProperties(i.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_remaining}}),s.sqlite3_randomness=(...e)=>{if(1===e.length&&q.isTypedArray(e[0])&&1===e[0].BYTES_PER_ELEMENT){const t=e[0];if(0===t.byteLength)return i.exports.sqlite3_randomness(0,0),t;const r=i.pstack.pointer;try{let e=t.byteLength,r=0;const n=i.exports.sqlite3_randomness,s=i.heap8u(),o=e<512?e:512,a=i.pstack.alloc(o);do{const i=e>o?o:e;n(i,a),t.set(d(s,a,a+i),r),e-=i,r+=i}while(e>0)}catch(e){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",e)}finally{i.pstack.restore(r)}return t}i.exports.sqlite3_randomness(...e)},s.sqlite3_wasmfs_opfs_dir=function(){if(void 0!==w)return w;const e=n.wasmfsOpfsDir;if(!(e&&globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle))return w="";try{return w=e&&0===i.xCallWrapped("sqlite3_wasm_init_wasmfs","i32",["string"],e)?e:""}catch(e){return w=""}},s.sqlite3_wasmfs_filename_is_persistent=function(e){const t=s.sqlite3_wasmfs_opfs_dir();return!(!t||!e)&&e.startsWith(t+"/")},s.sqlite3_js_db_uses_vfs=function(e,t,r=0){try{const n=s.sqlite3_vfs_find(t);return!!n&&(e?n===s.sqlite3_js_db_vfs(e,r)&&n:n===s.sqlite3_vfs_find(0)&&n)}catch(e){return!1}},s.sqlite3_js_vfs_list=function(){const e=[];let t=s.sqlite3_vfs_find(0);for(;t;){const r=new s.sqlite3_vfs(t);e.push(i.cstrToJs(r.$zName)),t=r.$pNext,r.dispose()}return e},s.sqlite3_js_db_export=function(e,t=0){(e=i.xWrap.testConvertArg("sqlite3*",e))||l("Invalid sqlite3* argument."),i.bigIntEnabled||l("BigInt64 support is not enabled.");const r=i.scopedAllocPush();let n;try{const r=i.scopedAlloc(8+i.ptrSizeof),s=r+8,o=t?i.isPtr(t)?t:i.scopedAllocCString(""+t):0;let a=i.exports.sqlite3_wasm_db_serialize(e,o,s,r,0);a&&l("Database serialization failed with code",S.capi.sqlite3_js_rc_str(a)),n=i.peekPtr(s);const c=i.peek(r,"i64");return a=c?i.heap8u().slice(n,n+Number(c)):new Uint8Array,a}finally{n&&i.exports.sqlite3_free(n),i.scopedAllocPop(r)}},s.sqlite3_js_db_vfs=(e,t=0)=>i.sqlite3_wasm_db_vfs(e,t),s.sqlite3_js_aggregate_context=(e,t)=>s.sqlite3_aggregate_context(e,t)||(t?y.toss("Cannot allocate",t,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(e,t,r){let n;t&&i.isPtr(t)?n=t:t instanceof ArrayBuffer||t instanceof Uint8Array?(n=i.allocFromTypedArray(t),(arguments.length<3||!q.isInt32(r)||r<0)&&(r=t.byteLength)):a.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!q.isInt32(r)||r<0)&&a.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const t=i.sqlite3_wasm_posix_create_file(e,n,r);t&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(t))}finally{i.dealloc(n)}},s.sqlite3_js_vfs_create_file=function(e,t,r,o){let l;n.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options."),r?(i.isPtr(r)?l=r:r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r instanceof Uint8Array?(l=i.allocFromTypedArray(r),(arguments.length<4||!q.isInt32(o)||o<0)&&(o=r.byteLength)):a.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):l=0,(!q.isInt32(o)||o<0)&&(i.dealloc(l),a.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const r=i.sqlite3_wasm_vfs_create_file(e,t,l,o);r&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(r))}finally{i.dealloc(l)}},s.sqlite3_js_sql_to_string=e=>{if("string"==typeof e)return e;const t=b(v);return t===v?void 0:t},q.isUIThread()){const e=function(e){const t=Object.create(null);return t.prefix="kvvfs-"+e,t.stores=[],"session"!==e&&""!==e||t.stores.push(globalThis.sessionStorage),"local"!==e&&""!==e||t.stores.push(globalThis.localStorage),t};s.sqlite3_js_kvvfs_clear=function(t=""){let r=0;const n=e(t);return n.stores.forEach((e=>{const t=[];let s;for(s=0;se.removeItem(t))),r+=t.length})),r},s.sqlite3_js_kvvfs_size=function(t=""){let r=0;const n=e(t);return n.stores.forEach((e=>{let t;for(t=0;tE(e,t,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(e,t)=>E(e,t,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(e,t)=>E(e,t,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(e,t)=>E(e,t,"sqlite3changeset_old");const S={WasmAllocError:y,SQLite3Error:a,capi:s,util:q,wasm:i,config:n,version:Object.create(null),client:void 0,asyncPostInit:async function e(){if(e.isReady instanceof Promise)return e.isReady;let r=t.initializersAsync;delete t.initializersAsync;const s=async()=>(S.__isUnderTest||(delete S.util,delete S.StructBinder),S),i=e=>{throw n.error("an async sqlite3 initializer failed:",e),e};if(!r||!r.length)return e.isReady=s().catch(i);r=r.map((e=>e instanceof Function?async t=>e(S):e)),r.push(s);let o=Promise.resolve(S);for(;r.length;)o=o.then(r.shift());return e.isReady=o.catch(i)},scriptInfo:void 0};try{t.initializers.forEach((e=>{e(S)}))}catch(e){throw console.error("sqlite3 bootstrap initializer threw:",e),e}return delete t.initializers,t.sqlite3=S,S},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(e){void 0===e.bigIntEnabled&&(e.bigIntEnabled=!!globalThis.BigInt64Array);const t=(...e)=>{throw new Error(e.join(" "))};e.exports||Object.defineProperty(e,"exports",{enumerable:!0,configurable:!0,get:()=>e.instance&&e.instance.exports});const r=e.pointerIR||"i32",n=e.ptrSizeof="i32"===r?4:"i64"===r?8:t("Unhandled ptrSizeof:",r),s=Object.create(null);s.heapSize=0,s.memory=null,s.freeFuncIndexes=[],s.scopedAlloc=[],s.utf8Decoder=new TextDecoder,s.utf8Encoder=new TextEncoder("utf-8"),e.sizeofIR=e=>{switch(e){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return n;default:return(""+e).endsWith("*")?n:void 0}};const i=function(){if(s.memory){if(s.heapSize===s.memory.buffer.byteLength)return s}else s.memory=e.memory instanceof WebAssembly.Memory?e.memory:e.exports.memory;const t=s.memory.buffer;return s.HEAP8=new Int8Array(t),s.HEAP8U=new Uint8Array(t),s.HEAP16=new Int16Array(t),s.HEAP16U=new Uint16Array(t),s.HEAP32=new Int32Array(t),s.HEAP32U=new Uint32Array(t),e.bigIntEnabled&&(s.HEAP64=new BigInt64Array(t),s.HEAP64U=new BigUint64Array(t)),s.HEAP32F=new Float32Array(t),s.HEAP64F=new Float64Array(t),s.heapSize=t.byteLength,s};e.heap8=()=>i().HEAP8,e.heap8u=()=>i().HEAP8U,e.heap16=()=>i().HEAP16,e.heap16u=()=>i().HEAP16U,e.heap32=()=>i().HEAP32,e.heap32u=()=>i().HEAP32U,e.heapForSize=function(r,n=!0){const o=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();switch(r){case Int8Array:return o.HEAP8;case Uint8Array:return o.HEAP8U;case Int16Array:return o.HEAP16;case Uint16Array:return o.HEAP16U;case Int32Array:return o.HEAP32;case Uint32Array:return o.HEAP32U;case 8:return n?o.HEAP8U:o.HEAP8;case 16:return n?o.HEAP16U:o.HEAP16;case 32:return n?o.HEAP32U:o.HEAP32;case 64:if(o.HEAP64)return n?o.HEAP64U:o.HEAP64;break;default:if(e.bigIntEnabled){if(r===globalThis.BigUint64Array)return o.HEAP64U;if(r===globalThis.BigInt64Array)return o.HEAP64;break}}t("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},e.functionTable=function(){return e.exports.__indirect_function_table},e.functionEntry=function(t){const r=e.functionTable();return t>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(t){const r=e._.rxJSig.exec(t);return r?r[2]:t.substr(1)},letterType:r=>e._.sigTypes[r]||t("Invalid signature letter:",r),pushSigType:(t,r)=>t.push(e._.typeCodes[e._.letterType(r)])}),"string"==typeof r){const e=n;n=r,r=e}const s=e._.sigParams(n),i=[1,96];e._.uleb128Encode(i,"push",s.length);for(const t of s)e._.pushSigType(i,t);return"v"===n[0]?i.push(0):(i.push(1),e._.pushSigType(i,n[0])),e._.uleb128Encode(i,"unshift",i.length),i.unshift(0,97,115,109,1,0,0,0,1),i.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(i)),{e:{f:r}}).exports.f};const o=function(r,n,i){if(i&&!s.scopedAlloc.length&&t("No scopedAllocPush() scope is active."),"string"==typeof r){const e=n;n=r,r=e}"string"==typeof n&&r instanceof Function||t("Invalid arguments: expecting (function,signature) or (signature,function).");const o=e.functionTable(),a=o.length;let l;for(;s.freeFuncIndexes.length&&(l=s.freeFuncIndexes.pop(),o.get(l));)l=null;l||(l=a,o.grow(1));try{return o.set(l,r),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l),l}catch(e){if(!(e instanceof TypeError))throw l===a&&s.freeFuncIndexes.push(a),e}try{const t=e.jsFuncToWasm(r,n);o.set(l,t),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l)}catch(e){throw l===a&&s.freeFuncIndexes.push(a),e}return l};e.installFunction=(e,t)=>o(e,t,!1),e.scopedInstallFunction=(e,t)=>o(e,t,!0),e.uninstallFunction=function(t){if(!t&&0!==t)return;const r=s.freeFuncIndexes,n=e.functionTable();r.push(t);const i=n.get(t);return n.set(t,null),i},e.peek=function(n,o="i8"){o.endsWith("*")&&(o=r);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i(),l=Array.isArray(n)?[]:void 0;let c;do{switch(l&&(n=arguments[0].shift()),o){case"i1":case"i8":c=a.HEAP8[0|n];break;case"i16":c=a.HEAP16[n>>1];break;case"i32":c=a.HEAP32[n>>2];break;case"float":case"f32":c=a.HEAP32F[n>>2];break;case"double":case"f64":c=Number(a.HEAP64F[n>>3]);break;case"i64":if(e.bigIntEnabled){c=BigInt(a.HEAP64[n>>3]);break}default:t("Invalid type for peek():",o)}l&&l.push(c)}while(l&&arguments[0].length);return l||c},e.poke=function(e,n,o="i8"){o.endsWith("*")&&(o=r);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();for(const r of Array.isArray(e)?e:[e])switch(o){case"i1":case"i8":a.HEAP8[0|r]=n;continue;case"i16":a.HEAP16[r>>1]=n;continue;case"i32":a.HEAP32[r>>2]=n;continue;case"float":case"f32":a.HEAP32F[r>>2]=n;continue;case"double":case"f64":a.HEAP64F[r>>3]=n;continue;case"i64":if(a.HEAP64){a.HEAP64[r>>3]=BigInt(n);continue}default:t("Invalid type for poke(): "+o)}return this},e.peekPtr=(...t)=>e.peek(1===t.length?t[0]:t,r),e.pokePtr=(t,n=0)=>e.poke(t,n,r),e.peek8=(...t)=>e.peek(1===t.length?t[0]:t,"i8"),e.poke8=(t,r)=>e.poke(t,r,"i8"),e.peek16=(...t)=>e.peek(1===t.length?t[0]:t,"i16"),e.poke16=(t,r)=>e.poke(t,r,"i16"),e.peek32=(...t)=>e.peek(1===t.length?t[0]:t,"i32"),e.poke32=(t,r)=>e.poke(t,r,"i32"),e.peek64=(...t)=>e.peek(1===t.length?t[0]:t,"i64"),e.poke64=(t,r)=>e.poke(t,r,"i64"),e.peek32f=(...t)=>e.peek(1===t.length?t[0]:t,"f32"),e.poke32f=(t,r)=>e.poke(t,r,"f32"),e.peek64f=(...t)=>e.peek(1===t.length?t[0]:t,"f64"),e.poke64f=(t,r)=>e.poke(t,r,"f64"),e.getMemValue=e.peek,e.getPtrValue=e.peekPtr,e.setMemValue=e.poke,e.setPtrValue=e.pokePtr,e.isPtr32=e=>"number"==typeof e&&e===(0|e)&&e>=0,e.isPtr=e.isPtr32,e.cstrlen=function(t){if(!t||!e.isPtr(t))return null;const r=i().HEAP8U;let n=t;for(;0!==r[n];++n);return n-t};const a="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer;e.cstrToJs=function(t){const r=e.cstrlen(t);return r?(n=i().HEAP8U,o=t,l=t+r,s.utf8Decoder.decode(n.buffer instanceof a?n.slice(o,l):n.subarray(o,l))):null===r?r:"";var n,o,l},e.jstrlen=function(e){if("string"!=typeof e)return null;const t=e.length;let r=0;for(let n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++n)),t<=127?++r:r+=t<=2047?2:t<=65535?3:4}return r},e.jstrcpy=function(e,r,n=0,s=-1,i=!0){if(r&&(r instanceof Int8Array||r instanceof Uint8Array)||t("jstrcpy() target must be an Int8Array or Uint8Array."),s<0&&(s=r.length-n),!(s>0&&n>=0))return 0;let o=0,a=e.length;const l=n,c=n+s-(i?1:0);for(;o=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++o)),t<=127){if(n>=c)break;r[n++]=t}else if(t<=2047){if(n+1>=c)break;r[n++]=192|t>>6,r[n++]=128|63&t}else if(t<=65535){if(n+2>=c)break;r[n++]=224|t>>12,r[n++]=128|t>>6&63,r[n++]=128|63&t}else{if(n+3>=c)break;r[n++]=240|t>>18,r[n++]=128|t>>12&63,r[n++]=128|t>>6&63,r[n++]=128|63&t}}return i&&(r[n++]=0),n-l},e.cstrncpy=function(r,n,s){if(r&&n||t("cstrncpy() does not accept NULL strings."),s<0)s=e.cstrlen(strPtr)+1;else if(!(s>0))return 0;const i=e.heap8u();let o,a=0;for(;as.utf8Encoder.encode(t?e+"\0":e);const l=(e,r)=>{e.alloc instanceof Function&&e.dealloc instanceof Function||t("Object is missing alloc() and/or dealloc() function(s)","required by",r+"().")},c=function(t,r,n,o){if(l(e,o),"string"!=typeof t)return null;{const e=s.utf8Encoder.encode(t),o=n(e.length+1),a=i().HEAP8U;return a.set(e,o),a[o+e.length]=0,r?[o,e.length]:o}};e.allocCString=(t,r=!1)=>c(t,r,e.alloc,"allocCString()"),e.scopedAllocPush=function(){l(e,"scopedAllocPush");const t=[];return s.scopedAlloc.push(t),t},e.scopedAllocPop=function(r){l(e,"scopedAllocPop");const n=arguments.length?s.scopedAlloc.indexOf(r):s.scopedAlloc.length-1;n<0&&t("Invalid state object for scopedAllocPop()."),0===arguments.length&&(r=s.scopedAlloc[n]),s.scopedAlloc.splice(n,1);for(let t;t=r.pop();)e.functionEntry(t)?e.uninstallFunction(t):e.dealloc(t)},e.scopedAlloc=function(r){s.scopedAlloc.length||t("No scopedAllocPush() scope is active.");const n=e.alloc(r);return s.scopedAlloc[s.scopedAlloc.length-1].push(n),n},Object.defineProperty(e.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>s.scopedAlloc.length,set:()=>t("The 'active' property is read-only.")}),e.scopedAllocCString=(t,r=!1)=>c(t,r,e.scopedAlloc,"scopedAllocCString()");const _=function(t,r){const n=e[t?"scopedAlloc":"alloc"]((r.length+1)*e.ptrSizeof);let s=0;return r.forEach((r=>{e.pokePtr(n+e.ptrSizeof*s++,e[t?"scopedAllocCString":"allocCString"](""+r))})),e.pokePtr(n+e.ptrSizeof*s,0),n};e.scopedAllocMainArgv=e=>_(!0,e),e.allocMainArgv=e=>_(!1,e),e.cArgvToJs=(t,r)=>{const n=[];for(let s=0;su(e,t,"alloc"),e.scopedAllocPtr=(e=1,t=!0)=>u(e,t,"scopedAlloc"),e.xGet=function(r){return e.exports[r]||t("Cannot find exported symbol:",r)};const d=(e,r)=>t(e+"() requires",r,"argument(s).");e.xCall=function(r,...n){const s=e.xGet(r);return s instanceof Function||t("Exported symbol",r,"is not a function."),s.length!==n.length&&d(r,s.length),2===arguments.length&&Array.isArray(arguments[1])?s.apply(null,arguments[1]):s.apply(null,n)},s.xWrap=Object.create(null),s.xWrap.convert=Object.create(null),s.xWrap.convert.arg=new Map,s.xWrap.convert.result=new Map;const f=s.xWrap.convert.arg,p=s.xWrap.convert.result;e.bigIntEnabled&&f.set("i64",(e=>BigInt(e)));const m="i32"===r?e=>0|e:e=>BigInt(e)|BigInt(0);f.set("i32",m).set("i16",(e=>65535&e)).set("i8",(e=>255&e)).set("f32",(e=>Number(e).valueOf())).set("float",f.get("f32")).set("f64",f.get("f32")).set("double",f.get("f64")).set("int",f.get("i32")).set("null",(e=>e)).set(null,f.get("null")).set("**",m).set("*",m),p.set("*",m).set("pointer",m).set("number",(e=>Number(e))).set("void",(e=>{})).set("null",(e=>e)).set(null,p.get("null"));{const n=["i8","i16","i32","int","f32","float","f64","double"];e.bigIntEnabled&&n.push("i64");const s=f.get(r);for(const e of n)f.set(e+"*",s),p.set(e+"*",s),p.set(e,f.get(e)||t("Missing arg converter:",e))}const h=function(t){return"string"==typeof t?e.scopedAllocCString(t):t?m(t):null};f.set("string",h).set("utf8",h).set("pointer",h),p.set("string",(t=>e.cstrToJs(t))).set("utf8",p.get("string")).set("string:dealloc",(t=>{try{return t?e.cstrToJs(t):null}finally{e.dealloc(t)}})).set("utf8:dealloc",p.get("string:dealloc")).set("json",(t=>JSON.parse(e.cstrToJs(t)))).set("json:dealloc",(t=>{try{return t?JSON.parse(e.cstrToJs(t)):null}finally{e.dealloc(t)}}));const g=class{constructor(e){this.name=e.name||"unnamed adapter"}convertArg(e,r,n){t("AbstractArgAdapter must be subclassed.")}};f.FuncPtrAdapter=class r extends g{constructor(e){super(e),f.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",e),this.name=e.name||"unnamed",this.signature=e.signature,e.contextKey instanceof Function&&(this.contextKey=e.contextKey,e.bindScope||(e.bindScope="context")),this.bindScope=e.bindScope||t("FuncPtrAdapter options requires a bindScope (explicit or implied)."),r.bindScopes.indexOf(e.bindScope)<0&&t("Invalid options.bindScope ("+e.bindMod+") for FuncPtrAdapter. Expecting one of: ("+r.bindScopes.join(", ")+")"),this.isTransient="transient"===this.bindScope,this.isContext="context"===this.bindScope,this.isPermanent="permanent"===this.bindScope,this.singleton="singleton"===this.bindScope?[]:void 0,this.callProxy=e.callProxy instanceof Function?e.callProxy:void 0}contextKey(e,t){return this}contextMap(e){const t=this.__cmap||(this.__cmap=new Map);let r=t.get(e);return void 0===r&&t.set(e,r=[]),r}convertArg(t,n,i){let a=this.singleton;if(!a&&this.isContext&&(a=this.contextMap(this.contextKey(n,i))),a&&a[0]===t)return a[1];if(t instanceof Function){this.callProxy&&(t=this.callProxy(t));const e=o(t,this.signature,this.isTransient);if(r.debugFuncInstall&&r.debugOut("FuncPtrAdapter installed",this,this.contextKey(n,i),"@"+e,t),a){if(a[1]){r.debugFuncInstall&&r.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(n,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}}a[0]=t,a[1]=e}return e}if(e.isPtr(t)||null==t){if(a&&a[1]&&a[1]!==t){r.debugFuncInstall&&r.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(n,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}a[0]=a[1]=0|t}return t||0}throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},f.FuncPtrAdapter.warnOnUse=!1,f.FuncPtrAdapter.debugFuncInstall=!1,f.FuncPtrAdapter.debugOut=console.debug.bind(console),f.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const b=e=>f.get(e)||t("Argument adapter not found:",e),y=e=>p.get(e)||t("Result adapter not found:",e);s.xWrap.convertArg=(e,...t)=>b(e)(...t),s.xWrap.convertArgNoCheck=(e,...t)=>f.get(e)(...t),s.xWrap.convertResult=(e,t)=>null===e?t:e?y(e)(t):void 0,s.xWrap.convertResultNoCheck=(e,t)=>null===e?t:e?p.get(e)(t):void 0,e.xWrap=function(r,n,...i){3===arguments.length&&Array.isArray(arguments[2])&&(i=arguments[2]),e.isPtr(r)&&(r=e.functionEntry(r)||t("Function pointer not found in WASM function table."));const o=r instanceof Function,a=o?r:e.xGet(r);if(o&&(r=a.name||"unnamed function"),i.length!==a.length&&d(r,a.length),null===n&&0===a.length)return a;null!=n&&y(n);for(const e of i)e instanceof g?f.set(e,((...t)=>e.convertArg(...t))):b(e);const l=s.xWrap;return 0===a.length?(...e)=>e.length?d(r,a.length):l.convertResult(n,a.call(null)):function(...t){t.length!==a.length&&d(r,a.length);const s=e.scopedAllocPush();try{for(const e in t)t[e]=l.convertArgNoCheck(i[e],t[e],t,e);return l.convertResultNoCheck(n,a.apply(null,t))}finally{e.scopedAllocPop(s)}}};const q=function(e,r,n,s,i,o){if("string"==typeof n){if(1===r)return o.get(n);if(2===r)return s?(s instanceof Function||t(i,"requires a function argument."),o.set(n,s),e):(o.get(n),e)}t("Invalid arguments to",i)};return e.xWrap.resultAdapter=function e(t,r){return q(e,arguments.length,t,r,"resultAdapter()",p)},e.xWrap.argAdapter=function e(t,r){return q(e,arguments.length,t,r,"argAdapter()",f)},e.xWrap.FuncPtrAdapter=f.FuncPtrAdapter,e.xCallWrapped=function(t,r,n,...s){return Array.isArray(arguments[3])&&(s=arguments[3]),e.xWrap(t,r,n||[]).apply(null,s||[])},e.xWrap.testConvertArg=s.xWrap.convertArg,e.xWrap.testConvertResult=s.xWrap.convertResult,e},globalThis.WhWasmUtilInstaller.yawl=function(e){const t=()=>fetch(e.uri,{credentials:"same-origin"}),r=this,n=function(t){if(e.wasmUtilTarget){const n=(...e)=>{throw new Error(e.join(" "))},s=e.wasmUtilTarget;if(s.module=t.module,s.instance=t.instance,s.instance.exports.memory||(s.memory=e.imports&&e.imports.env&&e.imports.env.memory||n("Missing 'memory' object!")),!s.alloc&&t.instance.exports.malloc){const e=t.instance.exports;s.alloc=function(t){return e.malloc(t)||n("Allocation of",t,"bytes failed.")},s.dealloc=function(t){e.free(t)}}r(s)}return e.onload&&e.onload(t,e),t};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(t(),e.imports||{}).then(n)}:function(){return t().then((e=>e.arrayBuffer())).then((t=>WebAssembly.instantiate(t,e.imports||{}))).then(n)}}.bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function e(t){const r=(...e)=>{throw new Error(e.join(" "))};t.heap instanceof WebAssembly.Memory||t.heap instanceof Function||r("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach((function(e){t[e]instanceof Function||r("Config option '"+e+"' must be a function.")}));const n=e,s=t.heap instanceof Function?t.heap:()=>new Uint8Array(t.heap.buffer),i=t.alloc,o=t.dealloc,a=t.log||console.log.bind(console),l=t.memberPrefix||"",c=t.memberSuffix||"",_=void 0===t.bigIntEnabled?!!globalThis.BigInt64Array:!!t.bigIntEnabled,u=globalThis.BigInt,d=globalThis.BigInt64Array,f=t.ptrSizeof||4,p=t.ptrIR||"i32";n.debugFlags||(n.__makeDebugFlags=function(e=null){e&&e.__flags&&(e=e.__flags);const t=function e(t){return 0===arguments.length?e.__flags:(t<0?(delete e.__flags.getter,delete e.__flags.setter,delete e.__flags.alloc,delete e.__flags.dealloc):(e.__flags.getter=!!(1&t),e.__flags.setter=!!(2&t),e.__flags.alloc=!!(4&t),e.__flags.dealloc=!!(8&t)),e._flags)};return Object.defineProperty(t,"__flags",{iterable:!1,writable:!1,value:Object.create(e)}),e||t(0),t},n.debugFlags=n.__makeDebugFlags());const m=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),h=e=>(e=>"("===e[1])(e)?"p":e[0],g=function(e){switch(h(e)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return p;case"j":return"i64";case"f":return"float";case"d":return"double"}r("Unhandled signature IR:",e)},b=d?()=>!0:()=>r("BigInt64Array is not available."),y=(e,t)=>e+"::"+t,q=new WeakMap,v="(pointer-is-external)",w=function(e,t,r){if(r||(r=q.get(t)),r){if(q.delete(t),Array.isArray(t.ondispose)){let n;for(;n=t.ondispose.shift();)try{n instanceof Function?n.call(t):n instanceof D?n.dispose():"number"==typeof n&&o(n)}catch(t){console.warn("ondispose() for",e.structName,"@",r,"threw. NOT propagating it.",t)}}else if(t.ondispose instanceof Function)try{t.ondispose()}catch(t){console.warn("ondispose() for",e.structName,"@",r,"threw. NOT propagating it.",t)}delete t.ondispose,e.debugFlags.__flags.dealloc&&a("debug.dealloc:",t[v]?"EXTERNAL":"",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+r),t[v]||o(r)}},E=e=>({configurable:!1,writable:!1,iterable:!1,value:e}),S=function(e,t,n){let o=!n;n?Object.defineProperty(t,v,E(n)):(n=i(e.structInfo.sizeof))||r("Allocation of",e.structName,"structure failed.");try{e.debugFlags.__flags.alloc&&a("debug.alloc:",o?"":"EXTERNAL",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+n),o&&s().fill(0,n,n+e.structInfo.sizeof),q.set(t,n)}catch(r){throw w(e,t,n),r}},A=E((e=>l+e+c)),x=function(e,t,n=!0){let s=e.members[t];if(!s&&(l||c)){for(const r of Object.values(e.members))if(r.key===t){s=r;break}!s&&n&&r(y(e.name,t),"is not a mapped struct member.")}return s},T=function e(t,r,n=!1){e._||(e._=e=>e.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const s=x(t.structInfo,r,!0);return n?e._(s.signature):s.signature},I={configurable:!1,enumerable:!1,get:function(){return q.get(this)},set:()=>r("Cannot assign the 'pointer' property of a struct.")},k=E((function(){const e=[];for(const t of Object.keys(this.structInfo.members))e.push(this.memberKey(t));return e})),F=new TextDecoder("utf-8"),O=new TextEncoder,P="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,L=function(e){"s"!==e.signature&&r("Invalid member type signature for C-string value:",JSON.stringify(e))},C=function(e,...t){e.ondispose?Array.isArray(e.ondispose)||(e.ondispose=[e.ondispose]):e.ondispose=[],e.ondispose.push(...t)},N=function(e){const t=O.encode(e),n=i(t.length+1);n||r("Allocation error while duplicating string:",e);const o=s();return o.set(t,n),o[n+t.length]=0,n},D=function(e,t){arguments[2]!==E&&r("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:E(e),structInfo:E(t)})};D.prototype=Object.create(null,{dispose:E((function(){w(this.constructor,this)})),lookupMember:E((function(e,t=!0){return x(this.structInfo,e,t)})),memberToJsString:E((function(e){return function(e,t){const r=x(e.structInfo,t,!0);L(r);const n=e[r.key];if(!n)return null;let i=n;const o=s();for(;0!==o[i];++i);return n===i?"":(a=o,l=n,c=i,F.decode(a.buffer instanceof P?a.slice(l,c):a.subarray(l,c)));var a,l,c}(this,e)})),memberIsString:E((function(e,t=!0){return function(e,t,r=!1){const n=x(e.structInfo,t,r);return!(!n||1!==n.signature.length||"s"!==n.signature[0])&&n}(this,e,t)})),memberKey:A,memberKeys:k,memberSignature:E((function(e,t=!1){return T(this,e,t)})),memoryDump:E((function(){const e=this.pointer;return e?new Uint8Array(s().slice(e,e+this.structInfo.sizeof)):null})),pointer:I,setMemberCString:E((function(e,t){return function(e,t,r){const n=x(e.structInfo,t,!0);L(n);const s=N(r);return e[n.key]=s,C(e,s),e}(this,e,t)}))}),Object.assign(D.prototype,{addOnDispose:function(...e){return C(this,...e),this}}),Object.defineProperties(D,{allocCString:E(N),isA:E((e=>e instanceof D)),hasExternalPointer:E((e=>e instanceof D&&!!e[v])),memberKey:A});const R=e=>Number.isFinite(e)||e instanceof(u||Number),M=function e(t,n,i){if(!e._){e._={getters:{},setters:{},sw:{}};const t=["i","c","C","p","P","s","f","d","v()"];_&&t.push("j"),t.forEach((function(t){e._.getters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"getInt32";case 8:return b()&&"getBigInt64"}break;case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return b()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}r("Unhandled DataView getter for signature:",e)}(t),e._.setters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"setInt32";case 8:return b()&&"setBigInt64"}break;case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return b()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}r("Unhandled DataView setter for signature:",e)}(t),e._.sw[t]=function(e){switch(h(e)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return b()&&u;case"p":case"P":case"s":switch(f){case 4:return Number;case 8:return b()&&u}}r("Unhandled DataView set wrapper for signature:",e)}(t)}));const n=/^[ipPsjfdcC]$/,s=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;e.sigCheck=function(e,t,i,o){Object.prototype.hasOwnProperty.call(e,i)&&r(e.structName,"already has a property named",i+"."),n.test(o)||s.test(o)||r("Malformed signature for",y(e.structName,t)+":",o)}}const o=t.memberKey(n);e.sigCheck(t.prototype,n,o,i.signature),i.key=o,i.name=n;const l=h(i.signature),c=y(t.prototype.structName,o),d=t.prototype.debugFlags.__flags,p=Object.create(null);var q,v;p.configurable=!1,p.enumerable=!1,p.get=function(){d.getter&&a("debug.getter:",e._.getters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof);let t=new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.getters[l]](0,m);return d.getter&&a("debug.getter:",c,"result =",t),t},i.readOnly?p.set=(q=t.prototype.structName,v=o,()=>r(y(q,v),"is read-only.")):p.set=function(t){if(d.setter&&a("debug.setter:",e._.setters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof,t),this.pointer||r("Cannot set struct property on disposed instance."),null===t)t=0;else for(;!R(t);){if("P"===i.signature&&t instanceof D){t=t.pointer||0,d.setter&&a("debug.setter:",c,"resolved to",t);break}r("Invalid value for pointer-type",c+".")}new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.setters[l]](0,e._.sw[l](t),m)},Object.defineProperty(t.prototype,o,p)},j=function e(t,s){1===arguments.length?t=(s=t).name:s.name||(s.name=t),t||r("Struct name is required.");let i=!1;Object.keys(s.members).forEach((e=>{const n=s.members[e];n.sizeof?1===n.sizeof?"c"===n.signature||"C"===n.signature||r("Unexpected sizeof==1 member",y(s.name,e),"with signature",n.signature):(0!=n.sizeof%4&&(console.warn("Invalid struct member description =",n,"from",s),r(t,"member",e,"sizeof is not aligned. sizeof="+n.sizeof)),0!=n.offset%4&&(console.warn("Invalid struct member description =",n,"from",s),r(t,"member",e,"offset is not aligned. offset="+n.offset))):r(t,"member",e,"is missing sizeof."),(!i||i.offsete instanceof a)),memberKey:A,memberKeys:k,methodInfoForKey:E((function(e){})),structInfo:E(s),structName:E(t)}),a.prototype=new D(t,s,E),Object.defineProperties(a.prototype,{debugFlags:o,constructor:E(a)}),Object.keys(s.members).forEach((e=>M(a,e,s.members[e]))),a};return j.StructType=D,j.config=t,j.allocCString=N,j.debugFlags||(j.debugFlags=n.__makeDebugFlags(n.debugFlags)),j},globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...e)=>{throw new Error(e.join(" "))},r=(e.SQLite3Error.toss,e.capi),n=e.wasm,s=e.util;if(globalThis.WhWasmUtilInstaller(n),delete globalThis.WhWasmUtilInstaller,n.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new n.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:e=>{let t;return(s,i,o,a)=>{try{const r=n.cArgvToJs(i,o);return t||(t=n.cArgvToJs(i,a)),0|e(r,t)}catch(e){return e.resultCode||r.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_codes","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_progress_handler",void 0,["sqlite3*","int",new n.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_set_authorizer","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(e,t)=>e[0],callProxy:e=>(t,s,i,o,a,l)=>{try{return i=i&&n.cstrToJs(i),o=o&&n.cstrToJs(o),a=a&&n.cstrToJs(a),l=l&&n.cstrToJs(l),e(t,s,i,o,a,l)||0}catch(e){return e.resultCode||r.SQLITE_ERROR}}}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*",new n.xWrap.FuncPtrAdapter({name:"xDestroyAuxData",signature:"v(*)",contextKey:(e,t)=>e[0]})]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_isexplain","int",["sqlite3_stmt*"]],["sqlite3_stmt_readonly","int",["sqlite3_stmt*"]],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new n.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],n.exports.sqlite3_activate_see instanceof Function&&n.bindingSignatures.push(["sqlite3_key","int","sqlite3*","string","int"],["sqlite3_key_v2","int","sqlite3*","string","*","int"],["sqlite3_rekey","int","sqlite3*","string","int"],["sqlite3_rekey_v2","int","sqlite3*","string","*","int"],["sqlite3_activate_see",void 0,"string"]),n.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:e=>e[0],callProxy:e=>(t,r,s,i,o,a,l)=>{e(t,r,s,n.cstrToJs(i),n.cstrToJs(o),a,l)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:e=>e[0],callProxy:e=>(t,r,s,i,o)=>{e(t,r,n.cstrToJs(s),n.cstrToJs(i),o)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]],n.bigIntEnabled&&n.exports.sqlite3changegroup_add){const e={signature:"i(ps)",callProxy:e=>(t,s)=>{try{return 0|e(t,n.cstrToJs(s))}catch(e){return e.resultCode||r.SQLITE_ERROR}}};n.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new n.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new n.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new n.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new n.xWrap.FuncPtrAdapter({name:"xFilter",...e,contextKey:(e,t)=>e[0]}),"*"]])}n.bindingSignatures.wasm=[["sqlite3_wasm_db_reset","int","sqlite3*"],["sqlite3_wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3_wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3_wasm_posix_create_file","int","string","*","int"],["sqlite3_wasm_vfs_unlink","int","sqlite3_vfs*","string"]],e.StructBinder=globalThis.Jaccwabyt({heap:n.heap8u,alloc:n.alloc,dealloc:n.dealloc,bigIntEnabled:n.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const i=n.xWrap.argAdapter("string");n.xWrap.argAdapter("string:flexible",(e=>i(s.flexibleString(e)))),n.xWrap.argAdapter("string:static",function(e){return n.isPtr(e)?e:this[e=""+e]||(this[e]=n.allocCString(e))}.bind(Object.create(null)));const o=n.xWrap.argAdapter("*"),a=function(){};n.xWrap.argAdapter("sqlite3_filename",o)("sqlite3_context*",o)("sqlite3_value*",o)("void*",o)("sqlite3_changegroup*",o)("sqlite3_changeset_iter*",o)("sqlite3_session*",o)("sqlite3_stmt*",(t=>o(t instanceof(e?.oo1?.Stmt||a)?t.pointer:t)))("sqlite3*",(t=>o(t instanceof(e?.oo1?.DB||a)?t.pointer:t)))("sqlite3_index_info*",(e=>o(e instanceof(r.sqlite3_index_info||a)?e.pointer:e)))("sqlite3_module*",(e=>o(e instanceof(r.sqlite3_module||a)?e.pointer:e)))("sqlite3_vfs*",(t=>"string"==typeof t?r.sqlite3_vfs_find(t)||e.SQLite3Error.toss(r.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",t):o(t instanceof(r.sqlite3_vfs||a)?t.pointer:t)));const l=n.xWrap.resultAdapter("*");n.xWrap.resultAdapter("sqlite3*",l)("sqlite3_context*",l)("sqlite3_stmt*",l)("sqlite3_value*",l)("sqlite3_vfs*",l)("void*",l),0===n.exports.sqlite3_step.length&&(n.xWrap.doArgcCheck=!1,e.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const e of n.bindingSignatures)r[e[0]]=n.xWrap.apply(null,e);for(const e of n.bindingSignatures.wasm)n[e[0]]=n.xWrap.apply(null,e);const c=function(e){return()=>t(e+"() is unavailable due to lack","of BigInt support in this build.")};for(const e of n.bindingSignatures.int64)r[e[0]]=n.bigIntEnabled?n.xWrap.apply(null,e):c(e[0]);if(delete n.bindingSignatures,n.exports.sqlite3_wasm_db_error){const t=n.xWrap("sqlite3_wasm_db_error","int","sqlite3*","int","string");s.sqlite3_wasm_db_error=function(n,s,i){return s instanceof e.WasmAllocError?(s=r.SQLITE_NOMEM,i=0):s instanceof Error&&(i=i||""+s,s=s.resultCode||r.SQLITE_ERROR),n?t(n,s,i):s}}else s.sqlite3_wasm_db_error=function(e,t,r){return console.warn("sqlite3_wasm_db_error() is not exported.",arguments),t}}{const i=n.xCall("sqlite3_wasm_enum_json");i||t("Maintenance required: increase sqlite3_wasm_enum_json()'s","static buffer size!"),n.ctype=JSON.parse(n.cstrToJs(i));const o=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];n.bigIntEnabled&&o.push("serialize","session","vtab");for(const e of o)for(const t of Object.entries(n.ctype[e]))r[t[0]]=t[1];n.functionEntry(r.SQLITE_WASM_DEALLOC)||t("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+r.SQLITE_WASM_DEALLOC+").");const a=Object.create(null);for(const e of["resultCodes"])for(const t of Object.entries(n.ctype[e]))a[t[1]]=t[0];r.sqlite3_js_rc_str=e=>a[e];const l=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!s.isUIThread(),sqlite3_index_info:!n.bigIntEnabled,sqlite3_index_constraint:!n.bigIntEnabled,sqlite3_index_orderby:!n.bigIntEnabled,sqlite3_index_constraint_usage:!n.bigIntEnabled});for(const t of n.ctype.structs)l[t.name]||(r[t.name]=e.StructBinder(t));if(r.sqlite3_index_info){for(const e of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])r.sqlite3_index_info[e]=r[e],delete r[e];r.sqlite3_vtab_config=n.xWrap("sqlite3_wasm_vtab_config","int",["sqlite3*","int","int"])}}const i=(e,t,n)=>s.sqlite3_wasm_db_error(e,r.SQLITE_MISUSE,t+"() requires "+n+" argument"+(1===n?"":"s")+"."),o=e=>s.sqlite3_wasm_db_error(e,r.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),a=e=>n.xWrap.argAdapter("sqlite3*")(e),l=e=>n.isPtr(e)?n.cstrToJs(e):e,c=function(e,t){e=a(e);let r=this.dbMap.get(e);return t?(!r&&t>0&&this.dbMap.set(e,r=Object.create(null)),r):(this.dbMap.delete(e),r)}.bind(Object.assign(Object.create(null),{dbMap:new Map}));c.addCollation=function(e,t){const r=c(e,1);r.collation||(r.collation=new Set),r.collation.add(l(t).toLowerCase())},c._addUDF=function(e,t,r,n){t=l(t).toLowerCase();let s=n.get(t);s||n.set(t,s=new Set),s.add(r<0?-1:r)},c.addFunction=function(e,t,r){const n=c(e,1);n.udf||(n.udf=new Map),this._addUDF(e,t,r,n.udf)},c.addWindowFunc=function(e,t,r){const n=c(e,1);n.wudf||(n.wudf=new Map),this._addUDF(e,t,r,n.wudf)},c.cleanup=function(e){const t=[e=a(e)];for(const e of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const s=n.exports[e];t.length=s.length;try{r[e](...t)}catch(r){console.warn("close-time call of",e+"(",t,") threw:",r)}}const s=c(e,0);if(!s)return;if(s.collation){for(const t of s.collation)try{r.sqlite3_create_collation_v2(e,t,r.SQLITE_UTF8,0,0,0)}catch(e){}delete s.collation}let i;for(i=0;i<2;++i){const t=i?s.wudf:s.udf;if(!t)continue;const n=i?r.sqlite3_create_window_function:r.sqlite3_create_function_v2;for(const s of t){const t=s[0],o=s[1],a=[e,t,0,r.SQLITE_UTF8,0,0,0,0,0];i&&a.push(0);for(const e of o)try{a[2]=e,n.apply(null,a)}catch(e){}o.clear()}t.clear()}delete s.udf,delete s.wudf};{const e=n.xWrap("sqlite3_close_v2","int","sqlite3*");r.sqlite3_close_v2=function(t){if(1!==arguments.length)return i(t,"sqlite3_close_v2",1);if(t)try{c.cleanup(t)}catch(e){}return e(t)}}if(r.sqlite3session_table_filter){const e=n.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);r.sqlite3session_delete=function(t){if(1!==arguments.length)return i(pDb,"sqlite3session_delete",1);t&&r.sqlite3session_table_filter(t,0,0),e(t)}}{const e=(e,t)=>"argv["+t+"]:"+e[0]+":"+n.cstrToJs(e[1]).toLowerCase(),t=n.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new n.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:e}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:e})]);r.sqlite3_create_collation_v2=function(e,n,a,l,_,u){if(6!==arguments.length)return i(e,"sqlite3_create_collation_v2",6);if(15&a){if(r.SQLITE_UTF8!==(15&a))return o(e)}else a|=r.SQLITE_UTF8;try{const r=t(e,n,a,l,_,u);return 0===r&&_ instanceof Function&&c.addCollation(e,n),r}catch(t){return s.sqlite3_wasm_db_error(e,t)}},r.sqlite3_create_collation=(e,t,n,s,o)=>5===arguments.length?r.sqlite3_create_collation_v2(e,t,n,s,o,0):i(e,"sqlite3_create_collation",5)}{const e=function(e,t){return e[0]+":"+(e[2]<0?-1:e[2])+":"+t+":"+n.cstrToJs(e[1]).toLowerCase()},t=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,n,s)=>{try{e(t,...r.sqlite3_values_to_js(n,s))}catch(e){r.sqlite3_result_error_js(t,e)}}},xFinalAndValue:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{r.sqlite3_result_js(t,e(t))}catch(e){r.sqlite3_result_error_js(t,e)}}},xFunc:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,n,s)=>{try{r.sqlite3_result_js(t,e(t,...r.sqlite3_values_to_js(n,s)))}catch(e){r.sqlite3_result_error_js(t,e)}}},xDestroy:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{e(t)}catch(e){console.error("UDF xDestroy method threw:",e)}}}}),a=n.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new n.xWrap.FuncPtrAdapter({name:"xFunc",...t.xFunc}),new n.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]),l=n.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new n.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xValue",...t.xFinalAndValue}),new n.xWrap.FuncPtrAdapter({name:"xInverse",...t.xInverseAndStep}),new n.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]);r.sqlite3_create_function_v2=function e(t,n,l,_,u,d,f,p,m){if(e.length!==arguments.length)return i(t,"sqlite3_create_function_v2",e.length);if(15&_){if(r.SQLITE_UTF8!==(15&_))return o(t)}else _|=r.SQLITE_UTF8;try{const e=a(t,n,l,_,u,d,f,p,m);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function)&&c.addFunction(t,n,l),e}catch(e){return console.error("sqlite3_create_function_v2() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},r.sqlite3_create_function=function e(t,n,s,o,a,l,c,_){return e.length===arguments.length?r.sqlite3_create_function_v2(t,n,s,o,a,l,c,_,0):i(t,"sqlite3_create_function",e.length)},r.sqlite3_create_window_function=function e(t,n,a,_,u,d,f,p,m,h){if(e.length!==arguments.length)return i(t,"sqlite3_create_window_function",e.length);if(15&_){if(r.SQLITE_UTF8!==(15&_))return o(t)}else _|=r.SQLITE_UTF8;try{const e=l(t,n,a,_,u,d,f,p,m,h);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function||h instanceof Function)&&c.addWindowFunc(t,n,a),e}catch(e){return console.error("sqlite3_create_window_function() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},r.sqlite3_create_function_v2.udfSetResult=r.sqlite3_create_function.udfSetResult=r.sqlite3_create_window_function.udfSetResult=r.sqlite3_result_js,r.sqlite3_create_function_v2.udfConvertArgs=r.sqlite3_create_function.udfConvertArgs=r.sqlite3_create_window_function.udfConvertArgs=r.sqlite3_values_to_js,r.sqlite3_create_function_v2.udfSetError=r.sqlite3_create_function.udfSetError=r.sqlite3_create_window_function.udfSetError=r.sqlite3_result_error_js}{const e=(e,t)=>("string"==typeof e?t=-1:s.isSQLableTypedArray(e)?(t=e.byteLength,e=s.typedArrayToString(e instanceof ArrayBuffer?new Uint8Array(e):e)):Array.isArray(e)&&(e=e.join(""),t=-1),[e,t]),t={basic:n.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:n.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};r.sqlite3_prepare_v3=function n(o,a,l,c,_,u){if(n.length!==arguments.length)return i(o,"sqlite3_prepare_v3",n.length);const[d,f]=e(a,l);switch(typeof d){case"string":return t.basic(o,d,f,c,_,null);case"number":return t.full(o,d,f,c,_,u);default:return s.sqlite3_wasm_db_error(o,r.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},r.sqlite3_prepare_v2=function e(t,n,s,o,a){return e.length===arguments.length?r.sqlite3_prepare_v3(t,n,s,0,o,a):i(t,"sqlite3_prepare_v2",e.length)}}{const e=n.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),t=n.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);r.sqlite3_bind_text=function t(o,a,l,c,_){if(t.length!==arguments.length)return i(r.sqlite3_db_handle(o),"sqlite3_bind_text",t.length);if(n.isPtr(l)||null===l)return e(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(pMem)&&(l=pMem.join(""));try{if(s.isSQLableTypedArray(l))u=n.allocFromTypedArray(l),d=l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");[u,d]=n.allocCString(l)}return e(o,a,u,d,r.SQLITE_WASM_DEALLOC)}catch(e){return n.dealloc(u),s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),e)}},r.sqlite3_bind_blob=function e(o,a,l,c,_){if(e.length!==arguments.length)return i(r.sqlite3_db_handle(o),"sqlite3_bind_blob",e.length);if(n.isPtr(l)||null===l)return t(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(l)&&(l=l.join(""));try{if(s.isBindableTypedArray(l))u=n.allocFromTypedArray(l),d=c>=0?c:l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");[u,d]=n.allocCString(l)}return t(o,a,u,d,r.SQLITE_WASM_DEALLOC)}catch(e){return n.dealloc(u),s.sqlite3_wasm_db_error(r.sqlite3_db_handle(o),e)}}}r.sqlite3_config=function(e,...t){if(arguments.length<2)return r.SQLITE_MISUSE;switch(e){case r.SQLITE_CONFIG_COVERING_INDEX_SCAN:case r.SQLITE_CONFIG_MEMSTATUS:case r.SQLITE_CONFIG_SMALL_MALLOC:case r.SQLITE_CONFIG_SORTERREF_SIZE:case r.SQLITE_CONFIG_STMTJRNL_SPILL:case r.SQLITE_CONFIG_URI:return n.exports.sqlite3_wasm_config_i(e,t[0]);case r.SQLITE_CONFIG_LOOKASIDE:return n.exports.sqlite3_wasm_config_ii(e,t[0],t[1]);case r.SQLITE_CONFIG_MEMDB_MAXSIZE:return n.exports.sqlite3_wasm_config_j(e,t[0]);case r.SQLITE_CONFIG_GETMALLOC:case r.SQLITE_CONFIG_GETMUTEX:case r.SQLITE_CONFIG_GETPCACHE2:case r.SQLITE_CONFIG_GETPCACHE:case r.SQLITE_CONFIG_HEAP:case r.SQLITE_CONFIG_LOG:case r.SQLITE_CONFIG_MALLOC:case r.SQLITE_CONFIG_MMAP_SIZE:case r.SQLITE_CONFIG_MULTITHREAD:case r.SQLITE_CONFIG_MUTEX:case r.SQLITE_CONFIG_PAGECACHE:case r.SQLITE_CONFIG_PCACHE2:case r.SQLITE_CONFIG_PCACHE:case r.SQLITE_CONFIG_PCACHE_HDRSZ:case r.SQLITE_CONFIG_PMASZ:case r.SQLITE_CONFIG_SERIALIZED:case r.SQLITE_CONFIG_SINGLETHREAD:case r.SQLITE_CONFIG_SQLLOG:case r.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return r.SQLITE_NOTFOUND}};{const e=new Set;r.sqlite3_auto_extension=function(t){if(t instanceof Function)t=n.installFunction("i(ppp)",t);else if(1!==arguments.length||!n.isPtr(t))return r.SQLITE_MISUSE;const s=n.exports.sqlite3_auto_extension(t);return t!==arguments[0]&&(0===s?e.add(t):n.uninstallFunction(t)),s},r.sqlite3_cancel_auto_extension=function(e){return e&&1===arguments.length&&n.isPtr(e)?n.exports.sqlite3_cancel_auto_extension(e):0},r.sqlite3_reset_auto_extension=function(){n.exports.sqlite3_reset_auto_extension();for(const t of e)n.uninstallFunction(t);e.clear()}}const _=r.sqlite3_vfs_find("kvvfs");if(_)if(s.isUIThread()){const e=new r.sqlite3_kvvfs_methods(n.exports.sqlite3_wasm_kvvfs_methods());delete r.sqlite3_kvvfs_methods;const t=n.exports.sqlite3_wasm_kvvfsMakeKeyOnPstack,s=n.pstack,i=e=>115===n.peek(e)?sessionStorage:localStorage,o={xRead:(e,r,o,a)=>{const l=s.pointer,c=n.scopedAllocPush();try{const s=t(e,r);if(!s)return-3;const l=n.cstrToJs(s),c=i(e).getItem(l);if(!c)return-1;const _=c.length;if(a<=0)return _;if(1===a)return n.poke(o,0),_;const u=n.scopedAllocCString(c);return a>_+1&&(a=_+1),n.heap8u().copyWithin(o,u,u+a-1),n.poke(o+a-1,0),a-1}catch(e){return console.error("kvstorageRead()",e),-2}finally{s.restore(l),n.scopedAllocPop(c)}},xWrite:(e,o,a)=>{const l=s.pointer;try{const r=t(e,o);if(!r)return 1;const s=n.cstrToJs(r);return i(e).setItem(s,n.cstrToJs(a)),0}catch(e){return console.error("kvstorageWrite()",e),r.SQLITE_IOERR}finally{s.restore(l)}},xDelete:(e,o)=>{const a=s.pointer;try{const r=t(e,o);return r?(i(e).removeItem(n.cstrToJs(r)),0):1}catch(e){return console.error("kvstorageDelete()",e),r.SQLITE_IOERR}finally{s.restore(a)}}};for(const t of Object.keys(o))e[e.memberKey(t)]=n.installFunction(e.memberSignature(t),o[t])}else r.sqlite3_vfs_unregister(_);n.xWrap.FuncPtrAdapter.warnOnUse=!0})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.version={libVersion:"3.44.2",libVersionNumber:3044002,sourceId:"2023-11-24 11:41:44 ebead0e7230cd33bcec9f95d2183069565b9e709bf745c9b5db65cc0cbf92c0f",downloadVersion:3440200}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...t)=>{throw new e.SQLite3Error(...t)},r=e.capi,n=e.wasm,s=e.util,i=new WeakMap,o=new WeakMap,a=(e,t,r)=>{const n=Object.getOwnPropertyDescriptor(e,t);return n?n.value:r},l=function(e,n){return n&&(e instanceof d&&(e=e.pointer),t(n,"sqlite3 result code",n+":",e?r.sqlite3_errmsg(e):r.sqlite3_errstr(n))),arguments[0]},c=n.installFunction("i(ippp)",function(e,t,s,i){r.SQLITE_TRACE_STMT===e&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+t+":",n.cstrToJs(i))}.bind({counter:0})),_=Object.create(null),u=function s(...a){if(!s._name2vfs){s._name2vfs=Object.create(null);const e="function"==typeof importScripts&&(e=>t("The VFS for",e,"is only available in the main window thread."));s._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:e||(()=>"local")},s._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:e||(()=>"session")}}const u=s.normalizeArgs(...a);let d=u.filename,f=u.vfs,p=u.flags;("string"!=typeof d&&"number"!=typeof d||"string"!=typeof p||f&&"string"!=typeof f&&"number"!=typeof f)&&(e.config.error("Invalid DB ctor args",u,arguments),t("Invalid arguments for DB constructor."));let m="number"==typeof d?n.cstrToJs(d):d;const h=s._name2vfs[m];h&&(f=h.vfs,d=m=h.filename(m));let g,b=0;p.indexOf("c")>=0&&(b|=r.SQLITE_OPEN_CREATE|r.SQLITE_OPEN_READWRITE),p.indexOf("w")>=0&&(b|=r.SQLITE_OPEN_READWRITE),0===b&&(b|=r.SQLITE_OPEN_READONLY),b|=r.SQLITE_OPEN_EXRESCODE;const y=n.pstack.pointer;try{const e=n.pstack.allocPtr();let t=r.sqlite3_open_v2(d,e,b,f||0);g=n.peekPtr(e),l(g,t),r.sqlite3_extended_result_codes(g,1),p.indexOf("t")>=0&&r.sqlite3_trace_v2(g,r.SQLITE_TRACE_STMT,c,g)}catch(e){throw g&&r.sqlite3_close_v2(g),e}finally{n.pstack.restore(y)}this.filename=m,i.set(this,g),o.set(this,Object.create(null));try{const n=r.sqlite3_js_db_vfs(g);n||t("Internal error: cannot get VFS for new db handle.");const s=_[n];s instanceof Function?s(this,e):s&&l(g,r.sqlite3_exec(g,s,0,0,0))}catch(e){throw this.close(),e}};u.setVfsPostOpenSql=function(e,t){_[e]=t},u.normalizeArgs=function(e=":memory:",t="c",r=null){const n={};return 1===arguments.length&&arguments[0]&&"object"==typeof arguments[0]?(Object.assign(n,arguments[0]),void 0===n.flags&&(n.flags="c"),void 0===n.vfs&&(n.vfs=null),void 0===n.filename&&(n.filename=":memory:")):(n.filename=e,n.flags=t,n.vfs=r),n};const d=function(...e){u.apply(this,e)};d.dbCtorHelper=u;const f={null:1,number:2,string:3,boolean:4,blob:5};f[void 0],f.null,n.bigIntEnabled&&(f.bigint=f.number);const p=function(){f!==arguments[2]&&t(r.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],i.set(this,arguments[1]),this.parameterCount=r.sqlite3_bind_parameter_count(this.pointer)},m=function(e){return e.pointer||t("DB has been closed."),e},h=function(e,r){return(r!==(0|r)||r<0||r>=e.columnCount)&&t("Column index",r,"is out of range."),e},g=(e,t,r,...n)=>{const s=e.prepare(t);try{const e=s.bind(r).step()?s.get(...n):void 0;return s.reset(),e}finally{s.finalize()}},b=(e,t,r,n)=>e.exec({sql:t,bind:r,rowMode:n,returnValue:"resultRows"});d.checkRc=(e,t)=>l(e,t),d.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return m(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch(e){}const e=this.pointer;if(Object.keys(o.get(this)).forEach(((e,t)=>{if(t&&t.pointer)try{t.finalize()}catch(e){}})),i.delete(this),o.delete(this),r.sqlite3_close_v2(e),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch(e){}delete this.filename}},changes:function(e=!1,t=!1){const n=m(this).pointer;return e?t?r.sqlite3_total_changes64(n):r.sqlite3_total_changes(n):t?r.sqlite3_changes64(n):r.sqlite3_changes(n)},dbFilename:function(e="main"){return r.sqlite3_db_filename(m(this).pointer,e)},dbName:function(e=0){return r.sqlite3_db_name(m(this).pointer,e)},dbVfsName:function(e=0){let t;const s=r.sqlite3_js_db_vfs(m(this).pointer,e);if(s){const e=new r.sqlite3_vfs(s);try{t=n.cstrToJs(e.$zName)}finally{e.dispose()}}return t},prepare:function(e){m(this);const s=n.pstack.pointer;let i,a;try{i=n.pstack.alloc(8),d.checkRc(this,r.sqlite3_prepare_v2(this.pointer,e,-1,i,null)),a=n.peekPtr(i)}finally{n.pstack.restore(s)}a||t("Cannot prepare empty SQL.");const l=new p(this,a,f);return o.get(this)[a]=l,l},exec:function(){m(this);const e=function(e,n){const i=Object.create(null);switch(i.opt=Object.create(null),n.length){case 1:"string"==typeof n[0]||s.isSQLableTypedArray(n[0])||Array.isArray(n[0])?i.sql=n[0]:n[0]&&"object"==typeof n[0]&&(i.opt=n[0],i.sql=i.opt.sql);break;case 2:i.sql=n[0],i.opt=n[1];break;default:t("Invalid argument count for exec().")}i.sql=s.flexibleString(i.sql),"string"!=typeof i.sql&&t("Missing SQL argument or unsupported SQL value type.");const o=i.opt;switch(o.returnValue){case"resultRows":o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows;break;case"saveSql":o.saveSql||(o.saveSql=[]),i.returnVal=()=>o.saveSql;break;case void 0:case"this":i.returnVal=()=>e;break;default:t("Invalid returnValue value:",o.returnValue)}if(o.callback||o.returnValue||void 0===o.rowMode||(o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows),o.callback||o.resultRows)switch(void 0===o.rowMode?"array":o.rowMode){case"object":i.cbArg=e=>e.get(Object.create(null));break;case"array":i.cbArg=e=>e.get([]);break;case"stmt":Array.isArray(o.resultRows)&&t("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),i.cbArg=e=>e;break;default:if(s.isInt32(o.rowMode)){i.cbArg=e=>e.get(o.rowMode);break}if("string"==typeof o.rowMode&&o.rowMode.length>1&&"$"===o.rowMode[0]){const e=o.rowMode.substr(1);i.cbArg=n=>{const s=n.get(Object.create(null))[e];return void 0===s?t(r.SQLITE_NOTFOUND,"exec(): unknown result column:",e):s};break}t("Invalid rowMode:",o.rowMode)}return i}(this,arguments);if(!e.sql)return t("exec() requires an SQL string.");const i=e.opt,o=i.callback,a=Array.isArray(i.resultRows)?i.resultRows:void 0;let l,c=i.bind,_=!!(e.cbArg||i.columnNames||a);const u=n.scopedAllocPush(),h=Array.isArray(i.saveSql)?i.saveSql:void 0;try{const t=s.isSQLableTypedArray(e.sql);let u=t?e.sql.byteLength:n.jstrlen(e.sql);const m=n.scopedAlloc(2*n.ptrSizeof+(u+1)),g=m+n.ptrSizeof;let b=g+n.ptrSizeof;const y=b+u;for(t?n.heap8().set(e.sql,b):n.jstrcpy(e.sql,n.heap8(),b,u,!1),n.poke(b+u,0);b&&n.peek(b,"i8");){n.pokePtr([m,g],0),d.checkRc(this,r.sqlite3_prepare_v3(this.pointer,b,u,0,m,g));const t=n.peekPtr(m);if(b=n.peekPtr(g),u=y-b,t){if(h&&h.push(r.sqlite3_sql(t).trim()),l=new p(this,t,f),c&&l.parameterCount&&(l.bind(c),c=null),_&&l.columnCount){let t=Array.isArray(i.columnNames)?0:1;if(_=!1,e.cbArg||a){for(;l.step();l._lockedByExec=!1){0==t++&&l.getColumnNames(i.columnNames),l._lockedByExec=!0;const r=e.cbArg(l);if(a&&a.push(r),o&&!1===o.call(i,r,l))break}l._lockedByExec=!1}0===t&&l.getColumnNames(i.columnNames)}else l.step();l.reset().finalize(),l=null}}}finally{n.scopedAllocPop(u),l&&(delete l._lockedByExec,l.finalize())}return e.returnVal()},createFunction:function(e,n,i){const o=e=>e instanceof Function;switch(arguments.length){case 1:e=(i=e).name,n=i.xFunc||0;break;case 2:o(n)||(n=(i=n).xFunc||0)}i||(i={}),"string"!=typeof e&&t("Invalid arguments: missing function name.");let l=i.xStep||0,c=i.xFinal||0;const _=i.xValue||0,u=i.xInverse||0;let f;o(n)?(f=!1,(o(l)||o(c))&&t("Ambiguous arguments: scalar or aggregate?"),l=c=null):o(l)?(o(c)||t("Missing xFinal() callback for aggregate or window UDF."),n=null):o(c)?t("Missing xStep() callback for aggregate or window UDF."):t("Missing function-type properties."),!1===f?(o(_)||o(u))&&t("xValue and xInverse are not permitted for non-window UDFs."):o(_)?(o(u)||t("xInverse must be provided if xValue is."),f=!0):o(u)&&t("xValue must be provided if xInverse is.");const p=i.pApp;null==p||"number"==typeof p&&s.isInt32(p)||t("Invalid value for pApp property. Must be a legal WASM pointer value.");const m=i.xDestroy||0;m&&!o(m)&&t("xDestroy property must be a function.");let h=0;a(i,"deterministic")&&(h|=r.SQLITE_DETERMINISTIC),a(i,"directOnly")&&(h|=r.SQLITE_DIRECTONLY),a(i,"innocuous")&&(h|=r.SQLITE_INNOCUOUS),e=e.toLowerCase();const g=n||l,b=a(i,"arity"),y="number"==typeof b?b:g.length?g.length-1:0;let q;return q=f?r.sqlite3_create_window_function(this.pointer,e,y,r.SQLITE_UTF8|h,p||0,l,c,_,u,m):r.sqlite3_create_function_v2(this.pointer,e,y,r.SQLITE_UTF8|h,p||0,n,l,c,m),d.checkRc(this,q),this},selectValue:function(e,t,r){return g(this,e,t,0,r)},selectValues:function(e,t,r){const n=this.prepare(e),s=[];try{for(n.bind(t);n.step();)s.push(n.get(0,r));n.reset()}finally{n.finalize()}return s},selectArray:function(e,t){return g(this,e,t,[])},selectObject:function(e,t){return g(this,e,t,{})},selectArrays:function(e,t){return b(this,e,t,"array")},selectObjects:function(e,t){return b(this,e,t,"object")},openStatementCount:function(){return this.pointer?Object.keys(o.get(this)).length:0},transaction:function(e){let n="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&t(r.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),n+=" "+arguments[0],e=arguments[1]),m(this).exec(n);try{const t=e(this);return this.exec("COMMIT"),t}catch(e){throw this.exec("ROLLBACK"),e}},savepoint:function(e){m(this).exec("SAVEPOINT oo1");try{const t=e(this);return this.exec("RELEASE oo1"),t}catch(e){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),e}},checkRc:function(e){return l(this,e)}};const y=function(e){return e.pointer||t("Stmt has been closed."),e},q=function(e){return function(e){let t=f[null==e?"null":typeof e];switch(t){case f.boolean:case f.null:case f.number:case f.string:return t;case f.bigint:if(n.bigIntEnabled)return t;default:return s.isBindableTypedArray(e)?f.blob:void 0}}(e)||t("Unsupported bind() argument type:",typeof e)},v=function(e,r){return e._lockedByExec&&t("Operation is illegal when statement is locked:",r),e},w=function i(o,a,l,c){v(y(o),"bind()"),i._||(i._tooBigInt=e=>t("BigInt value is too big to store without precision loss:",e),i._={string:function(e,t,s,i){const[o,a]=n.allocCString(s,!0);return(i?r.sqlite3_bind_blob:r.sqlite3_bind_text)(e.pointer,t,o,a,r.SQLITE_WASM_DEALLOC)}}),q(c),a=function(e,n){const i="number"==typeof n?n:r.sqlite3_bind_parameter_index(e.pointer,n);return 0!==i&&s.isInt32(i)?(i<1||i>e.parameterCount)&&t("Bind index",n,"is out of range."):t("Invalid bind() parameter name: "+n),i}(o,a);let _=0;switch(null==c?f.null:l){case f.null:_=r.sqlite3_bind_null(o.pointer,a);break;case f.string:_=i._.string(o,a,c,!1);break;case f.number:{let e;s.isInt32(c)?e=r.sqlite3_bind_int:"bigint"==typeof c?s.bigIntFits64(c)?n.bigIntEnabled?e=r.sqlite3_bind_int64:s.bigIntFitsDouble(c)?(c=Number(c),e=r.sqlite3_bind_double):i._tooBigInt(c):i._tooBigInt(c):(c=Number(c),e=n.bigIntEnabled&&Number.isInteger(c)?r.sqlite3_bind_int64:r.sqlite3_bind_double),_=e(o.pointer,a,c);break}case f.boolean:_=r.sqlite3_bind_int(o.pointer,a,c?1:0);break;case f.blob:{if("string"==typeof c){_=i._.string(o,a,c,!0);break}c instanceof ArrayBuffer?c=new Uint8Array(c):s.isBindableTypedArray(c)||t("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const e=n.alloc(c.byteLength||1);n.heap8().set(c.byteLength?c:[0],e),_=r.sqlite3_bind_blob(o.pointer,a,e,c.byteLength,r.SQLITE_WASM_DEALLOC);break}default:e.config.warn("Unsupported bind() argument type:",c),t("Unsupported bind() argument type: "+typeof c)}return _&&d.checkRc(o.db.pointer,_),o._mayGet=!1,o};p.prototype={finalize:function(){if(this.pointer){v(this,"finalize()");const e=r.sqlite3_finalize(this.pointer);return delete o.get(this.db)[this.pointer],i.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,e}},clearBindings:function(){return v(y(this),"clearBindings()"),r.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(e){v(this,"reset()"),e&&this.clearBindings();const t=r.sqlite3_reset(y(this).pointer);return this._mayGet=!1,l(this.db,t),this},bind:function(){let e,r;switch(y(this),arguments.length){case 1:e=1,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:t("Invalid bind() arguments.")}return void 0===r?this:(this.parameterCount||t("This statement has no bindable parameters."),this._mayGet=!1,null===r?w(this,e,f.null,r):Array.isArray(r)?(1!==arguments.length&&t("When binding an array, an index argument is not permitted."),r.forEach(((e,t)=>w(this,t+1,q(e),e))),this):(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),"object"!=typeof r||s.isBindableTypedArray(r)?w(this,e,q(r),r):(1!==arguments.length&&t("When binding an object, an index argument is not permitted."),Object.keys(r).forEach((e=>w(this,e,q(r[e]),r[e]))),this)))},bindAsBlob:function(e,r){y(this),1===arguments.length&&(r=e,e=1);const n=q(r);return f.string!==n&&f.blob!==n&&f.null!==n&&t("Invalid value type for bindAsBlob()"),w(this,e,f.blob,r)},step:function(){v(this,"step()");const t=r.sqlite3_step(y(this).pointer);switch(t){case r.SQLITE_DONE:return this._mayGet=!1;case r.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,e.config.warn("sqlite3_step() rc=",t,r.sqlite3_js_rc_str(t),"SQL =",r.sqlite3_sql(this.pointer)),d.checkRc(this.db.pointer,t)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const e=this.step();return this.reset(),e}finally{try{this.finalize()}catch(e){}}},get:function(e,i){if(y(this)._mayGet||t("Stmt.step() has not (recently) returned true."),Array.isArray(e)){let t=0;const r=this.columnCount;for(;t=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t).valueOf():t}{const n=r.sqlite3_column_double(this.pointer,e);return(n>Number.MAX_SAFE_INTEGER||nt("The pointer property is read-only.")};Object.defineProperty(p.prototype,"pointer",e),Object.defineProperty(d.prototype,"pointer",e)}if(Object.defineProperty(p.prototype,"columnCount",{enumerable:!1,get:function(){return r.sqlite3_column_count(this.pointer)},set:()=>t("The columnCount property is read-only.")}),e.oo1={DB:d,Stmt:p},s.isUIThread()){e.oo1.JsStorageDb=function(e="session"){"session"!==e&&"local"!==e&&t("JsStorageDb db name must be one of 'session' or 'local'."),u.call(this,{filename:e,flags:"c",vfs:"kvvfs"})};const n=e.oo1.JsStorageDb;n.prototype=Object.create(d.prototype),n.clearStorage=r.sqlite3_js_kvvfs_clear,n.prototype.clearStorage=function(){return n.clearStorage(m(this).filename)},n.storageSize=r.sqlite3_js_kvvfs_size,n.prototype.storageSize=function(){return n.storageSize(m(this).filename)}}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.initWorker1API=function(){const e=(...e)=>{throw new Error(e.join(" "))};globalThis.WorkerGlobalScope instanceof Function||e("initWorker1API() must be run from a Worker thread.");const t=this.sqlite3||e("Missing this.sqlite3 object."),r=t.oo1.DB,n=function(e){let t=s.idMap.get(e);return t||(t="db#"+ ++s.idSeq+"@"+e.pointer,s.idMap.set(e,t),t)},s={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(e){const t=new r(e);return this.dbs[n(t)]=t,this.dbList.indexOf(t)<0&&this.dbList.push(t),t},close:function(e,r){if(e){delete this.dbs[n(e)];const s=e.filename,i=t.wasm.sqlite3_wasm_db_vfs(e.pointer,0);e.close();const o=this.dbList.indexOf(e);o>=0&&this.dbList.splice(o,1),r&&s&&i&&t.wasm.sqlite3_wasm_vfs_unlink(i,s)}},post:function(e,t){t&&t.length?(globalThis.postMessage(e,Array.from(t)),t.length=0):globalThis.postMessage(e)},dbs:Object.create(null),getDb:function(t,r=!0){return this.dbs[t]||(r?e("Unknown (or closed) DB ID:",t):void 0)}},i=function(t,r=!0){const n=s.getDb(t.dbId,!1)||s.dbList[0];return r?function(t=s.dbList[0]){return t&&t.pointer?t:e("DB is not opened.")}(n):n},o={open:function(r){const i=Object.create(null),o=r.args||Object.create(null);o.simulateError&&e("Throwing because of simulateError flag.");const a=Object.create(null);let l,c;var _;if(i.vfs=o.vfs,""===(_=o.filename)||":"===_[0]?i.filename=o.filename||"":(i.filename=o.filename,l=o.byteArray,l&&(c=function(e){const r=/^file:.+(vfs=(\w+))/.exec(e);return t.capi.sqlite3_vfs_find(r?r[2]:0)}(o.filename))),c){let e;try{e=t.wasm.allocFromTypedArray(l);const r=t.wasm.sqlite3_wasm_vfs_create_file(c,i.filename,e,l.byteLength);r&&t.SQLite3Error.toss(r)}catch(e){throw new t.SQLite3Error(e.name+" creating "+o.filename+": "+e.message,{cause:e})}finally{e&&t.wasm.dealloc(e)}}const u=s.open(i);return a.filename=u.filename,a.persistent=!!t.capi.sqlite3_js_db_uses_vfs(u.pointer,"opfs"),a.dbId=n(u),a.vfs=u.dbVfsName(),a},close:function(e){const t=i(e,!1),r={filename:t&&t.filename};if(t){const r=!(!e.args||"object"!=typeof e.args||!e.args.unlink);s.close(t,r)}return r},exec:function(t){const r="string"==typeof t.args?{sql:t.args}:t.args||Object.create(null);"stmt"===r.rowMode?e("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):r.sql||e("'exec' requires input SQL.");const n=i(t);(r.callback||Array.isArray(r.resultRows))&&(n._blobXfer=s.xfer);const o=r.callback;let a=0;const l=!!r.columnNames;"string"==typeof o&&(l||(r.columnNames=[]),r.callback=function(e,t){s.post({type:o,columnNames:r.columnNames,rowNumber:++a,row:e},s.xfer)});try{const e=r.countChanges?n.changes(!0,64===r.countChanges):void 0;n.exec(r),void 0!==e&&(r.changeCount=n.changes(!0,64===r.countChanges)-e),r.callback instanceof Function&&(r.callback=o,s.post({type:o,columnNames:r.columnNames,rowNumber:null,row:void 0}))}finally{delete n._blobXfer,r.callback&&(r.callback=o)}return r},"config-get":function(){const e=Object.create(null),r=t.config;return["bigIntEnabled"].forEach((function(t){Object.getOwnPropertyDescriptor(r,t)&&(e[t]=r[t])})),e.version=t.version,e.vfsList=t.capi.sqlite3_js_vfs_list(),e.opfsEnabled=!!t.opfs,e},export:function(e){const r=i(e),n={byteArray:t.capi.sqlite3_js_db_export(r.pointer),filename:r.filename,mimetype:"application/x-sqlite3"};return s.xfer.push(n.byteArray.buffer),n},toss:function(t){e("Testing worker exception")},"opfs-tree":async function(r){return t.opfs||e("OPFS support is unavailable."),await t.opfs.treeList()}};globalThis.onmessage=async function(t){let r,i=(t=t.data).dbId,a=t.type;const l=performance.now();try{o.hasOwnProperty(a)&&o[a]instanceof Function?r=await o[a](t):e("Unknown db worker message type:",t.type)}catch(e){a="error",r={operation:t.type,message:e.message,errorClass:e.name,input:t},e.stack&&(r.stack="string"==typeof e.stack?e.stack.split(/\n\s*/):e.stack)}i||(i=r.dbId||s.dbList[0]&&n(s.dbList[0])),s.post({type:a,dbId:i,messageId:t.messageId,workerReceivedTime:l,workerRespondTime:performance.now(),departureTime:t.departureTime,result:r},s.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}.bind({sqlite3:e})})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.wasm,r=e.capi,n=e.util.toss3,s=Object.create(null),i=Object.create(null),o=e.StructBinder;e.vfs=s,e.vtab=i;const a=r.sqlite3_index_info;a.prototype.nthConstraint=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const r=this.$aConstraint+a.sqlite3_index_constraint.structInfo.sizeof*e;return t?r:new a.sqlite3_index_constraint(r)},a.prototype.nthConstraintUsage=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const r=this.$aConstraintUsage+a.sqlite3_index_constraint_usage.structInfo.sizeof*e;return t?r:new a.sqlite3_index_constraint_usage(r)},a.prototype.nthOrderBy=function(e,t=!1){if(e<0||e>=this.$nOrderBy)return!1;const r=this.$aOrderBy+a.sqlite3_index_orderby.structInfo.sizeof*e;return t?r:new a.sqlite3_index_orderby(r)};const l=function e(r,s,i,a=e.installMethodArgcCheck){if(r instanceof o.StructType?i instanceof Function||t.isPtr(i)||n("Usage errror: expecting a Function or WASM pointer to one."):n("Usage error: target object is-not-a StructType."),1===arguments.length)return(t,n)=>e(r,t,n,a);e.argcProxy||(e.argcProxy=function(e,t,r,s){return function(...i){return r.length!==arguments.length&&n("Argument mismatch for",e.structInfo.name+"::"+t+": Native signature is:",s),r.apply(this,i)}},e.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach(((e,r)=>{if("number"==typeof e)try{t.uninstallFunction(e)}catch(e){}})),delete this.ondispose.__removeFuncList)});const l=r.memberSignature(s);l.length<2&&n("Member",s,"does not have a function pointer signature:",l);const c=r.memberKey(s),_=a&&!t.isPtr(i)?e.argcProxy(r,c,i,l):i;if(t.isPtr(_))_&&!t.functionEntry(_)&&n("Pointer",_,"is not a WASM function table entry."),r[c]=_;else{const n=t.installFunction(_,r.memberSignature(s,!0));r[c]=n,r.ondispose&&r.ondispose.__removeFuncList||(r.addOnDispose("ondispose.__removeFuncList handler",e.removeFuncList),r.ondispose.__removeFuncList=[]),r.ondispose.__removeFuncList.push(c,n)}return(t,n)=>e(r,t,n,a)};l.installMethodArgcCheck=!1;const c=function(e,t,r=l.installMethodArgcCheck){const n=new Map;for(const s of Object.keys(t)){const i=t[s],o=n.get(i);if(o){const t=e.memberKey(s);e[t]=e[e.memberKey(o)]}else l(e,s,i,r),n.set(i,s)}return e};o.StructType.prototype.installMethod=function(e,t,r=l.installMethodArgcCheck){return arguments.length<3&&e&&"object"==typeof e?c(this,...arguments):l(this,...arguments)},o.StructType.prototype.installMethods=function(e,t=l.installMethodArgcCheck){return c(this,e,t)},r.sqlite3_vfs.prototype.registerVfs=function(t=!1){this instanceof e.capi.sqlite3_vfs||n("Expecting a sqlite3_vfs-type argument.");const s=r.sqlite3_vfs_register(this,t?1:0);return s&&n("sqlite3_vfs_register(",this,") failed with rc",s),this.pointer!==r.sqlite3_vfs_find(this.$zName)&&n("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},s.installVfs=function(e){let r=0;const s=["io","vfs"];for(const n of s){const s=e[n];s&&(++r,c(s.struct,s.methods,!!s.applyArgcCheck),"vfs"===n&&(s.struct.$zName||"string"!=typeof s.name||s.struct.addOnDispose(s.struct.$zName=t.allocCString(s.name)),s.struct.registerVfs(!!s.asDefault)))}return r||n("Misuse: installVfs() options object requires at least","one of:",s),this};const _=function(r,n){const s=function(r,n){return function(s,i=!1){if(0===arguments.length&&(s=new n),s instanceof n)return this.set(s.pointer,s),s;t.isPtr(s)||e.SQLite3Error.toss("Invalid argument to",r+"()");let o=this.get(s);return i&&this.delete(s),o}.bind(new Map)}(r,n);return Object.assign(Object.create(null),{StructType:n,create:e=>{const r=s();return t.pokePtr(e,r.pointer),r},get:e=>s(e),unget:e=>s(e,!0),dispose:e=>{const t=s(e,!0);t&&t.dispose()}})};i.xVtab=_("xVtab",r.sqlite3_vtab),i.xCursor=_("xCursor",r.sqlite3_vtab_cursor),i.xIndexInfo=e=>new r.sqlite3_index_info(e),i.xError=function t(n,s,i){if(t.errorReporter instanceof Function)try{t.errorReporter("sqlite3_module::"+n+"(): "+s.message)}catch(e){}let o;return s instanceof e.WasmAllocError?o=r.SQLITE_NOMEM:arguments.length>2?o=i:s instanceof e.SQLite3Error&&(o=s.resultCode),o||r.SQLITE_ERROR},i.xError.errorReporter=console.error.bind(console),i.xRowid=(e,r)=>t.poke(e,r,"i64"),i.setupModule=function(s){let o=!1;const a=this instanceof r.sqlite3_module?this:s.struct||(o=new r.sqlite3_module);try{const r=s.methods||n("Missing 'methods' object.");for(const e of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const t=e[0],n=e[1];!0===r[t]?r[t]=r[n]:!0===r[n]&&(r[n]=r[t])}if(s.catchExceptions){const n=function(r,n){return["xConnect","xCreate"].indexOf(r)>=0?function(s,o,a,l,c,_){try{return n(...arguments)||0}catch(n){return n instanceof e.WasmAllocError||(t.dealloc(t.peekPtr(_)),t.pokePtr(_,t.allocCString(n.message))),i.xError(r,n)}}:function(...e){try{return n(...e)||0}catch(e){return i.xError(r,e)}}},s=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],o=Object.create(null);for(const e of s){const t=r[e];t instanceof Function&&("xConnect"===e&&r.xCreate===t?o[e]=r.xCreate:"xCreate"===e&&r.xConnect===t?o[e]=r.xConnect:o[e]=n(e,t))}c(a,o,!1)}else c(a,r,!!s.applyArgcCheck);if(0===a.$iVersion){let e;e="number"==typeof s.iVersion?s.iVersion:a.$xShadowName?3:a.$xSavePoint||a.$xRelease||a.$xRollbackTo?2:1,a.$iVersion=e}}catch(e){throw o&&o.dispose(),e}return a},r.sqlite3_module.prototype.setupModule=function(e){return i.setupModule.call(this,e)}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=function t(n){if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if("undefined"==typeof WorkerGlobalScope)return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!(globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&navigator?.storage?.getDirectory))return Promise.reject(new Error("Missing required OPFS APIs."));n&&"object"==typeof n||(n=Object.create(null));const s=new URL(globalThis.location.href).searchParams;if(s.has("opfs-disable"))return Promise.resolve(e);void 0===n.verbose&&(n.verbose=s.has("opfs-verbose")?+s.get("opfs-verbose")||2:1),void 0===n.sanityChecks&&(n.sanityChecks=s.has("opfs-sanity-check")),void 0===n.proxyUri&&(n.proxyUri=t.defaultProxyUri),"function"==typeof n.proxyUri&&(n.proxyUri=n.proxyUri());const i=new Promise((function(t,s){const i=[e.config.error,e.config.warn,e.config.log],o=(e,...t)=>{n.verbose>e&&i[e]("OPFS syncer:",...t)},a=(...e)=>o(2,...e),l=(...e)=>o(1,...e),c=(...e)=>o(0,...e),_=e.util.toss,u=e.capi,d=e.util,f=e.wasm,p=u.sqlite3_vfs,m=u.sqlite3_file,h=u.sqlite3_io_methods,g=Object.create(null);g.metrics={dump:function(){let t,r=0,n=0,s=0;for(t in x.opIds){const e=T[t];r+=e.count,n+=e.time,s+=e.wait,e.avgTime=e.count&&e.time?e.time/e.count:0,e.avgWait=e.count&&e.wait?e.wait/e.count:0}e.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",T,"\nTotal of",r,"op(s) for",n,"ms (incl. "+s+" ms of waiting on the async side)"),e.config.log("Serialization metrics:",T.s11n),E.postMessage({type:"opfs-async-metrics"})},reset:function(){let e;for(e in x.opIds)(t=T[e]=Object.create(null)).count=t.time=t.wait=0;var t;let r=T.s11n=Object.create(null);r=r.serialize=Object.create(null),r.count=r.time=0,r=T.s11n.deserialize=Object.create(null),r.count=r.time=0}};const b=new h,y=(new p).addOnDispose((()=>b.dispose()));let q;const v=e=>(q=!0,y.dispose(),s(e)),w=()=>(q=!1,t(e)),E=new Worker(new URL(r.p+r.u(892),r.b));setTimeout((()=>{void 0===q&&v(new Error("Timeout while waiting for OPFS async proxy worker."))}),4e3),E._originalOnError=E.onerror,E.onerror=function(e){c("Error initializing OPFS asyncer:",e),v(new Error("Loading OPFS async Worker failed for unknown reasons."))};const S=u.sqlite3_vfs_find(null),A=S?new p(S):null;b.$iVersion=1,y.$iVersion=2,y.$szOsFile=u.sqlite3_file.structInfo.sizeof,y.$mxPathname=1024,y.$zName=f.allocCString("opfs"),y.$xDlOpen=y.$xDlError=y.$xDlSym=y.$xDlClose=null,y.addOnDispose("$zName",y.$zName,"cleanup default VFS wrapper",(()=>A?A.dispose():null));const x=Object.create(null);x.verbose=n.verbose,x.littleEndian=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]})(),x.asyncIdleWaitTime=150,x.asyncS11nExceptions=1,x.fileBufferSize=65536,x.sabS11nOffset=x.fileBufferSize,x.sabS11nSize=2*y.$mxPathname,x.sabIO=new SharedArrayBuffer(x.fileBufferSize+x.sabS11nSize),x.opIds=Object.create(null);const T=Object.create(null);{let e=0;x.opIds.whichOp=e++,x.opIds.rc=e++,x.opIds.xAccess=e++,x.opIds.xClose=e++,x.opIds.xDelete=e++,x.opIds.xDeleteNoWait=e++,x.opIds.xFileSize=e++,x.opIds.xLock=e++,x.opIds.xOpen=e++,x.opIds.xRead=e++,x.opIds.xSleep=e++,x.opIds.xSync=e++,x.opIds.xTruncate=e++,x.opIds.xUnlock=e++,x.opIds.xWrite=e++,x.opIds.mkdir=e++,x.opIds["opfs-async-metrics"]=e++,x.opIds["opfs-async-shutdown"]=e++,x.opIds.retry=e++,x.sabOP=new SharedArrayBuffer(4*e),g.metrics.reset()}x.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_PENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach((e=>{void 0===(x.sq3Codes[e]=u[e])&&_("Maintenance required: not found:",e)})),x.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,defaultUnlockAsap:!1});const I=(e,...t)=>{const r=x.opIds[e]||_("Invalid op ID:",e);x.s11n.serialize(...t),Atomics.store(x.sabOPView,x.opIds.rc,-1),Atomics.store(x.sabOPView,x.opIds.whichOp,r),Atomics.notify(x.sabOPView,x.opIds.whichOp);const n=performance.now();Atomics.wait(x.sabOPView,x.opIds.rc,-1);const s=Atomics.load(x.sabOPView,x.opIds.rc);if(T[e].wait+=performance.now()-n,s&&x.asyncS11nExceptions){const t=x.s11n.deserialize();t&&c(e+"() async error:",...t)}return s};g.debug={asyncShutdown:()=>{l("Shutting down OPFS async listener. The OPFS VFS will no longer work."),I("opfs-async-shutdown")},asyncRestart:()=>{l("Attempting to restart OPFS VFS async listener. Might work, might not."),E.postMessage({type:"opfs-async-restart"})}};const k=function e(t=16){e._chars||(e._n=(e._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789").length);const r=[];let n=0;for(;n{O.start=performance.now(),O.op=e,++T[e].count},L=()=>T[O.op].time+=performance.now()-O.start,C={xCheckReservedLock:function(e,t){const r=F[e];return f.poke(t,r.lockType?1:0,"i32"),0},xClose:function(e){P("xClose");let t=0;const r=F[e];return r&&(delete F[e],t=I("xClose",e),r.sq3File&&r.sq3File.dispose()),L(),t},xDeviceCharacteristics:function(e){return u.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,r){return u.SQLITE_NOTFOUND},xFileSize:function(e,t){P("xFileSize");let r=I("xFileSize",e);if(0==r)try{const e=x.s11n.deserialize()[0];f.poke(t,e,"i64")}catch(e){c("Unexpected error reading xFileSize() result:",e),r=x.sq3Codes.SQLITE_IOERR}return L(),r},xLock:function(e,t){P("xLock");const r=F[e];let n=0;return r.lockType?r.lockType=t:(n=I("xLock",e,t),0===n&&(r.lockType=t)),L(),n},xRead:function(e,t,r,n){P("xRead");const s=F[e];let i;try{i=I("xRead",e,r,Number(n)),0!==i&&u.SQLITE_IOERR_SHORT_READ!==i||f.heap8u().set(s.sabView.subarray(0,r),t)}catch(e){c("xRead(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_READ}return L(),i},xSync:function(e,t){P("xSync"),++T.xSync.count;const r=I("xSync",e,t);return L(),r},xTruncate:function(e,t){P("xTruncate");const r=I("xTruncate",e,Number(t));return L(),r},xUnlock:function(e,t){P("xUnlock");const r=F[e];let n=0;return u.SQLITE_LOCK_NONE===t&&r.lockType&&(n=I("xUnlock",e,t)),0===n&&(r.lockType=t),L(),n},xWrite:function(e,t,r,n){P("xWrite");const s=F[e];let i;try{s.sabView.set(f.heap8u().subarray(t,t+r)),i=I("xWrite",e,r,Number(n))}catch(e){c("xWrite(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_WRITE}return L(),i}},N={xAccess:function(e,t,r,n){P("xAccess");const s=I("xAccess",f.cstrToJs(t));return f.poke(n,s?0:1,"i32"),L(),0},xCurrentTime:function(e,t){return f.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return f.poke(t,21086676e7+(new Date).getTime(),"i64"),0},xDelete:function(e,t,r){P("xDelete");const n=I("xDelete",f.cstrToJs(t),r,!1);return L(),n},xFullPathname:function(e,t,r,n){return f.cstrncpy(n,t,r)!!e)):r},g.getDirForFilename=async function(e,t=!1){const r=g.getResolvedPath(e,!0),n=r.pop();let s=g.rootDirectory;for(const e of r)e&&(s=await s.getDirectoryHandle(e,{create:!!t}));return[s,n]},g.mkdir=async function(e){try{return await g.getDirForFilename(e+"/filepart",!0),!0}catch(e){return!1}},g.entryExists=async function(e){try{const[t,r]=await g.getDirForFilename(e);return await t.getFileHandle(r),!0}catch(e){return!1}},g.randomFilename=k,g.registerVfs=(e=!1)=>f.exports.sqlite3_vfs_register(y.pointer,e?1:0),g.treeList=async function(){const e=Object.create(null);return await async function e(t,r){r.name=t.name,r.dirs=[],r.files=[];for await(const n of t.values())if("directory"===n.kind){const t=Object.create(null);r.dirs.push(t),await e(n,t)}else r.files.push(n.name)}(g.rootDirectory,e),e},g.rmfr=async function(){const e=g.rootDirectory,t={recurse:!0};for await(const r of e.values())e.removeEntry(r.name,t)},g.unlink=async function(e,t=!1,r=!1){try{const[r,n]=await g.getDirForFilename(e,!1);return await r.removeEntry(n,{recursive:t}),!0}catch(e){if(r)throw new Error("unlink(",arguments[0],") failed: "+e.message,{cause:e});return!1}},g.traverse=async function(e){const t={recursive:!0,directory:g.rootDirectory};"function"==typeof e&&(e={callback:e}),async function t(r,n){for await(const s of r.values()){if(!1===e.callback(s,r,n))return!1;if(e.recursive&&"directory"===s.kind&&!1===await t(s,n+1))break}}((e=Object.assign(t,e||{})).directory,0)},g.importDb=async function(e,t){if(t instanceof Function)return async function(e,t){const[r,n]=await g.getDirForFilename(e,!0),s=await r.getFileHandle(n,{create:!0});let i,o=await s.createSyncAccessHandle(),a=0,l=!1;try{for(o.truncate(0);void 0!==(i=await t());)i instanceof ArrayBuffer&&(i=new Uint8Array(i)),0===a&&i.byteLength>=15&&(d.affirmDbHeader(i),l=!0),o.write(i,{at:a}),a+=i.byteLength;if((a<512||0!=a%512)&&_("Input size",a,"is not correct for an SQLite database."),!l){const e=new Uint8Array(20);o.read(e,{at:0}),d.affirmDbHeader(e)}return o.write(new Uint8Array([1,1]),{at:18}),a}catch(e){throw await o.close(),o=void 0,await r.removeEntry(n).catch((()=>{})),e}finally{o&&await o.close()}}(e,t);t instanceof ArrayBuffer&&(t=new Uint8Array(t)),d.affirmIsDb(t);const r=t.byteLength,[n,s]=await g.getDirForFilename(e,!0);let i,o=0;try{const e=await n.getFileHandle(s,{create:!0});return i=await e.createSyncAccessHandle(),i.truncate(0),o=i.write(t,{at:0}),o!=r&&_("Expected to write "+r+" bytes but wrote "+o+"."),i.write(new Uint8Array([1,1]),{at:18}),o}catch(e){throw i&&(await i.close(),i=void 0),await n.removeEntry(s).catch((()=>{})),e}finally{i&&await i.close()}},e.oo1){const t=function(...t){const r=e.oo1.DB.dbCtorHelper.normalizeArgs(...t);r.vfs=y.$zName,e.oo1.DB.dbCtorHelper.call(this,r)};t.prototype=Object.create(e.oo1.DB.prototype),e.oo1.OpfsDb=t,t.importDb=g.importDb,e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(y.pointer,(function(e,t){t.capi.sqlite3_busy_timeout(e,1e4),t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}E.onmessage=function({data:t}){switch(t.type){case"opfs-unavailable":v(new Error(t.payload.join(" ")));break;case"opfs-async-loaded":E.postMessage({type:"opfs-async-init",args:x});break;case"opfs-async-inited":if(!0===q)break;try{e.vfs.installVfs({io:{struct:b,methods:C},vfs:{struct:y,methods:N}}),x.sabOPView=new Int32Array(x.sabOP),x.sabFileBufView=new Uint8Array(x.sabIO,0,x.fileBufferSize),x.sabS11nView=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),(()=>{if(x.s11n)return x.s11n;const e=new TextDecoder,t=new TextEncoder("utf-8"),r=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),n=new DataView(x.sabIO,x.sabS11nOffset,x.sabS11nSize);x.s11n=Object.create(null);const s=Object.create(null);s.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},s.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},s.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},s.string={id:4};const i=e=>s[typeof e]||_("Maintenance required: this value type cannot be serialized.",e),o=e=>{switch(e){case s.number.id:return s.number;case s.bigint.id:return s.bigint;case s.boolean.id:return s.boolean;case s.string.id:return s.string;default:_("Invalid type ID:",e)}};x.s11n.deserialize=function(t=!1){++T.s11n.deserialize.count;const s=performance.now(),i=r[0],a=i?[]:null;if(i){const t=[];let s,l,c,_=1;for(s=0;s{E.onerror=E._originalOnError,delete E._originalOnError,e.opfs=g,g.rootDirectory=t,a("End of OPFS sqlite3_vfs setup.",y),w()})).catch(v):w()}catch(e){c(e),v(e)}break;default:{const e="Unexpected message from the OPFS async worker: "+JSON.stringify(t);c(e),v(new Error(e));break}}}}));return i};t.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push((async e=>{try{let r=t.defaultProxyUri;return e.scriptInfo.sqlite3Dir&&(t.defaultProxyUri=e.scriptInfo.sqlite3Dir+r),t().catch((t=>{e.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",t.message)}))}catch(t){return e.config.error("installOpfsVfs() exception:",t),Promise.reject(t)}}))})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.util.toss,r=e.util.toss3,n=Object.create(null),s=e.capi,i=e.util,o=e.wasm,a=4096,l=s.SQLITE_OPEN_MAIN_DB|s.SQLITE_OPEN_MAIN_JOURNAL|s.SQLITE_OPEN_SUPER_JOURNAL|s.SQLITE_OPEN_WAL,c=".opaque",_=()=>Math.random().toString(36).slice(2),u=new TextDecoder,d=new TextEncoder,f=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2}),p=[e.config.error,e.config.warn,e.config.log],m=(e.config.log,e.config.warn),h=(e.config.error,new Map),g=e=>h.get(e),b=(e,t)=>{t?h.set(e,t):h.delete(e)},y=new Map,q=e=>y.get(e),v=(e,t)=>{t?y.set(e,t):y.delete(e)},w={xCheckReservedLock:function(e,t){const r=q(e);return r.log("xCheckReservedLock"),r.storeErr(),o.poke32(t,1),0},xClose:function(e){const t=q(e);t.storeErr();const r=t.getOFileForS3File(e);if(r)try{t.log(`xClose ${r.path}`),t.mapS3FileToOFile(e,!1),r.sah.flush(),r.flags&s.SQLITE_OPEN_DELETEONCLOSE&&t.deletePath(r.path)}catch(e){return t.storeErr(e,s.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(e){return s.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,r){return s.SQLITE_NOTFOUND},xFileSize:function(e,t){const r=q(e);r.log("xFileSize");const n=r.getOFileForS3File(e).sah.getSize()-a;return o.poke64(t,BigInt(n)),0},xLock:function(e,t){const r=q(e);return r.log(`xLock ${t}`),r.storeErr(),r.getOFileForS3File(e).lockType=t,0},xRead:function(e,t,r,n){const i=q(e);i.storeErr();const l=i.getOFileForS3File(e);i.log(`xRead ${l.path} ${r} @ ${n}`);try{const e=l.sah.read(o.heap8u().subarray(t,t+r),{at:a+Number(n)});return et&&o.poke8(r+t-1,0)}catch(i){return s.SQLITE_NOMEM}finally{o.scopedAllocPop(e)}}return i?i.sqlite3Rc||s.SQLITE_IOERR:0},xOpen:function(e,r,n,i,a){const l=g(e);try{l.log(`xOpen ${o.cstrToJs(r)} ${i}`);const e=r&&o.peek8(r)?l.getPath(r):_();let c=l.getSAHForPath(e);!c&&i&s.SQLITE_OPEN_CREATE&&(l.getFileCount()b(n.pointer,0))),a&&(n.$xRandomness=a.$xRandomness,n.$xSleep=a.$xSleep,a.dispose()),n.$xRandomness||S.xRandomness||(S.xRandomness=function(e,t,r){const n=o.heap8u();let s=0;for(;s0),e.vfs.installVfs({vfs:{struct:n,methods:S}}),n}(this.vfsName),b(this.#c.pointer,this),this.vfsDir=t.directory||"."+this.vfsName,this.#l=new DataView(this.#a.buffer,this.#a.byteOffset),this.isReady=this.reset(!!(t.clearOnInit??f.clearOnInit)).then((()=>{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(t.initialCapacity||f.initialCapacity)}))}#u(e,...t){this.#_>e&&p[e](this.vfsName+":",...t)}log(...e){this.#u(2,...e)}warn(...e){this.#u(1,...e)}error(...e){this.#u(0,...e)}getVfs(){return this.#c}getCapacity(){return this.#n.size}getFileCount(){return this.#s.size}getFileNames(){const e=[],t=this.#s.keys();for(const r of t)e.push(r);return e}async addCapacity(e){for(let t=0;t{try{const n=await r.createSyncAccessHandle();if(this.#n.set(n,t),e)n.truncate(a),this.setAssociatedPath(n,"",0);else{const e=this.getAssociatedPath(n);e?this.#s.set(e,n):this.#i.add(n)}}catch(e){throw this.storeErr(e),this.releaseAccessHandles(),e}})))}getAssociatedPath(e){e.read(this.#a,{at:0});const t=this.#l.getUint32(512);if(this.#a[0]&&(t&s.SQLITE_OPEN_DELETEONCLOSE||!(t&l)))return m(`Removing file with unexpected flags ${t.toString(16)}`,this.#a),this.setAssociatedPath(e,"",0),"";const r=new Uint32Array(2);e.read(r,{at:516});const n=this.computeDigest(this.#a);if(r.every(((e,t)=>e===n[t]))){const t=this.#a.findIndex((e=>0===e));return 0===t&&e.truncate(a),t?u.decode(this.#a.subarray(0,t)):""}return m("Disassociating file with bad digest."),this.setAssociatedPath(e,"",0),""}setAssociatedPath(e,r,n){const s=d.encodeInto(r,this.#a);512<=s.written+1&&t("Path too long:",r),this.#a.fill(0,s.written,512),this.#l.setUint32(512,n);const i=this.computeDigest(this.#a);e.write(this.#a,{at:0}),e.write(i,{at:516}),e.flush(),r?(this.#s.set(r,e),this.#i.delete(e)):(e.truncate(a),this.#i.add(e))}computeDigest(e){let t=3735928559,r=1103547991;for(const n of e)t=31*t+307*n,r=31*r+307*n;return new Uint32Array([t>>>0,r>>>0])}async reset(e){await this.isReady;let t,r=await navigator.storage.getDirectory();for(const e of this.vfsDir.split("/"))e&&(t=r,r=await r.getDirectoryHandle(e,{create:!0}));return this.#e=r,this.#r=t,this.#t=await this.#e.getDirectoryHandle(c,{create:!0}),this.releaseAccessHandles(),this.acquireAccessHandles(e)}getPath(e){return o.isPtr(e)&&(e=o.cstrToJs(e)),(e instanceof URL?e:new URL(e,"file://localhost/")).pathname}deletePath(e){const t=this.#s.get(e);return t&&(this.#s.delete(e),this.setAssociatedPath(t,"",0)),!!t}storeErr(e,t){return e&&(e.sqlite3Rc=t||s.SQLITE_IOERR,this.error(e)),this.$error=e,t}popErr(){const e=this.$error;return this.$error=void 0,e}nextAvailableSAH(){const[e]=this.#i.keys();return e}getOFileForS3File(e){return this.#o.get(e)}mapS3FileToOFile(e,t){t?(this.#o.set(e,t),v(e,this)):(this.#o.delete(e),v(e,!1))}hasFilename(e){return this.#s.has(e)}getSAHForPath(e){return this.#s.get(e)}async removeVfs(){if(!this.#c.pointer||!this.#t)return!1;s.sqlite3_vfs_unregister(this.#c.pointer),this.#c.dispose();try{this.releaseAccessHandles(),await this.#e.removeEntry(c,{recursive:!0}),this.#t=void 0,await this.#r.removeEntry(this.#e.name,{recursive:!0}),this.#e=this.#r=void 0}catch(t){e.config.error(this.vfsName,"removeVfs() failed:",t)}return!0}exportFile(e){const r=this.#s.get(e)||t("File not found:",e),n=r.getSize()-a,s=new Uint8Array(n>0?n:0);if(n>0){const e=r.read(s,{at:a});e!=n&&t("Expected to read "+n+" bytes but read "+e+".")}return s}async importDbChunked(e,r){const n=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to.");n.truncate(0);let o,l=0,c=!1;try{for(;void 0!==(o=await r());)o instanceof ArrayBuffer&&(o=new Uint8Array(o)),0===l&&o.byteLength>=15&&(i.affirmDbHeader(o),c=!0),n.write(o,{at:a+l}),l+=o.byteLength;if((l<512||0!=l%512)&&t("Input size",l,"is not correct for an SQLite database."),!c){const e=new Uint8Array(20);n.read(e,{at:0}),i.affirmDbHeader(e)}n.write(new Uint8Array([1,1]),{at:4114})}catch(e){throw this.setAssociatedPath(n,"",0),e}return this.setAssociatedPath(n,e,s.SQLITE_OPEN_MAIN_DB),l}importDb(e,r){if(r instanceof ArrayBuffer)r=new Uint8Array(r);else if(r instanceof Function)return this.importDbChunked(e,r);const n=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to."),i=r.byteLength;(i<512||i%512!=0)&&t("Byte array size is invalid for an SQLite db.");for(let e=0;e<15;++e)"SQLite format 3".charCodeAt(e)!==r[e]&&t("Input does not contain an SQLite database header.");const o=n.write(r,{at:a});return o!=i?(this.setAssociatedPath(n,"",0),t("Expected to write "+i+" bytes but wrote "+o+".")):(n.write(new Uint8Array([1,1]),{at:4114}),this.setAssociatedPath(n,e,s.SQLITE_OPEN_MAIN_DB)),o}}class x{#d;constructor(e){this.#d=e,this.vfsName=e.vfsName}async addCapacity(e){return this.#d.addCapacity(e)}async reduceCapacity(e){return this.#d.reduceCapacity(e)}getCapacity(){return this.#d.getCapacity(this.#d)}getFileCount(){return this.#d.getFileCount()}getFileNames(){return this.#d.getFileNames()}async reserveMinimumCapacity(e){const t=this.#d.getCapacity();return t{const e=await navigator.storage.getDirectory(),r=".opfs-sahpool-sync-check-"+_(),n=await e.getFileHandle(r,{create:!0}),s=(await n.createSyncAccessHandle()).close();return await s,await e.removeEntry(r),s?.then&&t("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0})().then((async function(){if(r.$testThrowInInit)throw r.$testThrowInInit;const t=new A(r);return t.isReady.then((async()=>{const r=new x(t);if(e.oo1){const n=e.oo1,s=t.getVfs(),i=function(...e){const t=n.DB.dbCtorHelper.normalizeArgs(...e);t.vfs=s.$zName,n.DB.dbCtorHelper.call(this,t)};i.prototype=Object.create(n.DB.prototype),r.OpfsSAHPoolDb=i,n.DB.dbCtorHelper.setVfsPostOpenSql(s.pointer,(function(e,t){t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}return t.log("VFS initialized."),r})).catch((async e=>(await t.removeVfs().catch((()=>{})),e)))})).catch((e=>n[s]=Promise.reject(e))):n[s]=Promise.reject(new Error("Missing required OPFS APIs."))}})),void 0!==e){const t=Object.assign(Object.create(null),{exports:void 0===Re?e.asm:Re,memory:e.wasmMemory},globalThis.sqlite3ApiConfig||{});let r;globalThis.sqlite3ApiConfig=t;try{r=globalThis.sqlite3ApiBootstrap()}catch(e){throw console.error("sqlite3ApiBootstrap() error:",e),e}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}e.sqlite3=r}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")})),e.ready});const i=function(){const e=s;if(!e)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const t=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:globalThis?.document?.currentScript,isWorker:"undefined"!=typeof WorkerGlobalScope,location:globalThis.location,urlParams:globalThis?.location?.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(t.debugModule=t.urlParams.has("sqlite3.debugModule")?(...e)=>console.warn("sqlite3.debugModule:",...e):()=>{},t.urlParams.has("sqlite3.dir"))t.sqlite3Dir=t.urlParams.get("sqlite3.dir")+"/";else if(t.moduleScript){const e=t.moduleScript.src.split("/");e.pop(),t.sqlite3Dir=e.join("/")+"/"}if(globalThis.sqlite3InitModule=function r(...n){return e(...n).then((e=>{const n=e.sqlite3;n.scriptInfo=t,r.__isUnderTest&&(n.__isUnderTest=!0);const s=n.asyncPostInit;return delete n.asyncPostInit,s()})).catch((e=>{throw console.error("Exception loading sqlite3 module:",e),e}))},globalThis.sqlite3InitModule.ready=e.ready,globalThis.sqlite3InitModuleState.moduleScript){const e=globalThis.sqlite3InitModuleState;let t=e.moduleScript.src.split("/");t.pop(),e.scriptDir=t.join("/")+"/"}return t.debugModule("sqlite3InitModuleState =",t),globalThis.sqlite3InitModule}();(s=i)().then((e=>e.initWorker1API()))})(); \ No newline at end of file diff --git a/2003.bundle.js b/2003.bundle.js index b4643074..34c73aa1 100644 --- a/2003.bundle.js +++ b/2003.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2003],{4096:(o,n,e)=>{e.d(n,{A:()=>a});var r=e(1601),t=e.n(r),l=e(6314),i=e.n(l)()(t());i.push([o.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=i},5045:(o,n,e)=>{var r=e(5072),t=e.n(r),l=e(7825),i=e.n(l),a=e(7659),s=e.n(a),c=e(5056),u=e.n(c),d=e(540),p=e.n(d),b=e(1113),h=e.n(b),g=e(4096),m={};m.styleTagTransform=h(),m.setAttributes=u(),m.insert=s().bind(null,"head"),m.domAPI=i(),m.insertStyleElement=p(),t()(g.A,m),g.A&&g.A.locals&&g.A.locals},2003:(o,n,e)=>{e.r(n),e.d(n,{default:()=>d});var r=e(6540),t=e(3407),l=(e(5045),e(7240)),i=e(945),a=e(2662),s=e(1443);class c extends a.A{constructor(o,n){super(o,n),this.addon=Promise.all([e.e(3075),e.e(1060)]).then(e.bind(e,1060)),this.ol=new i.A,this.source=null,this.abort=null,this.createSource()}createSource(){(0,s.A)("createSource start",this),this.metadata=this.addon.then((o=>{var n,e,r,t;return o.importMBTiles({url:this.props.url,sqlWorkers:null!==(n=this.props.workers)&&void 0!==n?n:4,sqlCacheSize:null!==(e=this.props.sqlCacheSize)&&void 0!==e?e:4096,maxSqlPageSize:null!==(r=this.props.maxSqlPageSize)&&void 0!==r?r:4096,backendType:null!==(t=this.props.backend)&&void 0!==t?t:"sync"})}));const o=new AbortController;this.abort=o,Promise.all([this.addon,this.metadata]).then((([n,e])=>o.signal.aborted?((0,s.A)("createSource aborted",this),void e.pool.then((o=>o.close()))):(this.source=new n.MBTilesRasterSource(e),this.eventSources=[this.ol,this.source],this.ol.setSource(this.source),this.attachOldEventHandlers(this.source),this.props.onMetadataReady&&this.props.onMetadataReady.call(this,e),this.source)))}destroySource(){(0,s.A)("destroySource",this,this.abort),this.source&&(this.source.dispose(),this.source=null,this.ol&&this.ol.setSource(null)),this.abort&&(this.abort.abort(),this.abort=null)}componentWillUnmount(){super.componentWillUnmount(),this.destroySource()}refresh(o){super.refresh(o),(null==o?void 0:o.url)!==this.props.url&&(this.destroySource(),this.createSource())}}const u=(0,t.Rb)([55.47437,-21.08468]);function d(){return r.createElement(l.f9,{width:"100%",height:"60vh",initial:{center:u,zoom:9}},r.createElement(c,{url:"https://velivole.b-cdn.net/tiles-RGR92UTM40S.mbtiles"}))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2003],{4096:(o,n,e)=>{e.d(n,{A:()=>a});var r=e(1601),t=e.n(r),l=e(6314),i=e.n(l)()(t());i.push([o.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=i},5045:(o,n,e)=>{var r=e(5072),t=e.n(r),l=e(7825),i=e.n(l),a=e(7659),s=e.n(a),c=e(5056),u=e.n(c),d=e(540),p=e.n(d),b=e(1113),h=e.n(b),g=e(4096),m={};m.styleTagTransform=h(),m.setAttributes=u(),m.insert=s().bind(null,"head"),m.domAPI=i(),m.insertStyleElement=p(),t()(g.A,m),g.A&&g.A.locals&&g.A.locals},2003:(o,n,e)=>{e.r(n),e.d(n,{default:()=>d});var r=e(6540),t=e(3407),l=(e(5045),e(7240)),i=e(945),a=e(2662),s=e(1443);class c extends a.A{constructor(o,n){super(o,n),this.addon=Promise.all([e.e(3075),e.e(8112),e.e(1060)]).then(e.bind(e,1060)),this.ol=new i.A,this.source=null,this.abort=null,this.createSource()}createSource(){(0,s.A)("createSource start",this),this.metadata=this.addon.then((o=>{var n,e,r,t;return o.importMBTiles({url:this.props.url,sqlWorkers:null!==(n=this.props.workers)&&void 0!==n?n:4,sqlCacheSize:null!==(e=this.props.sqlCacheSize)&&void 0!==e?e:4096,maxSqlPageSize:null!==(r=this.props.maxSqlPageSize)&&void 0!==r?r:4096,backendType:null!==(t=this.props.backend)&&void 0!==t?t:"sync"})}));const o=new AbortController;this.abort=o,Promise.all([this.addon,this.metadata]).then((([n,e])=>o.signal.aborted?((0,s.A)("createSource aborted",this),void e.pool.then((o=>o.close()))):(this.source=new n.MBTilesRasterSource(e),this.eventSources=[this.ol,this.source],this.ol.setSource(this.source),this.attachOldEventHandlers(this.source),this.props.onMetadataReady&&this.props.onMetadataReady.call(this,e),this.source)))}destroySource(){(0,s.A)("destroySource",this,this.abort),this.source&&(this.source.dispose(),this.source=null,this.ol&&this.ol.setSource(null)),this.abort&&(this.abort.abort(),this.abort=null)}componentWillUnmount(){super.componentWillUnmount(),this.destroySource()}refresh(o){super.refresh(o),(null==o?void 0:o.url)!==this.props.url&&(this.destroySource(),this.createSource())}}const u=(0,t.Rb)([55.47437,-21.08468]);function d(){return r.createElement(l.f9,{width:"100%",height:"60vh",initial:{center:u,zoom:9}},r.createElement(c,{url:"https://velivole.b-cdn.net/tiles-RGR92UTM40S.mbtiles"}))}}}]); \ No newline at end of file diff --git a/2099.bundle.js b/2099.bundle.js index 5dfc328f..07dc72e6 100644 --- a/2099.bundle.js +++ b/2099.bundle.js @@ -1 +1 @@ -(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2099],{89:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});var r=t(6540),o=t(7240),u=t(5553),i=t(114),l=t(9633),n=(t(5045),t(8110)),c=t(4078);n.A.defs("EPSG:32636","+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"),(0,c.kz)(n.A);class h extends u.A{constructor(e,s){super(e,s),this.createSource(),this.ol=new i.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new l.A({sources:this.props.urls.map((e=>({url:e})))}),this.eventSources=[this.ol,this.source]}componentDidMount(){super.componentDidMount(),this.context.map.setView(this.source.getView())}refresh(e){var s;super.refresh(e),(null===(s=null==e?void 0:e.urls)||void 0===s?void 0:s.length)===this.props.urls.length&&this.props.urls.every(((s,t)=>{var r;return s===(null===(r=null==e?void 0:e.urls)||void 0===r?void 0:r[t])}))||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}function a(){return r.createElement(o.f9,{width:"100%",height:"60vh",initial:{center:[0,0],zoom:1}},r.createElement(h,{properties:{label:"GeoTIFF"},urls:["https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/36/Q/WD/2020/7/S2A_36QWD_20200701_0_L2A/TCI.tif"]}))}},8625:()=>{},6504:()=>{},6580:()=>{}}]); \ No newline at end of file +(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2099],{89:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});var r=t(6540),o=t(7240),u=t(5553),i=t(114),l=t(9633),n=(t(5045),t(8721)),c=t(4078);n.A.defs("EPSG:32636","+proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"),(0,c.kz)(n.A);class h extends u.A{constructor(e,s){super(e,s),this.createSource(),this.ol=new i.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new l.A({sources:this.props.urls.map((e=>({url:e})))}),this.eventSources=[this.ol,this.source]}componentDidMount(){super.componentDidMount(),this.context.map.setView(this.source.getView())}refresh(e){var s;super.refresh(e),(null===(s=null==e?void 0:e.urls)||void 0===s?void 0:s.length)===this.props.urls.length&&this.props.urls.every(((s,t)=>{var r;return s===(null===(r=null==e?void 0:e.urls)||void 0===r?void 0:r[t])}))||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}function a(){return r.createElement(o.f9,{width:"100%",height:"60vh",initial:{center:[0,0],zoom:1}},r.createElement(h,{properties:{label:"GeoTIFF"},urls:["https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/36/Q/WD/2020/7/S2A_36QWD_20200701_0_L2A/TCI.tif"]}))}},8625:()=>{},6504:()=>{},6580:()=>{}}]); \ No newline at end of file diff --git a/2396.bundle.js b/2396.bundle.js index 890c19cc..7f502b41 100644 --- a/2396.bundle.js +++ b/2396.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2396],{2396:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(6540),r=s(3407),l=s(4078),n=s(8110),i=(s(5045),s(7240));n.A.defs("EPSG:2056","+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs +type=crs"),(0,l.kz)(n.A);const o=(0,r.Rb)([7.4475,46.948056],"EPSG:2056");function c(){const[e,t]=a.useState("...retrieving capabilities.."),[s,r]=a.useState(null);return a.createElement(a.Fragment,null,a.createElement(i.f9,{width:"100%",height:"60vh",projection:"EPSG:2056",initial:{center:o,zoom:12}},a.createElement(i.Fd,{zIndex:5,projection:"EPSG:2056",onCapabilities:function(e){t("Map is ready, format is"),r(e.format)},url:"https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml",layer:"ch.swisstopo.pixelkarte-farbe"})),a.createElement("div",{className:"border round my-1 p-1"},e,s&&a.createElement("em",{className:"ms-1"},s)))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2396],{2396:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(6540),r=s(3407),l=s(4078),n=s(8721),i=(s(5045),s(7240));n.A.defs("EPSG:2056","+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs +type=crs"),(0,l.kz)(n.A);const o=(0,r.Rb)([7.4475,46.948056],"EPSG:2056");function c(){const[e,t]=a.useState("...retrieving capabilities.."),[s,r]=a.useState(null);return a.createElement(a.Fragment,null,a.createElement(i.f9,{width:"100%",height:"60vh",projection:"EPSG:2056",initial:{center:o,zoom:12}},a.createElement(i.Fd,{zIndex:5,projection:"EPSG:2056",onCapabilities:function(e){t("Map is ready, format is"),r(e.format)},url:"https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml",layer:"ch.swisstopo.pixelkarte-farbe"})),a.createElement("div",{className:"border round my-1 p-1"},e,s&&a.createElement("em",{className:"ms-1"},s)))}}}]); \ No newline at end of file diff --git a/2729.bundle.js b/2729.bundle.js index ed0b480f..2f86db9d 100644 --- a/2729.bundle.js +++ b/2729.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2729],{6308:(e,t,a)=>{a.d(t,{A:()=>n});const n=a.p+"32ba7744565a0c818ef0e2e35126abbb.geojson"},2729:(e,t,a)=>{a.r(t),a.d(t,{default:()=>x});var n=a(6540),r=a(3407),o=a(1365),s=a(915),i=(a(5045),a(7240)),l=a(5111),c=a(2381),m=a(6308),u=a(6717);const p=new o.A({featureProjection:"EPSG:3857",featureClass:u.A}),g=e=>"rgba("+[255,153,0,Math.min(.8,.4+Math.log(e/10)/20)].join()+")",d=e=>Math.round(5*(parseFloat(e.get("mag"))-2.5)),h=(e,t)=>{const a=(0,s.S5)();for(const t of e)(0,s.X$)(a,t.getGeometry().getExtent());return Math.round(.25*((0,s.RG)(a)+(0,s.Oq)(a)))/t};function x(){const[e,t]=n.useState(20),[a,o]=n.useState("Click a cluster for details"),s=n.useRef();return n.createElement(n.Fragment,null,n.createElement(i.f9,{className:"example-map",initial:{center:(0,r.Rb)([0,0]),zoom:1}},n.createElement(c.A,{layer:"stamen_toner"}),n.createElement(i.od,{ref:s,distance:e,format:p,url:m.A,onClick:n.useCallback((e=>{var t;const a=null!==(t=e.target.get("features"))&&void 0!==t?t:[];o(`${a.length} earthquakes in this location, magnitudes are ${a.map((e=>e.get("mag"))).join(", ")}`)}),[])},n.createElement(l.RStyle,{cacheSize:1024,cacheId:(0,n.useCallback)(((e,t)=>e.get("features").length>1?"#"+h(e.get("features"),t):"$"+d(e.get("features")[0])),[]),render:(0,n.useCallback)(((e,t)=>{const a=e.get("features").length;if(a>1){const r=h(e.get("features"),t);return n.createElement(n.Fragment,null,n.createElement(l.RCircle,{radius:r},n.createElement(l.RFill,{color:g(a)})),n.createElement(l.RText,{text:a.toString()},n.createElement(l.RFill,{color:"#fff"}),n.createElement(l.RStroke,{color:"rgba(0, 0, 0, 0.6)",width:3})))}const r=e.get("features")[0];return n.createElement(l.RRegularShape,{radius:d(r),radius2:3,points:5,angle:Math.PI},n.createElement(l.RFill,{color:"rgba(255, 153, 0, 0.8)"}),n.createElement(l.RStroke,{color:"rgba(255, 204, 0, 0.2)",width:1}))}),[])}))),n.createElement("div",{className:"my-3 w-100"},n.createElement("label",{htmlFor:"distance"},"Clustering distance"),n.createElement("div",{className:"w-100"},n.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"5",max:"50",id:"distance",value:e,onChange:(0,n.useCallback)((e=>t(parseInt(e.currentTarget.value))),[])}))),n.createElement("div",null,a))}},2381:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(945),r=a(5042),o=a(2662);class s extends o.A{constructor(e,t){var a;super(e,t),this.source=new r.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(a=this.props.retina)&&void 0!==a&&a}),this.ol=new n.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(702),r=a(7896);const o={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},s={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends n.A{constructor(e){const t=e.layer.indexOf("-"),a=-1==t?e.layer:e.layer.slice(0,t),n=s[a]||{minZoom:0,maxZoom:20,retina:!0},i=o[e.layer],l=e.apiKey?"?api_key="+e.apiKey:"",c=n.retina&&e.retina?"@2x":"",m=void 0!==e.url?e.url:"https://tiles.stadiamaps.com/tiles/"+e.layer+"/{z}/{x}/{y}"+c+"."+i.extension+l,u=['© Stadia Maps','© OpenMapTiles',r.o];e.layer.startsWith("stamen_")&&u.splice(1,0,'© Stamen Design'),super({attributions:u,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:e.interpolate,maxZoom:void 0!==e.maxZoom?e.maxZoom:n.maxZoom,minZoom:void 0!==e.minZoom?e.minZoom:n.minZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:m,tilePixelRatio:c?2:1,wrapX:e.wrapX,zDirection:e.zDirection})}}const l=i}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2729],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var t=e(1601),r=e.n(t),l=e(6314),a=e.n(l)()(r());a.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=a},6308:(n,o,e)=>{e.d(o,{A:()=>t});const t=e.p+"32ba7744565a0c818ef0e2e35126abbb.geojson"},5045:(n,o,e)=>{var t=e(5072),r=e.n(t),l=e(7825),a=e.n(l),i=e(7659),s=e.n(i),c=e(5056),u=e.n(c),p=e(540),d=e.n(p),m=e(1113),b=e.n(m),g=e(4096),x={};x.styleTagTransform=b(),x.setAttributes=u(),x.insert=s().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=d(),r()(g.A,x),g.A&&g.A.locals&&g.A.locals},2729:(n,o,e)=>{e.r(o),e.d(o,{default:()=>x});var t=e(6540),r=e(3407),l=e(1365),a=e(915),i=(e(5045),e(7240)),s=e(5111),c=e(2381),u=e(6308),p=e(6717);const d=new l.A({featureProjection:"EPSG:3857",featureClass:p.A}),m=n=>"rgba("+[255,153,0,Math.min(.8,.4+Math.log(n/10)/20)].join()+")",b=n=>Math.round(5*(parseFloat(n.get("mag"))-2.5)),g=(n,o)=>{const e=(0,a.S5)();for(const o of n)(0,a.X$)(e,o.getGeometry().getExtent());return Math.round(.25*((0,a.RG)(e)+(0,a.Oq)(e)))/o};function x(){const[n,o]=t.useState(20),[e,l]=t.useState("Click a cluster for details"),a=t.useRef();return t.createElement(t.Fragment,null,t.createElement(i.f9,{className:"example-map",initial:{center:(0,r.Rb)([0,0]),zoom:1}},t.createElement(c.A,{layer:"stamen_toner"}),t.createElement(i.od,{ref:a,distance:n,format:d,url:u.A,onClick:t.useCallback((n=>{var o;const e=null!==(o=n.target.get("features"))&&void 0!==o?o:[];l(`${e.length} earthquakes in this location, magnitudes are ${e.map((n=>n.get("mag"))).join(", ")}`)}),[])},t.createElement(s.RStyle,{cacheSize:1024,cacheId:(0,t.useCallback)(((n,o)=>n.get("features").length>1?"#"+g(n.get("features"),o):"$"+b(n.get("features")[0])),[]),render:(0,t.useCallback)(((n,o)=>{const e=n.get("features").length;if(e>1){const r=g(n.get("features"),o);return t.createElement(t.Fragment,null,t.createElement(s.RCircle,{radius:r},t.createElement(s.RFill,{color:m(e)})),t.createElement(s.RText,{text:e.toString()},t.createElement(s.RFill,{color:"#fff"}),t.createElement(s.RStroke,{color:"rgba(0, 0, 0, 0.6)",width:3})))}const r=n.get("features")[0];return t.createElement(s.RRegularShape,{radius:b(r),radius2:3,points:5,angle:Math.PI},t.createElement(s.RFill,{color:"rgba(255, 153, 0, 0.8)"}),t.createElement(s.RStroke,{color:"rgba(255, 204, 0, 0.2)",width:1}))}),[])}))),t.createElement("div",{className:"my-3 w-100"},t.createElement("label",{htmlFor:"distance"},"Clustering distance"),t.createElement("div",{className:"w-100"},t.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"5",max:"50",id:"distance",value:n,onChange:(0,t.useCallback)((n=>o(parseInt(n.currentTarget.value))),[])}))),t.createElement("div",null,e))}},2381:(n,o,e)=>{e.d(o,{A:()=>a});var t=e(945),r=e(5042),l=e(2662);class a extends l.A{constructor(n,o){var e;super(n,o),this.source=new r.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(e=this.props.retina)&&void 0!==e&&e}),this.ol=new t.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(n,o,e)=>{e.d(o,{A:()=>s});var t=e(702),r=e(7896);const l={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},a={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends t.A{constructor(n){const o=n.layer.indexOf("-"),e=-1==o?n.layer:n.layer.slice(0,o),t=a[e]||{minZoom:0,maxZoom:20,retina:!0},i=l[n.layer],s=n.apiKey?"?api_key="+n.apiKey:"",c=t.retina&&n.retina?"@2x":"",u=void 0!==n.url?n.url:"https://tiles.stadiamaps.com/tiles/"+n.layer+"/{z}/{x}/{y}"+c+"."+i.extension+s,p=['© Stadia Maps','© OpenMapTiles',r.o];n.layer.startsWith("stamen_")&&p.splice(1,0,'© Stamen Design'),super({attributions:p,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:n.interpolate,maxZoom:void 0!==n.maxZoom?n.maxZoom:t.maxZoom,minZoom:void 0!==n.minZoom?n.minZoom:t.minZoom,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:u,tilePixelRatio:c?2:1,wrapX:n.wrapX,zDirection:n.zDirection})}}const s=i}}]); \ No newline at end of file diff --git a/2836.bundle.js b/2836.bundle.js index d15ef64e..f41a4484 100644 --- a/2836.bundle.js +++ b/2836.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2836],{2836:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var o=n(6540),a=n(3407),r=n(6717),s=n(1365),i=(n(5045),n(7240)),l=n(2381);const m="https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson",c=new s.A({featureProjection:"EPSG:3857",featureClass:r.A}),p=fetch("https://public.opendatasoft.com/api/records/1.0/search/?dataset=population-francaise-par-departement-2018&q=&rows=200").then((e=>e.json())),u=(e,t)=>{var n,o;return null!==(o=null===(n=e.records.find((e=>e.fields.code_departement===t)))||void 0===n?void 0:n.fields.population)&&void 0!==o?o:0};function d(){const[e,t]=o.useState({records:[]}),[n,r]=o.useState(null);return o.useEffect((()=>{p.then((e=>t(e)))}),[]),o.createElement("div",{className:"d-flex flex-row"},o.createElement(i.f9,{className:"example-map",initial:(0,o.useMemo)((()=>({center:(0,a.Rb)([2,46.5]),zoom:5.75})),[]),noDefaultControls:!0,noDefaultInteractions:!0},o.createElement(l.A,{layer:"stamen_toner"}),o.createElement(i.j9,{zIndex:5,format:c,url:m,onPointerEnter:(0,o.useCallback)((e=>r(e.target)),[]),onPointerLeave:(0,o.useCallback)((e=>n===e.target&&r(null)),[n])},o.createElement(i.cq.RStyle,{render:(0,o.useCallback)((t=>o.createElement(i.cq.RFill,{color:`rgba(0, 0, ${u(e,t.get("code"))/5e3}, 0.75)`})),[e])})),o.createElement(i.j9,{zIndex:10},n?o.createElement("div",null,o.createElement(i.Dp,{geometry:n.getGeometry()},o.createElement(i.Rv,{className:"example-overlay",autoPosition:!0},"Population in ",o.createElement("strong",null,n.get("nom"))," in 2018 is"," ",o.createElement("strong",null,u(e,n.get("code")))))):null)))}i.Dp.hitTolerance=0},2381:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(945),a=n(5042),r=n(2662);class s extends r.A{constructor(e,t){var n;super(e,t),this.source=new a.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(n=this.props.retina)&&void 0!==n&&n}),this.ol=new o.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(702),a=n(7896);const r={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},s={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends o.A{constructor(e){const t=e.layer.indexOf("-"),n=-1==t?e.layer:e.layer.slice(0,t),o=s[n]||{minZoom:0,maxZoom:20,retina:!0},i=r[e.layer],l=e.apiKey?"?api_key="+e.apiKey:"",m=o.retina&&e.retina?"@2x":"",c=void 0!==e.url?e.url:"https://tiles.stadiamaps.com/tiles/"+e.layer+"/{z}/{x}/{y}"+m+"."+i.extension+l,p=['© Stadia Maps','© OpenMapTiles',a.o];e.layer.startsWith("stamen_")&&p.splice(1,0,'© Stamen Design'),super({attributions:p,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:e.interpolate,maxZoom:void 0!==e.maxZoom?e.maxZoom:o.maxZoom,minZoom:void 0!==e.minZoom?e.minZoom:o.minZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:c,tilePixelRatio:m?2:1,wrapX:e.wrapX,zDirection:e.zDirection})}}const l=i}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2836],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var t=e(1601),r=e.n(t),l=e(6314),a=e.n(l)()(r());a.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=a},5045:(n,o,e)=>{var t=e(5072),r=e.n(t),l=e(7825),a=e.n(l),i=e(7659),s=e.n(i),c=e(5056),p=e.n(c),u=e(540),d=e.n(u),m=e(1113),b=e.n(m),g=e(4096),x={};x.styleTagTransform=b(),x.setAttributes=p(),x.insert=s().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=d(),r()(g.A,x),g.A&&g.A.locals&&g.A.locals},2836:(n,o,e)=>{e.r(o),e.d(o,{default:()=>m});var t=e(6540),r=e(3407),l=e(6717),a=e(1365),i=(e(5045),e(7240)),s=e(2381);const c="https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson",p=new a.A({featureProjection:"EPSG:3857",featureClass:l.A}),u=fetch("https://public.opendatasoft.com/api/records/1.0/search/?dataset=population-francaise-par-departement-2018&q=&rows=200").then((n=>n.json())),d=(n,o)=>{var e,t;return null!==(t=null===(e=n.records.find((n=>n.fields.code_departement===o)))||void 0===e?void 0:e.fields.population)&&void 0!==t?t:0};function m(){const[n,o]=t.useState({records:[]}),[e,l]=t.useState(null);return t.useEffect((()=>{u.then((n=>o(n)))}),[]),t.createElement("div",{className:"d-flex flex-row"},t.createElement(i.f9,{className:"example-map",initial:(0,t.useMemo)((()=>({center:(0,r.Rb)([2,46.5]),zoom:5.75})),[]),noDefaultControls:!0,noDefaultInteractions:!0},t.createElement(s.A,{layer:"stamen_toner"}),t.createElement(i.j9,{zIndex:5,format:p,url:c,onPointerEnter:(0,t.useCallback)((n=>l(n.target)),[]),onPointerLeave:(0,t.useCallback)((n=>e===n.target&&l(null)),[e])},t.createElement(i.cq.RStyle,{render:(0,t.useCallback)((o=>t.createElement(i.cq.RFill,{color:`rgba(0, 0, ${d(n,o.get("code"))/5e3}, 0.75)`})),[n])})),t.createElement(i.j9,{zIndex:10},e?t.createElement("div",null,t.createElement(i.Dp,{geometry:e.getGeometry()},t.createElement(i.Rv,{className:"example-overlay",autoPosition:!0},"Population in ",t.createElement("strong",null,e.get("nom"))," in 2018 is"," ",t.createElement("strong",null,d(n,e.get("code")))))):null)))}i.Dp.hitTolerance=0},2381:(n,o,e)=>{e.d(o,{A:()=>a});var t=e(945),r=e(5042),l=e(2662);class a extends l.A{constructor(n,o){var e;super(n,o),this.source=new r.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(e=this.props.retina)&&void 0!==e&&e}),this.ol=new t.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(n,o,e)=>{e.d(o,{A:()=>s});var t=e(702),r=e(7896);const l={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},a={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends t.A{constructor(n){const o=n.layer.indexOf("-"),e=-1==o?n.layer:n.layer.slice(0,o),t=a[e]||{minZoom:0,maxZoom:20,retina:!0},i=l[n.layer],s=n.apiKey?"?api_key="+n.apiKey:"",c=t.retina&&n.retina?"@2x":"",p=void 0!==n.url?n.url:"https://tiles.stadiamaps.com/tiles/"+n.layer+"/{z}/{x}/{y}"+c+"."+i.extension+s,u=['© Stadia Maps','© OpenMapTiles',r.o];n.layer.startsWith("stamen_")&&u.splice(1,0,'© Stamen Design'),super({attributions:u,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:n.interpolate,maxZoom:void 0!==n.maxZoom?n.maxZoom:t.maxZoom,minZoom:void 0!==n.minZoom?n.minZoom:t.minZoom,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:p,tilePixelRatio:c?2:1,wrapX:n.wrapX,zDirection:n.zDirection})}}const s=i}}]); \ No newline at end of file diff --git a/2883.bundle.js b/2883.bundle.js index 5d61cd79..a6111d0b 100644 --- a/2883.bundle.js +++ b/2883.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2883],{2883:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var l=r(6540),n=r(3407),a=r(4525),o=(r(5045),r(7240)),c=r(5111),s=r(2381);const i={0:{width:6,font:"1.2rem helvetica,sans-serif"},1:{width:5,font:"0.6rem helvetica,sans-serif"},2:{width:3,font:"0.5rem helvetica,sans-serif"},def:{width:1,font:"0.4rem helvetica,sans-serif"}};function m(){const[e,t]=l.useState(""),r=(0,c.useRStyle)(),m=(0,l.useMemo)((()=>new a.A),[]);return l.createElement(l.Fragment,null,l.createElement(c.RStyleArray,{ref:r,render:(0,l.useCallback)((e=>{var t;const{width:r,font:n}=null!==(t=i[e.get("p")])&&void 0!==t?t:i.def,a="#ffff"+e.get("c").charAt(0).toString("hex").substring(0,2).padStart(2,"0");return l.createElement(l.Fragment,null,l.createElement(c.RStyle,{zIndex:10},l.createElement(c.RCircle,{radius:r},l.createElement(c.RStroke,{color:"#007bff",width:r}),l.createElement(c.RFill,{color:"#007bff"})),l.createElement(c.RText,{font:n,text:e.get("n")},l.createElement(c.RStroke,{color:"#007bff",width:2}),l.createElement(c.RFill,{color:a}))),l.createElement(c.RStyle,{zIndex:0},l.createElement(c.RCircle,{radius:1.5*r},l.createElement(c.RStroke,{color:"#000000",width:1.5*r}),l.createElement(c.RFill,{color:"#000000"}))))}),[])}),l.createElement(o.f9,{className:"example-map",initial:{center:(0,n.Rb)([2.364,48.82],"EPSG:4326"),zoom:8},projection:"EPSG:4326"},l.createElement(s.A,{layer:"stamen_watercolor"}),l.createElement(o.Ji,{onPointerEnter:l.useCallback((e=>{var r;return(null===(r=e.target)||void 0===r?void 0:r.get)&&t(e.target.get("n")+", "+e.target.get("c"))}),[t]),url:"https://velivole.b-cdn.net/tiles/admin/{z}/{x}/{y}.pbf",projection:"EPSG:4326",format:m},l.createElement(c.RStyle,null,l.createElement(c.RStroke,{color:"#007bff",width:2}),l.createElement(c.RFill,{color:"transparent"}))),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/0/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:.01,style:r,format:m}),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/1/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:.0025,style:r,format:m}),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/2/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:5e-4,style:r,format:m})),l.createElement("div",{className:"mx-0 mt-0 mb-3 p-1 w-100 jumbotron shadow shadow"},l.createElement("p",null,"You are now in ",l.createElement("strong",null,e))))}},2381:(e,t,r)=>{r.d(t,{A:()=>o});var l=r(945),n=r(5042),a=r(2662);class o extends a.A{constructor(e,t){var r;super(e,t),this.source=new n.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(r=this.props.retina)&&void 0!==r&&r}),this.ol=new l.A({source:this.source}),this.eventSources=[this.ol,this.source]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[2883],{2883:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var l=r(6540),n=r(3407),a=r(4662),o=(r(5045),r(7240)),c=r(5111),s=r(2381);const i={0:{width:6,font:"1.2rem helvetica,sans-serif"},1:{width:5,font:"0.6rem helvetica,sans-serif"},2:{width:3,font:"0.5rem helvetica,sans-serif"},def:{width:1,font:"0.4rem helvetica,sans-serif"}};function m(){const[e,t]=l.useState(""),r=(0,c.useRStyle)(),m=(0,l.useMemo)((()=>new a.A),[]);return l.createElement(l.Fragment,null,l.createElement(c.RStyleArray,{ref:r,render:(0,l.useCallback)((e=>{var t;const{width:r,font:n}=null!==(t=i[e.get("p")])&&void 0!==t?t:i.def,a="#ffff"+e.get("c").charAt(0).toString("hex").substring(0,2).padStart(2,"0");return l.createElement(l.Fragment,null,l.createElement(c.RStyle,{zIndex:10},l.createElement(c.RCircle,{radius:r},l.createElement(c.RStroke,{color:"#007bff",width:r}),l.createElement(c.RFill,{color:"#007bff"})),l.createElement(c.RText,{font:n,text:e.get("n")},l.createElement(c.RStroke,{color:"#007bff",width:2}),l.createElement(c.RFill,{color:a}))),l.createElement(c.RStyle,{zIndex:0},l.createElement(c.RCircle,{radius:1.5*r},l.createElement(c.RStroke,{color:"#000000",width:1.5*r}),l.createElement(c.RFill,{color:"#000000"}))))}),[])}),l.createElement(o.f9,{className:"example-map",initial:{center:(0,n.Rb)([2.364,48.82],"EPSG:4326"),zoom:8},projection:"EPSG:4326"},l.createElement(s.A,{layer:"stamen_watercolor"}),l.createElement(o.Ji,{onPointerEnter:l.useCallback((e=>{var r;return(null===(r=e.target)||void 0===r?void 0:r.get)&&t(e.target.get("n")+", "+e.target.get("c"))}),[t]),url:"https://velivole.b-cdn.net/tiles/admin/{z}/{x}/{y}.pbf",projection:"EPSG:4326",format:m},l.createElement(c.RStyle,null,l.createElement(c.RStroke,{color:"#007bff",width:2}),l.createElement(c.RFill,{color:"transparent"}))),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/0/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:.01,style:r,format:m}),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/1/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:.0025,style:r,format:m}),l.createElement(o.Ji,{url:"https://velivole.b-cdn.net/tiles/place/2/{z}/{x}/{y}.pbf",projection:"EPSG:4326",maxResolution:5e-4,style:r,format:m})),l.createElement("div",{className:"mx-0 mt-0 mb-3 p-1 w-100 jumbotron shadow shadow"},l.createElement("p",null,"You are now in ",l.createElement("strong",null,e))))}},2381:(e,t,r)=>{r.d(t,{A:()=>o});var l=r(945),n=r(5042),a=r(2662);class o extends a.A{constructor(e,t){var r;super(e,t),this.source=new n.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(r=this.props.retina)&&void 0!==r&&r}),this.ol=new l.A({source:this.source}),this.eventSources=[this.ol,this.source]}}}}]); \ No newline at end of file diff --git a/290.bundle.js b/290.bundle.js deleted file mode 100644 index 57011197..00000000 --- a/290.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[290],{4096:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(1601),r=n.n(o),i=n(6314),s=n.n(i)()(r());s.push([t.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=s},5045:(t,e,n)=>{var o=n(5072),r=n.n(o),i=n(7825),s=n.n(i),a=n(7659),l=n.n(a),d=n(5056),h=n.n(d),u=n(540),c=n.n(u),p=n(1113),g=n.n(p),f=n(4096),b={};b.styleTagTransform=g(),b.setAttributes=h(),b.insert=l().bind(null,"head"),b.domAPI=s(),b.insertStyleElement=c(),r()(f.A,b),f.A&&f.A.locals&&f.A.locals},8217:(t,e,n)=>{n.d(e,{Ay:()=>f,Bs:()=>w,hX:()=>b,te:()=>x});var o=n(6717),r=n(4778),i=n(4294),s=n(1217),a=n(1064),l=n(503),d=n(6702),h=n(2871),u=n(4338),c=n(4087),p=n(3407),g=n(3402);const f=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=o.A,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?(0,p.Jt)(e.dataProjection):this.readProjection(t);e.extent&&n&&"tile-pixels"===n.getUnits()&&(n=(0,p.Jt)(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return(0,c.b0)()}readFeature(t,e){return(0,c.b0)()}readFeatures(t,e){return(0,c.b0)()}readGeometry(t,e){return(0,c.b0)()}readProjection(t){return(0,c.b0)()}writeFeature(t,e){return(0,c.b0)()}writeFeatures(t,e){return(0,c.b0)()}writeGeometry(t,e){return(0,c.b0)()}};function b(t,e,n){const o=n?(0,p.Jt)(n.featureProjection):null,r=n?(0,p.Jt)(n.dataProjection):null;let i=t;if(o&&r&&!(0,p.tI)(o,r)){e&&(i=t.clone());const n=e?o:r,s=e?r:o;"tile-pixels"===n.getUnits()?i.transform(n,s):i.applyTransform((0,p.RG)(n,s))}if(e&&n&&void 0!==n.decimals){const e=Math.pow(10,n.decimals),o=function(t){for(let n=0,o=t.length;nw({...t,geometry:e}))).flat();const o="MultiPolygon"===n.type?"Polygon":n.type;if("GeometryCollection"===o||"Circle"===o)throw new Error("Unsupported geometry type: "+o);const i=n.layout.length;return b(new r.Ay(o,"Polygon"===o?function(t,e,n){return Array.isArray(e[0])?((0,g.mb)(t,0,e,n)||(t=t.slice(),(0,g.NK)(t,0,e,n)),t):((0,g.PA)(t,0,e,n)||(t=t.slice(),(0,g.ug)(t,0,e,n)),t)}(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function x(t,e){if(!t)return null;if(Array.isArray(t)){const n=t.map((t=>x(t,e)));return new u.A(n)}return b(new(0,m[t.type])(t.flatCoordinates,t.layout,t.ends),!1,e)}},4525:(t,e,n)=>{n.d(e,{A:()=>C});var o=n(8217),r=n(1217),i=n(6702),s=n(503),a=n(2871);const l=4294967296,d=1/l,h="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class u{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e,n=this.length){for(;this.pos>3,r=this.pos;this.type=7&n,t(o,e,this),this.pos===r&&this.skip(n)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*l;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*l;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let n,o;return o=e[this.pos++],n=127&o,o<128?n:(o=e[this.pos++],n|=(127&o)<<7,o<128?n:(o=e[this.pos++],n|=(127&o)<<14,o<128?n:(o=e[this.pos++],n|=(127&o)<<21,o<128?n:(o=e[this.pos],n|=(15&o)<<28,function(t,e,n){const o=n.buf;let r,i;if(i=o[n.pos++],r=(112&i)>>4,i<128)return c(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return c(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return c(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return c(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return c(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return c(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(n,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&h?h.decode(this.buf.subarray(e,t)):function(t,e,n){let o="",r=e;for(;r239?4:e>223?3:e>191?2:1;if(r+d>n)break;1===d?e<128&&(l=e):2===d?(i=t[r+1],128==(192&i)&&(l=(31&e)<<6|63&i,l<=127&&(l=null))):3===d?(i=t[r+1],s=t[r+2],128==(192&i)&&128==(192&s)&&(l=(15&e)<<12|(63&i)<<6|63&s,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===d&&(i=t[r+1],s=t[r+2],a=t[r+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(l=(15&e)<<18|(63&i)<<12|(63&s)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,d=1):l>65535&&(l-=65536,o+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),o+=String.fromCharCode(l),r+=d}return o}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const n=this.readPackedEnd();for(;this.pos127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error(`Unimplemented type: ${e}`);this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e268435455||t<0?function(t,e){let n,o;if(t>=0?(n=t%4294967296|0,o=t/4294967296|0):(n=~(-t%4294967296),o=~(-t/4294967296),4294967295^n?n=n+1|0:(n=0,o=o+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){const n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(o,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,n){for(let o,r,i=0;i55295&&o<57344){if(!r){o>56319||i+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=o;continue}if(o<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=o;continue}o=r-55296<<10|o-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);o<128?t[n++]=o:(o<2048?t[n++]=o>>6|192:(o<65536?t[n++]=o>>12|224:(t[n++]=o>>18|240,t[n++]=o>>12&63|128),t[n++]=o>>6&63|128),t[n++]=63&o|128)}return n}(this.buf,t,this.pos);const n=this.pos-e;n>=128&&p(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let n=0;n=128&&p(n,o,this),this.pos=n-1,this.writeVarint(o),this.pos+=o}writeMessage(t,e,n){this.writeTag(t,2),this.writeRawMessage(e,n)}writePackedVarint(t,e){e.length&&this.writeMessage(t,g,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,f,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,w,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,b,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,m,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,x,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,y,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,v,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,k,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function c(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function p(t,e,n){const o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(o);for(let e=n.pos-1;e>=t;e--)n.buf[e+o]=n.buf[e]}function g(t,e){for(let n=0;n>3}if(s--,1===i||2===i)a+=t.readSVarint(),l+=t.readSVarint(),1===i&&d>h&&(o.push(d),h=d),n.push(a,l),d+=2;else{if(7!==i)throw new Error("Invalid command found in the PBF");d>h&&(n.push(n[h],n[h+1]),d+=2)}}d>h&&(o.push(d),h=d)}createFeature_(t,e,n){const l=e.type;if(0===l)return null;let d;const h=e.properties;let u;this.idProperty_?(u=h[this.idProperty_],delete h[this.idProperty_]):u=e.id,h[this.layerName_]=e.layer.name;const c=[],p=[];this.readRawGeometry_(t,e,c,p);const g=function(t,e){let n;return 1===t?n=1===e?"Point":"MultiPoint":2===t?n=1===e?"LineString":"MultiLineString":3===t&&(n="Polygon"),n}(l,p.length);if(this.featureClass===S.Ay)d=new this.featureClass(g,c,p,2,h,u),d.transform(n.dataProjection);else{let t;if("Polygon"==g){const e=(0,A.yJ)(c,p);t=e.length>1?new a.A(c,"XY",e):new P.Ay(c,"XY",p)}else t="Point"===g?new F.A(c,"XY"):"LineString"===g?new r.A(c,"XY"):"MultiPoint"===g?new s.A(c,"XY"):"MultiLineString"===g?new i.A(c,"XY",p):null;d=new(0,this.featureClass),this.geometryName_&&d.setGeometryName(this.geometryName_);const e=(0,o.hX)(t,!1,n);d.setGeometry(e),void 0!==u&&d.setId(u),d.setProperties(h,!0)}return d}getType(){return"arraybuffer"}readFeatures(t,e){const n=this.layers_;e=this.adaptOptions(e);const o=(0,_.Jt)(e.dataProjection);o.setWorldExtent(e.extent),e.dataProjection=o;const r=new u(t),i=r.readFields(M,{}),s=[];for(const t in i){if(n&&!n.includes(t))continue;const a=i[t],l=a?[0,0,a.extent,a.extent]:null;o.setExtent(l);for(let t=0,n=a.length;t>3)?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;e.values.push(o)}}function j(t,e,n){if(1==t)e.id=n.readVarint();else if(2==t){const t=n.readVarint()+n.pos;for(;n.pos{n.d(e,{A:()=>l});var o=n(702),r=n(7896);const i={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},s={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class a extends o.A{constructor(t){const e=t.layer.indexOf("-"),n=-1==e?t.layer:t.layer.slice(0,e),o=s[n]||{minZoom:0,maxZoom:20,retina:!0},a=i[t.layer],l=t.apiKey?"?api_key="+t.apiKey:"",d=o.retina&&t.retina?"@2x":"",h=void 0!==t.url?t.url:"https://tiles.stadiamaps.com/tiles/"+t.layer+"/{z}/{x}/{y}"+d+"."+a.extension+l,u=['© Stadia Maps','© OpenMapTiles',r.o];t.layer.startsWith("stamen_")&&u.splice(1,0,'© Stamen Design'),super({attributions:u,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:o.maxZoom,minZoom:void 0!==t.minZoom?t.minZoom:o.minZoom,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:h,tilePixelRatio:d?2:1,wrapX:t.wrapX,zDirection:t.zDirection})}}const l=a}}]); \ No newline at end of file diff --git a/3075.bundle.js b/3075.bundle.js index b6d6043f..2420c769 100644 --- a/3075.bundle.js +++ b/3075.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[3075],{3075:(t,e,a)=>{function i(t){let e=t.length;for(;--e>=0;)t[e]=0}a.d(e,{Ay:()=>_a,UD:()=>da});const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),s=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),l=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);i(o);const h=new Array(60);i(h);const d=new Array(512);i(d);const _=new Array(256);i(_);const f=new Array(29);i(f);const c=new Array(30);function u(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let w,b,m;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}i(c);const p=t=>t<256?d[t]:d[256+(t>>>7)],k=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},v=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{v(t,a[2*e],a[2*e+1])},x=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=x(i[e]++,e))}},A=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},E=t=>{t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},R=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let i,r,l,o,h=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+h++],i+=(255&t.pending_buf[t.sym_buf+h++])<<8,r=t.pending_buf[t.sym_buf+h++],0===i?y(t,r,e):(l=_[r],y(t,l+256+1,e),o=n[l],0!==o&&(r-=f[l],v(t,r,o)),i--,l=p(i),y(t,l,a),o=s[l],0!==o&&(i-=c[l],v(t,i,o)))}while(h{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,l,o,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)Z(t,a,r);o=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Z(t,a,1),l=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=l,a[2*o]=a[2*r]+a[2*l],t.depth[o]=(t.depth[r]>=t.depth[l]?t.depth[r]:t.depth[l])+1,a[2*r+1]=a[2*l+1]=o,t.heap[1]=o++,Z(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,o=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>o&&(f=o,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=l&&(c=r[d-l]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=o-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[o]--,w-=2}while(w>0);for(f=o;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),z(a,h,t.bl_count)},D=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{v(t,0+(i?1:0),3),E(t),k(t,a),k(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var I={_tr_init:t=>{O||((()=>{let t,e,a,i,l;const g=new Array(16);for(a=0,i=0;i<28;i++)for(f[i]=a,t=0;t<1<>=7;i<30;i++)for(c[i]=l<<7,t=0;t<1<{let n,s,r=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),S(t,t.l_desc),S(t,t.d_desc),r=(t=>{let e;for(D(t,t.dyn_ltree,t.l_desc.max_code),D(t,t.dyn_dtree,t.d_desc.max_code),S(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=a+5,a+4<=n&&-1!==e?F(t,e,a,i):4===t.strategy||s===n?(v(t,2+(i?1:0),3),U(t,o,h)):(v(t,4+(i?1:0),3),((t,e,a,i)=>{let n;for(v(t,e-257,5),v(t,a-1,5),v(t,i-4,4),n=0;n(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*p(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{v(t,2,3),y(t,256,o),(t=>{16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},L=(t,e,a,i)=>{let n=65535&t,s=t>>>16&65535,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16};const N=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var B=(t,e,a,i)=>{const n=N,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return~t},C={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:M,_tr_stored_block:j,_tr_flush_block:K,_tr_tally:P,_tr_align:Y}=I,{Z_NO_FLUSH:G,Z_PARTIAL_FLUSH:X,Z_FULL_FLUSH:W,Z_FINISH:q,Z_BLOCK:J,Z_OK:Q,Z_STREAM_END:V,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:at,Z_FILTERED:it,Z_HUFFMAN_ONLY:nt,Z_RLE:st,Z_FIXED:rt,Z_DEFAULT_STRATEGY:lt,Z_UNKNOWN:ot,Z_DEFLATED:ht}=H,dt=258,_t=262,ft=42,ct=113,ut=666,wt=(t,e)=>(t.msg=C[e],e),bt=t=>2*t-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},gt=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let pt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},vt=(t,e)=>{K(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},yt=(t,e)=>{t.pending_buf[t.pending++]=e},xt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},zt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=L(t.adler,e,n,a):2===t.state.wrap&&(t.adler=B(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},At=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-_t?t.strstart-(t.w_size-_t):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+dt;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Et=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-_t)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),gt(t),i+=e),0===t.strm.avail_in)break;if(a=zt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=pt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=pt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<_t&&0!==t.strm.avail_in)},Rt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,l=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,kt(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(zt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return l-=t.strm.avail_in,l&&(l>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=l&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-l,t.strm.next_in),t.strstart),t.strstart+=l,t.insert+=l>t.w_size-t.insert?t.w_size-t.insert:l),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(zt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===q)&&e!==G&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===q&&0===t.strm.avail_in&&a===i?1:0,j(t,t.block_start,a,r),t.block_start+=a,kt(t.strm)),r?3:1)},Zt=(t,e)=>{let a,i;for(;;){if(t.lookahead<_t){if(Et(t),t.lookahead<_t&&e===G)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-_t&&(t.match_length=At(t,a)),t.match_length>=3)if(i=P(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=pt(t,t.ins_h,t.window[t.strstart+1]);else i=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<_t){if(Et(t),t.lookahead<_t&&e===G)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=P(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(vt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=P(t,0,t.window[t.strstart-1]),i&&vt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=P(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,Rt),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ht,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ft&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==ct&&e.status!==ut?1:0},Ft=t=>{if(Ot(t))return wt(t,$);t.total_in=t.total_out=0,t.data_type=ot;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?ft:ct,t.adler=2===e.wrap?0:1,e.last_flush=-2,M(e),Q},It=t=>{const e=Ft(t);var a;return e===Q&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Lt=(t,e,a,i,n,s)=>{if(!t)return $;let r=1;if(e===at&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ht||i<8||i>15||e<0||e>9||s<0||s>rt||8===i&&1!==r)return wt(t,$);8===i&&(i=9);const l=new Tt;return t.state=l,l.strm=t,l.status=ft,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Lt(t,e,ht,15,8,lt),deflateInit2:Lt,deflateReset:It,deflateResetKeep:Ft,deflateSetHeader:(t,e)=>Ot(t)||2!==t.state.wrap?$:(t.state.gzhead=e,Q),deflate:(t,e)=>{if(Ot(t)||e>J||e<0)return t?wt(t,$):$;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===ut&&e!==q)return wt(t,0===t.avail_out?et:$);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(kt(t),0===t.avail_out)return a.last_flush=-1,Q}else if(0===t.avail_in&&bt(e)<=bt(i)&&e!==q)return wt(t,et);if(a.status===ut&&0!==t.avail_in)return wt(t,et);if(a.status===ft&&0===a.wrap&&(a.status=ct),a.status===ft){let e=ht+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=nt||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,xt(a,e),0!==a.strstart&&(xt(a,t.adler>>>16),xt(a,65535&t.adler)),t.adler=1,a.status=ct,kt(t),0!==a.pending)return a.last_flush=-1,Q}if(57===a.status)if(t.adler=0,yt(a,31),yt(a,139),yt(a,8),a.gzhead)yt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),yt(a,255&a.gzhead.time),yt(a,a.gzhead.time>>8&255),yt(a,a.gzhead.time>>16&255),yt(a,a.gzhead.time>>24&255),yt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),yt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(yt(a,255&a.gzhead.extra.length),yt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=B(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(yt(a,0),yt(a,0),yt(a,0),yt(a,0),yt(a,0),yt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),yt(a,3),a.status=ct,kt(t),0!==a.pending)return a.last_flush=-1,Q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=B(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,kt(t),0!==a.pending)return a.last_flush=-1,Q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=B(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=B(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,Q;i=0}e=a.gzindexi&&(t.adler=B(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=B(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,Q;i=0}e=a.gzindexi&&(t.adler=B(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(kt(t),0!==a.pending))return a.last_flush=-1,Q;yt(a,255&t.adler),yt(a,t.adler>>8&255),t.adler=0}if(a.status=ct,kt(t),0!==a.pending)return a.last_flush=-1,Q}if(0!==t.avail_in||0!==a.lookahead||e!==G&&a.status!==ut){let i=0===a.level?Rt(a,e):a.strategy===nt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===G)return 1;break}if(t.match_length=0,a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===st?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=dt){if(Et(t),t.lookahead<=dt&&e===G)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+dt;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=P(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(a,e):Dt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=ut),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),Q;if(2===i&&(e===X?Y(a):e!==J&&(j(a,0,0,!1),e===W&&(mt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),kt(t),0===t.avail_out))return a.last_flush=-1,Q}return e!==q?Q:a.wrap<=0?V:(2===a.wrap?(yt(a,255&t.adler),yt(a,t.adler>>8&255),yt(a,t.adler>>16&255),yt(a,t.adler>>24&255),yt(a,255&t.total_in),yt(a,t.total_in>>8&255),yt(a,t.total_in>>16&255),yt(a,t.total_in>>24&255)):(xt(a,t.adler>>>16),xt(a,65535&t.adler)),kt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?Q:V)},deflateEnd:t=>{if(Ot(t))return $;const e=t.state.status;return t.state=null,e===ct?wt(t,tt):Q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Ot(t))return $;const i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ft||i.lookahead)return $;if(1===n&&(t.adler=L(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=pt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Et(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,Q},deflateInfo:"pako deflate (from Nodeca project)"};const Bt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Ct={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Bt(a,e)&&(t[e]=a[e])}}return t},flattenChunks:t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Mt[254]=Mt[254]=1;var jt={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},buf2string:(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ht)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Mt[t[a]]>e?a:e}},Kt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Pt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Gt,Z_FULL_FLUSH:Xt,Z_FINISH:Wt,Z_OK:qt,Z_STREAM_END:Jt,Z_DEFAULT_COMPRESSION:Qt,Z_DEFAULT_STRATEGY:Vt,Z_DEFLATED:$t}=H;function te(t){this.options=Ct.assign({level:Qt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Vt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Kt,this.strm.avail_out=0;let a=Nt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==qt)throw new Error(C[a]);if(e.header&&Nt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt.string2buf(e.dictionary):"[object ArrayBuffer]"===Pt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Nt.deflateSetDictionary(this.strm,t),a!==qt)throw new Error(C[a]);this._dict_set=!0}}function ee(t,e){const a=new te(e);if(a.push(t,!0),a.err)throw a.msg||C[a.err];return a.result}te.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Wt:Yt,"string"==typeof t?a.input=jt.string2buf(t):"[object ArrayBuffer]"===Pt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Gt||s===Xt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Nt.deflate(a,s),n===Jt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Nt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},te.prototype.onData=function(t){this.chunks.push(t)},te.prototype.onEnd=function(t){t===qt&&(this.result=Ct.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ae={Deflate:te,deflate:ee,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ee(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ee(t,e)},constants:H};const ie=16209;var ne=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,m,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(64&p){if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=ie;break t}g=u[(65535&g)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=g>>>16&255,16&p){if(v=65535&g,p&=15,cl){t.msg="invalid distance too far back",E.mode=ie;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=ie;break t}if(y=0,x=_,0===d){if(y+=o-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}if(64&p){t.msg="invalid distance code",E.mode=ie;break t}g=w[(65535&g)+(f&(1<>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,m=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(b=0;b=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(m=1;m0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(b=0;b852||2===t&&x>592)return 1;for(;;){Z=w-v,r[b]+1=u?(U=D[r[b]-u],S=A[r[b]-u]):(U=96,S=0),h=1<>v)+d]=Z<<24|U<<16|S}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--E[w]){if(w===g)break;w=e[a+r[b]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=m,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s}}return 0!==z&&(n[c+z]=w-v<<24|64<<16),l.bits=p,0};const{Z_FINISH:de,Z_BLOCK:_e,Z_TREES:fe,Z_OK:ce,Z_STREAM_END:ue,Z_NEED_DICT:we,Z_STREAM_ERROR:be,Z_DATA_ERROR:me,Z_MEM_ERROR:ge,Z_BUF_ERROR:pe,Z_DEFLATED:ke}=H,ve=16180,ye=16190,xe=16191,ze=16192,Ae=16194,Ee=16199,Re=16200,Ze=16206,Ue=16209,Se=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function De(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Te=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode16211?1:0},Oe=t=>{if(Te(t))return be;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=ve,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ce},Fe=t=>{if(Te(t))return be;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Oe(t)},Ie=(t,e)=>{let a;if(Te(t))return be;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?be:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Fe(t))},Le=(t,e)=>{if(!t)return be;const a=new De;t.state=a,a.strm=t,a.window=null,a.mode=ve;const i=Ie(t,e);return i!==ce&&(t.state=null),i};let Ne,Be,Ce=!0;const He=t=>{if(Ce){Ne=new Int32Array(512),Be=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(he(1,t.lens,0,288,Ne,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;he(2,t.lens,0,32,Be,0,t.work,{bits:5}),Ce=!1}t.lencode=Ne,t.lenbits=9,t.distcode=Be,t.distbits=5},Me=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveLe(t,15),inflateInit2:Le,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,m,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Te(t)||!t.output||!t.input&&0!==t.avail_in)return be;a=t.state,a.mode===xe&&(a.mode=ze),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=ce;t:for(;;)switch(a.mode){case ve:if(0===a.wrap){a.mode=ze;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=B(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Ue;break}if((15&h)!==ke){t.msg="unknown compression method",a.mode=Ue;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Ue;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=B(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=B(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=B(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=B(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=B(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 16189:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=Ze;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(He(a),a.mode=Ee,e===fe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Ue}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=Ue;break}if(a.length=65535&h,h=0,d=0,a.mode=Ae,e===fe)break t;case Ae:a.mode=16195;case 16195:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 16196:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Ue;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=he(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=Ue;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,m=z>>>16&255,g=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=g;else{if(16===g){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=Ue;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Ue;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===Ue)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Ue;break}if(a.lenbits=9,E={bits:a.lenbits},x=he(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=Ue;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=he(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=Ue;break}if(a.mode=Ee,e===fe)break t;case Ee:a.mode=Re;case Re:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,ne(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,m=z>>>16&255,g=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>p)],b=z>>>24,m=z>>>16&255,g=65535&z,!(p+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=b,d-=b,a.back+=b,a.length=g,0===m){a.mode=16205;break}if(32&m){a.back=-1,a.mode=xe;break}if(64&m){t.msg="invalid literal/length code",a.mode=Ue;break}a.extra=15&m,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,m=z>>>16&255,g=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>p)],b=z>>>24,m=z>>>16&255,g=65535&z,!(p+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=b,d-=b,a.back+=b,64&m){t.msg="invalid distance code",a.mode=Ue;break}a.offset=g,a.extra=15&m,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Ue;break}a.mode=16204;case 16204:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Ue;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=Re);break;case 16205:if(0===o)break t;n[r++]=a.length,o--,a.mode=Re;break;case Ze:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(Te(t))return be;let e=t.state;return e.window&&(e.window=null),t.state=null,ce},inflateGetHeader:(t,e)=>{if(Te(t))return be;const a=t.state;return 2&a.wrap?(a.head=e,e.done=!1,ce):be},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return Te(t)?be:(i=t.state,0!==i.wrap&&i.mode!==ye?be:i.mode===ye&&(n=1,n=L(n,e,a,0),n!==i.check)?me:(s=Me(t,e,a,a),s?(i.mode=16210,ge):(i.havedict=1,ce)))},inflateInfo:"pako inflate (from Nodeca project)"},Ke=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Pe=Object.prototype.toString,{Z_NO_FLUSH:Ye,Z_FINISH:Ge,Z_OK:Xe,Z_STREAM_END:We,Z_NEED_DICT:qe,Z_STREAM_ERROR:Je,Z_DATA_ERROR:Qe,Z_MEM_ERROR:Ve}=H;function $e(t){this.options=Ct.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Kt,this.strm.avail_out=0;let a=je.inflateInit2(this.strm,e.windowBits);if(a!==Xe)throw new Error(C[a]);if(this.header=new Ke,je.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt.string2buf(e.dictionary):"[object ArrayBuffer]"===Pe.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=je.inflateSetDictionary(this.strm,e.dictionary),a!==Xe)))throw new Error(C[a])}function ta(t,e){const a=new $e(e);if(a.push(t),a.err)throw a.msg||C[a.err];return a.result}$e.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Ge:Ye,"[object ArrayBuffer]"===Pe.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=je.inflate(a,r),s===qe&&n&&(s=je.inflateSetDictionary(a,n),s===Xe?s=je.inflate(a,r):s===Qe&&(s=qe));a.avail_in>0&&s===We&&a.state.wrap>0&&0!==t[a.next_in];)je.inflateReset(a),s=je.inflate(a,r);switch(s){case Je:case Qe:case qe:case Ve:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===We))if("string"===this.options.to){let t=jt.utf8border(a.output,a.next_out),e=a.next_out-t,n=jt.buf2string(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Xe||0!==l){if(s===We)return s=je.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},$e.prototype.onData=function(t){this.chunks.push(t)},$e.prototype.onEnd=function(t){t===Xe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ea={Inflate:$e,inflate:ta,inflateRaw:function(t,e){return(e=e||{}).raw=!0,ta(t,e)},ungzip:ta,constants:H};const{Deflate:aa,deflate:ia,deflateRaw:na,gzip:sa}=ae,{Inflate:ra,inflate:la,inflateRaw:oa,ungzip:ha}=ea;var da=la,_a={Deflate:aa,deflate:ia,deflateRaw:na,gzip:sa,Inflate:ra,inflate:la,inflateRaw:oa,ungzip:ha,constants:H}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[3075],{3075:(t,e,a)=>{function i(t){let e=t.length;for(;--e>=0;)t[e]=0}a.d(e,{Ay:()=>xa,UD:()=>ya});const n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),s=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),o=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=new Array(576);i(l);const h=new Array(60);i(h);const _=new Array(512);i(_);const d=new Array(256);i(d);const c=new Array(29);i(c);const u=new Array(30);function f(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let w,m,b;function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}i(u);const p=t=>t<256?_[t]:_[256+(t>>>7)],k=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},v=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{v(t,a[2*e],a[2*e+1])},x=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=x(i[e]++,e))}},A=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},E=t=>{t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},R=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let i,r,o,l,h=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+h++],i+=(255&t.pending_buf[t.sym_buf+h++])<<8,r=t.pending_buf[t.sym_buf+h++],0===i?y(t,r,e):(o=d[r],y(t,o+256+1,e),l=n[o],0!==l&&(r-=c[o],v(t,r,l)),i--,o=p(i),y(t,o,a),l=s[o],0!==l&&(i-=u[o],v(t,i,l)))}while(h{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)Z(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Z(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,Z(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,_,d,c,u,f,w=0;for(c=0;c<=15;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)_=t.heap[h],c=a[2*a[2*_+1]+1]+1,c>l&&(c=l,w++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=r[_-o]),f=a[2*_],t.opt_len+=f*(c+u),s&&(t.static_len+=f*(n[2*_+1]+u)));if(0!==w){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(c=l;0!==c;c--)for(_=t.bl_count[c];0!==_;)d=t.heap[--h],d>i||(a[2*d+1]!==c&&(t.opt_len+=(c-a[2*d+1])*a[2*d],a[2*d+1]=c),_--)}})(t,e),z(a,h,t.bl_count)},D=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o{v(t,0+(i?1:0),3),E(t),k(t,a),k(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var L={_tr_init:t=>{O||((()=>{let t,e,a,i,o;const g=new Array(16);for(a=0,i=0;i<28;i++)for(c[i]=a,t=0;t<1<>=7;i<30;i++)for(u[i]=o<<7,t=0;t<1<{let n,s,r=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),S(t,t.l_desc),S(t,t.d_desc),r=(t=>{let e;for(D(t,t.dyn_ltree,t.l_desc.max_code),D(t,t.dyn_dtree,t.d_desc.max_code),S(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*o[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=a+5,a+4<=n&&-1!==e?F(t,e,a,i):4===t.strategy||s===n?(v(t,2+(i?1:0),3),U(t,l,h)):(v(t,4+(i?1:0),3),((t,e,a,i)=>{let n;for(v(t,e-257,5),v(t,a-1,5),v(t,i-4,4),n=0;n(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(d[a]+256+1)]++,t.dyn_dtree[2*p(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{v(t,2,3),y(t,256,l),(t=>{16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},B=(t,e,a,i)=>{let n=65535&t,s=t>>>16&65535,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16};const N=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var I=(t,e,a,i)=>{const n=N,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return~t},C={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},M={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:H,_tr_stored_block:j,_tr_flush_block:K,_tr_tally:P,_tr_align:Y}=L,{Z_NO_FLUSH:G,Z_PARTIAL_FLUSH:X,Z_FULL_FLUSH:W,Z_FINISH:q,Z_BLOCK:J,Z_OK:Q,Z_STREAM_END:V,Z_STREAM_ERROR:$,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:at,Z_FILTERED:it,Z_HUFFMAN_ONLY:nt,Z_RLE:st,Z_FIXED:rt,Z_DEFAULT_STRATEGY:ot,Z_UNKNOWN:lt,Z_DEFLATED:ht}=M,_t=258,dt=262,ct=42,ut=113,ft=666,wt=(t,e)=>(t.msg=C[e],e),mt=t=>2*t-(t>4?9:0),bt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},gt=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let pt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},vt=(t,e)=>{K(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},yt=(t,e)=>{t.pending_buf[t.pending++]=e},xt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},zt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=I(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},At=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-dt?t.strstart-(t.w_size-dt):0,h=t.window,_=t.w_mask,d=t.prev,c=t.strstart+_t;let u=h[s+r-1],f=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===f&&h[a+r-1]===u&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=o)break;u=h[s+r-1],f=h[s+r]}}}while((e=d[e&_])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},Et=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-dt)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),gt(t),i+=e),0===t.strm.avail_in)break;if(a=zt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=pt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=pt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,kt(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(zt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(zt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===q)&&e!==G&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===q&&0===t.strm.avail_in&&a===i?1:0,j(t,t.block_start,a,r),t.block_start+=a,kt(t.strm)),r?3:1)},Zt=(t,e)=>{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-dt&&(t.match_length=At(t,a)),t.match_length>=3)if(i=P(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=pt(t,t.ins_h,t.window[t.strstart+1]);else i=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=P(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=pt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(vt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=P(t,0,t.window[t.strstart-1]),i&&vt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=P(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,Rt),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ht,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),bt(this.dyn_ltree),bt(this.dyn_dtree),bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),bt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ct&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==ut&&e.status!==ft?1:0},Ft=t=>{if(Ot(t))return wt(t,$);t.total_in=t.total_out=0,t.data_type=lt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?ct:ut,t.adler=2===e.wrap?0:1,e.last_flush=-2,H(e),Q},Lt=t=>{const e=Ft(t);var a;return e===Q&&((a=t.state).window_size=2*a.w_size,bt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Bt=(t,e,a,i,n,s)=>{if(!t)return $;let r=1;if(e===at&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ht||i<8||i>15||e<0||e>9||s<0||s>rt||8===i&&1!==r)return wt(t,$);8===i&&(i=9);const o=new Tt;return t.state=o,o.strm=t,o.status=ct,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<Ot(t)||2!==t.state.wrap?$:(t.state.gzhead=e,Q),Ct=(t,e)=>{if(Ot(t)||e>J||e<0)return t?wt(t,$):$;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===ft&&e!==q)return wt(t,0===t.avail_out?et:$);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(kt(t),0===t.avail_out)return a.last_flush=-1,Q}else if(0===t.avail_in&&mt(e)<=mt(i)&&e!==q)return wt(t,et);if(a.status===ft&&0!==t.avail_in)return wt(t,et);if(a.status===ct&&0===a.wrap&&(a.status=ut),a.status===ct){let e=ht+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=nt||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,xt(a,e),0!==a.strstart&&(xt(a,t.adler>>>16),xt(a,65535&t.adler)),t.adler=1,a.status=ut,kt(t),0!==a.pending)return a.last_flush=-1,Q}if(57===a.status)if(t.adler=0,yt(a,31),yt(a,139),yt(a,8),a.gzhead)yt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),yt(a,255&a.gzhead.time),yt(a,a.gzhead.time>>8&255),yt(a,a.gzhead.time>>16&255),yt(a,a.gzhead.time>>24&255),yt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),yt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(yt(a,255&a.gzhead.extra.length),yt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=I(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(yt(a,0),yt(a,0),yt(a,0),yt(a,0),yt(a,0),yt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),yt(a,3),a.status=ut,kt(t),0!==a.pending)return a.last_flush=-1,Q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=I(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,kt(t),0!==a.pending)return a.last_flush=-1,Q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=I(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=I(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,Q;i=0}e=a.gzindexi&&(t.adler=I(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=I(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,Q;i=0}e=a.gzindexi&&(t.adler=I(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(kt(t),0!==a.pending))return a.last_flush=-1,Q;yt(a,255&t.adler),yt(a,t.adler>>8&255),t.adler=0}if(a.status=ut,kt(t),0!==a.pending)return a.last_flush=-1,Q}if(0!==t.avail_in||0!==a.lookahead||e!==G&&a.status!==ft){let i=0===a.level?Rt(a,e):a.strategy===nt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Et(t),0===t.lookahead)){if(e===G)return 1;break}if(t.match_length=0,a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===st?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=_t){if(Et(t),t.lookahead<=_t&&e===G)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+_t;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=P(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=P(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===q?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2})(a,e):Dt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=ft),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),Q;if(2===i&&(e===X?Y(a):e!==J&&(j(a,0,0,!1),e===W&&(bt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),kt(t),0===t.avail_out))return a.last_flush=-1,Q}return e!==q?Q:a.wrap<=0?V:(2===a.wrap?(yt(a,255&t.adler),yt(a,t.adler>>8&255),yt(a,t.adler>>16&255),yt(a,t.adler>>24&255),yt(a,255&t.total_in),yt(a,t.total_in>>8&255),yt(a,t.total_in>>16&255),yt(a,t.total_in>>24&255)):(xt(a,t.adler>>>16),xt(a,65535&t.adler)),kt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?Q:V)},Mt=t=>{if(Ot(t))return $;const e=t.state.status;return t.state=null,e===ut?wt(t,tt):Q},Ht=(t,e)=>{let a=e.length;if(Ot(t))return $;const i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ct||i.lookahead)return $;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(bt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Et(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=pt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Et(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,Q};const jt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Kt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)jt(a,e)&&(t[e]=a[e])}}return t},Pt=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Gt[254]=Gt[254]=1;var Xt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Wt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Yt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Gt[t[a]]>e?a:e},Jt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Qt=Object.prototype.toString,{Z_NO_FLUSH:Vt,Z_SYNC_FLUSH:$t,Z_FULL_FLUSH:te,Z_FINISH:ee,Z_OK:ae,Z_STREAM_END:ie,Z_DEFAULT_COMPRESSION:ne,Z_DEFAULT_STRATEGY:se,Z_DEFLATED:re}=M;function oe(t){this.options=Kt({level:ne,method:re,chunkSize:16384,windowBits:15,memLevel:8,strategy:se},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jt,this.strm.avail_out=0;let a=Nt(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==ae)throw new Error(C[a]);if(e.header&&It(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Xt(e.dictionary):"[object ArrayBuffer]"===Qt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Ht(this.strm,t),a!==ae)throw new Error(C[a]);this._dict_set=!0}}function le(t,e){const a=new oe(e);if(a.push(t,!0),a.err)throw a.msg||C[a.err];return a.result}oe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?ee:Vt,"string"==typeof t?a.input=Xt(t):"[object ArrayBuffer]"===Qt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===$t||s===te)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Ct(a,s),n===ie)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Mt(this.strm),this.onEnd(n),this.ended=!0,n===ae;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},oe.prototype.onData=function(t){this.chunks.push(t)},oe.prototype.onEnd=function(t){t===ae&&(this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var he={Deflate:oe,deflate:le,deflateRaw:function(t,e){return(e=e||{}).raw=!0,le(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,le(t,e)},constants:M};const _e=16209;var de=function(t,e){let a,i,n,s,r,o,l,h,_,d,c,u,f,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,_=E.wnext,d=E.window,c=E.hold,u=E.bits,f=E.lencode,w=E.distcode,m=(1<>>24,c>>>=p,u-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(64&p){if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=_e;break t}g=f[(65535&g)+(c&(1<>>=p,u-=p),u<15&&(c+=z[a++]<>>24,c>>>=p,u-=p,p=g>>>16&255,16&p){if(v=65535&g,p&=15,uo){t.msg="invalid distance too far back",E.mode=_e;break t}if(c>>>=p,u-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=_e;break t}if(y=0,x=d,0===_){if(y+=l-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}if(64&p){t.msg="invalid distance code",E.mode=_e;break t}g=w[(65535&g)+(c&(1<>3,a-=k,u-=k<<3,c&=(1<{const l=o.bits;let h,_,d,c,u,f,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1=f?(U=D[r[m]-f],S=A[r[m]-f]):(U=96,S=0),h=1<>v)+_]=Z<<24|U<<16|S}while(0!==_);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&c)!==d){for(0===v&&(v=p),u+=b,k=w-v,y=1<852||2===t&&x>592)return 1;d=z&c,n[d]=p<<24|k<<16|u-s}}return 0!==z&&(n[u+z]=w-v<<24|64<<16),o.bits=p,0};const{Z_FINISH:be,Z_BLOCK:ge,Z_TREES:pe,Z_OK:ke,Z_STREAM_END:ve,Z_NEED_DICT:ye,Z_STREAM_ERROR:xe,Z_DATA_ERROR:ze,Z_MEM_ERROR:Ae,Z_BUF_ERROR:Ee,Z_DEFLATED:Re}=M,Ze=16180,Ue=16190,Se=16191,De=16192,Te=16194,Oe=16199,Fe=16200,Le=16206,Be=16209,Ne=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ie(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ce=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode16211?1:0},Me=t=>{if(Ce(t))return xe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ze,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ke},He=t=>{if(Ce(t))return xe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Me(t)},je=(t,e)=>{let a;if(Ce(t))return xe;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?xe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,He(t))},Ke=(t,e)=>{if(!t)return xe;const a=new Ie;t.state=a,a.strm=t,a.window=null,a.mode=Ze;const i=je(t,e);return i!==ke&&(t.state=null),i};let Pe,Ye,Ge=!0;const Xe=t=>{if(Ge){Pe=new Int32Array(512),Ye=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(me(1,t.lens,0,288,Pe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;me(2,t.lens,0,32,Ye,0,t.work,{bits:5}),Ge=!1}t.lencode=Pe,t.lenbits=9,t.distcode=Ye,t.distbits=5},We=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave{let a,i,n,s,r,o,l,h,_,d,c,u,f,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ce(t)||!t.output||!t.input&&0!==t.avail_in)return xe;a=t.state,a.mode===Se&&(a.mode=De),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,_=a.bits,d=o,c=l,x=ke;t:for(;;)switch(a.mode){case Ze:if(0===a.wrap){a.mode=De;break}for(;_<16;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0),h=0,_=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Be;break}if((15&h)!==Re){t.msg="unknown compression method",a.mode=Be;break}if(h>>>=4,_-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Be;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0)),h=0,_=0,a.mode=16182;case 16182:for(;_<32;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=I(a.check,A,4,0)),h=0,_=0,a.mode=16183;case 16183:for(;_<16;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0)),h=0,_=0,a.mode=16184;case 16184:if(1024&a.flags){for(;_<16;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=I(a.check,A,2,0)),h=0,_=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(u=a.length,u>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+u),y)),512&a.flags&&4&a.wrap&&(a.check=I(a.check,i,u,s)),o-=u,s+=u,a.length-=u),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;u=0;do{y=i[s+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=Se;break;case 16189:for(;_<32;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}t.adler=a.check=Ne(h),h=0,_=0,a.mode=Ue;case Ue:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=_,ye;t.adler=a.check=1,a.mode=Se;case Se:if(e===ge||e===pe)break t;case De:if(a.last){h>>>=7&_,_-=7&_,a.mode=Le;break}for(;_<3;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}switch(a.last=1&h,h>>>=1,_-=1,3&h){case 0:a.mode=16193;break;case 1:if(Xe(a),a.mode=Oe,e===pe){h>>>=2,_-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Be}h>>>=2,_-=2;break;case 16193:for(h>>>=7&_,_-=7&_;_<32;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Be;break}if(a.length=65535&h,h=0,_=0,a.mode=Te,e===pe)break t;case Te:a.mode=16195;case 16195:if(u=a.length,u){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;n.set(i.subarray(s,s+u),r),o-=u,s+=u,l-=u,r+=u,a.length-=u;break}a.mode=Se;break;case 16196:for(;_<14;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(a.nlen=257+(31&h),h>>>=5,_-=5,a.ndist=1+(31&h),h>>>=5,_-=5,a.ncode=4+(15&h),h>>>=4,_-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Be;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,_-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=me(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=Be;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,b=z>>>16&255,g=65535&z,!(m<=_);){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(g<16)h>>>=m,_-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;_>>=m,_-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Be;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,_-=2}else if(17===g){for(R=m+3;_>>=m,_-=m,y=0,u=3+(7&h),h>>>=3,_-=3}else{for(R=m+7;_>>=m,_-=m,y=0,u=11+(127&h),h>>>=7,_-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Be;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Be)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Be;break}if(a.lenbits=9,E={bits:a.lenbits},x=me(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=Be;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=me(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=Be;break}if(a.mode=Oe,e===pe)break t;case Oe:a.mode=Fe;case Fe:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=_,de(t,c),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,_=a.bits,a.mode===Se&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=_);){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(b&&!(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=_);){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}h>>>=p,_-=p,a.back+=p}if(h>>>=m,_-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=Se;break}if(64&b){t.msg="invalid literal/length code",a.mode=Be;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;_>>=a.extra,_-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=_);){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(!(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=_);){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}h>>>=p,_-=p,a.back+=p}if(h>>>=m,_-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Be;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;_>>=a.extra,_-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Be;break}a.mode=16204;case 16204:if(0===l)break t;if(u=c-l,a.offset>u){if(u=a.offset-u,u>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Be;break}u>a.wnext?(u-=a.wnext,f=a.wsize-u):f=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=n,f=r-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{n[r++]=w[f++]}while(--u);0===a.length&&(a.mode=Fe);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=Fe;break;case Le:if(a.wrap){for(;_<32;){if(0===o)break t;o--,h|=i[s++]<<_,_+=8}if(c-=l,t.total_out+=c,a.total+=c,4&a.wrap&&c&&(t.adler=a.check=a.flags?I(a.check,n,c,r-c):B(a.check,n,c,r-c)),c=l,4&a.wrap&&(a.flags?h:Ne(h))!==a.check){t.msg="incorrect data check",a.mode=Be;break}h=0,_=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;_<32;){if(0===o)break t;o--,h+=i[s++]<<_,_+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Be;break}h=0,_=0}a.mode=16208;case 16208:x=ve;break t;case Be:x=ze;break t;case 16210:return Ae;default:return xe}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=_,(a.wsize||c!==t.avail_out&&a.mode{if(Ce(t))return xe;let e=t.state;return e.window&&(e.window=null),t.state=null,ke},$e=(t,e)=>{if(Ce(t))return xe;const a=t.state;return 2&a.wrap?(a.head=e,e.done=!1,ke):xe},ta=(t,e)=>{const a=e.length;let i,n,s;return Ce(t)?xe:(i=t.state,0!==i.wrap&&i.mode!==Ue?xe:i.mode===Ue&&(n=1,n=B(n,e,a,0),n!==i.check)?ze:(s=We(t,e,a,a),s?(i.mode=16210,Ae):(i.havedict=1,ke)))},ea=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const aa=Object.prototype.toString,{Z_NO_FLUSH:ia,Z_FINISH:na,Z_OK:sa,Z_STREAM_END:ra,Z_NEED_DICT:oa,Z_STREAM_ERROR:la,Z_DATA_ERROR:ha,Z_MEM_ERROR:_a}=M;function da(t){this.options=Kt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jt,this.strm.avail_out=0;let a=Je(this.strm,e.windowBits);if(a!==sa)throw new Error(C[a]);if(this.header=new ea,$e(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Xt(e.dictionary):"[object ArrayBuffer]"===aa.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=ta(this.strm,e.dictionary),a!==sa)))throw new Error(C[a])}function ca(t,e){const a=new da(e);if(a.push(t),a.err)throw a.msg||C[a.err];return a.result}da.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?na:ia,"[object ArrayBuffer]"===aa.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Qe(a,r),s===oa&&n&&(s=ta(a,n),s===sa?s=Qe(a,r):s===ha&&(s=oa));a.avail_in>0&&s===ra&&a.state.wrap>0&&0!==t[a.next_in];)qe(a),s=Qe(a,r);switch(s){case la:case ha:case oa:case _a:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===ra))if("string"===this.options.to){let t=qt(a.output,a.next_out),e=a.next_out-t,n=Wt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==sa||0!==o){if(s===ra)return s=Ve(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},da.prototype.onData=function(t){this.chunks.push(t)},da.prototype.onEnd=function(t){t===sa&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ua={Inflate:da,inflate:ca,inflateRaw:function(t,e){return(e=e||{}).raw=!0,ca(t,e)},ungzip:ca,constants:M};const{Deflate:fa,deflate:wa,deflateRaw:ma,gzip:ba}=he,{Inflate:ga,inflate:pa,inflateRaw:ka,ungzip:va}=ua;var ya=pa,xa={Deflate:fa,deflate:wa,deflateRaw:ma,gzip:ba,Inflate:ga,inflate:pa,inflateRaw:ka,ungzip:va,constants:M}}}]); \ No newline at end of file diff --git a/4025.bundle.js b/4025.bundle.js index 4f470b1b..3d37d245 100644 --- a/4025.bundle.js +++ b/4025.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 4025.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4025],{8168:(e,t,n)=>{e.exports=n.p+"4fb34c1567962ff5a6c9.wasm"},4025:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r,s=(r="file:///home/mmom/src/rlayers/node_modules/sqlite-wasm-http/deps/dist/sqlite3-bundler-friendly.mjs",function(e={}){var t,s,i=e;i.ready=new Promise(((e,n)=>{t=e,s=n})),["_malloc","_free","_realloc","_sqlite3_aggregate_context","_sqlite3_auto_extension","_sqlite3_bind_blob","_sqlite3_bind_double","_sqlite3_bind_int","_sqlite3_bind_int64","_sqlite3_bind_null","_sqlite3_bind_parameter_count","_sqlite3_bind_parameter_index","_sqlite3_bind_pointer","_sqlite3_bind_text","_sqlite3_busy_handler","_sqlite3_busy_timeout","_sqlite3_cancel_auto_extension","_sqlite3_changes","_sqlite3_changes64","_sqlite3_clear_bindings","_sqlite3_close_v2","_sqlite3_collation_needed","_sqlite3_column_blob","_sqlite3_column_bytes","_sqlite3_column_count","_sqlite3_column_double","_sqlite3_column_int","_sqlite3_column_int64","_sqlite3_column_name","_sqlite3_column_text","_sqlite3_column_type","_sqlite3_column_value","_sqlite3_commit_hook","_sqlite3_compileoption_get","_sqlite3_compileoption_used","_sqlite3_complete","_sqlite3_context_db_handle","_sqlite3_create_collation","_sqlite3_create_collation_v2","_sqlite3_create_function","_sqlite3_create_function_v2","_sqlite3_create_module","_sqlite3_create_module_v2","_sqlite3_create_window_function","_sqlite3_data_count","_sqlite3_db_filename","_sqlite3_db_handle","_sqlite3_db_name","_sqlite3_db_status","_sqlite3_declare_vtab","_sqlite3_deserialize","_sqlite3_drop_modules","_sqlite3_errcode","_sqlite3_errmsg","_sqlite3_error_offset","_sqlite3_errstr","_sqlite3_exec","_sqlite3_expanded_sql","_sqlite3_extended_errcode","_sqlite3_extended_result_codes","_sqlite3_file_control","_sqlite3_finalize","_sqlite3_free","_sqlite3_get_auxdata","_sqlite3_initialize","_sqlite3_keyword_count","_sqlite3_keyword_name","_sqlite3_keyword_check","_sqlite3_last_insert_rowid","_sqlite3_libversion","_sqlite3_libversion_number","_sqlite3_limit","_sqlite3_malloc","_sqlite3_malloc64","_sqlite3_msize","_sqlite3_open","_sqlite3_open_v2","_sqlite3_overload_function","_sqlite3_prepare_v2","_sqlite3_prepare_v3","_sqlite3_preupdate_blobwrite","_sqlite3_preupdate_count","_sqlite3_preupdate_depth","_sqlite3_preupdate_hook","_sqlite3_preupdate_new","_sqlite3_preupdate_old","_sqlite3_progress_handler","_sqlite3_randomness","_sqlite3_realloc","_sqlite3_realloc64","_sqlite3_reset","_sqlite3_reset_auto_extension","_sqlite3_result_blob","_sqlite3_result_double","_sqlite3_result_error","_sqlite3_result_error_code","_sqlite3_result_error_nomem","_sqlite3_result_error_toobig","_sqlite3_result_int","_sqlite3_result_int64","_sqlite3_result_null","_sqlite3_result_pointer","_sqlite3_result_subtype","_sqlite3_result_text","_sqlite3_result_zeroblob","_sqlite3_result_zeroblob64","_sqlite3_rollback_hook","_sqlite3_serialize","_sqlite3_set_authorizer","_sqlite3_set_auxdata","_sqlite3_set_last_insert_rowid","_sqlite3_shutdown","_sqlite3_sourceid","_sqlite3_sql","_sqlite3_status","_sqlite3_status64","_sqlite3_step","_sqlite3_stmt_isexplain","_sqlite3_stmt_readonly","_sqlite3_stmt_status","_sqlite3_strglob","_sqlite3_stricmp","_sqlite3_strlike","_sqlite3_strnicmp","_sqlite3_table_column_metadata","_sqlite3_total_changes","_sqlite3_total_changes64","_sqlite3_trace_v2","_sqlite3_txn_state","_sqlite3_update_hook","_sqlite3_uri_boolean","_sqlite3_uri_int64","_sqlite3_uri_key","_sqlite3_uri_parameter","_sqlite3_user_data","_sqlite3_value_blob","_sqlite3_value_bytes","_sqlite3_value_double","_sqlite3_value_dup","_sqlite3_value_free","_sqlite3_value_frombind","_sqlite3_value_int","_sqlite3_value_int64","_sqlite3_value_nochange","_sqlite3_value_numeric_type","_sqlite3_value_pointer","_sqlite3_value_subtype","_sqlite3_value_text","_sqlite3_value_type","_sqlite3_vfs_find","_sqlite3_vfs_register","_sqlite3_vfs_unregister","_sqlite3_vtab_collation","_sqlite3_vtab_distinct","_sqlite3_vtab_in","_sqlite3_vtab_in_first","_sqlite3_vtab_in_next","_sqlite3_vtab_nochange","_sqlite3_vtab_on_conflict","_sqlite3_vtab_rhs_value","_sqlite3changegroup_add","_sqlite3changegroup_add_strm","_sqlite3changegroup_delete","_sqlite3changegroup_new","_sqlite3changegroup_output","_sqlite3changegroup_output_strm","_sqlite3changeset_apply","_sqlite3changeset_apply_strm","_sqlite3changeset_apply_v2","_sqlite3changeset_apply_v2_strm","_sqlite3changeset_concat","_sqlite3changeset_concat_strm","_sqlite3changeset_conflict","_sqlite3changeset_finalize","_sqlite3changeset_fk_conflicts","_sqlite3changeset_invert","_sqlite3changeset_invert_strm","_sqlite3changeset_new","_sqlite3changeset_next","_sqlite3changeset_old","_sqlite3changeset_op","_sqlite3changeset_pk","_sqlite3changeset_start","_sqlite3changeset_start_strm","_sqlite3changeset_start_v2","_sqlite3changeset_start_v2_strm","_sqlite3session_attach","_sqlite3session_changeset","_sqlite3session_changeset_size","_sqlite3session_changeset_strm","_sqlite3session_config","_sqlite3session_create","_sqlite3session_delete","_sqlite3session_diff","_sqlite3session_enable","_sqlite3session_indirect","_sqlite3session_isempty","_sqlite3session_memory_used","_sqlite3session_object_config","_sqlite3session_patchset","_sqlite3session_patchset_strm","_sqlite3session_table_filter","_sqlite3_wasm_pstack_ptr","_sqlite3_wasm_pstack_restore","_sqlite3_wasm_pstack_alloc","_sqlite3_wasm_pstack_remaining","_sqlite3_wasm_pstack_quota","_sqlite3_wasm_db_error","_sqlite3_wasm_test_struct","_sqlite3_wasm_enum_json","_sqlite3_wasm_vfs_unlink","_sqlite3_wasm_db_vfs","_sqlite3_wasm_db_reset","_sqlite3_wasm_db_export_chunked","_sqlite3_wasm_db_serialize","_sqlite3_wasm_vfs_create_file","_sqlite3_wasm_posix_create_file","_sqlite3_wasm_kvvfsMakeKeyOnPstack","_sqlite3_wasm_kvvfs_methods","_sqlite3_wasm_vtab_config","_sqlite3_wasm_db_config_ip","_sqlite3_wasm_db_config_pii","_sqlite3_wasm_db_config_s","_sqlite3_wasm_config_i","_sqlite3_wasm_config_ii","_sqlite3_wasm_config_j","_sqlite3_wasm_init_wasmfs","_sqlite3_wasm_test_intptr","_sqlite3_wasm_test_voidptr","_sqlite3_wasm_test_int64_max","_sqlite3_wasm_test_int64_min","_sqlite3_wasm_test_int64_times2","_sqlite3_wasm_test_int64_minmax","_sqlite3_wasm_test_int64ptr","_sqlite3_wasm_test_stack_overflow","_sqlite3_wasm_test_str_hello","_sqlite3_wasm_SQLTester_strglob","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>G("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>G("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));const o=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,o.debugModule("globalThis.location =",globalThis.location);const a="emscripten-bug-17951";i[a]=function e(t,n){t.env.foo=function(){};const r=i.locateFile(e.uri,void 0===g?"":g);o.debugModule("instantiateWasm() uri =",r);const s=()=>fetch(r,{credentials:"same-origin"});return(WebAssembly.instantiateStreaming?async()=>WebAssembly.instantiateStreaming(s(),t).then((e=>n(e.instance,e.module))):async()=>s().then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,t))).then((e=>n(e.instance,e.module))))(),{}},i[a].uri="sqlite3.wasm";var l=Object.assign({},i),c="./this.program",_="object"==typeof window,u="function"==typeof importScripts,d="object"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions&&"string"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions.node,f=!_&&!d&&!u;if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var p,m,h,g="";if(f){if("function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(p=read),h=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,"binary");return O("object"==typeof t),t},m=(e,t,n)=>{setTimeout((()=>t(h(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():G()),"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!_&&!u)throw new Error("environment detection error");if(u?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),m=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}}var b,y,q,E=i.print||console.log.bind(console),w=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,b="fetchSettings",Object.getOwnPropertyDescriptor(i,b)&&G(`\`Module.${b}\` was supplied but \`${b}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,Z("arguments","arguments_"),i.thisProgram&&(c=i.thisProgram),Z("thisProgram","thisProgram"),i.quit&&i.quit,Z("quit","quit_"),O(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),O(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),O(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),O(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),O(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Z("asm","wasmExports"),Z("read","read_"),Z("readAsync","readAsync"),Z("readBinary","readBinary"),Z("setWindowTitle","setWindowTitle"),O(!d,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),O(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(y=i.wasmBinary),Z("wasmBinary","wasmBinary"),i.noExitRuntime,Z("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&G("no native wasm support detected");var S,A,x,T,I,k,F=!1;function O(e,t){e||G("Assertion failed"+(t?": "+t:""))}function P(){var e=q.buffer;i.HEAP8=S=new Int8Array(e),i.HEAP16=x=new Int16Array(e),i.HEAPU8=A=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=T=new Int32Array(e),i.HEAPU32=I=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=k=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}O(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),O("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var L=i.INITIAL_MEMORY||16777216;function C(){if(!F){var e=We();0==e&&(e+=4);var t=I[e>>2],n=I[e+4>>2];34821223==t&&2310721022==n||G(`Stack overflow! Stack cookie has been overwritten at ${se(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${se(n)} ${se(t)}`),1668509029!=I[0]&&G("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Z("INITIAL_MEMORY","INITIAL_MEMORY"),O(L>=524288,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+L+"! (STACK_SIZE=524288)"),q=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:L/65536,maximum:32768}),P(),O((L=q.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],D=[],R=[],M=!1;O(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var j=0,U=null,B=null,z={};function W(e){for(var t=e;;){if(!z[e])return e;e=t+Math.random()}}function H(e){j++,i.monitorRunDependencies&&i.monitorRunDependencies(j),e?(O(!z[e]),z[e]=1,null===U&&"undefined"!=typeof setInterval&&(U=setInterval((()=>{if(F)return clearInterval(U),void(U=null);var e=!1;for(var t in z)e||(e=!0,w("still waiting on run dependencies:")),w(`dependency: ${t}`);e&&w("(end of list)")}),1e4))):w("warning: run dependency added without ID")}function Q(e){if(j--,i.monitorRunDependencies&&i.monitorRunDependencies(j),e?(O(z[e]),delete z[e]):w("warning: run dependency removed without ID"),0==j&&(null!==U&&(clearInterval(U),U=null),B)){var t=B;B=null,t()}}function G(e){i.onAbort&&i.onAbort(e),w(e="Aborted("+e+")"),F=!0;var t=new WebAssembly.RuntimeError(e);throw s(t),t}var V,$;function K(e){return e.startsWith("data:application/octet-stream;base64,")}function J(e){return function(){O(M,`native function \`${e}\` called before runtime initialization`);var t=Re[e];return O(t,`exported native function \`${e}\` not found`),t.apply(null,arguments)}}function Y(e){if(e==V&&y)return new Uint8Array(y);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}function X(e,t,n){return function(e){return y||!_&&!u||"function"!=typeof fetch?Promise.resolve().then((()=>Y(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>Y(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(n,(e=>{w(`failed to asynchronously prepare wasm: ${e}`),V.startsWith("file://")&&w(`warning: Loading from a file URI (${V}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),G(e)}))}function Z(e,t,n=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){G(`\`Module.${e}\` has been replaced by \`${t}\``+(n?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function ee(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function te(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){ie("`"+e+"` is not longer defined by emscripten. "+t)}})}function ne(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),G(t)}})}i.locateFile?K(V="sqlite3.wasm")||($=V,V=i.locateFile?i.locateFile($,g):g+$):V=new URL(n(8168),n.b).href,te("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),te("asm","Please use wasmExports instead");var re=e=>{for(;e.length>0;)e.shift()(i)},se=e=>(O("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ie=e=>{ie.shown||(ie.shown={}),ie.shown[e]||(ie.shown[e]=1,w(e))},oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var s=e[r];"."===s?e.splice(r,1):".."===s?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),n="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);G("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),le={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:we.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=oe.isAbs(r)}return(t?"/":"")+(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=le.resolve(e).substr(1),t=le.resolve(t).substr(1);for(var r=n(e.split("/")),s=n(t.split("/")),i=Math.min(r.length,s.length),o=i,a=0;a{for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&ce)return ce.decode(e.subarray(t,s));for(var i="";t>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i},ue=[],de=e=>{for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t},fe=(e,t,n,r)=>{if(O("string"==typeof e),!(r>0))return 0;for(var s=n,i=n+r-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;a>1114111&&ie("Invalid Unicode code point "+se(a)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-s};function pe(e,t,n){var r=n>0?n:de(e)+1,s=new Array(r),i=fe(e,s,0,s.length);return t&&(s.length=i),s}var me,he={ttys:[],init(){},shutdown(){},register(e,t){he.ttys[e]={input:[],output:[],ops:t},we.registerDevice(e,he.stream_ops)},stream_ops:{open(e){var t=he.ttys[e.node.rdev];if(!t)throw new we.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,s){if(!e.tty||!e.tty.ops.get_char)throw new we.ErrnoError(60);for(var i=0,o=0;o(()=>{if(!ue.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ue=pe(e,!0)}return ue.shift()})(),put_char(e,t){null===t||10===t?(E(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(E(_e(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(w(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(_e(e.output,0)),e.output=[])}}},ge=e=>{e=((e,t)=>(O(t,"alignment argument is required"),Math.ceil(e/t)*t))(e,65536);var t=Be(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},be={ops_table:null,mount:e=>be.createNode(null,"/",16895,0),createNode(e,t,n,r){if(we.isBlkdev(n)||we.isFIFO(n))throw new we.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:we.chrdev_stream_ops}});var s=we.createNode(e,t,n,r);return we.isDir(s.mode)?(s.node_ops=be.ops_table.dir.node,s.stream_ops=be.ops_table.dir.stream,s.contents={}):we.isFile(s.mode)?(s.node_ops=be.ops_table.file.node,s.stream_ops=be.ops_table.file.stream,s.usedBytes=0,s.contents=null):we.isLink(s.mode)?(s.node_ops=be.ops_table.link.node,s.stream_ops=be.ops_table.link.stream):we.isChrdev(s.mode)&&(s.node_ops=be.ops_table.chrdev.node,s.stream_ops=be.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=we.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,we.isDir(e.mode)?t.size=4096:we.isFile(e.mode)?t.size=e.usedBytes:we.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup(e,t){throw we.genericErrors[44]},mknod:(e,t,n,r)=>be.createNode(e,t,n,r),rename(e,t,n){if(we.isDir(e.mode)){var r;try{r=we.lookupNode(t,n)}catch(e){}if(r)for(var s in r.contents)throw new we.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=we.lookupNode(e,t);for(var r in n.contents)throw new we.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink(e,t,n){var r=be.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!we.isLink(e.mode))throw new we.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,s){var i=e.node.contents;if(s>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-s,r);if(O(o>=0),o>8&&i.subarray)t.set(i.subarray(s,s+o),n);else for(var a=0;a0||n+t(be.stream_ops.write(e,t,0,r,n,!1),0)}},ye=i.preloadPlugins||[],qe=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},Ee={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ve={},we={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=le.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new we.ErrnoError(32);for(var n=e.split("/").filter((e=>!!e)),r=we.root,s="/",i=0;i40)throw new we.ErrnoError(32)}}return{path:s,node:r}},getPath(e){for(var t;;){if(we.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r>>0)%we.nameTable.length},hashAddNode(e){var t=we.hashName(e.parent.id,e.name);e.name_next=we.nameTable[t],we.nameTable[t]=e},hashRemoveNode(e){var t=we.hashName(e.parent.id,e.name);if(we.nameTable[t]===e)we.nameTable[t]=e.name_next;else for(var n=we.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=we.mayLookup(e);if(n)throw new we.ErrnoError(n,e);for(var r=we.hashName(e.id,t),s=we.nameTable[r];s;s=s.name_next){var i=s.name;if(s.parent.id===e.id&&i===t)return s}return we.lookup(e,t)},createNode(e,t,n,r){O("object"==typeof e);var s=new we.FSNode(e,t,n,r);return we.hashAddNode(s),s},destroyNode(e){we.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>we.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>we.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,t){try{return we.lookupNode(e,t),20}catch(e){}return we.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=we.lookupNode(e,t)}catch(e){return e.errno}var s=we.nodePermissions(e,"wx");if(s)return s;if(n){if(!we.isDir(r.mode))return 54;if(we.isRoot(r)||we.getPath(r)===we.cwd())return 10}else if(we.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?we.isLink(e.mode)?32:we.isDir(e.mode)&&("r"!==we.flagsToPermissionString(t)||512&t)?31:we.nodePermissions(e,we.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=we.MAX_OPEN_FDS;e++)if(!we.streams[e])return e;throw new we.ErrnoError(33)},getStreamChecked(e){var t=we.getStream(e);if(!t)throw new we.ErrnoError(8);return t},getStream:e=>we.streams[e],createStream:(e,t=-1)=>(we.FSStream||(we.FSStream=function(){this.shared={}},we.FSStream.prototype={},Object.defineProperties(we.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new we.FSStream,e),-1==t&&(t=we.nextfd()),e.fd=t,we.streams[t]=e,e),closeStream(e){we.streams[e]=null},chrdev_stream_ops:{open(e){var t=we.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new we.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){we.devices[e]={stream_ops:t}},getDevice:e=>we.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),we.syncFSRequests++,we.syncFSRequests>1&&w(`warning: ${we.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=we.getMounts(we.root.mount),r=0;function s(e){return O(we.syncFSRequests>0),we.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,s(e));++r>=n.length&&s(null)}n.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,n){if("string"==typeof e)throw e;var r,s="/"===n,i=!n;if(s&&we.root)throw new we.ErrnoError(10);if(!s&&!i){var o=we.lookupPath(n,{follow_mount:!1});if(n=o.path,r=o.node,we.isMountpoint(r))throw new we.ErrnoError(10);if(!we.isDir(r.mode))throw new we.ErrnoError(54)}var a={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(a);return l.mount=a,a.root=l,s?we.root=l:r&&(r.mounted=a,r.mount&&r.mount.mounts.push(a)),l},unmount(e){var t=we.lookupPath(e,{follow_mount:!1});if(!we.isMountpoint(t.node))throw new we.ErrnoError(28);var n=t.node,r=n.mounted,s=we.getMounts(r);Object.keys(we.nameTable).forEach((e=>{for(var t=we.nameTable[e];t;){var n=t.name_next;s.includes(t.mount)&&we.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);O(-1!==i),n.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=we.lookupPath(e,{parent:!0}).node,s=oe.basename(e);if(!s||"."===s||".."===s)throw new we.ErrnoError(28);var i=we.mayCreate(r,s);if(i)throw new we.ErrnoError(i);if(!r.node_ops.mknod)throw new we.ErrnoError(63);return r.node_ops.mknod(r,s,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,we.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,we.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split("/"),r="",s=0;s(void 0===n&&(n=t,t=438),t|=8192,we.mknod(e,t,n)),symlink(e,t){if(!le.resolve(e))throw new we.ErrnoError(44);var n=we.lookupPath(t,{parent:!0}).node;if(!n)throw new we.ErrnoError(44);var r=oe.basename(t),s=we.mayCreate(n,r);if(s)throw new we.ErrnoError(s);if(!n.node_ops.symlink)throw new we.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,s=oe.dirname(e),i=oe.dirname(t),o=oe.basename(e),a=oe.basename(t);if(n=we.lookupPath(e,{parent:!0}).node,r=we.lookupPath(t,{parent:!0}).node,!n||!r)throw new we.ErrnoError(44);if(n.mount!==r.mount)throw new we.ErrnoError(75);var l,c=we.lookupNode(n,o),_=le.relative(e,i);if("."!==_.charAt(0))throw new we.ErrnoError(28);if("."!==(_=le.relative(t,s)).charAt(0))throw new we.ErrnoError(55);try{l=we.lookupNode(r,a)}catch(e){}if(c!==l){var u=we.isDir(c.mode),d=we.mayDelete(n,o,u);if(d)throw new we.ErrnoError(d);if(d=l?we.mayDelete(r,a,u):we.mayCreate(r,a))throw new we.ErrnoError(d);if(!n.node_ops.rename)throw new we.ErrnoError(63);if(we.isMountpoint(c)||l&&we.isMountpoint(l))throw new we.ErrnoError(10);if(r!==n&&(d=we.nodePermissions(n,"w")))throw new we.ErrnoError(d);we.hashRemoveNode(c);try{n.node_ops.rename(c,r,a)}catch(e){throw e}finally{we.hashAddNode(c)}}},rmdir(e){var t=we.lookupPath(e,{parent:!0}).node,n=oe.basename(e),r=we.lookupNode(t,n),s=we.mayDelete(t,n,!0);if(s)throw new we.ErrnoError(s);if(!t.node_ops.rmdir)throw new we.ErrnoError(63);if(we.isMountpoint(r))throw new we.ErrnoError(10);t.node_ops.rmdir(t,n),we.destroyNode(r)},readdir(e){var t=we.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new we.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=we.lookupPath(e,{parent:!0}).node;if(!t)throw new we.ErrnoError(44);var n=oe.basename(e),r=we.lookupNode(t,n),s=we.mayDelete(t,n,!1);if(s)throw new we.ErrnoError(s);if(!t.node_ops.unlink)throw new we.ErrnoError(63);if(we.isMountpoint(r))throw new we.ErrnoError(10);t.node_ops.unlink(t,n),we.destroyNode(r)},readlink(e){var t=we.lookupPath(e).node;if(!t)throw new we.ErrnoError(44);if(!t.node_ops.readlink)throw new we.ErrnoError(28);return le.resolve(we.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=we.lookupPath(e,{follow:!t}).node;if(!n)throw new we.ErrnoError(44);if(!n.node_ops.getattr)throw new we.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>we.stat(e,!0),chmod(e,t,n){var r;if(!(r="string"==typeof e?we.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new we.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){we.chmod(e,t,!0)},fchmod(e,t){var n=we.getStreamChecked(e);we.chmod(n.node,t)},chown(e,t,n,r){var s;if(!(s="string"==typeof e?we.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new we.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,n){we.chown(e,t,n,!0)},fchown(e,t,n){var r=we.getStreamChecked(e);we.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new we.ErrnoError(28);var n;if(!(n="string"==typeof e?we.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new we.ErrnoError(63);if(we.isDir(n.mode))throw new we.ErrnoError(31);if(!we.isFile(n.mode))throw new we.ErrnoError(28);var r=we.nodePermissions(n,"w");if(r)throw new we.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=we.getStreamChecked(e);if(!(2097155&n.flags))throw new we.ErrnoError(28);we.truncate(n.node,t)},utime(e,t,n){var r=we.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(""===e)throw new we.ErrnoError(44);var r;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&n|32768:0,"object"==typeof e)r=e;else{e=oe.normalize(e);try{r=we.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(r){if(128&t)throw new we.ErrnoError(20)}else r=we.mknod(e,n,0),s=!0;if(!r)throw new we.ErrnoError(44);if(we.isChrdev(r.mode)&&(t&=-513),65536&t&&!we.isDir(r.mode))throw new we.ErrnoError(54);if(!s){var o=we.mayOpen(r,t);if(o)throw new we.ErrnoError(o)}512&t&&!s&&we.truncate(r,0),t&=-131713;var a=we.createStream({node:r,path:we.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(we.readFiles||(we.readFiles={}),e in we.readFiles||(we.readFiles[e]=1)),a},close(e){if(we.isClosed(e))throw new we.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{we.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(we.isClosed(e))throw new we.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new we.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new we.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,s){if(O(n>=0),r<0||s<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(1==(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.read)throw new we.ErrnoError(28);var i=void 0!==s;if(i){if(!e.seekable)throw new we.ErrnoError(70)}else s=e.position;var o=e.stream_ops.read(e,t,n,r,s);return i||(e.position+=o),o},write(e,t,n,r,s,i){if(O(n>=0),r<0||s<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.write)throw new we.ErrnoError(28);e.seekable&&1024&e.flags&&we.llseek(e,0,2);var o=void 0!==s;if(o){if(!e.seekable)throw new we.ErrnoError(70)}else s=e.position;var a=e.stream_ops.write(e,t,n,r,s,i);return o||(e.position+=a),a},allocate(e,t,n){if(we.isClosed(e))throw new we.ErrnoError(8);if(t<0||n<=0)throw new we.ErrnoError(28);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(!we.isFile(e.node.mode)&&!we.isDir(e.node.mode))throw new we.ErrnoError(43);if(!e.stream_ops.allocate)throw new we.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,s){if(2&r&&!(2&s)&&2!=(2097155&e.flags))throw new we.ErrnoError(2);if(1==(2097155&e.flags))throw new we.ErrnoError(2);if(!e.stream_ops.mmap)throw new we.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,s)},msync:(e,t,n,r,s)=>(O(n>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,s):0),munmap:e=>0,ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new we.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=we.open(e,t.flags),s=we.stat(e).size,i=new Uint8Array(s);return we.read(r,i,0,s,0),"utf8"===t.encoding?n=_e(i,0):"binary"===t.encoding&&(n=i),we.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=we.open(e,n.flags,n.mode);if("string"==typeof t){var s=new Uint8Array(de(t)+1),i=fe(t,s,0,s.length);we.write(r,s,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");we.write(r,t,0,t.byteLength,void 0,n.canOwn)}we.close(r)},cwd:()=>we.currentPath,chdir(e){var t=we.lookupPath(e,{follow:!0});if(null===t.node)throw new we.ErrnoError(44);if(!we.isDir(t.node.mode))throw new we.ErrnoError(54);var n=we.nodePermissions(t.node,"x");if(n)throw new we.ErrnoError(n);we.currentPath=t.path},createDefaultDirectories(){we.mkdir("/tmp"),we.mkdir("/home"),we.mkdir("/home/web_user")},createDefaultDevices(){we.mkdir("/dev"),we.registerDevice(we.makedev(1,3),{read:()=>0,write:(e,t,n,r,s)=>r}),we.mkdev("/dev/null",we.makedev(1,3)),he.register(we.makedev(5,0),he.default_tty_ops),he.register(we.makedev(6,0),he.default_tty1_ops),we.mkdev("/dev/tty",we.makedev(5,0)),we.mkdev("/dev/tty1",we.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=ae(e).byteLength),e[--t]);we.createDevice("/dev","random",n),we.createDevice("/dev","urandom",n),we.mkdir("/dev/shm"),we.mkdir("/dev/shm/tmp")},createSpecialDirectories(){we.mkdir("/proc");var e=we.mkdir("/proc/self");we.mkdir("/proc/self/fd"),we.mount({mount(){var t=we.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=we.getStreamChecked(n),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return s.parent=s,s}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?we.createDevice("/dev","stdin",i.stdin):we.symlink("/dev/tty","/dev/stdin"),i.stdout?we.createDevice("/dev","stdout",null,i.stdout):we.symlink("/dev/tty","/dev/stdout"),i.stderr?we.createDevice("/dev","stderr",null,i.stderr):we.symlink("/dev/tty1","/dev/stderr");var e=we.open("/dev/stdin",0),t=we.open("/dev/stdout",1),n=we.open("/dev/stderr",1);O(0===e.fd,`invalid handle for stdin (${e.fd})`),O(1===t.fd,`invalid handle for stdout (${t.fd})`),O(2===n.fd,`invalid handle for stderr (${n.fd})`)},ensureErrnoError(){we.ErrnoError||(we.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){for(var t in this.errno=e,ve)if(ve[t]===e){this.code=t;break}},this.setErrno(e),this.message=Ee[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var t,n=(t=e,ie("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),t);return e===n?e:n+" ["+e+"]"})))},we.ErrnoError.prototype=new Error,we.ErrnoError.prototype.constructor=we.ErrnoError,[44].forEach((e=>{we.genericErrors[e]=new we.ErrnoError(e),we.genericErrors[e].stack=""})))},staticInit(){we.ensureErrnoError(),we.nameTable=new Array(4096),we.mount(be,{},"/"),we.createDefaultDirectories(),we.createDefaultDevices(),we.createSpecialDirectories(),we.filesystems={MEMFS:be}},init(e,t,n){O(!we.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),we.init.initialized=!0,we.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=n||i.stderr,we.createStandardStreams()},quit(){we.init.initialized=!1,Ue(0);for(var e=0;ethis.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),s=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;s||(o=r);var a=this;a.setDataGetter((e=>{var t=e*o,s=(e+1)*o-1;if(s=Math.min(s,r-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var s=new XMLHttpRequest;if(s.open("GET",n,!1),r!==o&&s.setRequestHeader("Range","bytes="+e+"-"+t),s.responseType="arraybuffer",s.overrideMimeType&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.send(null),!(s.status>=200&&s.status<300||304===s.status))throw new Error("Couldn't load "+n+". Status: "+s.status);return void 0!==s.response?new Uint8Array(s.response||[]):pe(s.responseText||"",!0)})(t,s)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&r||(o=r=1,r=this.getter(0).length,o=r,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var o=new i;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:o}}else a={isDevice:!1,url:n};var l=we.createFile(e,t,a,r,s);a.contents?l.contents=a.contents:a.url&&(l.contents=null,l.url=a.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function _(e,t,n,r,s){var i=e.node.contents;if(s>=i.length)return 0;var o=Math.min(i.length-s,r);if(O(o>=0),i.slice)for(var a=0;a{var t=l.stream_ops[e];c[e]=function(){return we.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,n,r,s)=>(we.forceLoadFile(l),_(e,t,n,r,s)),c.mmap=(e,t,n,r,s)=>{we.forceLoadFile(l);var i=ge(t);if(!i)throw new we.ErrnoError(48);return _(e,S,i,t,n),{ptr:i,allocated:!0}},l.stream_ops=c,l},absolutePath(){G("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){G("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){G("FS.createLink has been removed; use FS.symlink instead")},joinPath(){G("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){G("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){G("FS.standardizePath has been removed; use PATH.normalize instead")}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(oe.isAbs(t))return t;var r;if(r=-100===e?we.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!n)throw new we.ErrnoError(44);return r}return oe.join2(r,t)},doStat(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(we.getPath(e.node)))return-54;throw e}T[n>>2]=r.dev,T[n+4>>2]=r.mode,I[n+8>>2]=r.nlink,T[n+12>>2]=r.uid,T[n+16>>2]=r.gid,T[n+20>>2]=r.rdev,k[n+24>>3]=BigInt(r.size),T[n+32>>2]=4096,T[n+36>>2]=r.blocks;var s=r.atime.getTime(),i=r.mtime.getTime(),o=r.ctime.getTime();return k[n+40>>3]=BigInt(Math.floor(s/1e3)),I[n+48>>2]=s%1e3*1e3,k[n+56>>3]=BigInt(Math.floor(i/1e3)),I[n+64>>2]=i%1e3*1e3,k[n+72>>3]=BigInt(Math.floor(o/1e3)),I[n+80>>2]=o%1e3*1e3,k[n+88>>3]=BigInt(r.ino),0},doMsync(e,t,n,r,s){if(!we.isFile(t.node.mode))throw new we.ErrnoError(43);if(2&r)return 0;var i=A.slice(e,e+n);we.msync(t,i,s,n,r)},varargs:void 0,get(){O(null!=Se.varargs);var e=T[+Se.varargs>>2];return Se.varargs+=4,e},getp:()=>Se.get(),getStr(e){var t=(e=>(O("number"==typeof e),e?_e(A,e,void 0):""))(e);return t},getStreamFromFD:e=>we.getStreamChecked(e)},Ae=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),xe=(e,t,n)=>(O("number"==typeof n,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),fe(e,A,t,n)),Te=e=>I[e>>2]+4294967296*T[e+4>>2],Ie=[0,31,60,91,121,152,182,213,244,274,305,335],ke=[0,31,59,90,120,151,181,212,243,273,304,334],Fe=e=>{var t=de(e)+1,n=je(t);return n&&xe(e,n,t),n};me=()=>performance.now();var Oe=e=>{var t=q.buffer,n=(e-t.byteLength+65535)/65536;try{return q.grow(n),P(),1}catch(n){w(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},Pe={},Le=()=>{if(!Le.strings){var 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",_:c||"./this.program"};for(var t in Pe)void 0===Pe[t]?delete e[t]:e[t]=Pe[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);Le.strings=n}return Le.strings},Ce=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=we.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};Object.defineProperties(Ce.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return we.isDir(this.mode)}},isDevice:{get:function(){return we.isChrdev(this.mode)}}}),we.FSNode=Ce,we.createPreloadedFile=(e,t,n,r,s,i,o,a,l,c)=>{var _=t?le.resolve(oe.join2(e,t)):e,u=W(`cp ${_}`);function d(n){function d(n){c&&c(),a||((e,t,n,r,s,i)=>{we.createDataFile(e,t,n,r,s,i)})(e,t,n,r,s,l),i&&i(),Q(u)}((e,t,n,r)=>{"undefined"!=typeof Browser&&Browser.init();var s=!1;return ye.forEach((i=>{s||i.canHandle(t)&&(i.handle(e,t,n,r),s=!0)})),s})(n,_,d,(()=>{o&&o(),Q(u)}))||d(n)}H(u),"string"==typeof n?((e,t,n)=>{var r=W(`al ${e}`);m(e,(t=>{O(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),r&&Q(r)}),(t=>{if(!n)throw`Loading data file "${e}" failed.`;n()})),r&&H(r)})(n,0,o):d(n)},we.staticInit(),ve={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var Ne,De={__syscall_chmod:function(e,t){try{return e=Se.getStr(e),we.chmod(e,t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_faccessat:function(e,t,n,r){try{if(t=Se.getStr(t),O(0===r),t=Se.calculateAt(e,t),-8&n)return-28;var s=we.lookupPath(t,{follow:!0}).node;if(!s)return-44;var i="";return 4&n&&(i+="r"),2&n&&(i+="w"),1&n&&(i+="x"),i&&we.nodePermissions(s,i)?-2:0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchmod:function(e,t){try{return we.fchmod(e,t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchown32:function(e,t,n){try{return we.fchown(e,t,n),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fcntl64:function(e,t,n){Se.varargs=n;try{var r=Se.getStreamFromFD(e);switch(t){case 0:if((s=Se.get())<0)return-28;for(;we.streams[s];)s++;return we.createStream(r,s).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var s=Se.get();return r.flags|=s,0;case 5:return s=Se.getp(),x[s+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Me()>>2]=28,-1}}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var n=Se.getStreamFromFD(e);return Se.doStat(we.stat,n.path,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t){t=Ae(t);try{return isNaN(t)?61:(we.ftruncate(e,t),0)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_getcwd:function(e,t){try{if(0===t)return-28;var n=we.cwd(),r=de(n)+1;return t>2]=s.c_iflag||0,T[i+4>>2]=s.c_oflag||0,T[i+8>>2]=s.c_cflag||0,T[i+12>>2]=s.c_lflag||0;for(var o=0;o<32;o++)S[i+o+17|0]=s.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){i=Se.getp();var a=T[i>>2],l=T[i+4>>2],c=T[i+8>>2],_=T[i+12>>2],u=[];for(o=0;o<32;o++)u.push(S[i+o+17|0]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:a,c_oflag:l,c_cflag:c,c_lflag:_,c_cc:u})}return 0;case 21519:return r.tty?(i=Se.getp(),T[i>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return i=Se.getp(),we.ioctl(r,t,i);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var d=r.tty.ops.ioctl_tiocgwinsz(r.tty);i=Se.getp(),x[i>>1]=d[0],x[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(we.lstat,e,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_mkdirat:function(e,t,n){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),"/"===(t=oe.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),we.mkdir(t,n,0),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,n,r){try{t=Se.getStr(t);var s=256&r,i=4096&r;return O(!(r&=-6401),`unknown flags in __syscall_newfstatat: ${r}`),t=Se.calculateAt(e,t,i),Se.doStat(s?we.lstat:we.stat,t,n)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,n,r){Se.varargs=r;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var s=r?Se.get():0;return we.open(t,n,s).fd}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_readlinkat:function(e,t,n,r){try{if(t=Se.getStr(t),t=Se.calculateAt(e,t),r<=0)return-28;var s=we.readlink(t),i=Math.min(r,de(s)),o=S[n+i];return xe(s,n,r+1),S[n+i]=o,i}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Se.getStr(e),we.rmdir(e),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(we.stat,e,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,n){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),0===n?we.unlink(t):512===n?we.rmdir(t):G("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_utimensat:function(e,t,n,r){try{if(t=Se.getStr(t),O(0===r),t=Se.calculateAt(e,t,!0),n){var s=Te(n),i=T[n+8>>2];o=1e3*s+i/1e6,a=1e3*(s=Te(n+=16))+(i=T[n+8>>2])/1e6}else var o=Date.now(),a=o;return we.utime(t,o,a),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_emscripten_get_now_is_monotonic:()=>!0,_localtime_js:function(e,t){e=Ae(e);var n=new Date(1e3*e);T[t>>2]=n.getSeconds(),T[t+4>>2]=n.getMinutes(),T[t+8>>2]=n.getHours(),T[t+12>>2]=n.getDate(),T[t+16>>2]=n.getMonth(),T[t+20>>2]=n.getFullYear()-1900,T[t+24>>2]=n.getDay();var r=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?ke:Ie)[e.getMonth()]+e.getDate()-1})(n);T[t+28>>2]=r,T[t+36>>2]=-60*n.getTimezoneOffset();var s=new Date(n.getFullYear(),0,1),i=new Date(n.getFullYear(),6,1).getTimezoneOffset(),o=s.getTimezoneOffset(),a=0|(i!=o&&n.getTimezoneOffset()==Math.min(o,i));T[t+32>>2]=a},_mmap_js:function(e,t,n,r,s,i,o){s=Ae(s);try{if(isNaN(s))return 61;var a=Se.getStreamFromFD(r),l=we.mmap(a,e,s,t,n),c=l.ptr;return T[i>>2]=l.allocated,I[o>>2]=c,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_munmap_js:function(e,t,n,r,s,i){i=Ae(i);try{if(isNaN(i))return 61;var o=Se.getStreamFromFD(s);2&n&&Se.doMsync(e,o,t,r,i),we.munmap(o)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_tzset_js:(e,t,n)=>{var r=(new Date).getFullYear(),s=new Date(r,0,1),i=new Date(r,6,1),o=s.getTimezoneOffset(),a=i.getTimezoneOffset(),l=Math.max(o,a);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[e>>2]=60*l,T[t>>2]=Number(o!=a);var _=c(s),u=c(i),d=Fe(_),f=Fe(u);a>2]=d,I[n+4>>2]=f):(I[n>>2]=f,I[n+4>>2]=d)},emscripten_date_now:()=>Date.now(),emscripten_get_now:me,emscripten_memcpy_js:(e,t,n)=>A.copyWithin(e,t,t+n),emscripten_resize_heap:e=>{var t=A.length;O((e>>>=0)>t);var n=2147483648;if(e>n)return w(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var r,s=1;s<=4;s*=2){var i=t*(1+.2/s);i=Math.min(i,e+100663296);var o=Math.min(n,(r=Math.max(e,i))+(65536-r%65536)%65536);if(Oe(o))return!0}return w(`Failed to grow the heap from ${t} bytes to ${o} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var n=0;return Le().forEach(((r,s)=>{var i=t+n;I[e+4*s>>2]=i,((e,t)=>{for(var n=0;n{var n=Le();I[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),I[t>>2]=r,0},fd_close:function(e){try{var t=Se.getStreamFromFD(e);return we.close(t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,t){try{var n=Se.getStreamFromFD(e),r=n.tty?2:we.isDir(n.mode)?3:we.isLink(n.mode)?7:4;return S[0|t]=r,x[t+2>>1]=0,k[t+8>>3]=BigInt(0),k[t+16>>3]=BigInt(0),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,t,n,r){try{var s=((e,t,n,r)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=we.read(e,S,o,a,r);if(l<0)return-1;if(s+=l,l>2]=s,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,n,r){t=Ae(t);try{if(isNaN(t))return 61;var s=Se.getStreamFromFD(e);return we.llseek(s,t,n),k[r>>3]=BigInt(s.position),s.getdents&&0===t&&0===n&&(s.getdents=null),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Se.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,t,n,r){try{var s=((e,t,n,r)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=we.write(e,S,o,a,r);if(l<0)return-1;s+=l,void 0!==r&&(r+=l)}return s})(Se.getStreamFromFD(e),t,n);return I[r>>2]=s,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},memory:q},Re=function(){var e={env:De,wasi_snapshot_preview1:De};function t(e,t){var n;return n=(Re=e.exports).__wasm_call_ctors,D.unshift(n),Q("wasm-instantiate"),Re}H("wasm-instantiate");var n,r,o,a,l=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){w(`Module.instantiateWasm callback failed with error: ${e}`),s(e)}return(n=y,r=V,o=e,a=function(e){O(i===l,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),l=null,t(e.instance)},n||"function"!=typeof WebAssembly.instantiateStreaming||K(r)||"function"!=typeof fetch?X(r,o,a):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return w(`wasm streaming compile failed: ${e}`),w("falling back to ArrayBuffer instantiation"),X(r,o,a)}))))).catch(s),{}}(),Me=(J("__wasm_call_ctors"),i._sqlite3_status64=J("sqlite3_status64"),i._sqlite3_status=J("sqlite3_status"),i._sqlite3_db_status=J("sqlite3_db_status"),i._sqlite3_msize=J("sqlite3_msize"),i._sqlite3_vfs_find=J("sqlite3_vfs_find"),i._sqlite3_initialize=J("sqlite3_initialize"),i._sqlite3_vfs_register=J("sqlite3_vfs_register"),i._sqlite3_vfs_unregister=J("sqlite3_vfs_unregister"),i._sqlite3_malloc=J("sqlite3_malloc"),i._sqlite3_malloc64=J("sqlite3_malloc64"),i._sqlite3_free=J("sqlite3_free"),i._sqlite3_realloc=J("sqlite3_realloc"),i._sqlite3_realloc64=J("sqlite3_realloc64"),i._sqlite3_value_int64=J("sqlite3_value_int64"),i._sqlite3_value_double=J("sqlite3_value_double"),i._sqlite3_value_text=J("sqlite3_value_text"),i._sqlite3_randomness=J("sqlite3_randomness"),i._sqlite3_stricmp=J("sqlite3_stricmp"),i._sqlite3_strnicmp=J("sqlite3_strnicmp"),J("__errno_location")),je=(i._sqlite3_serialize=J("sqlite3_serialize"),i._sqlite3_prepare_v2=J("sqlite3_prepare_v2"),i._sqlite3_step=J("sqlite3_step"),i._sqlite3_column_int64=J("sqlite3_column_int64"),i._sqlite3_column_int=J("sqlite3_column_int"),i._sqlite3_finalize=J("sqlite3_finalize"),i._sqlite3_file_control=J("sqlite3_file_control"),i._sqlite3_reset=J("sqlite3_reset"),i._sqlite3_value_int=J("sqlite3_value_int"),i._sqlite3_deserialize=J("sqlite3_deserialize"),i._sqlite3_clear_bindings=J("sqlite3_clear_bindings"),i._sqlite3_value_blob=J("sqlite3_value_blob"),i._sqlite3_value_bytes=J("sqlite3_value_bytes"),i._sqlite3_value_subtype=J("sqlite3_value_subtype"),i._sqlite3_value_pointer=J("sqlite3_value_pointer"),i._sqlite3_value_type=J("sqlite3_value_type"),i._sqlite3_value_nochange=J("sqlite3_value_nochange"),i._sqlite3_value_frombind=J("sqlite3_value_frombind"),i._sqlite3_value_dup=J("sqlite3_value_dup"),i._sqlite3_value_free=J("sqlite3_value_free"),i._sqlite3_result_blob=J("sqlite3_result_blob"),i._sqlite3_result_error_toobig=J("sqlite3_result_error_toobig"),i._sqlite3_result_error_nomem=J("sqlite3_result_error_nomem"),i._sqlite3_result_double=J("sqlite3_result_double"),i._sqlite3_result_error=J("sqlite3_result_error"),i._sqlite3_result_int=J("sqlite3_result_int"),i._sqlite3_result_int64=J("sqlite3_result_int64"),i._sqlite3_result_null=J("sqlite3_result_null"),i._sqlite3_result_pointer=J("sqlite3_result_pointer"),i._sqlite3_result_subtype=J("sqlite3_result_subtype"),i._sqlite3_result_text=J("sqlite3_result_text"),i._sqlite3_result_zeroblob=J("sqlite3_result_zeroblob"),i._sqlite3_result_zeroblob64=J("sqlite3_result_zeroblob64"),i._sqlite3_result_error_code=J("sqlite3_result_error_code"),i._sqlite3_sql=J("sqlite3_sql"),i._sqlite3_user_data=J("sqlite3_user_data"),i._sqlite3_context_db_handle=J("sqlite3_context_db_handle"),i._sqlite3_vtab_nochange=J("sqlite3_vtab_nochange"),i._sqlite3_vtab_in_first=J("sqlite3_vtab_in_first"),i._sqlite3_vtab_in_next=J("sqlite3_vtab_in_next"),i._sqlite3_aggregate_context=J("sqlite3_aggregate_context"),i._sqlite3_get_auxdata=J("sqlite3_get_auxdata"),i._sqlite3_set_auxdata=J("sqlite3_set_auxdata"),i._sqlite3_column_count=J("sqlite3_column_count"),i._sqlite3_data_count=J("sqlite3_data_count"),i._sqlite3_column_blob=J("sqlite3_column_blob"),i._sqlite3_column_bytes=J("sqlite3_column_bytes"),i._sqlite3_column_double=J("sqlite3_column_double"),i._sqlite3_column_text=J("sqlite3_column_text"),i._sqlite3_column_value=J("sqlite3_column_value"),i._sqlite3_column_type=J("sqlite3_column_type"),i._sqlite3_column_name=J("sqlite3_column_name"),i._sqlite3_bind_blob=J("sqlite3_bind_blob"),i._sqlite3_bind_double=J("sqlite3_bind_double"),i._sqlite3_bind_int=J("sqlite3_bind_int"),i._sqlite3_bind_int64=J("sqlite3_bind_int64"),i._sqlite3_bind_null=J("sqlite3_bind_null"),i._sqlite3_bind_pointer=J("sqlite3_bind_pointer"),i._sqlite3_bind_text=J("sqlite3_bind_text"),i._sqlite3_bind_parameter_count=J("sqlite3_bind_parameter_count"),i._sqlite3_bind_parameter_index=J("sqlite3_bind_parameter_index"),i._sqlite3_db_handle=J("sqlite3_db_handle"),i._sqlite3_stmt_readonly=J("sqlite3_stmt_readonly"),i._sqlite3_stmt_isexplain=J("sqlite3_stmt_isexplain"),i._sqlite3_stmt_status=J("sqlite3_stmt_status"),i._sqlite3_expanded_sql=J("sqlite3_expanded_sql"),i._sqlite3_preupdate_old=J("sqlite3_preupdate_old"),i._sqlite3_preupdate_count=J("sqlite3_preupdate_count"),i._sqlite3_preupdate_depth=J("sqlite3_preupdate_depth"),i._sqlite3_preupdate_blobwrite=J("sqlite3_preupdate_blobwrite"),i._sqlite3_preupdate_new=J("sqlite3_preupdate_new"),i._sqlite3_value_numeric_type=J("sqlite3_value_numeric_type"),i._sqlite3_errmsg=J("sqlite3_errmsg"),i._sqlite3_set_authorizer=J("sqlite3_set_authorizer"),i._sqlite3_strglob=J("sqlite3_strglob"),i._sqlite3_strlike=J("sqlite3_strlike"),i._sqlite3_exec=J("sqlite3_exec"),i._sqlite3_auto_extension=J("sqlite3_auto_extension"),i._sqlite3_cancel_auto_extension=J("sqlite3_cancel_auto_extension"),i._sqlite3_reset_auto_extension=J("sqlite3_reset_auto_extension"),i._sqlite3_prepare_v3=J("sqlite3_prepare_v3"),i._sqlite3_create_module=J("sqlite3_create_module"),i._sqlite3_create_module_v2=J("sqlite3_create_module_v2"),i._sqlite3_drop_modules=J("sqlite3_drop_modules"),i._sqlite3_declare_vtab=J("sqlite3_declare_vtab"),i._sqlite3_vtab_on_conflict=J("sqlite3_vtab_on_conflict"),i._sqlite3_vtab_collation=J("sqlite3_vtab_collation"),i._sqlite3_vtab_in=J("sqlite3_vtab_in"),i._sqlite3_vtab_rhs_value=J("sqlite3_vtab_rhs_value"),i._sqlite3_vtab_distinct=J("sqlite3_vtab_distinct"),i._sqlite3_keyword_name=J("sqlite3_keyword_name"),i._sqlite3_keyword_count=J("sqlite3_keyword_count"),i._sqlite3_keyword_check=J("sqlite3_keyword_check"),i._sqlite3_complete=J("sqlite3_complete"),i._sqlite3_libversion=J("sqlite3_libversion"),i._sqlite3_libversion_number=J("sqlite3_libversion_number"),i._sqlite3_shutdown=J("sqlite3_shutdown"),i._sqlite3_last_insert_rowid=J("sqlite3_last_insert_rowid"),i._sqlite3_set_last_insert_rowid=J("sqlite3_set_last_insert_rowid"),i._sqlite3_changes64=J("sqlite3_changes64"),i._sqlite3_changes=J("sqlite3_changes"),i._sqlite3_total_changes64=J("sqlite3_total_changes64"),i._sqlite3_total_changes=J("sqlite3_total_changes"),i._sqlite3_txn_state=J("sqlite3_txn_state"),i._sqlite3_close_v2=J("sqlite3_close_v2"),i._sqlite3_busy_handler=J("sqlite3_busy_handler"),i._sqlite3_progress_handler=J("sqlite3_progress_handler"),i._sqlite3_busy_timeout=J("sqlite3_busy_timeout"),i._sqlite3_create_function=J("sqlite3_create_function"),i._sqlite3_create_function_v2=J("sqlite3_create_function_v2"),i._sqlite3_create_window_function=J("sqlite3_create_window_function"),i._sqlite3_overload_function=J("sqlite3_overload_function"),i._sqlite3_trace_v2=J("sqlite3_trace_v2"),i._sqlite3_commit_hook=J("sqlite3_commit_hook"),i._sqlite3_update_hook=J("sqlite3_update_hook"),i._sqlite3_rollback_hook=J("sqlite3_rollback_hook"),i._sqlite3_preupdate_hook=J("sqlite3_preupdate_hook"),i._sqlite3_error_offset=J("sqlite3_error_offset"),i._sqlite3_errcode=J("sqlite3_errcode"),i._sqlite3_extended_errcode=J("sqlite3_extended_errcode"),i._sqlite3_errstr=J("sqlite3_errstr"),i._sqlite3_limit=J("sqlite3_limit"),i._sqlite3_open=J("sqlite3_open"),i._sqlite3_open_v2=J("sqlite3_open_v2"),i._sqlite3_create_collation=J("sqlite3_create_collation"),i._sqlite3_create_collation_v2=J("sqlite3_create_collation_v2"),i._sqlite3_collation_needed=J("sqlite3_collation_needed"),i._sqlite3_table_column_metadata=J("sqlite3_table_column_metadata"),i._sqlite3_extended_result_codes=J("sqlite3_extended_result_codes"),i._sqlite3_uri_parameter=J("sqlite3_uri_parameter"),i._sqlite3_uri_key=J("sqlite3_uri_key"),i._sqlite3_uri_boolean=J("sqlite3_uri_boolean"),i._sqlite3_uri_int64=J("sqlite3_uri_int64"),i._sqlite3_db_name=J("sqlite3_db_name"),i._sqlite3_db_filename=J("sqlite3_db_filename"),i._sqlite3_compileoption_used=J("sqlite3_compileoption_used"),i._sqlite3_compileoption_get=J("sqlite3_compileoption_get"),i._sqlite3session_diff=J("sqlite3session_diff"),i._sqlite3session_attach=J("sqlite3session_attach"),i._sqlite3session_create=J("sqlite3session_create"),i._sqlite3session_delete=J("sqlite3session_delete"),i._sqlite3session_table_filter=J("sqlite3session_table_filter"),i._sqlite3session_changeset=J("sqlite3session_changeset"),i._sqlite3session_changeset_strm=J("sqlite3session_changeset_strm"),i._sqlite3session_patchset_strm=J("sqlite3session_patchset_strm"),i._sqlite3session_patchset=J("sqlite3session_patchset"),i._sqlite3session_enable=J("sqlite3session_enable"),i._sqlite3session_indirect=J("sqlite3session_indirect"),i._sqlite3session_isempty=J("sqlite3session_isempty"),i._sqlite3session_memory_used=J("sqlite3session_memory_used"),i._sqlite3session_object_config=J("sqlite3session_object_config"),i._sqlite3session_changeset_size=J("sqlite3session_changeset_size"),i._sqlite3changeset_start=J("sqlite3changeset_start"),i._sqlite3changeset_start_v2=J("sqlite3changeset_start_v2"),i._sqlite3changeset_start_strm=J("sqlite3changeset_start_strm"),i._sqlite3changeset_start_v2_strm=J("sqlite3changeset_start_v2_strm"),i._sqlite3changeset_next=J("sqlite3changeset_next"),i._sqlite3changeset_op=J("sqlite3changeset_op"),i._sqlite3changeset_pk=J("sqlite3changeset_pk"),i._sqlite3changeset_old=J("sqlite3changeset_old"),i._sqlite3changeset_new=J("sqlite3changeset_new"),i._sqlite3changeset_conflict=J("sqlite3changeset_conflict"),i._sqlite3changeset_fk_conflicts=J("sqlite3changeset_fk_conflicts"),i._sqlite3changeset_finalize=J("sqlite3changeset_finalize"),i._sqlite3changeset_invert=J("sqlite3changeset_invert"),i._sqlite3changeset_invert_strm=J("sqlite3changeset_invert_strm"),i._sqlite3changeset_apply_v2=J("sqlite3changeset_apply_v2"),i._sqlite3changeset_apply=J("sqlite3changeset_apply"),i._sqlite3changeset_apply_v2_strm=J("sqlite3changeset_apply_v2_strm"),i._sqlite3changeset_apply_strm=J("sqlite3changeset_apply_strm"),i._sqlite3changegroup_new=J("sqlite3changegroup_new"),i._sqlite3changegroup_add=J("sqlite3changegroup_add"),i._sqlite3changegroup_output=J("sqlite3changegroup_output"),i._sqlite3changegroup_add_strm=J("sqlite3changegroup_add_strm"),i._sqlite3changegroup_output_strm=J("sqlite3changegroup_output_strm"),i._sqlite3changegroup_delete=J("sqlite3changegroup_delete"),i._sqlite3changeset_concat=J("sqlite3changeset_concat"),i._sqlite3changeset_concat_strm=J("sqlite3changeset_concat_strm"),i._sqlite3session_config=J("sqlite3session_config"),i._sqlite3_sourceid=J("sqlite3_sourceid"),i._sqlite3_wasm_pstack_ptr=J("sqlite3_wasm_pstack_ptr"),i._sqlite3_wasm_pstack_restore=J("sqlite3_wasm_pstack_restore"),i._sqlite3_wasm_pstack_alloc=J("sqlite3_wasm_pstack_alloc"),i._sqlite3_wasm_pstack_remaining=J("sqlite3_wasm_pstack_remaining"),i._sqlite3_wasm_pstack_quota=J("sqlite3_wasm_pstack_quota"),i._sqlite3_wasm_db_error=J("sqlite3_wasm_db_error"),i._sqlite3_wasm_test_struct=J("sqlite3_wasm_test_struct"),i._sqlite3_wasm_enum_json=J("sqlite3_wasm_enum_json"),i._sqlite3_wasm_vfs_unlink=J("sqlite3_wasm_vfs_unlink"),i._sqlite3_wasm_db_vfs=J("sqlite3_wasm_db_vfs"),i._sqlite3_wasm_db_reset=J("sqlite3_wasm_db_reset"),i._sqlite3_wasm_db_export_chunked=J("sqlite3_wasm_db_export_chunked"),i._sqlite3_wasm_db_serialize=J("sqlite3_wasm_db_serialize"),i._sqlite3_wasm_vfs_create_file=J("sqlite3_wasm_vfs_create_file"),i._sqlite3_wasm_posix_create_file=J("sqlite3_wasm_posix_create_file"),i._sqlite3_wasm_kvvfsMakeKeyOnPstack=J("sqlite3_wasm_kvvfsMakeKeyOnPstack"),i._sqlite3_wasm_kvvfs_methods=J("sqlite3_wasm_kvvfs_methods"),i._sqlite3_wasm_vtab_config=J("sqlite3_wasm_vtab_config"),i._sqlite3_wasm_db_config_ip=J("sqlite3_wasm_db_config_ip"),i._sqlite3_wasm_db_config_pii=J("sqlite3_wasm_db_config_pii"),i._sqlite3_wasm_db_config_s=J("sqlite3_wasm_db_config_s"),i._sqlite3_wasm_config_i=J("sqlite3_wasm_config_i"),i._sqlite3_wasm_config_ii=J("sqlite3_wasm_config_ii"),i._sqlite3_wasm_config_j=J("sqlite3_wasm_config_j"),i._sqlite3_wasm_init_wasmfs=J("sqlite3_wasm_init_wasmfs"),i._sqlite3_wasm_test_intptr=J("sqlite3_wasm_test_intptr"),i._sqlite3_wasm_test_voidptr=J("sqlite3_wasm_test_voidptr"),i._sqlite3_wasm_test_int64_max=J("sqlite3_wasm_test_int64_max"),i._sqlite3_wasm_test_int64_min=J("sqlite3_wasm_test_int64_min"),i._sqlite3_wasm_test_int64_times2=J("sqlite3_wasm_test_int64_times2"),i._sqlite3_wasm_test_int64_minmax=J("sqlite3_wasm_test_int64_minmax"),i._sqlite3_wasm_test_int64ptr=J("sqlite3_wasm_test_int64ptr"),i._sqlite3_wasm_test_stack_overflow=J("sqlite3_wasm_test_stack_overflow"),i._sqlite3_wasm_test_str_hello=J("sqlite3_wasm_test_str_hello"),i._sqlite3_wasm_SQLTester_strglob=J("sqlite3_wasm_SQLTester_strglob"),i._malloc=J("malloc")),Ue=(i._free=J("free"),i._realloc=J("realloc"),i._fflush=J("fflush")),Be=J("emscripten_builtin_memalign"),ze=()=>(ze=Re.emscripten_stack_init)(),We=()=>(We=Re.emscripten_stack_get_end)();function He(){function e(){Ne||(Ne=!0,i.calledRun=!0,F||(O(!M),M=!0,C(),i.noFSInit||we.init.initialized||we.init(),we.ignorePermissions=!1,he.init(),re(D),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),O(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(C(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),R.unshift(e);var e;re(R)}()))}var n;j>0||(ze(),O(!(3&(n=We()))),0==n&&(n+=4),I[n>>2]=34821223,I[n+4>>2]=2310721022,I[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),N.unshift(e);var e;re(N)}(),j>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e(),C()))}if(J("stackSave"),J("stackRestore"),J("stackAlloc"),i.wasmMemory=q,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","handleAllocatorInit","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",n=e;n.startsWith("_")||(n="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+n+"')",ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ie(t)}}),ne(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","keepRuntimeAlive","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","asyncLoad","alignMemory","mmapAlloc","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToNewUTF8","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"].forEach(ne),B=function e(){Ne||He(),Ne||(B=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return He(),i.postRun||(i.postRun=[]),i.postRun.push((function(e){if(globalThis.sqlite3ApiBootstrap=function t(n=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return console.warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const r=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:void 0!==e?!!e.HEAPU64:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},n||{});Object.assign(r,{allocExportName:r.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:r.useStdAlloc?"free":"sqlite3_free",reallocExportName:r.useStdAlloc?"realloc":"sqlite3_realloc"},r),["exports","memory","wasmfsOpfsDir"].forEach((e=>{"function"==typeof r[e]&&(r[e]=r[e]())}));const s=Object.create(null),i=Object.create(null),o=e=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(e)||"Unknown result code #"+e;class a extends Error{constructor(...e){let t;if(e.length)if("number"==typeof(n=e[0])&&n===(0|n))if(t=e[0],1===e.length)super(o(e[0]));else{const n=o(t);"object"==typeof e[1]?super(n,e[1]):(e[0]=n+":",super(e.join(" ")))}else 2===e.length&&"object"==typeof e[1]?super(...e):super(e.join(" "));var n;this.resultCode=t||s.SQLITE_ERROR,this.name="SQLite3Error"}}a.toss=(...e)=>{throw new a(...e)};const l=a.toss;r.wasmfsOpfsDir&&!/^\/[^/]+$/.test(r.wasmfsOpfsDir)&&l("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const c=e=>"bigint"!=typeof e&&!!(e===(0|e)&&e<=2147483647&&e>=-2147483648),_="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,u=e=>e.buffer instanceof _,d=(e,t,n)=>u(e)?e.slice(t,n):e.subarray(t,n),f=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),p=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),m=e=>f(e)||l("Value is not of a supported TypedArray type."),h=new TextDecoder("utf-8"),g=function(e,t,n){return h.decode(d(e,t,n))},b=function(e){return p(e)?g(e instanceof ArrayBuffer?new Uint8Array(e):e):Array.isArray(e)?e.join(""):(i.isPtr(e)&&(e=i.cstrToJs(e)),e)};class y extends Error{constructor(...e){2===e.length&&"object"==typeof e[1]?super(...e):e.length?super(e.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}y.toss=(...e)=>{throw new y(...e)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(e,t,n,r,s,i,o,a,l)=>{},sqlite3_create_function:(e,t,n,r,s,i,o,a)=>{},sqlite3_create_window_function:(e,t,n,r,s,i,o,a,l,c)=>{},sqlite3_prepare_v3:(e,t,n,r,s,i)=>{},sqlite3_prepare_v2:(e,t,n,r,s)=>{},sqlite3_exec:(e,t,n,r,s)=>{},sqlite3_randomness:(e,t)=>{}});const q={affirmBindableTypedArray:m,flexibleString:b,bigIntFits32:e=>e>=-2147483648n&&e<=0x7fffffffn,bigIntFits64:function e(t){return e._max||(e._max=BigInt("0x7fffffffffffffff"),e._min=~e._max),t>=e._min&&t<=e._max},bigIntFitsDouble:function e(t){return e._min||(e._min=Number.MIN_SAFE_INTEGER,e._max=Number.MAX_SAFE_INTEGER),t>=e._min&&t<=e._max},isBindableTypedArray:f,isInt32:c,isSQLableTypedArray:p,isTypedArray:e=>!!(e&&e.constructor&&c(e.constructor.BYTES_PER_ELEMENT))&&e,typedArrayToString:g,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:u,toss:function(...e){throw new Error(e.join(" "))},toss3:l,typedArrayPart:d,affirmDbHeader:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));15>e.byteLength&&l("Input does not contain an SQLite3 database header.");for(let t=0;t<15;++t)"SQLite format 3".charCodeAt(t)!==e[t]&&l("Input does not contain an SQLite3 database header.")},affirmIsDb:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const t=e.byteLength;(t<512||t%512!=0)&&l("Byte array size",t,"is invalid for an SQLite3 db."),q.affirmDbHeader(e)}};Object.assign(i,{ptrSizeof:r.wasmPtrSizeof||4,ptrIR:r.wasmPtrIR||"i32",bigIntEnabled:!!r.bigIntEnabled,exports:r.exports||l("Missing API config.exports (WASM module exports)."),memory:r.memory||r.exports.memory||l("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),i.allocFromTypedArray=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e)),m(e);const t=i.alloc(e.byteLength||1);return i.heapForSize(e.constructor).set(e.byteLength?e:[0],t),t};{const e=r.allocExportName,t=r.deallocExportName,n=r.reallocExportName;for(const r of[e,t,n])i.exports[r]instanceof Function||l("Missing required exports[",r,"] function.");i.alloc=function e(t){return e.impl(t)||y.toss("Failed to allocate",t," bytes.")},i.alloc.impl=i.exports[e],i.realloc=function e(t,n){const r=e.impl(t,n);return n?r||y.toss("Failed to reallocate",n," bytes."):0},i.realloc.impl=i.exports[n],i.dealloc=i.exports[t]}let E;if(i.compileOptionUsed=function e(t){if(!arguments.length){if(e._result)return e._result;e._opt||(e._rx=/^([^=]+)=(.+)/,e._rxInt=/^-?\d+$/,e._opt=function(t,n){const r=e._rx.exec(t);n[0]=r?r[1]:t,n[1]=!r||(e._rxInt.test(r[2])?+r[2]:r[2])});const t={},n=[0,0];let r,i=0;for(;r=s.sqlite3_compileoption_get(i++);)e._opt(r,n),t[n[0]]=n[1];return e._result=t}if(Array.isArray(t)){const e={};return t.forEach((t=>{e[t]=s.sqlite3_compileoption_used(t)})),e}return"object"==typeof t?(Object.keys(t).forEach((e=>{t[e]=s.sqlite3_compileoption_used(e)})),t):"string"==typeof t&&!!s.sqlite3_compileoption_used(t)},i.pstack=Object.assign(Object.create(null),{restore:i.exports.sqlite3_wasm_pstack_restore,alloc:function(e){return"string"!=typeof e||(e=i.sizeofIR(e))||y.toss("Invalid value for pstack.alloc(",arguments[0],")"),i.exports.sqlite3_wasm_pstack_alloc(e)||y.toss("Could not allocate",e,"bytes from the pstack.")},allocChunks:function(e,t){"string"!=typeof t||(t=i.sizeofIR(t))||y.toss("Invalid size value for allocChunks(",arguments[1],")");const n=i.pstack.alloc(e*t),r=[];let s=0,o=0;for(;s1===e?i.pstack.alloc(t?8:i.ptrSizeof):i.pstack.allocChunks(e,t?8:i.ptrSizeof),call:function(e){const t=i.pstack.pointer;try{return e(S)}finally{i.pstack.restore(t)}}}),Object.defineProperties(i.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_remaining}}),s.sqlite3_randomness=(...e)=>{if(1===e.length&&q.isTypedArray(e[0])&&1===e[0].BYTES_PER_ELEMENT){const t=e[0];if(0===t.byteLength)return i.exports.sqlite3_randomness(0,0),t;const n=i.pstack.pointer;try{let e=t.byteLength,n=0;const r=i.exports.sqlite3_randomness,s=i.heap8u(),o=e<512?e:512,a=i.pstack.alloc(o);do{const i=e>o?o:e;r(i,a),t.set(d(s,a,a+i),n),e-=i,n+=i}while(e>0)}catch(e){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",e)}finally{i.pstack.restore(n)}return t}i.exports.sqlite3_randomness(...e)},s.sqlite3_wasmfs_opfs_dir=function(){if(void 0!==E)return E;const e=r.wasmfsOpfsDir;if(!(e&&globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle))return E="";try{return E=e&&0===i.xCallWrapped("sqlite3_wasm_init_wasmfs","i32",["string"],e)?e:""}catch(e){return E=""}},s.sqlite3_wasmfs_filename_is_persistent=function(e){const t=s.sqlite3_wasmfs_opfs_dir();return!(!t||!e)&&e.startsWith(t+"/")},s.sqlite3_js_db_uses_vfs=function(e,t,n=0){try{const r=s.sqlite3_vfs_find(t);return!!r&&(e?r===s.sqlite3_js_db_vfs(e,n)&&r:r===s.sqlite3_vfs_find(0)&&r)}catch(e){return!1}},s.sqlite3_js_vfs_list=function(){const e=[];let t=s.sqlite3_vfs_find(0);for(;t;){const n=new s.sqlite3_vfs(t);e.push(i.cstrToJs(n.$zName)),t=n.$pNext,n.dispose()}return e},s.sqlite3_js_db_export=function(e,t=0){(e=i.xWrap.testConvertArg("sqlite3*",e))||l("Invalid sqlite3* argument."),i.bigIntEnabled||l("BigInt64 support is not enabled.");const n=i.scopedAllocPush();let r;try{const n=i.scopedAlloc(8+i.ptrSizeof),s=n+8,o=t?i.isPtr(t)?t:i.scopedAllocCString(""+t):0;let a=i.exports.sqlite3_wasm_db_serialize(e,o,s,n,0);a&&l("Database serialization failed with code",S.capi.sqlite3_js_rc_str(a)),r=i.peekPtr(s);const c=i.peek(n,"i64");return a=c?i.heap8u().slice(r,r+Number(c)):new Uint8Array,a}finally{r&&i.exports.sqlite3_free(r),i.scopedAllocPop(n)}},s.sqlite3_js_db_vfs=(e,t=0)=>i.sqlite3_wasm_db_vfs(e,t),s.sqlite3_js_aggregate_context=(e,t)=>s.sqlite3_aggregate_context(e,t)||(t?y.toss("Cannot allocate",t,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(e,t,n){let r;t&&i.isPtr(t)?r=t:t instanceof ArrayBuffer||t instanceof Uint8Array?(r=i.allocFromTypedArray(t),(arguments.length<3||!q.isInt32(n)||n<0)&&(n=t.byteLength)):a.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!q.isInt32(n)||n<0)&&a.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const t=i.sqlite3_wasm_posix_create_file(e,r,n);t&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(t))}finally{i.dealloc(r)}},s.sqlite3_js_vfs_create_file=function(e,t,n,o){let l;r.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options."),n?(i.isPtr(n)?l=n:n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array?(l=i.allocFromTypedArray(n),(arguments.length<4||!q.isInt32(o)||o<0)&&(o=n.byteLength)):a.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):l=0,(!q.isInt32(o)||o<0)&&(i.dealloc(l),a.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const n=i.sqlite3_wasm_vfs_create_file(e,t,l,o);n&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(n))}finally{i.dealloc(l)}},s.sqlite3_js_sql_to_string=e=>{if("string"==typeof e)return e;const t=b(v);return t===v?void 0:t},q.isUIThread()){const e=function(e){const t=Object.create(null);return t.prefix="kvvfs-"+e,t.stores=[],"session"!==e&&""!==e||t.stores.push(globalThis.sessionStorage),"local"!==e&&""!==e||t.stores.push(globalThis.localStorage),t};s.sqlite3_js_kvvfs_clear=function(t=""){let n=0;const r=e(t);return r.stores.forEach((e=>{const t=[];let s;for(s=0;se.removeItem(t))),n+=t.length})),n},s.sqlite3_js_kvvfs_size=function(t=""){let n=0;const r=e(t);return r.stores.forEach((e=>{let t;for(t=0;tw(e,t,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(e,t)=>w(e,t,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(e,t)=>w(e,t,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(e,t)=>w(e,t,"sqlite3changeset_old");const S={WasmAllocError:y,SQLite3Error:a,capi:s,util:q,wasm:i,config:r,version:Object.create(null),client:void 0,asyncPostInit:async function e(){if(e.isReady instanceof Promise)return e.isReady;let n=t.initializersAsync;delete t.initializersAsync;const s=async()=>(S.__isUnderTest||(delete S.util,delete S.StructBinder),S),i=e=>{throw r.error("an async sqlite3 initializer failed:",e),e};if(!n||!n.length)return e.isReady=s().catch(i);n=n.map((e=>e instanceof Function?async t=>e(S):e)),n.push(s);let o=Promise.resolve(S);for(;n.length;)o=o.then(n.shift());return e.isReady=o.catch(i)},scriptInfo:void 0};try{t.initializers.forEach((e=>{e(S)}))}catch(e){throw console.error("sqlite3 bootstrap initializer threw:",e),e}return delete t.initializers,t.sqlite3=S,S},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(e){void 0===e.bigIntEnabled&&(e.bigIntEnabled=!!globalThis.BigInt64Array);const t=(...e)=>{throw new Error(e.join(" "))};e.exports||Object.defineProperty(e,"exports",{enumerable:!0,configurable:!0,get:()=>e.instance&&e.instance.exports});const n=e.pointerIR||"i32",r=e.ptrSizeof="i32"===n?4:"i64"===n?8:t("Unhandled ptrSizeof:",n),s=Object.create(null);s.heapSize=0,s.memory=null,s.freeFuncIndexes=[],s.scopedAlloc=[],s.utf8Decoder=new TextDecoder,s.utf8Encoder=new TextEncoder("utf-8"),e.sizeofIR=e=>{switch(e){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return r;default:return(""+e).endsWith("*")?r:void 0}};const i=function(){if(s.memory){if(s.heapSize===s.memory.buffer.byteLength)return s}else s.memory=e.memory instanceof WebAssembly.Memory?e.memory:e.exports.memory;const t=s.memory.buffer;return s.HEAP8=new Int8Array(t),s.HEAP8U=new Uint8Array(t),s.HEAP16=new Int16Array(t),s.HEAP16U=new Uint16Array(t),s.HEAP32=new Int32Array(t),s.HEAP32U=new Uint32Array(t),e.bigIntEnabled&&(s.HEAP64=new BigInt64Array(t),s.HEAP64U=new BigUint64Array(t)),s.HEAP32F=new Float32Array(t),s.HEAP64F=new Float64Array(t),s.heapSize=t.byteLength,s};e.heap8=()=>i().HEAP8,e.heap8u=()=>i().HEAP8U,e.heap16=()=>i().HEAP16,e.heap16u=()=>i().HEAP16U,e.heap32=()=>i().HEAP32,e.heap32u=()=>i().HEAP32U,e.heapForSize=function(n,r=!0){const o=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();switch(n){case Int8Array:return o.HEAP8;case Uint8Array:return o.HEAP8U;case Int16Array:return o.HEAP16;case Uint16Array:return o.HEAP16U;case Int32Array:return o.HEAP32;case Uint32Array:return o.HEAP32U;case 8:return r?o.HEAP8U:o.HEAP8;case 16:return r?o.HEAP16U:o.HEAP16;case 32:return r?o.HEAP32U:o.HEAP32;case 64:if(o.HEAP64)return r?o.HEAP64U:o.HEAP64;break;default:if(e.bigIntEnabled){if(n===globalThis.BigUint64Array)return o.HEAP64U;if(n===globalThis.BigInt64Array)return o.HEAP64;break}}t("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},e.functionTable=function(){return e.exports.__indirect_function_table},e.functionEntry=function(t){const n=e.functionTable();return t>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(t){const n=e._.rxJSig.exec(t);return n?n[2]:t.substr(1)},letterType:n=>e._.sigTypes[n]||t("Invalid signature letter:",n),pushSigType:(t,n)=>t.push(e._.typeCodes[e._.letterType(n)])}),"string"==typeof n){const e=r;r=n,n=e}const s=e._.sigParams(r),i=[1,96];e._.uleb128Encode(i,"push",s.length);for(const t of s)e._.pushSigType(i,t);return"v"===r[0]?i.push(0):(i.push(1),e._.pushSigType(i,r[0])),e._.uleb128Encode(i,"unshift",i.length),i.unshift(0,97,115,109,1,0,0,0,1),i.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(i)),{e:{f:n}}).exports.f};const o=function(n,r,i){if(i&&!s.scopedAlloc.length&&t("No scopedAllocPush() scope is active."),"string"==typeof n){const e=r;r=n,n=e}"string"==typeof r&&n instanceof Function||t("Invalid arguments: expecting (function,signature) or (signature,function).");const o=e.functionTable(),a=o.length;let l;for(;s.freeFuncIndexes.length&&(l=s.freeFuncIndexes.pop(),o.get(l));)l=null;l||(l=a,o.grow(1));try{return o.set(l,n),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l),l}catch(e){if(!(e instanceof TypeError))throw l===a&&s.freeFuncIndexes.push(a),e}try{const t=e.jsFuncToWasm(n,r);o.set(l,t),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l)}catch(e){throw l===a&&s.freeFuncIndexes.push(a),e}return l};e.installFunction=(e,t)=>o(e,t,!1),e.scopedInstallFunction=(e,t)=>o(e,t,!0),e.uninstallFunction=function(t){if(!t&&0!==t)return;const n=s.freeFuncIndexes,r=e.functionTable();n.push(t);const i=r.get(t);return r.set(t,null),i},e.peek=function(r,o="i8"){o.endsWith("*")&&(o=n);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i(),l=Array.isArray(r)?[]:void 0;let c;do{switch(l&&(r=arguments[0].shift()),o){case"i1":case"i8":c=a.HEAP8[0|r];break;case"i16":c=a.HEAP16[r>>1];break;case"i32":c=a.HEAP32[r>>2];break;case"float":case"f32":c=a.HEAP32F[r>>2];break;case"double":case"f64":c=Number(a.HEAP64F[r>>3]);break;case"i64":if(e.bigIntEnabled){c=BigInt(a.HEAP64[r>>3]);break}default:t("Invalid type for peek():",o)}l&&l.push(c)}while(l&&arguments[0].length);return l||c},e.poke=function(e,r,o="i8"){o.endsWith("*")&&(o=n);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();for(const n of Array.isArray(e)?e:[e])switch(o){case"i1":case"i8":a.HEAP8[0|n]=r;continue;case"i16":a.HEAP16[n>>1]=r;continue;case"i32":a.HEAP32[n>>2]=r;continue;case"float":case"f32":a.HEAP32F[n>>2]=r;continue;case"double":case"f64":a.HEAP64F[n>>3]=r;continue;case"i64":if(a.HEAP64){a.HEAP64[n>>3]=BigInt(r);continue}default:t("Invalid type for poke(): "+o)}return this},e.peekPtr=(...t)=>e.peek(1===t.length?t[0]:t,n),e.pokePtr=(t,r=0)=>e.poke(t,r,n),e.peek8=(...t)=>e.peek(1===t.length?t[0]:t,"i8"),e.poke8=(t,n)=>e.poke(t,n,"i8"),e.peek16=(...t)=>e.peek(1===t.length?t[0]:t,"i16"),e.poke16=(t,n)=>e.poke(t,n,"i16"),e.peek32=(...t)=>e.peek(1===t.length?t[0]:t,"i32"),e.poke32=(t,n)=>e.poke(t,n,"i32"),e.peek64=(...t)=>e.peek(1===t.length?t[0]:t,"i64"),e.poke64=(t,n)=>e.poke(t,n,"i64"),e.peek32f=(...t)=>e.peek(1===t.length?t[0]:t,"f32"),e.poke32f=(t,n)=>e.poke(t,n,"f32"),e.peek64f=(...t)=>e.peek(1===t.length?t[0]:t,"f64"),e.poke64f=(t,n)=>e.poke(t,n,"f64"),e.getMemValue=e.peek,e.getPtrValue=e.peekPtr,e.setMemValue=e.poke,e.setPtrValue=e.pokePtr,e.isPtr32=e=>"number"==typeof e&&e===(0|e)&&e>=0,e.isPtr=e.isPtr32,e.cstrlen=function(t){if(!t||!e.isPtr(t))return null;const n=i().HEAP8U;let r=t;for(;0!==n[r];++r);return r-t};const a="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer;e.cstrToJs=function(t){const n=e.cstrlen(t);return n?(r=i().HEAP8U,o=t,l=t+n,s.utf8Decoder.decode(r.buffer instanceof a?r.slice(o,l):r.subarray(o,l))):null===n?n:"";var r,o,l},e.jstrlen=function(e){if("string"!=typeof e)return null;const t=e.length;let n=0;for(let r=0;r=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++r)),t<=127?++n:n+=t<=2047?2:t<=65535?3:4}return n},e.jstrcpy=function(e,n,r=0,s=-1,i=!0){if(n&&(n instanceof Int8Array||n instanceof Uint8Array)||t("jstrcpy() target must be an Int8Array or Uint8Array."),s<0&&(s=n.length-r),!(s>0&&r>=0))return 0;let o=0,a=e.length;const l=r,c=r+s-(i?1:0);for(;o=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++o)),t<=127){if(r>=c)break;n[r++]=t}else if(t<=2047){if(r+1>=c)break;n[r++]=192|t>>6,n[r++]=128|63&t}else if(t<=65535){if(r+2>=c)break;n[r++]=224|t>>12,n[r++]=128|t>>6&63,n[r++]=128|63&t}else{if(r+3>=c)break;n[r++]=240|t>>18,n[r++]=128|t>>12&63,n[r++]=128|t>>6&63,n[r++]=128|63&t}}return i&&(n[r++]=0),r-l},e.cstrncpy=function(n,r,s){if(n&&r||t("cstrncpy() does not accept NULL strings."),s<0)s=e.cstrlen(strPtr)+1;else if(!(s>0))return 0;const i=e.heap8u();let o,a=0;for(;as.utf8Encoder.encode(t?e+"\0":e);const l=(e,n)=>{e.alloc instanceof Function&&e.dealloc instanceof Function||t("Object is missing alloc() and/or dealloc() function(s)","required by",n+"().")},c=function(t,n,r,o){if(l(e,o),"string"!=typeof t)return null;{const e=s.utf8Encoder.encode(t),o=r(e.length+1),a=i().HEAP8U;return a.set(e,o),a[o+e.length]=0,n?[o,e.length]:o}};e.allocCString=(t,n=!1)=>c(t,n,e.alloc,"allocCString()"),e.scopedAllocPush=function(){l(e,"scopedAllocPush");const t=[];return s.scopedAlloc.push(t),t},e.scopedAllocPop=function(n){l(e,"scopedAllocPop");const r=arguments.length?s.scopedAlloc.indexOf(n):s.scopedAlloc.length-1;r<0&&t("Invalid state object for scopedAllocPop()."),0===arguments.length&&(n=s.scopedAlloc[r]),s.scopedAlloc.splice(r,1);for(let t;t=n.pop();)e.functionEntry(t)?e.uninstallFunction(t):e.dealloc(t)},e.scopedAlloc=function(n){s.scopedAlloc.length||t("No scopedAllocPush() scope is active.");const r=e.alloc(n);return s.scopedAlloc[s.scopedAlloc.length-1].push(r),r},Object.defineProperty(e.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>s.scopedAlloc.length,set:()=>t("The 'active' property is read-only.")}),e.scopedAllocCString=(t,n=!1)=>c(t,n,e.scopedAlloc,"scopedAllocCString()");const _=function(t,n){const r=e[t?"scopedAlloc":"alloc"]((n.length+1)*e.ptrSizeof);let s=0;return n.forEach((n=>{e.pokePtr(r+e.ptrSizeof*s++,e[t?"scopedAllocCString":"allocCString"](""+n))})),e.pokePtr(r+e.ptrSizeof*s,0),r};e.scopedAllocMainArgv=e=>_(!0,e),e.allocMainArgv=e=>_(!1,e),e.cArgvToJs=(t,n)=>{const r=[];for(let s=0;su(e,t,"alloc"),e.scopedAllocPtr=(e=1,t=!0)=>u(e,t,"scopedAlloc"),e.xGet=function(n){return e.exports[n]||t("Cannot find exported symbol:",n)};const d=(e,n)=>t(e+"() requires",n,"argument(s).");e.xCall=function(n,...r){const s=e.xGet(n);return s instanceof Function||t("Exported symbol",n,"is not a function."),s.length!==r.length&&d(n,s.length),2===arguments.length&&Array.isArray(arguments[1])?s.apply(null,arguments[1]):s.apply(null,r)},s.xWrap=Object.create(null),s.xWrap.convert=Object.create(null),s.xWrap.convert.arg=new Map,s.xWrap.convert.result=new Map;const f=s.xWrap.convert.arg,p=s.xWrap.convert.result;e.bigIntEnabled&&f.set("i64",(e=>BigInt(e)));const m="i32"===n?e=>0|e:e=>BigInt(e)|BigInt(0);f.set("i32",m).set("i16",(e=>65535&e)).set("i8",(e=>255&e)).set("f32",(e=>Number(e).valueOf())).set("float",f.get("f32")).set("f64",f.get("f32")).set("double",f.get("f64")).set("int",f.get("i32")).set("null",(e=>e)).set(null,f.get("null")).set("**",m).set("*",m),p.set("*",m).set("pointer",m).set("number",(e=>Number(e))).set("void",(e=>{})).set("null",(e=>e)).set(null,p.get("null"));{const r=["i8","i16","i32","int","f32","float","f64","double"];e.bigIntEnabled&&r.push("i64");const s=f.get(n);for(const e of r)f.set(e+"*",s),p.set(e+"*",s),p.set(e,f.get(e)||t("Missing arg converter:",e))}const h=function(t){return"string"==typeof t?e.scopedAllocCString(t):t?m(t):null};f.set("string",h).set("utf8",h).set("pointer",h),p.set("string",(t=>e.cstrToJs(t))).set("utf8",p.get("string")).set("string:dealloc",(t=>{try{return t?e.cstrToJs(t):null}finally{e.dealloc(t)}})).set("utf8:dealloc",p.get("string:dealloc")).set("json",(t=>JSON.parse(e.cstrToJs(t)))).set("json:dealloc",(t=>{try{return t?JSON.parse(e.cstrToJs(t)):null}finally{e.dealloc(t)}}));const g=class{constructor(e){this.name=e.name||"unnamed adapter"}convertArg(e,n,r){t("AbstractArgAdapter must be subclassed.")}};f.FuncPtrAdapter=class n extends g{constructor(e){super(e),f.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",e),this.name=e.name||"unnamed",this.signature=e.signature,e.contextKey instanceof Function&&(this.contextKey=e.contextKey,e.bindScope||(e.bindScope="context")),this.bindScope=e.bindScope||t("FuncPtrAdapter options requires a bindScope (explicit or implied)."),n.bindScopes.indexOf(e.bindScope)<0&&t("Invalid options.bindScope ("+e.bindMod+") for FuncPtrAdapter. Expecting one of: ("+n.bindScopes.join(", ")+")"),this.isTransient="transient"===this.bindScope,this.isContext="context"===this.bindScope,this.isPermanent="permanent"===this.bindScope,this.singleton="singleton"===this.bindScope?[]:void 0,this.callProxy=e.callProxy instanceof Function?e.callProxy:void 0}contextKey(e,t){return this}contextMap(e){const t=this.__cmap||(this.__cmap=new Map);let n=t.get(e);return void 0===n&&t.set(e,n=[]),n}convertArg(t,r,i){let a=this.singleton;if(!a&&this.isContext&&(a=this.contextMap(this.contextKey(r,i))),a&&a[0]===t)return a[1];if(t instanceof Function){this.callProxy&&(t=this.callProxy(t));const e=o(t,this.signature,this.isTransient);if(n.debugFuncInstall&&n.debugOut("FuncPtrAdapter installed",this,this.contextKey(r,i),"@"+e,t),a){if(a[1]){n.debugFuncInstall&&n.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(r,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}}a[0]=t,a[1]=e}return e}if(e.isPtr(t)||null==t){if(a&&a[1]&&a[1]!==t){n.debugFuncInstall&&n.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(r,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}a[0]=a[1]=0|t}return t||0}throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},f.FuncPtrAdapter.warnOnUse=!1,f.FuncPtrAdapter.debugFuncInstall=!1,f.FuncPtrAdapter.debugOut=console.debug.bind(console),f.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const b=e=>f.get(e)||t("Argument adapter not found:",e),y=e=>p.get(e)||t("Result adapter not found:",e);s.xWrap.convertArg=(e,...t)=>b(e)(...t),s.xWrap.convertArgNoCheck=(e,...t)=>f.get(e)(...t),s.xWrap.convertResult=(e,t)=>null===e?t:e?y(e)(t):void 0,s.xWrap.convertResultNoCheck=(e,t)=>null===e?t:e?p.get(e)(t):void 0,e.xWrap=function(n,r,...i){3===arguments.length&&Array.isArray(arguments[2])&&(i=arguments[2]),e.isPtr(n)&&(n=e.functionEntry(n)||t("Function pointer not found in WASM function table."));const o=n instanceof Function,a=o?n:e.xGet(n);if(o&&(n=a.name||"unnamed function"),i.length!==a.length&&d(n,a.length),null===r&&0===a.length)return a;null!=r&&y(r);for(const e of i)e instanceof g?f.set(e,((...t)=>e.convertArg(...t))):b(e);const l=s.xWrap;return 0===a.length?(...e)=>e.length?d(n,a.length):l.convertResult(r,a.call(null)):function(...t){t.length!==a.length&&d(n,a.length);const s=e.scopedAllocPush();try{for(const e in t)t[e]=l.convertArgNoCheck(i[e],t[e],t,e);return l.convertResultNoCheck(r,a.apply(null,t))}finally{e.scopedAllocPop(s)}}};const q=function(e,n,r,s,i,o){if("string"==typeof r){if(1===n)return o.get(r);if(2===n)return s?(s instanceof Function||t(i,"requires a function argument."),o.set(r,s),e):(o.get(r),e)}t("Invalid arguments to",i)};return e.xWrap.resultAdapter=function e(t,n){return q(e,arguments.length,t,n,"resultAdapter()",p)},e.xWrap.argAdapter=function e(t,n){return q(e,arguments.length,t,n,"argAdapter()",f)},e.xWrap.FuncPtrAdapter=f.FuncPtrAdapter,e.xCallWrapped=function(t,n,r,...s){return Array.isArray(arguments[3])&&(s=arguments[3]),e.xWrap(t,n,r||[]).apply(null,s||[])},e.xWrap.testConvertArg=s.xWrap.convertArg,e.xWrap.testConvertResult=s.xWrap.convertResult,e},globalThis.WhWasmUtilInstaller.yawl=function(e){const t=()=>fetch(e.uri,{credentials:"same-origin"}),n=this,r=function(t){if(e.wasmUtilTarget){const r=(...e)=>{throw new Error(e.join(" "))},s=e.wasmUtilTarget;if(s.module=t.module,s.instance=t.instance,s.instance.exports.memory||(s.memory=e.imports&&e.imports.env&&e.imports.env.memory||r("Missing 'memory' object!")),!s.alloc&&t.instance.exports.malloc){const e=t.instance.exports;s.alloc=function(t){return e.malloc(t)||r("Allocation of",t,"bytes failed.")},s.dealloc=function(t){e.free(t)}}n(s)}return e.onload&&e.onload(t,e),t};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(t(),e.imports||{}).then(r)}:function(){return t().then((e=>e.arrayBuffer())).then((t=>WebAssembly.instantiate(t,e.imports||{}))).then(r)}}.bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function e(t){const n=(...e)=>{throw new Error(e.join(" "))};t.heap instanceof WebAssembly.Memory||t.heap instanceof Function||n("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach((function(e){t[e]instanceof Function||n("Config option '"+e+"' must be a function.")}));const r=e,s=t.heap instanceof Function?t.heap:()=>new Uint8Array(t.heap.buffer),i=t.alloc,o=t.dealloc,a=t.log||console.log.bind(console),l=t.memberPrefix||"",c=t.memberSuffix||"",_=void 0===t.bigIntEnabled?!!globalThis.BigInt64Array:!!t.bigIntEnabled,u=globalThis.BigInt,d=globalThis.BigInt64Array,f=t.ptrSizeof||4,p=t.ptrIR||"i32";r.debugFlags||(r.__makeDebugFlags=function(e=null){e&&e.__flags&&(e=e.__flags);const t=function e(t){return 0===arguments.length?e.__flags:(t<0?(delete e.__flags.getter,delete e.__flags.setter,delete e.__flags.alloc,delete e.__flags.dealloc):(e.__flags.getter=!!(1&t),e.__flags.setter=!!(2&t),e.__flags.alloc=!!(4&t),e.__flags.dealloc=!!(8&t)),e._flags)};return Object.defineProperty(t,"__flags",{iterable:!1,writable:!1,value:Object.create(e)}),e||t(0),t},r.debugFlags=r.__makeDebugFlags());const m=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),h=e=>(e=>"("===e[1])(e)?"p":e[0],g=function(e){switch(h(e)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return p;case"j":return"i64";case"f":return"float";case"d":return"double"}n("Unhandled signature IR:",e)},b=d?()=>!0:()=>n("BigInt64Array is not available."),y=(e,t)=>e+"::"+t,q=new WeakMap,E="(pointer-is-external)",v=function(e,t,n){if(n||(n=q.get(t)),n){if(q.delete(t),Array.isArray(t.ondispose)){let r;for(;r=t.ondispose.shift();)try{r instanceof Function?r.call(t):r instanceof D?r.dispose():"number"==typeof r&&o(r)}catch(t){console.warn("ondispose() for",e.structName,"@",n,"threw. NOT propagating it.",t)}}else if(t.ondispose instanceof Function)try{t.ondispose()}catch(t){console.warn("ondispose() for",e.structName,"@",n,"threw. NOT propagating it.",t)}delete t.ondispose,e.debugFlags.__flags.dealloc&&a("debug.dealloc:",t[E]?"EXTERNAL":"",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+n),t[E]||o(n)}},w=e=>({configurable:!1,writable:!1,iterable:!1,value:e}),S=function(e,t,r){let o=!r;r?Object.defineProperty(t,E,w(r)):(r=i(e.structInfo.sizeof))||n("Allocation of",e.structName,"structure failed.");try{e.debugFlags.__flags.alloc&&a("debug.alloc:",o?"":"EXTERNAL",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+r),o&&s().fill(0,r,r+e.structInfo.sizeof),q.set(t,r)}catch(n){throw v(e,t,r),n}},A=w((e=>l+e+c)),x=function(e,t,r=!0){let s=e.members[t];if(!s&&(l||c)){for(const n of Object.values(e.members))if(n.key===t){s=n;break}!s&&r&&n(y(e.name,t),"is not a mapped struct member.")}return s},T=function e(t,n,r=!1){e._||(e._=e=>e.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const s=x(t.structInfo,n,!0);return r?e._(s.signature):s.signature},I={configurable:!1,enumerable:!1,get:function(){return q.get(this)},set:()=>n("Cannot assign the 'pointer' property of a struct.")},k=w((function(){const e=[];for(const t of Object.keys(this.structInfo.members))e.push(this.memberKey(t));return e})),F=new TextDecoder("utf-8"),O=new TextEncoder,P="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,L=function(e){"s"!==e.signature&&n("Invalid member type signature for C-string value:",JSON.stringify(e))},C=function(e,...t){e.ondispose?Array.isArray(e.ondispose)||(e.ondispose=[e.ondispose]):e.ondispose=[],e.ondispose.push(...t)},N=function(e){const t=O.encode(e),r=i(t.length+1);r||n("Allocation error while duplicating string:",e);const o=s();return o.set(t,r),o[r+t.length]=0,r},D=function(e,t){arguments[2]!==w&&n("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:w(e),structInfo:w(t)})};D.prototype=Object.create(null,{dispose:w((function(){v(this.constructor,this)})),lookupMember:w((function(e,t=!0){return x(this.structInfo,e,t)})),memberToJsString:w((function(e){return function(e,t){const n=x(e.structInfo,t,!0);L(n);const r=e[n.key];if(!r)return null;let i=r;const o=s();for(;0!==o[i];++i);return r===i?"":(a=o,l=r,c=i,F.decode(a.buffer instanceof P?a.slice(l,c):a.subarray(l,c)));var a,l,c}(this,e)})),memberIsString:w((function(e,t=!0){return function(e,t,n=!1){const r=x(e.structInfo,t,n);return!(!r||1!==r.signature.length||"s"!==r.signature[0])&&r}(this,e,t)})),memberKey:A,memberKeys:k,memberSignature:w((function(e,t=!1){return T(this,e,t)})),memoryDump:w((function(){const e=this.pointer;return e?new Uint8Array(s().slice(e,e+this.structInfo.sizeof)):null})),pointer:I,setMemberCString:w((function(e,t){return function(e,t,n){const r=x(e.structInfo,t,!0);L(r);const s=N(n);return e[r.key]=s,C(e,s),e}(this,e,t)}))}),Object.assign(D.prototype,{addOnDispose:function(...e){return C(this,...e),this}}),Object.defineProperties(D,{allocCString:w(N),isA:w((e=>e instanceof D)),hasExternalPointer:w((e=>e instanceof D&&!!e[E])),memberKey:A});const R=e=>Number.isFinite(e)||e instanceof(u||Number),M=function e(t,r,i){if(!e._){e._={getters:{},setters:{},sw:{}};const t=["i","c","C","p","P","s","f","d","v()"];_&&t.push("j"),t.forEach((function(t){e._.getters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"getInt32";case 8:return b()&&"getBigInt64"}break;case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return b()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}n("Unhandled DataView getter for signature:",e)}(t),e._.setters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"setInt32";case 8:return b()&&"setBigInt64"}break;case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return b()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}n("Unhandled DataView setter for signature:",e)}(t),e._.sw[t]=function(e){switch(h(e)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return b()&&u;case"p":case"P":case"s":switch(f){case 4:return Number;case 8:return b()&&u}}n("Unhandled DataView set wrapper for signature:",e)}(t)}));const r=/^[ipPsjfdcC]$/,s=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;e.sigCheck=function(e,t,i,o){Object.prototype.hasOwnProperty.call(e,i)&&n(e.structName,"already has a property named",i+"."),r.test(o)||s.test(o)||n("Malformed signature for",y(e.structName,t)+":",o)}}const o=t.memberKey(r);e.sigCheck(t.prototype,r,o,i.signature),i.key=o,i.name=r;const l=h(i.signature),c=y(t.prototype.structName,o),d=t.prototype.debugFlags.__flags,p=Object.create(null);var q,E;p.configurable=!1,p.enumerable=!1,p.get=function(){d.getter&&a("debug.getter:",e._.getters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof);let t=new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.getters[l]](0,m);return d.getter&&a("debug.getter:",c,"result =",t),t},i.readOnly?p.set=(q=t.prototype.structName,E=o,()=>n(y(q,E),"is read-only.")):p.set=function(t){if(d.setter&&a("debug.setter:",e._.setters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof,t),this.pointer||n("Cannot set struct property on disposed instance."),null===t)t=0;else for(;!R(t);){if("P"===i.signature&&t instanceof D){t=t.pointer||0,d.setter&&a("debug.setter:",c,"resolved to",t);break}n("Invalid value for pointer-type",c+".")}new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.setters[l]](0,e._.sw[l](t),m)},Object.defineProperty(t.prototype,o,p)},j=function e(t,s){1===arguments.length?t=(s=t).name:s.name||(s.name=t),t||n("Struct name is required.");let i=!1;Object.keys(s.members).forEach((e=>{const r=s.members[e];r.sizeof?1===r.sizeof?"c"===r.signature||"C"===r.signature||n("Unexpected sizeof==1 member",y(s.name,e),"with signature",r.signature):(0!=r.sizeof%4&&(console.warn("Invalid struct member description =",r,"from",s),n(t,"member",e,"sizeof is not aligned. sizeof="+r.sizeof)),0!=r.offset%4&&(console.warn("Invalid struct member description =",r,"from",s),n(t,"member",e,"offset is not aligned. offset="+r.offset))):n(t,"member",e,"is missing sizeof."),(!i||i.offsete instanceof a)),memberKey:A,memberKeys:k,methodInfoForKey:w((function(e){})),structInfo:w(s),structName:w(t)}),a.prototype=new D(t,s,w),Object.defineProperties(a.prototype,{debugFlags:o,constructor:w(a)}),Object.keys(s.members).forEach((e=>M(a,e,s.members[e]))),a};return j.StructType=D,j.config=t,j.allocCString=N,j.debugFlags||(j.debugFlags=r.__makeDebugFlags(r.debugFlags)),j},globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...e)=>{throw new Error(e.join(" "))},n=(e.SQLite3Error.toss,e.capi),r=e.wasm,s=e.util;if(globalThis.WhWasmUtilInstaller(r),delete globalThis.WhWasmUtilInstaller,r.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new r.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:e=>{let t;return(s,i,o,a)=>{try{const n=r.cArgvToJs(i,o);return t||(t=r.cArgvToJs(i,a)),0|e(n,t)}catch(e){return e.resultCode||n.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_codes","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_progress_handler",void 0,["sqlite3*","int",new r.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_set_authorizer","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(e,t)=>e[0],callProxy:e=>(t,s,i,o,a,l)=>{try{return i=i&&r.cstrToJs(i),o=o&&r.cstrToJs(o),a=a&&r.cstrToJs(a),l=l&&r.cstrToJs(l),e(t,s,i,o,a,l)||0}catch(e){return e.resultCode||n.SQLITE_ERROR}}}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*",new r.xWrap.FuncPtrAdapter({name:"xDestroyAuxData",signature:"v(*)",contextKey:(e,t)=>e[0]})]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_isexplain","int",["sqlite3_stmt*"]],["sqlite3_stmt_readonly","int",["sqlite3_stmt*"]],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new r.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],r.exports.sqlite3_activate_see instanceof Function&&r.bindingSignatures.push(["sqlite3_key","int","sqlite3*","string","int"],["sqlite3_key_v2","int","sqlite3*","string","*","int"],["sqlite3_rekey","int","sqlite3*","string","int"],["sqlite3_rekey_v2","int","sqlite3*","string","*","int"],["sqlite3_activate_see",void 0,"string"]),r.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:e=>e[0],callProxy:e=>(t,n,s,i,o,a,l)=>{e(t,n,s,r.cstrToJs(i),r.cstrToJs(o),a,l)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:e=>e[0],callProxy:e=>(t,n,s,i,o)=>{e(t,n,r.cstrToJs(s),r.cstrToJs(i),o)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]],r.bigIntEnabled&&r.exports.sqlite3changegroup_add){const e={signature:"i(ps)",callProxy:e=>(t,s)=>{try{return 0|e(t,r.cstrToJs(s))}catch(e){return e.resultCode||n.SQLITE_ERROR}}};r.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new r.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xFilter",...e,contextKey:(e,t)=>e[0]}),"*"]])}r.bindingSignatures.wasm=[["sqlite3_wasm_db_reset","int","sqlite3*"],["sqlite3_wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3_wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3_wasm_posix_create_file","int","string","*","int"],["sqlite3_wasm_vfs_unlink","int","sqlite3_vfs*","string"]],e.StructBinder=globalThis.Jaccwabyt({heap:r.heap8u,alloc:r.alloc,dealloc:r.dealloc,bigIntEnabled:r.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const i=r.xWrap.argAdapter("string");r.xWrap.argAdapter("string:flexible",(e=>i(s.flexibleString(e)))),r.xWrap.argAdapter("string:static",function(e){return r.isPtr(e)?e:this[e=""+e]||(this[e]=r.allocCString(e))}.bind(Object.create(null)));const o=r.xWrap.argAdapter("*"),a=function(){};r.xWrap.argAdapter("sqlite3_filename",o)("sqlite3_context*",o)("sqlite3_value*",o)("void*",o)("sqlite3_changegroup*",o)("sqlite3_changeset_iter*",o)("sqlite3_session*",o)("sqlite3_stmt*",(t=>o(t instanceof(e?.oo1?.Stmt||a)?t.pointer:t)))("sqlite3*",(t=>o(t instanceof(e?.oo1?.DB||a)?t.pointer:t)))("sqlite3_index_info*",(e=>o(e instanceof(n.sqlite3_index_info||a)?e.pointer:e)))("sqlite3_module*",(e=>o(e instanceof(n.sqlite3_module||a)?e.pointer:e)))("sqlite3_vfs*",(t=>"string"==typeof t?n.sqlite3_vfs_find(t)||e.SQLite3Error.toss(n.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",t):o(t instanceof(n.sqlite3_vfs||a)?t.pointer:t)));const l=r.xWrap.resultAdapter("*");r.xWrap.resultAdapter("sqlite3*",l)("sqlite3_context*",l)("sqlite3_stmt*",l)("sqlite3_value*",l)("sqlite3_vfs*",l)("void*",l),0===r.exports.sqlite3_step.length&&(r.xWrap.doArgcCheck=!1,e.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const e of r.bindingSignatures)n[e[0]]=r.xWrap.apply(null,e);for(const e of r.bindingSignatures.wasm)r[e[0]]=r.xWrap.apply(null,e);const c=function(e){return()=>t(e+"() is unavailable due to lack","of BigInt support in this build.")};for(const e of r.bindingSignatures.int64)n[e[0]]=r.bigIntEnabled?r.xWrap.apply(null,e):c(e[0]);if(delete r.bindingSignatures,r.exports.sqlite3_wasm_db_error){const t=r.xWrap("sqlite3_wasm_db_error","int","sqlite3*","int","string");s.sqlite3_wasm_db_error=function(r,s,i){return s instanceof e.WasmAllocError?(s=n.SQLITE_NOMEM,i=0):s instanceof Error&&(i=i||""+s,s=s.resultCode||n.SQLITE_ERROR),r?t(r,s,i):s}}else s.sqlite3_wasm_db_error=function(e,t,n){return console.warn("sqlite3_wasm_db_error() is not exported.",arguments),t}}{const i=r.xCall("sqlite3_wasm_enum_json");i||t("Maintenance required: increase sqlite3_wasm_enum_json()'s","static buffer size!"),r.ctype=JSON.parse(r.cstrToJs(i));const o=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];r.bigIntEnabled&&o.push("serialize","session","vtab");for(const e of o)for(const t of Object.entries(r.ctype[e]))n[t[0]]=t[1];r.functionEntry(n.SQLITE_WASM_DEALLOC)||t("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+n.SQLITE_WASM_DEALLOC+").");const a=Object.create(null);for(const e of["resultCodes"])for(const t of Object.entries(r.ctype[e]))a[t[1]]=t[0];n.sqlite3_js_rc_str=e=>a[e];const l=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!s.isUIThread(),sqlite3_index_info:!r.bigIntEnabled,sqlite3_index_constraint:!r.bigIntEnabled,sqlite3_index_orderby:!r.bigIntEnabled,sqlite3_index_constraint_usage:!r.bigIntEnabled});for(const t of r.ctype.structs)l[t.name]||(n[t.name]=e.StructBinder(t));if(n.sqlite3_index_info){for(const e of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])n.sqlite3_index_info[e]=n[e],delete n[e];n.sqlite3_vtab_config=r.xWrap("sqlite3_wasm_vtab_config","int",["sqlite3*","int","int"])}}const i=(e,t,r)=>s.sqlite3_wasm_db_error(e,n.SQLITE_MISUSE,t+"() requires "+r+" argument"+(1===r?"":"s")+"."),o=e=>s.sqlite3_wasm_db_error(e,n.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),a=e=>r.xWrap.argAdapter("sqlite3*")(e),l=e=>r.isPtr(e)?r.cstrToJs(e):e,c=function(e,t){e=a(e);let n=this.dbMap.get(e);return t?(!n&&t>0&&this.dbMap.set(e,n=Object.create(null)),n):(this.dbMap.delete(e),n)}.bind(Object.assign(Object.create(null),{dbMap:new Map}));c.addCollation=function(e,t){const n=c(e,1);n.collation||(n.collation=new Set),n.collation.add(l(t).toLowerCase())},c._addUDF=function(e,t,n,r){t=l(t).toLowerCase();let s=r.get(t);s||r.set(t,s=new Set),s.add(n<0?-1:n)},c.addFunction=function(e,t,n){const r=c(e,1);r.udf||(r.udf=new Map),this._addUDF(e,t,n,r.udf)},c.addWindowFunc=function(e,t,n){const r=c(e,1);r.wudf||(r.wudf=new Map),this._addUDF(e,t,n,r.wudf)},c.cleanup=function(e){const t=[e=a(e)];for(const e of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const s=r.exports[e];t.length=s.length;try{n[e](...t)}catch(n){console.warn("close-time call of",e+"(",t,") threw:",n)}}const s=c(e,0);if(!s)return;if(s.collation){for(const t of s.collation)try{n.sqlite3_create_collation_v2(e,t,n.SQLITE_UTF8,0,0,0)}catch(e){}delete s.collation}let i;for(i=0;i<2;++i){const t=i?s.wudf:s.udf;if(!t)continue;const r=i?n.sqlite3_create_window_function:n.sqlite3_create_function_v2;for(const s of t){const t=s[0],o=s[1],a=[e,t,0,n.SQLITE_UTF8,0,0,0,0,0];i&&a.push(0);for(const e of o)try{a[2]=e,r.apply(null,a)}catch(e){}o.clear()}t.clear()}delete s.udf,delete s.wudf};{const e=r.xWrap("sqlite3_close_v2","int","sqlite3*");n.sqlite3_close_v2=function(t){if(1!==arguments.length)return i(t,"sqlite3_close_v2",1);if(t)try{c.cleanup(t)}catch(e){}return e(t)}}if(n.sqlite3session_table_filter){const e=r.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);n.sqlite3session_delete=function(t){if(1!==arguments.length)return i(pDb,"sqlite3session_delete",1);t&&n.sqlite3session_table_filter(t,0,0),e(t)}}{const e=(e,t)=>"argv["+t+"]:"+e[0]+":"+r.cstrToJs(e[1]).toLowerCase(),t=r.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new r.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:e}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:e})]);n.sqlite3_create_collation_v2=function(e,r,a,l,_,u){if(6!==arguments.length)return i(e,"sqlite3_create_collation_v2",6);if(15&a){if(n.SQLITE_UTF8!==(15&a))return o(e)}else a|=n.SQLITE_UTF8;try{const n=t(e,r,a,l,_,u);return 0===n&&_ instanceof Function&&c.addCollation(e,r),n}catch(t){return s.sqlite3_wasm_db_error(e,t)}},n.sqlite3_create_collation=(e,t,r,s,o)=>5===arguments.length?n.sqlite3_create_collation_v2(e,t,r,s,o,0):i(e,"sqlite3_create_collation",5)}{const e=function(e,t){return e[0]+":"+(e[2]<0?-1:e[2])+":"+t+":"+r.cstrToJs(e[1]).toLowerCase()},t=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,r,s)=>{try{e(t,...n.sqlite3_values_to_js(r,s))}catch(e){n.sqlite3_result_error_js(t,e)}}},xFinalAndValue:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{n.sqlite3_result_js(t,e(t))}catch(e){n.sqlite3_result_error_js(t,e)}}},xFunc:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,r,s)=>{try{n.sqlite3_result_js(t,e(t,...n.sqlite3_values_to_js(r,s)))}catch(e){n.sqlite3_result_error_js(t,e)}}},xDestroy:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{e(t)}catch(e){console.error("UDF xDestroy method threw:",e)}}}}),a=r.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new r.xWrap.FuncPtrAdapter({name:"xFunc",...t.xFunc}),new r.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]),l=r.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new r.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xValue",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xInverse",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]);n.sqlite3_create_function_v2=function e(t,r,l,_,u,d,f,p,m){if(e.length!==arguments.length)return i(t,"sqlite3_create_function_v2",e.length);if(15&_){if(n.SQLITE_UTF8!==(15&_))return o(t)}else _|=n.SQLITE_UTF8;try{const e=a(t,r,l,_,u,d,f,p,m);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function)&&c.addFunction(t,r,l),e}catch(e){return console.error("sqlite3_create_function_v2() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},n.sqlite3_create_function=function e(t,r,s,o,a,l,c,_){return e.length===arguments.length?n.sqlite3_create_function_v2(t,r,s,o,a,l,c,_,0):i(t,"sqlite3_create_function",e.length)},n.sqlite3_create_window_function=function e(t,r,a,_,u,d,f,p,m,h){if(e.length!==arguments.length)return i(t,"sqlite3_create_window_function",e.length);if(15&_){if(n.SQLITE_UTF8!==(15&_))return o(t)}else _|=n.SQLITE_UTF8;try{const e=l(t,r,a,_,u,d,f,p,m,h);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function||h instanceof Function)&&c.addWindowFunc(t,r,a),e}catch(e){return console.error("sqlite3_create_window_function() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},n.sqlite3_create_function_v2.udfSetResult=n.sqlite3_create_function.udfSetResult=n.sqlite3_create_window_function.udfSetResult=n.sqlite3_result_js,n.sqlite3_create_function_v2.udfConvertArgs=n.sqlite3_create_function.udfConvertArgs=n.sqlite3_create_window_function.udfConvertArgs=n.sqlite3_values_to_js,n.sqlite3_create_function_v2.udfSetError=n.sqlite3_create_function.udfSetError=n.sqlite3_create_window_function.udfSetError=n.sqlite3_result_error_js}{const e=(e,t)=>("string"==typeof e?t=-1:s.isSQLableTypedArray(e)?(t=e.byteLength,e=s.typedArrayToString(e instanceof ArrayBuffer?new Uint8Array(e):e)):Array.isArray(e)&&(e=e.join(""),t=-1),[e,t]),t={basic:r.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:r.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};n.sqlite3_prepare_v3=function r(o,a,l,c,_,u){if(r.length!==arguments.length)return i(o,"sqlite3_prepare_v3",r.length);const[d,f]=e(a,l);switch(typeof d){case"string":return t.basic(o,d,f,c,_,null);case"number":return t.full(o,d,f,c,_,u);default:return s.sqlite3_wasm_db_error(o,n.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},n.sqlite3_prepare_v2=function e(t,r,s,o,a){return e.length===arguments.length?n.sqlite3_prepare_v3(t,r,s,0,o,a):i(t,"sqlite3_prepare_v2",e.length)}}{const e=r.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),t=r.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);n.sqlite3_bind_text=function t(o,a,l,c,_){if(t.length!==arguments.length)return i(n.sqlite3_db_handle(o),"sqlite3_bind_text",t.length);if(r.isPtr(l)||null===l)return e(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(pMem)&&(l=pMem.join(""));try{if(s.isSQLableTypedArray(l))u=r.allocFromTypedArray(l),d=l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),n.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");[u,d]=r.allocCString(l)}return e(o,a,u,d,n.SQLITE_WASM_DEALLOC)}catch(e){return r.dealloc(u),s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),e)}},n.sqlite3_bind_blob=function e(o,a,l,c,_){if(e.length!==arguments.length)return i(n.sqlite3_db_handle(o),"sqlite3_bind_blob",e.length);if(r.isPtr(l)||null===l)return t(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(l)&&(l=l.join(""));try{if(s.isBindableTypedArray(l))u=r.allocFromTypedArray(l),d=c>=0?c:l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),n.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");[u,d]=r.allocCString(l)}return t(o,a,u,d,n.SQLITE_WASM_DEALLOC)}catch(e){return r.dealloc(u),s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),e)}}}n.sqlite3_config=function(e,...t){if(arguments.length<2)return n.SQLITE_MISUSE;switch(e){case n.SQLITE_CONFIG_COVERING_INDEX_SCAN:case n.SQLITE_CONFIG_MEMSTATUS:case n.SQLITE_CONFIG_SMALL_MALLOC:case n.SQLITE_CONFIG_SORTERREF_SIZE:case n.SQLITE_CONFIG_STMTJRNL_SPILL:case n.SQLITE_CONFIG_URI:return r.exports.sqlite3_wasm_config_i(e,t[0]);case n.SQLITE_CONFIG_LOOKASIDE:return r.exports.sqlite3_wasm_config_ii(e,t[0],t[1]);case n.SQLITE_CONFIG_MEMDB_MAXSIZE:return r.exports.sqlite3_wasm_config_j(e,t[0]);case n.SQLITE_CONFIG_GETMALLOC:case n.SQLITE_CONFIG_GETMUTEX:case n.SQLITE_CONFIG_GETPCACHE2:case n.SQLITE_CONFIG_GETPCACHE:case n.SQLITE_CONFIG_HEAP:case n.SQLITE_CONFIG_LOG:case n.SQLITE_CONFIG_MALLOC:case n.SQLITE_CONFIG_MMAP_SIZE:case n.SQLITE_CONFIG_MULTITHREAD:case n.SQLITE_CONFIG_MUTEX:case n.SQLITE_CONFIG_PAGECACHE:case n.SQLITE_CONFIG_PCACHE2:case n.SQLITE_CONFIG_PCACHE:case n.SQLITE_CONFIG_PCACHE_HDRSZ:case n.SQLITE_CONFIG_PMASZ:case n.SQLITE_CONFIG_SERIALIZED:case n.SQLITE_CONFIG_SINGLETHREAD:case n.SQLITE_CONFIG_SQLLOG:case n.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return n.SQLITE_NOTFOUND}};{const e=new Set;n.sqlite3_auto_extension=function(t){if(t instanceof Function)t=r.installFunction("i(ppp)",t);else if(1!==arguments.length||!r.isPtr(t))return n.SQLITE_MISUSE;const s=r.exports.sqlite3_auto_extension(t);return t!==arguments[0]&&(0===s?e.add(t):r.uninstallFunction(t)),s},n.sqlite3_cancel_auto_extension=function(e){return e&&1===arguments.length&&r.isPtr(e)?r.exports.sqlite3_cancel_auto_extension(e):0},n.sqlite3_reset_auto_extension=function(){r.exports.sqlite3_reset_auto_extension();for(const t of e)r.uninstallFunction(t);e.clear()}}const _=n.sqlite3_vfs_find("kvvfs");if(_)if(s.isUIThread()){const e=new n.sqlite3_kvvfs_methods(r.exports.sqlite3_wasm_kvvfs_methods());delete n.sqlite3_kvvfs_methods;const t=r.exports.sqlite3_wasm_kvvfsMakeKeyOnPstack,s=r.pstack,i=e=>115===r.peek(e)?sessionStorage:localStorage,o={xRead:(e,n,o,a)=>{const l=s.pointer,c=r.scopedAllocPush();try{const s=t(e,n);if(!s)return-3;const l=r.cstrToJs(s),c=i(e).getItem(l);if(!c)return-1;const _=c.length;if(a<=0)return _;if(1===a)return r.poke(o,0),_;const u=r.scopedAllocCString(c);return a>_+1&&(a=_+1),r.heap8u().copyWithin(o,u,u+a-1),r.poke(o+a-1,0),a-1}catch(e){return console.error("kvstorageRead()",e),-2}finally{s.restore(l),r.scopedAllocPop(c)}},xWrite:(e,o,a)=>{const l=s.pointer;try{const n=t(e,o);if(!n)return 1;const s=r.cstrToJs(n);return i(e).setItem(s,r.cstrToJs(a)),0}catch(e){return console.error("kvstorageWrite()",e),n.SQLITE_IOERR}finally{s.restore(l)}},xDelete:(e,o)=>{const a=s.pointer;try{const n=t(e,o);return n?(i(e).removeItem(r.cstrToJs(n)),0):1}catch(e){return console.error("kvstorageDelete()",e),n.SQLITE_IOERR}finally{s.restore(a)}}};for(const t of Object.keys(o))e[e.memberKey(t)]=r.installFunction(e.memberSignature(t),o[t])}else n.sqlite3_vfs_unregister(_);r.xWrap.FuncPtrAdapter.warnOnUse=!0})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.version={libVersion:"3.44.2",libVersionNumber:3044002,sourceId:"2023-11-24 11:41:44 ebead0e7230cd33bcec9f95d2183069565b9e709bf745c9b5db65cc0cbf92c0f",downloadVersion:3440200}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...t)=>{throw new e.SQLite3Error(...t)},n=e.capi,r=e.wasm,s=e.util,i=new WeakMap,o=new WeakMap,a=(e,t,n)=>{const r=Object.getOwnPropertyDescriptor(e,t);return r?r.value:n},l=function(e,r){return r&&(e instanceof d&&(e=e.pointer),t(r,"sqlite3 result code",r+":",e?n.sqlite3_errmsg(e):n.sqlite3_errstr(r))),arguments[0]},c=r.installFunction("i(ippp)",function(e,t,s,i){n.SQLITE_TRACE_STMT===e&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+t+":",r.cstrToJs(i))}.bind({counter:0})),_=Object.create(null),u=function s(...a){if(!s._name2vfs){s._name2vfs=Object.create(null);const e="function"==typeof importScripts&&(e=>t("The VFS for",e,"is only available in the main window thread."));s._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:e||(()=>"local")},s._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:e||(()=>"session")}}const u=s.normalizeArgs(...a);let d=u.filename,f=u.vfs,p=u.flags;("string"!=typeof d&&"number"!=typeof d||"string"!=typeof p||f&&"string"!=typeof f&&"number"!=typeof f)&&(e.config.error("Invalid DB ctor args",u,arguments),t("Invalid arguments for DB constructor."));let m="number"==typeof d?r.cstrToJs(d):d;const h=s._name2vfs[m];h&&(f=h.vfs,d=m=h.filename(m));let g,b=0;p.indexOf("c")>=0&&(b|=n.SQLITE_OPEN_CREATE|n.SQLITE_OPEN_READWRITE),p.indexOf("w")>=0&&(b|=n.SQLITE_OPEN_READWRITE),0===b&&(b|=n.SQLITE_OPEN_READONLY),b|=n.SQLITE_OPEN_EXRESCODE;const y=r.pstack.pointer;try{const e=r.pstack.allocPtr();let t=n.sqlite3_open_v2(d,e,b,f||0);g=r.peekPtr(e),l(g,t),n.sqlite3_extended_result_codes(g,1),p.indexOf("t")>=0&&n.sqlite3_trace_v2(g,n.SQLITE_TRACE_STMT,c,g)}catch(e){throw g&&n.sqlite3_close_v2(g),e}finally{r.pstack.restore(y)}this.filename=m,i.set(this,g),o.set(this,Object.create(null));try{const r=n.sqlite3_js_db_vfs(g);r||t("Internal error: cannot get VFS for new db handle.");const s=_[r];s instanceof Function?s(this,e):s&&l(g,n.sqlite3_exec(g,s,0,0,0))}catch(e){throw this.close(),e}};u.setVfsPostOpenSql=function(e,t){_[e]=t},u.normalizeArgs=function(e=":memory:",t="c",n=null){const r={};return 1===arguments.length&&arguments[0]&&"object"==typeof arguments[0]?(Object.assign(r,arguments[0]),void 0===r.flags&&(r.flags="c"),void 0===r.vfs&&(r.vfs=null),void 0===r.filename&&(r.filename=":memory:")):(r.filename=e,r.flags=t,r.vfs=n),r};const d=function(...e){u.apply(this,e)};d.dbCtorHelper=u;const f={null:1,number:2,string:3,boolean:4,blob:5};f[void 0],f.null,r.bigIntEnabled&&(f.bigint=f.number);const p=function(){f!==arguments[2]&&t(n.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],i.set(this,arguments[1]),this.parameterCount=n.sqlite3_bind_parameter_count(this.pointer)},m=function(e){return e.pointer||t("DB has been closed."),e},h=function(e,n){return(n!==(0|n)||n<0||n>=e.columnCount)&&t("Column index",n,"is out of range."),e},g=(e,t,n,...r)=>{const s=e.prepare(t);try{const e=s.bind(n).step()?s.get(...r):void 0;return s.reset(),e}finally{s.finalize()}},b=(e,t,n,r)=>e.exec({sql:t,bind:n,rowMode:r,returnValue:"resultRows"});d.checkRc=(e,t)=>l(e,t),d.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return m(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch(e){}const e=this.pointer;if(Object.keys(o.get(this)).forEach(((e,t)=>{if(t&&t.pointer)try{t.finalize()}catch(e){}})),i.delete(this),o.delete(this),n.sqlite3_close_v2(e),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch(e){}delete this.filename}},changes:function(e=!1,t=!1){const r=m(this).pointer;return e?t?n.sqlite3_total_changes64(r):n.sqlite3_total_changes(r):t?n.sqlite3_changes64(r):n.sqlite3_changes(r)},dbFilename:function(e="main"){return n.sqlite3_db_filename(m(this).pointer,e)},dbName:function(e=0){return n.sqlite3_db_name(m(this).pointer,e)},dbVfsName:function(e=0){let t;const s=n.sqlite3_js_db_vfs(m(this).pointer,e);if(s){const e=new n.sqlite3_vfs(s);try{t=r.cstrToJs(e.$zName)}finally{e.dispose()}}return t},prepare:function(e){m(this);const s=r.pstack.pointer;let i,a;try{i=r.pstack.alloc(8),d.checkRc(this,n.sqlite3_prepare_v2(this.pointer,e,-1,i,null)),a=r.peekPtr(i)}finally{r.pstack.restore(s)}a||t("Cannot prepare empty SQL.");const l=new p(this,a,f);return o.get(this)[a]=l,l},exec:function(){m(this);const e=function(e,r){const i=Object.create(null);switch(i.opt=Object.create(null),r.length){case 1:"string"==typeof r[0]||s.isSQLableTypedArray(r[0])||Array.isArray(r[0])?i.sql=r[0]:r[0]&&"object"==typeof r[0]&&(i.opt=r[0],i.sql=i.opt.sql);break;case 2:i.sql=r[0],i.opt=r[1];break;default:t("Invalid argument count for exec().")}i.sql=s.flexibleString(i.sql),"string"!=typeof i.sql&&t("Missing SQL argument or unsupported SQL value type.");const o=i.opt;switch(o.returnValue){case"resultRows":o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows;break;case"saveSql":o.saveSql||(o.saveSql=[]),i.returnVal=()=>o.saveSql;break;case void 0:case"this":i.returnVal=()=>e;break;default:t("Invalid returnValue value:",o.returnValue)}if(o.callback||o.returnValue||void 0===o.rowMode||(o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows),o.callback||o.resultRows)switch(void 0===o.rowMode?"array":o.rowMode){case"object":i.cbArg=e=>e.get(Object.create(null));break;case"array":i.cbArg=e=>e.get([]);break;case"stmt":Array.isArray(o.resultRows)&&t("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),i.cbArg=e=>e;break;default:if(s.isInt32(o.rowMode)){i.cbArg=e=>e.get(o.rowMode);break}if("string"==typeof o.rowMode&&o.rowMode.length>1&&"$"===o.rowMode[0]){const e=o.rowMode.substr(1);i.cbArg=r=>{const s=r.get(Object.create(null))[e];return void 0===s?t(n.SQLITE_NOTFOUND,"exec(): unknown result column:",e):s};break}t("Invalid rowMode:",o.rowMode)}return i}(this,arguments);if(!e.sql)return t("exec() requires an SQL string.");const i=e.opt,o=i.callback,a=Array.isArray(i.resultRows)?i.resultRows:void 0;let l,c=i.bind,_=!!(e.cbArg||i.columnNames||a);const u=r.scopedAllocPush(),h=Array.isArray(i.saveSql)?i.saveSql:void 0;try{const t=s.isSQLableTypedArray(e.sql);let u=t?e.sql.byteLength:r.jstrlen(e.sql);const m=r.scopedAlloc(2*r.ptrSizeof+(u+1)),g=m+r.ptrSizeof;let b=g+r.ptrSizeof;const y=b+u;for(t?r.heap8().set(e.sql,b):r.jstrcpy(e.sql,r.heap8(),b,u,!1),r.poke(b+u,0);b&&r.peek(b,"i8");){r.pokePtr([m,g],0),d.checkRc(this,n.sqlite3_prepare_v3(this.pointer,b,u,0,m,g));const t=r.peekPtr(m);if(b=r.peekPtr(g),u=y-b,t){if(h&&h.push(n.sqlite3_sql(t).trim()),l=new p(this,t,f),c&&l.parameterCount&&(l.bind(c),c=null),_&&l.columnCount){let t=Array.isArray(i.columnNames)?0:1;if(_=!1,e.cbArg||a){for(;l.step();l._lockedByExec=!1){0==t++&&l.getColumnNames(i.columnNames),l._lockedByExec=!0;const n=e.cbArg(l);if(a&&a.push(n),o&&!1===o.call(i,n,l))break}l._lockedByExec=!1}0===t&&l.getColumnNames(i.columnNames)}else l.step();l.reset().finalize(),l=null}}}finally{r.scopedAllocPop(u),l&&(delete l._lockedByExec,l.finalize())}return e.returnVal()},createFunction:function(e,r,i){const o=e=>e instanceof Function;switch(arguments.length){case 1:e=(i=e).name,r=i.xFunc||0;break;case 2:o(r)||(r=(i=r).xFunc||0)}i||(i={}),"string"!=typeof e&&t("Invalid arguments: missing function name.");let l=i.xStep||0,c=i.xFinal||0;const _=i.xValue||0,u=i.xInverse||0;let f;o(r)?(f=!1,(o(l)||o(c))&&t("Ambiguous arguments: scalar or aggregate?"),l=c=null):o(l)?(o(c)||t("Missing xFinal() callback for aggregate or window UDF."),r=null):o(c)?t("Missing xStep() callback for aggregate or window UDF."):t("Missing function-type properties."),!1===f?(o(_)||o(u))&&t("xValue and xInverse are not permitted for non-window UDFs."):o(_)?(o(u)||t("xInverse must be provided if xValue is."),f=!0):o(u)&&t("xValue must be provided if xInverse is.");const p=i.pApp;null==p||"number"==typeof p&&s.isInt32(p)||t("Invalid value for pApp property. Must be a legal WASM pointer value.");const m=i.xDestroy||0;m&&!o(m)&&t("xDestroy property must be a function.");let h=0;a(i,"deterministic")&&(h|=n.SQLITE_DETERMINISTIC),a(i,"directOnly")&&(h|=n.SQLITE_DIRECTONLY),a(i,"innocuous")&&(h|=n.SQLITE_INNOCUOUS),e=e.toLowerCase();const g=r||l,b=a(i,"arity"),y="number"==typeof b?b:g.length?g.length-1:0;let q;return q=f?n.sqlite3_create_window_function(this.pointer,e,y,n.SQLITE_UTF8|h,p||0,l,c,_,u,m):n.sqlite3_create_function_v2(this.pointer,e,y,n.SQLITE_UTF8|h,p||0,r,l,c,m),d.checkRc(this,q),this},selectValue:function(e,t,n){return g(this,e,t,0,n)},selectValues:function(e,t,n){const r=this.prepare(e),s=[];try{for(r.bind(t);r.step();)s.push(r.get(0,n));r.reset()}finally{r.finalize()}return s},selectArray:function(e,t){return g(this,e,t,[])},selectObject:function(e,t){return g(this,e,t,{})},selectArrays:function(e,t){return b(this,e,t,"array")},selectObjects:function(e,t){return b(this,e,t,"object")},openStatementCount:function(){return this.pointer?Object.keys(o.get(this)).length:0},transaction:function(e){let r="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&t(n.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),r+=" "+arguments[0],e=arguments[1]),m(this).exec(r);try{const t=e(this);return this.exec("COMMIT"),t}catch(e){throw this.exec("ROLLBACK"),e}},savepoint:function(e){m(this).exec("SAVEPOINT oo1");try{const t=e(this);return this.exec("RELEASE oo1"),t}catch(e){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),e}},checkRc:function(e){return l(this,e)}};const y=function(e){return e.pointer||t("Stmt has been closed."),e},q=function(e){return function(e){let t=f[null==e?"null":typeof e];switch(t){case f.boolean:case f.null:case f.number:case f.string:return t;case f.bigint:if(r.bigIntEnabled)return t;default:return s.isBindableTypedArray(e)?f.blob:void 0}}(e)||t("Unsupported bind() argument type:",typeof e)},E=function(e,n){return e._lockedByExec&&t("Operation is illegal when statement is locked:",n),e},v=function i(o,a,l,c){E(y(o),"bind()"),i._||(i._tooBigInt=e=>t("BigInt value is too big to store without precision loss:",e),i._={string:function(e,t,s,i){const[o,a]=r.allocCString(s,!0);return(i?n.sqlite3_bind_blob:n.sqlite3_bind_text)(e.pointer,t,o,a,n.SQLITE_WASM_DEALLOC)}}),q(c),a=function(e,r){const i="number"==typeof r?r:n.sqlite3_bind_parameter_index(e.pointer,r);return 0!==i&&s.isInt32(i)?(i<1||i>e.parameterCount)&&t("Bind index",r,"is out of range."):t("Invalid bind() parameter name: "+r),i}(o,a);let _=0;switch(null==c?f.null:l){case f.null:_=n.sqlite3_bind_null(o.pointer,a);break;case f.string:_=i._.string(o,a,c,!1);break;case f.number:{let e;s.isInt32(c)?e=n.sqlite3_bind_int:"bigint"==typeof c?s.bigIntFits64(c)?r.bigIntEnabled?e=n.sqlite3_bind_int64:s.bigIntFitsDouble(c)?(c=Number(c),e=n.sqlite3_bind_double):i._tooBigInt(c):i._tooBigInt(c):(c=Number(c),e=r.bigIntEnabled&&Number.isInteger(c)?n.sqlite3_bind_int64:n.sqlite3_bind_double),_=e(o.pointer,a,c);break}case f.boolean:_=n.sqlite3_bind_int(o.pointer,a,c?1:0);break;case f.blob:{if("string"==typeof c){_=i._.string(o,a,c,!0);break}c instanceof ArrayBuffer?c=new Uint8Array(c):s.isBindableTypedArray(c)||t("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const e=r.alloc(c.byteLength||1);r.heap8().set(c.byteLength?c:[0],e),_=n.sqlite3_bind_blob(o.pointer,a,e,c.byteLength,n.SQLITE_WASM_DEALLOC);break}default:e.config.warn("Unsupported bind() argument type:",c),t("Unsupported bind() argument type: "+typeof c)}return _&&d.checkRc(o.db.pointer,_),o._mayGet=!1,o};p.prototype={finalize:function(){if(this.pointer){E(this,"finalize()");const e=n.sqlite3_finalize(this.pointer);return delete o.get(this.db)[this.pointer],i.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,e}},clearBindings:function(){return E(y(this),"clearBindings()"),n.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(e){E(this,"reset()"),e&&this.clearBindings();const t=n.sqlite3_reset(y(this).pointer);return this._mayGet=!1,l(this.db,t),this},bind:function(){let e,n;switch(y(this),arguments.length){case 1:e=1,n=arguments[0];break;case 2:e=arguments[0],n=arguments[1];break;default:t("Invalid bind() arguments.")}return void 0===n?this:(this.parameterCount||t("This statement has no bindable parameters."),this._mayGet=!1,null===n?v(this,e,f.null,n):Array.isArray(n)?(1!==arguments.length&&t("When binding an array, an index argument is not permitted."),n.forEach(((e,t)=>v(this,t+1,q(e),e))),this):(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),"object"!=typeof n||s.isBindableTypedArray(n)?v(this,e,q(n),n):(1!==arguments.length&&t("When binding an object, an index argument is not permitted."),Object.keys(n).forEach((e=>v(this,e,q(n[e]),n[e]))),this)))},bindAsBlob:function(e,n){y(this),1===arguments.length&&(n=e,e=1);const r=q(n);return f.string!==r&&f.blob!==r&&f.null!==r&&t("Invalid value type for bindAsBlob()"),v(this,e,f.blob,n)},step:function(){E(this,"step()");const t=n.sqlite3_step(y(this).pointer);switch(t){case n.SQLITE_DONE:return this._mayGet=!1;case n.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,e.config.warn("sqlite3_step() rc=",t,n.sqlite3_js_rc_str(t),"SQL =",n.sqlite3_sql(this.pointer)),d.checkRc(this.db.pointer,t)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const e=this.step();return this.reset(),e}finally{try{this.finalize()}catch(e){}}},get:function(e,i){if(y(this)._mayGet||t("Stmt.step() has not (recently) returned true."),Array.isArray(e)){let t=0;const n=this.columnCount;for(;t=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t).valueOf():t}{const r=n.sqlite3_column_double(this.pointer,e);return(r>Number.MAX_SAFE_INTEGER||rt("The pointer property is read-only.")};Object.defineProperty(p.prototype,"pointer",e),Object.defineProperty(d.prototype,"pointer",e)}if(Object.defineProperty(p.prototype,"columnCount",{enumerable:!1,get:function(){return n.sqlite3_column_count(this.pointer)},set:()=>t("The columnCount property is read-only.")}),e.oo1={DB:d,Stmt:p},s.isUIThread()){e.oo1.JsStorageDb=function(e="session"){"session"!==e&&"local"!==e&&t("JsStorageDb db name must be one of 'session' or 'local'."),u.call(this,{filename:e,flags:"c",vfs:"kvvfs"})};const r=e.oo1.JsStorageDb;r.prototype=Object.create(d.prototype),r.clearStorage=n.sqlite3_js_kvvfs_clear,r.prototype.clearStorage=function(){return r.clearStorage(m(this).filename)},r.storageSize=n.sqlite3_js_kvvfs_size,r.prototype.storageSize=function(){return r.storageSize(m(this).filename)}}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.initWorker1API=function(){const e=(...e)=>{throw new Error(e.join(" "))};globalThis.WorkerGlobalScope instanceof Function||e("initWorker1API() must be run from a Worker thread.");const t=this.sqlite3||e("Missing this.sqlite3 object."),n=t.oo1.DB,r=function(e){let t=s.idMap.get(e);return t||(t="db#"+ ++s.idSeq+"@"+e.pointer,s.idMap.set(e,t),t)},s={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(e){const t=new n(e);return this.dbs[r(t)]=t,this.dbList.indexOf(t)<0&&this.dbList.push(t),t},close:function(e,n){if(e){delete this.dbs[r(e)];const s=e.filename,i=t.wasm.sqlite3_wasm_db_vfs(e.pointer,0);e.close();const o=this.dbList.indexOf(e);o>=0&&this.dbList.splice(o,1),n&&s&&i&&t.wasm.sqlite3_wasm_vfs_unlink(i,s)}},post:function(e,t){t&&t.length?(globalThis.postMessage(e,Array.from(t)),t.length=0):globalThis.postMessage(e)},dbs:Object.create(null),getDb:function(t,n=!0){return this.dbs[t]||(n?e("Unknown (or closed) DB ID:",t):void 0)}},i=function(t,n=!0){const r=s.getDb(t.dbId,!1)||s.dbList[0];return n?function(t=s.dbList[0]){return t&&t.pointer?t:e("DB is not opened.")}(r):r},o={open:function(n){const i=Object.create(null),o=n.args||Object.create(null);o.simulateError&&e("Throwing because of simulateError flag.");const a=Object.create(null);let l,c;var _;if(i.vfs=o.vfs,""===(_=o.filename)||":"===_[0]?i.filename=o.filename||"":(i.filename=o.filename,l=o.byteArray,l&&(c=function(e){const n=/^file:.+(vfs=(\w+))/.exec(e);return t.capi.sqlite3_vfs_find(n?n[2]:0)}(o.filename))),c){let e;try{e=t.wasm.allocFromTypedArray(l);const n=t.wasm.sqlite3_wasm_vfs_create_file(c,i.filename,e,l.byteLength);n&&t.SQLite3Error.toss(n)}catch(e){throw new t.SQLite3Error(e.name+" creating "+o.filename+": "+e.message,{cause:e})}finally{e&&t.wasm.dealloc(e)}}const u=s.open(i);return a.filename=u.filename,a.persistent=!!t.capi.sqlite3_js_db_uses_vfs(u.pointer,"opfs"),a.dbId=r(u),a.vfs=u.dbVfsName(),a},close:function(e){const t=i(e,!1),n={filename:t&&t.filename};if(t){const n=!(!e.args||"object"!=typeof e.args||!e.args.unlink);s.close(t,n)}return n},exec:function(t){const n="string"==typeof t.args?{sql:t.args}:t.args||Object.create(null);"stmt"===n.rowMode?e("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):n.sql||e("'exec' requires input SQL.");const r=i(t);(n.callback||Array.isArray(n.resultRows))&&(r._blobXfer=s.xfer);const o=n.callback;let a=0;const l=!!n.columnNames;"string"==typeof o&&(l||(n.columnNames=[]),n.callback=function(e,t){s.post({type:o,columnNames:n.columnNames,rowNumber:++a,row:e},s.xfer)});try{const e=n.countChanges?r.changes(!0,64===n.countChanges):void 0;r.exec(n),void 0!==e&&(n.changeCount=r.changes(!0,64===n.countChanges)-e),n.callback instanceof Function&&(n.callback=o,s.post({type:o,columnNames:n.columnNames,rowNumber:null,row:void 0}))}finally{delete r._blobXfer,n.callback&&(n.callback=o)}return n},"config-get":function(){const e=Object.create(null),n=t.config;return["bigIntEnabled"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)&&(e[t]=n[t])})),e.version=t.version,e.vfsList=t.capi.sqlite3_js_vfs_list(),e.opfsEnabled=!!t.opfs,e},export:function(e){const n=i(e),r={byteArray:t.capi.sqlite3_js_db_export(n.pointer),filename:n.filename,mimetype:"application/x-sqlite3"};return s.xfer.push(r.byteArray.buffer),r},toss:function(t){e("Testing worker exception")},"opfs-tree":async function(n){return t.opfs||e("OPFS support is unavailable."),await t.opfs.treeList()}};globalThis.onmessage=async function(t){let n,i=(t=t.data).dbId,a=t.type;const l=performance.now();try{o.hasOwnProperty(a)&&o[a]instanceof Function?n=await o[a](t):e("Unknown db worker message type:",t.type)}catch(e){a="error",n={operation:t.type,message:e.message,errorClass:e.name,input:t},e.stack&&(n.stack="string"==typeof e.stack?e.stack.split(/\n\s*/):e.stack)}i||(i=n.dbId||s.dbList[0]&&r(s.dbList[0])),s.post({type:a,dbId:i,messageId:t.messageId,workerReceivedTime:l,workerRespondTime:performance.now(),departureTime:t.departureTime,result:n},s.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}.bind({sqlite3:e})})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.wasm,n=e.capi,r=e.util.toss3,s=Object.create(null),i=Object.create(null),o=e.StructBinder;e.vfs=s,e.vtab=i;const a=n.sqlite3_index_info;a.prototype.nthConstraint=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const n=this.$aConstraint+a.sqlite3_index_constraint.structInfo.sizeof*e;return t?n:new a.sqlite3_index_constraint(n)},a.prototype.nthConstraintUsage=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const n=this.$aConstraintUsage+a.sqlite3_index_constraint_usage.structInfo.sizeof*e;return t?n:new a.sqlite3_index_constraint_usage(n)},a.prototype.nthOrderBy=function(e,t=!1){if(e<0||e>=this.$nOrderBy)return!1;const n=this.$aOrderBy+a.sqlite3_index_orderby.structInfo.sizeof*e;return t?n:new a.sqlite3_index_orderby(n)};const l=function e(n,s,i,a=e.installMethodArgcCheck){if(n instanceof o.StructType?i instanceof Function||t.isPtr(i)||r("Usage errror: expecting a Function or WASM pointer to one."):r("Usage error: target object is-not-a StructType."),1===arguments.length)return(t,r)=>e(n,t,r,a);e.argcProxy||(e.argcProxy=function(e,t,n,s){return function(...i){return n.length!==arguments.length&&r("Argument mismatch for",e.structInfo.name+"::"+t+": Native signature is:",s),n.apply(this,i)}},e.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach(((e,n)=>{if("number"==typeof e)try{t.uninstallFunction(e)}catch(e){}})),delete this.ondispose.__removeFuncList)});const l=n.memberSignature(s);l.length<2&&r("Member",s,"does not have a function pointer signature:",l);const c=n.memberKey(s),_=a&&!t.isPtr(i)?e.argcProxy(n,c,i,l):i;if(t.isPtr(_))_&&!t.functionEntry(_)&&r("Pointer",_,"is not a WASM function table entry."),n[c]=_;else{const r=t.installFunction(_,n.memberSignature(s,!0));n[c]=r,n.ondispose&&n.ondispose.__removeFuncList||(n.addOnDispose("ondispose.__removeFuncList handler",e.removeFuncList),n.ondispose.__removeFuncList=[]),n.ondispose.__removeFuncList.push(c,r)}return(t,r)=>e(n,t,r,a)};l.installMethodArgcCheck=!1;const c=function(e,t,n=l.installMethodArgcCheck){const r=new Map;for(const s of Object.keys(t)){const i=t[s],o=r.get(i);if(o){const t=e.memberKey(s);e[t]=e[e.memberKey(o)]}else l(e,s,i,n),r.set(i,s)}return e};o.StructType.prototype.installMethod=function(e,t,n=l.installMethodArgcCheck){return arguments.length<3&&e&&"object"==typeof e?c(this,...arguments):l(this,...arguments)},o.StructType.prototype.installMethods=function(e,t=l.installMethodArgcCheck){return c(this,e,t)},n.sqlite3_vfs.prototype.registerVfs=function(t=!1){this instanceof e.capi.sqlite3_vfs||r("Expecting a sqlite3_vfs-type argument.");const s=n.sqlite3_vfs_register(this,t?1:0);return s&&r("sqlite3_vfs_register(",this,") failed with rc",s),this.pointer!==n.sqlite3_vfs_find(this.$zName)&&r("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},s.installVfs=function(e){let n=0;const s=["io","vfs"];for(const r of s){const s=e[r];s&&(++n,c(s.struct,s.methods,!!s.applyArgcCheck),"vfs"===r&&(s.struct.$zName||"string"!=typeof s.name||s.struct.addOnDispose(s.struct.$zName=t.allocCString(s.name)),s.struct.registerVfs(!!s.asDefault)))}return n||r("Misuse: installVfs() options object requires at least","one of:",s),this};const _=function(n,r){const s=function(n,r){return function(s,i=!1){if(0===arguments.length&&(s=new r),s instanceof r)return this.set(s.pointer,s),s;t.isPtr(s)||e.SQLite3Error.toss("Invalid argument to",n+"()");let o=this.get(s);return i&&this.delete(s),o}.bind(new Map)}(n,r);return Object.assign(Object.create(null),{StructType:r,create:e=>{const n=s();return t.pokePtr(e,n.pointer),n},get:e=>s(e),unget:e=>s(e,!0),dispose:e=>{const t=s(e,!0);t&&t.dispose()}})};i.xVtab=_("xVtab",n.sqlite3_vtab),i.xCursor=_("xCursor",n.sqlite3_vtab_cursor),i.xIndexInfo=e=>new n.sqlite3_index_info(e),i.xError=function t(r,s,i){if(t.errorReporter instanceof Function)try{t.errorReporter("sqlite3_module::"+r+"(): "+s.message)}catch(e){}let o;return s instanceof e.WasmAllocError?o=n.SQLITE_NOMEM:arguments.length>2?o=i:s instanceof e.SQLite3Error&&(o=s.resultCode),o||n.SQLITE_ERROR},i.xError.errorReporter=console.error.bind(console),i.xRowid=(e,n)=>t.poke(e,n,"i64"),i.setupModule=function(s){let o=!1;const a=this instanceof n.sqlite3_module?this:s.struct||(o=new n.sqlite3_module);try{const n=s.methods||r("Missing 'methods' object.");for(const e of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const t=e[0],r=e[1];!0===n[t]?n[t]=n[r]:!0===n[r]&&(n[r]=n[t])}if(s.catchExceptions){const r=function(n,r){return["xConnect","xCreate"].indexOf(n)>=0?function(s,o,a,l,c,_){try{return r(...arguments)||0}catch(r){return r instanceof e.WasmAllocError||(t.dealloc(t.peekPtr(_)),t.pokePtr(_,t.allocCString(r.message))),i.xError(n,r)}}:function(...e){try{return r(...e)||0}catch(e){return i.xError(n,e)}}},s=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],o=Object.create(null);for(const e of s){const t=n[e];t instanceof Function&&("xConnect"===e&&n.xCreate===t?o[e]=n.xCreate:"xCreate"===e&&n.xConnect===t?o[e]=n.xConnect:o[e]=r(e,t))}c(a,o,!1)}else c(a,n,!!s.applyArgcCheck);if(0===a.$iVersion){let e;e="number"==typeof s.iVersion?s.iVersion:a.$xShadowName?3:a.$xSavePoint||a.$xRelease||a.$xRollbackTo?2:1,a.$iVersion=e}}catch(e){throw o&&o.dispose(),e}return a},n.sqlite3_module.prototype.setupModule=function(e){return i.setupModule.call(this,e)}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=function t(r){if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if("undefined"==typeof WorkerGlobalScope)return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!(globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&navigator?.storage?.getDirectory))return Promise.reject(new Error("Missing required OPFS APIs."));r&&"object"==typeof r||(r=Object.create(null));const s=new URL(globalThis.location.href).searchParams;if(s.has("opfs-disable"))return Promise.resolve(e);void 0===r.verbose&&(r.verbose=s.has("opfs-verbose")?+s.get("opfs-verbose")||2:1),void 0===r.sanityChecks&&(r.sanityChecks=s.has("opfs-sanity-check")),void 0===r.proxyUri&&(r.proxyUri=t.defaultProxyUri),"function"==typeof r.proxyUri&&(r.proxyUri=r.proxyUri());const i=new Promise((function(t,s){const i=[e.config.error,e.config.warn,e.config.log],o=(e,...t)=>{r.verbose>e&&i[e]("OPFS syncer:",...t)},a=(...e)=>o(2,...e),l=(...e)=>o(1,...e),c=(...e)=>o(0,...e),_=e.util.toss,u=e.capi,d=e.util,f=e.wasm,p=u.sqlite3_vfs,m=u.sqlite3_file,h=u.sqlite3_io_methods,g=Object.create(null);g.metrics={dump:function(){let t,n=0,r=0,s=0;for(t in x.opIds){const e=T[t];n+=e.count,r+=e.time,s+=e.wait,e.avgTime=e.count&&e.time?e.time/e.count:0,e.avgWait=e.count&&e.wait?e.wait/e.count:0}e.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",T,"\nTotal of",n,"op(s) for",r,"ms (incl. "+s+" ms of waiting on the async side)"),e.config.log("Serialization metrics:",T.s11n),w.postMessage({type:"opfs-async-metrics"})},reset:function(){let e;for(e in x.opIds)(t=T[e]=Object.create(null)).count=t.time=t.wait=0;var t;let n=T.s11n=Object.create(null);n=n.serialize=Object.create(null),n.count=n.time=0,n=T.s11n.deserialize=Object.create(null),n.count=n.time=0}};const b=new h,y=(new p).addOnDispose((()=>b.dispose()));let q;const E=e=>(q=!0,y.dispose(),s(e)),v=()=>(q=!1,t(e)),w=new Worker(new URL(n.p+n.u(892),n.b));setTimeout((()=>{void 0===q&&E(new Error("Timeout while waiting for OPFS async proxy worker."))}),4e3),w._originalOnError=w.onerror,w.onerror=function(e){c("Error initializing OPFS asyncer:",e),E(new Error("Loading OPFS async Worker failed for unknown reasons."))};const S=u.sqlite3_vfs_find(null),A=S?new p(S):null;b.$iVersion=1,y.$iVersion=2,y.$szOsFile=u.sqlite3_file.structInfo.sizeof,y.$mxPathname=1024,y.$zName=f.allocCString("opfs"),y.$xDlOpen=y.$xDlError=y.$xDlSym=y.$xDlClose=null,y.addOnDispose("$zName",y.$zName,"cleanup default VFS wrapper",(()=>A?A.dispose():null));const x=Object.create(null);x.verbose=r.verbose,x.littleEndian=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]})(),x.asyncIdleWaitTime=150,x.asyncS11nExceptions=1,x.fileBufferSize=65536,x.sabS11nOffset=x.fileBufferSize,x.sabS11nSize=2*y.$mxPathname,x.sabIO=new SharedArrayBuffer(x.fileBufferSize+x.sabS11nSize),x.opIds=Object.create(null);const T=Object.create(null);{let e=0;x.opIds.whichOp=e++,x.opIds.rc=e++,x.opIds.xAccess=e++,x.opIds.xClose=e++,x.opIds.xDelete=e++,x.opIds.xDeleteNoWait=e++,x.opIds.xFileSize=e++,x.opIds.xLock=e++,x.opIds.xOpen=e++,x.opIds.xRead=e++,x.opIds.xSleep=e++,x.opIds.xSync=e++,x.opIds.xTruncate=e++,x.opIds.xUnlock=e++,x.opIds.xWrite=e++,x.opIds.mkdir=e++,x.opIds["opfs-async-metrics"]=e++,x.opIds["opfs-async-shutdown"]=e++,x.opIds.retry=e++,x.sabOP=new SharedArrayBuffer(4*e),g.metrics.reset()}x.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_PENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach((e=>{void 0===(x.sq3Codes[e]=u[e])&&_("Maintenance required: not found:",e)})),x.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,defaultUnlockAsap:!1});const I=(e,...t)=>{const n=x.opIds[e]||_("Invalid op ID:",e);x.s11n.serialize(...t),Atomics.store(x.sabOPView,x.opIds.rc,-1),Atomics.store(x.sabOPView,x.opIds.whichOp,n),Atomics.notify(x.sabOPView,x.opIds.whichOp);const r=performance.now();Atomics.wait(x.sabOPView,x.opIds.rc,-1);const s=Atomics.load(x.sabOPView,x.opIds.rc);if(T[e].wait+=performance.now()-r,s&&x.asyncS11nExceptions){const t=x.s11n.deserialize();t&&c(e+"() async error:",...t)}return s};g.debug={asyncShutdown:()=>{l("Shutting down OPFS async listener. The OPFS VFS will no longer work."),I("opfs-async-shutdown")},asyncRestart:()=>{l("Attempting to restart OPFS VFS async listener. Might work, might not."),w.postMessage({type:"opfs-async-restart"})}};const k=function e(t=16){e._chars||(e._n=(e._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789").length);const n=[];let r=0;for(;r{O.start=performance.now(),O.op=e,++T[e].count},L=()=>T[O.op].time+=performance.now()-O.start,C={xCheckReservedLock:function(e,t){const n=F[e];return f.poke(t,n.lockType?1:0,"i32"),0},xClose:function(e){P("xClose");let t=0;const n=F[e];return n&&(delete F[e],t=I("xClose",e),n.sq3File&&n.sq3File.dispose()),L(),t},xDeviceCharacteristics:function(e){return u.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,n){return u.SQLITE_NOTFOUND},xFileSize:function(e,t){P("xFileSize");let n=I("xFileSize",e);if(0==n)try{const e=x.s11n.deserialize()[0];f.poke(t,e,"i64")}catch(e){c("Unexpected error reading xFileSize() result:",e),n=x.sq3Codes.SQLITE_IOERR}return L(),n},xLock:function(e,t){P("xLock");const n=F[e];let r=0;return n.lockType?n.lockType=t:(r=I("xLock",e,t),0===r&&(n.lockType=t)),L(),r},xRead:function(e,t,n,r){P("xRead");const s=F[e];let i;try{i=I("xRead",e,n,Number(r)),0!==i&&u.SQLITE_IOERR_SHORT_READ!==i||f.heap8u().set(s.sabView.subarray(0,n),t)}catch(e){c("xRead(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_READ}return L(),i},xSync:function(e,t){P("xSync"),++T.xSync.count;const n=I("xSync",e,t);return L(),n},xTruncate:function(e,t){P("xTruncate");const n=I("xTruncate",e,Number(t));return L(),n},xUnlock:function(e,t){P("xUnlock");const n=F[e];let r=0;return u.SQLITE_LOCK_NONE===t&&n.lockType&&(r=I("xUnlock",e,t)),0===r&&(n.lockType=t),L(),r},xWrite:function(e,t,n,r){P("xWrite");const s=F[e];let i;try{s.sabView.set(f.heap8u().subarray(t,t+n)),i=I("xWrite",e,n,Number(r))}catch(e){c("xWrite(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_WRITE}return L(),i}},N={xAccess:function(e,t,n,r){P("xAccess");const s=I("xAccess",f.cstrToJs(t));return f.poke(r,s?0:1,"i32"),L(),0},xCurrentTime:function(e,t){return f.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return f.poke(t,21086676e7+(new Date).getTime(),"i64"),0},xDelete:function(e,t,n){P("xDelete");const r=I("xDelete",f.cstrToJs(t),n,!1);return L(),r},xFullPathname:function(e,t,n,r){return f.cstrncpy(r,t,n)!!e)):n},g.getDirForFilename=async function(e,t=!1){const n=g.getResolvedPath(e,!0),r=n.pop();let s=g.rootDirectory;for(const e of n)e&&(s=await s.getDirectoryHandle(e,{create:!!t}));return[s,r]},g.mkdir=async function(e){try{return await g.getDirForFilename(e+"/filepart",!0),!0}catch(e){return!1}},g.entryExists=async function(e){try{const[t,n]=await g.getDirForFilename(e);return await t.getFileHandle(n),!0}catch(e){return!1}},g.randomFilename=k,g.registerVfs=(e=!1)=>f.exports.sqlite3_vfs_register(y.pointer,e?1:0),g.treeList=async function(){const e=Object.create(null);return await async function e(t,n){n.name=t.name,n.dirs=[],n.files=[];for await(const r of t.values())if("directory"===r.kind){const t=Object.create(null);n.dirs.push(t),await e(r,t)}else n.files.push(r.name)}(g.rootDirectory,e),e},g.rmfr=async function(){const e=g.rootDirectory,t={recurse:!0};for await(const n of e.values())e.removeEntry(n.name,t)},g.unlink=async function(e,t=!1,n=!1){try{const[n,r]=await g.getDirForFilename(e,!1);return await n.removeEntry(r,{recursive:t}),!0}catch(e){if(n)throw new Error("unlink(",arguments[0],") failed: "+e.message,{cause:e});return!1}},g.traverse=async function(e){const t={recursive:!0,directory:g.rootDirectory};"function"==typeof e&&(e={callback:e}),async function t(n,r){for await(const s of n.values()){if(!1===e.callback(s,n,r))return!1;if(e.recursive&&"directory"===s.kind&&!1===await t(s,r+1))break}}((e=Object.assign(t,e||{})).directory,0)},g.importDb=async function(e,t){if(t instanceof Function)return async function(e,t){const[n,r]=await g.getDirForFilename(e,!0),s=await n.getFileHandle(r,{create:!0});let i,o=await s.createSyncAccessHandle(),a=0,l=!1;try{for(o.truncate(0);void 0!==(i=await t());)i instanceof ArrayBuffer&&(i=new Uint8Array(i)),0===a&&i.byteLength>=15&&(d.affirmDbHeader(i),l=!0),o.write(i,{at:a}),a+=i.byteLength;if((a<512||0!=a%512)&&_("Input size",a,"is not correct for an SQLite database."),!l){const e=new Uint8Array(20);o.read(e,{at:0}),d.affirmDbHeader(e)}return o.write(new Uint8Array([1,1]),{at:18}),a}catch(e){throw await o.close(),o=void 0,await n.removeEntry(r).catch((()=>{})),e}finally{o&&await o.close()}}(e,t);t instanceof ArrayBuffer&&(t=new Uint8Array(t)),d.affirmIsDb(t);const n=t.byteLength,[r,s]=await g.getDirForFilename(e,!0);let i,o=0;try{const e=await r.getFileHandle(s,{create:!0});return i=await e.createSyncAccessHandle(),i.truncate(0),o=i.write(t,{at:0}),o!=n&&_("Expected to write "+n+" bytes but wrote "+o+"."),i.write(new Uint8Array([1,1]),{at:18}),o}catch(e){throw i&&(await i.close(),i=void 0),await r.removeEntry(s).catch((()=>{})),e}finally{i&&await i.close()}},e.oo1){const t=function(...t){const n=e.oo1.DB.dbCtorHelper.normalizeArgs(...t);n.vfs=y.$zName,e.oo1.DB.dbCtorHelper.call(this,n)};t.prototype=Object.create(e.oo1.DB.prototype),e.oo1.OpfsDb=t,t.importDb=g.importDb,e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(y.pointer,(function(e,t){t.capi.sqlite3_busy_timeout(e,1e4),t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}w.onmessage=function({data:t}){switch(t.type){case"opfs-unavailable":E(new Error(t.payload.join(" ")));break;case"opfs-async-loaded":w.postMessage({type:"opfs-async-init",args:x});break;case"opfs-async-inited":if(!0===q)break;try{e.vfs.installVfs({io:{struct:b,methods:C},vfs:{struct:y,methods:N}}),x.sabOPView=new Int32Array(x.sabOP),x.sabFileBufView=new Uint8Array(x.sabIO,0,x.fileBufferSize),x.sabS11nView=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),(()=>{if(x.s11n)return x.s11n;const e=new TextDecoder,t=new TextEncoder("utf-8"),n=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),r=new DataView(x.sabIO,x.sabS11nOffset,x.sabS11nSize);x.s11n=Object.create(null);const s=Object.create(null);s.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},s.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},s.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},s.string={id:4};const i=e=>s[typeof e]||_("Maintenance required: this value type cannot be serialized.",e),o=e=>{switch(e){case s.number.id:return s.number;case s.bigint.id:return s.bigint;case s.boolean.id:return s.boolean;case s.string.id:return s.string;default:_("Invalid type ID:",e)}};x.s11n.deserialize=function(t=!1){++T.s11n.deserialize.count;const s=performance.now(),i=n[0],a=i?[]:null;if(i){const t=[];let s,l,c,_=1;for(s=0;s{w.onerror=w._originalOnError,delete w._originalOnError,e.opfs=g,g.rootDirectory=t,a("End of OPFS sqlite3_vfs setup.",y),v()})).catch(E):v()}catch(e){c(e),E(e)}break;default:{const e="Unexpected message from the OPFS async worker: "+JSON.stringify(t);c(e),E(new Error(e));break}}}}));return i};t.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push((async e=>{try{let n=t.defaultProxyUri;return e.scriptInfo.sqlite3Dir&&(t.defaultProxyUri=e.scriptInfo.sqlite3Dir+n),t().catch((t=>{e.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",t.message)}))}catch(t){return e.config.error("installOpfsVfs() exception:",t),Promise.reject(t)}}))})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.util.toss,n=e.util.toss3,r=Object.create(null),s=e.capi,i=e.util,o=e.wasm,a=4096,l=s.SQLITE_OPEN_MAIN_DB|s.SQLITE_OPEN_MAIN_JOURNAL|s.SQLITE_OPEN_SUPER_JOURNAL|s.SQLITE_OPEN_WAL,c=".opaque",_=()=>Math.random().toString(36).slice(2),u=new TextDecoder,d=new TextEncoder,f=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2}),p=[e.config.error,e.config.warn,e.config.log],m=(e.config.log,e.config.warn),h=(e.config.error,new Map),g=e=>h.get(e),b=(e,t)=>{t?h.set(e,t):h.delete(e)},y=new Map,q=e=>y.get(e),E=(e,t)=>{t?y.set(e,t):y.delete(e)},v={xCheckReservedLock:function(e,t){const n=q(e);return n.log("xCheckReservedLock"),n.storeErr(),o.poke32(t,1),0},xClose:function(e){const t=q(e);t.storeErr();const n=t.getOFileForS3File(e);if(n)try{t.log(`xClose ${n.path}`),t.mapS3FileToOFile(e,!1),n.sah.flush(),n.flags&s.SQLITE_OPEN_DELETEONCLOSE&&t.deletePath(n.path)}catch(e){return t.storeErr(e,s.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(e){return s.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,n){return s.SQLITE_NOTFOUND},xFileSize:function(e,t){const n=q(e);n.log("xFileSize");const r=n.getOFileForS3File(e).sah.getSize()-a;return o.poke64(t,BigInt(r)),0},xLock:function(e,t){const n=q(e);return n.log(`xLock ${t}`),n.storeErr(),n.getOFileForS3File(e).lockType=t,0},xRead:function(e,t,n,r){const i=q(e);i.storeErr();const l=i.getOFileForS3File(e);i.log(`xRead ${l.path} ${n} @ ${r}`);try{const e=l.sah.read(o.heap8u().subarray(t,t+n),{at:a+Number(r)});return et&&o.poke8(n+t-1,0)}catch(i){return s.SQLITE_NOMEM}finally{o.scopedAllocPop(e)}}return i?i.sqlite3Rc||s.SQLITE_IOERR:0},xOpen:function(e,n,r,i,a){const l=g(e);try{l.log(`xOpen ${o.cstrToJs(n)} ${i}`);const e=n&&o.peek8(n)?l.getPath(n):_();let c=l.getSAHForPath(e);!c&&i&s.SQLITE_OPEN_CREATE&&(l.getFileCount()b(r.pointer,0))),a&&(r.$xRandomness=a.$xRandomness,r.$xSleep=a.$xSleep,a.dispose()),r.$xRandomness||S.xRandomness||(S.xRandomness=function(e,t,n){const r=o.heap8u();let s=0;for(;s0),e.vfs.installVfs({vfs:{struct:r,methods:S}}),r}(this.vfsName),b(this.#c.pointer,this),this.vfsDir=t.directory||"."+this.vfsName,this.#l=new DataView(this.#a.buffer,this.#a.byteOffset),this.isReady=this.reset(!!(t.clearOnInit??f.clearOnInit)).then((()=>{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(t.initialCapacity||f.initialCapacity)}))}#u(e,...t){this.#_>e&&p[e](this.vfsName+":",...t)}log(...e){this.#u(2,...e)}warn(...e){this.#u(1,...e)}error(...e){this.#u(0,...e)}getVfs(){return this.#c}getCapacity(){return this.#r.size}getFileCount(){return this.#s.size}getFileNames(){const e=[],t=this.#s.keys();for(const n of t)e.push(n);return e}async addCapacity(e){for(let t=0;t{try{const r=await n.createSyncAccessHandle();if(this.#r.set(r,t),e)r.truncate(a),this.setAssociatedPath(r,"",0);else{const e=this.getAssociatedPath(r);e?this.#s.set(e,r):this.#i.add(r)}}catch(e){throw this.storeErr(e),this.releaseAccessHandles(),e}})))}getAssociatedPath(e){e.read(this.#a,{at:0});const t=this.#l.getUint32(512);if(this.#a[0]&&(t&s.SQLITE_OPEN_DELETEONCLOSE||!(t&l)))return m(`Removing file with unexpected flags ${t.toString(16)}`,this.#a),this.setAssociatedPath(e,"",0),"";const n=new Uint32Array(2);e.read(n,{at:516});const r=this.computeDigest(this.#a);if(n.every(((e,t)=>e===r[t]))){const t=this.#a.findIndex((e=>0===e));return 0===t&&e.truncate(a),t?u.decode(this.#a.subarray(0,t)):""}return m("Disassociating file with bad digest."),this.setAssociatedPath(e,"",0),""}setAssociatedPath(e,n,r){const s=d.encodeInto(n,this.#a);512<=s.written+1&&t("Path too long:",n),this.#a.fill(0,s.written,512),this.#l.setUint32(512,r);const i=this.computeDigest(this.#a);e.write(this.#a,{at:0}),e.write(i,{at:516}),e.flush(),n?(this.#s.set(n,e),this.#i.delete(e)):(e.truncate(a),this.#i.add(e))}computeDigest(e){let t=3735928559,n=1103547991;for(const r of e)t=31*t+307*r,n=31*n+307*r;return new Uint32Array([t>>>0,n>>>0])}async reset(e){await this.isReady;let t,n=await navigator.storage.getDirectory();for(const e of this.vfsDir.split("/"))e&&(t=n,n=await n.getDirectoryHandle(e,{create:!0}));return this.#e=n,this.#n=t,this.#t=await this.#e.getDirectoryHandle(c,{create:!0}),this.releaseAccessHandles(),this.acquireAccessHandles(e)}getPath(e){return o.isPtr(e)&&(e=o.cstrToJs(e)),(e instanceof URL?e:new URL(e,"file://localhost/")).pathname}deletePath(e){const t=this.#s.get(e);return t&&(this.#s.delete(e),this.setAssociatedPath(t,"",0)),!!t}storeErr(e,t){return e&&(e.sqlite3Rc=t||s.SQLITE_IOERR,this.error(e)),this.$error=e,t}popErr(){const e=this.$error;return this.$error=void 0,e}nextAvailableSAH(){const[e]=this.#i.keys();return e}getOFileForS3File(e){return this.#o.get(e)}mapS3FileToOFile(e,t){t?(this.#o.set(e,t),E(e,this)):(this.#o.delete(e),E(e,!1))}hasFilename(e){return this.#s.has(e)}getSAHForPath(e){return this.#s.get(e)}async removeVfs(){if(!this.#c.pointer||!this.#t)return!1;s.sqlite3_vfs_unregister(this.#c.pointer),this.#c.dispose();try{this.releaseAccessHandles(),await this.#e.removeEntry(c,{recursive:!0}),this.#t=void 0,await this.#n.removeEntry(this.#e.name,{recursive:!0}),this.#e=this.#n=void 0}catch(t){e.config.error(this.vfsName,"removeVfs() failed:",t)}return!0}exportFile(e){const n=this.#s.get(e)||t("File not found:",e),r=n.getSize()-a,s=new Uint8Array(r>0?r:0);if(r>0){const e=n.read(s,{at:a});e!=r&&t("Expected to read "+r+" bytes but read "+e+".")}return s}async importDbChunked(e,n){const r=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to.");r.truncate(0);let o,l=0,c=!1;try{for(;void 0!==(o=await n());)o instanceof ArrayBuffer&&(o=new Uint8Array(o)),0===l&&o.byteLength>=15&&(i.affirmDbHeader(o),c=!0),r.write(o,{at:a+l}),l+=o.byteLength;if((l<512||0!=l%512)&&t("Input size",l,"is not correct for an SQLite database."),!c){const e=new Uint8Array(20);r.read(e,{at:0}),i.affirmDbHeader(e)}r.write(new Uint8Array([1,1]),{at:4114})}catch(e){throw this.setAssociatedPath(r,"",0),e}return this.setAssociatedPath(r,e,s.SQLITE_OPEN_MAIN_DB),l}importDb(e,n){if(n instanceof ArrayBuffer)n=new Uint8Array(n);else if(n instanceof Function)return this.importDbChunked(e,n);const r=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to."),i=n.byteLength;(i<512||i%512!=0)&&t("Byte array size is invalid for an SQLite db.");for(let e=0;e<15;++e)"SQLite format 3".charCodeAt(e)!==n[e]&&t("Input does not contain an SQLite database header.");const o=r.write(n,{at:a});return o!=i?(this.setAssociatedPath(r,"",0),t("Expected to write "+i+" bytes but wrote "+o+".")):(r.write(new Uint8Array([1,1]),{at:4114}),this.setAssociatedPath(r,e,s.SQLITE_OPEN_MAIN_DB)),o}}class x{#d;constructor(e){this.#d=e,this.vfsName=e.vfsName}async addCapacity(e){return this.#d.addCapacity(e)}async reduceCapacity(e){return this.#d.reduceCapacity(e)}getCapacity(){return this.#d.getCapacity(this.#d)}getFileCount(){return this.#d.getFileCount()}getFileNames(){return this.#d.getFileNames()}async reserveMinimumCapacity(e){const t=this.#d.getCapacity();return t{const e=await navigator.storage.getDirectory(),n=".opfs-sahpool-sync-check-"+_(),r=await e.getFileHandle(n,{create:!0}),s=(await r.createSyncAccessHandle()).close();return await s,await e.removeEntry(n),s?.then&&t("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0})().then((async function(){if(n.$testThrowInInit)throw n.$testThrowInInit;const t=new A(n);return t.isReady.then((async()=>{const n=new x(t);if(e.oo1){const r=e.oo1,s=t.getVfs(),i=function(...e){const t=r.DB.dbCtorHelper.normalizeArgs(...e);t.vfs=s.$zName,r.DB.dbCtorHelper.call(this,t)};i.prototype=Object.create(r.DB.prototype),n.OpfsSAHPoolDb=i,r.DB.dbCtorHelper.setVfsPostOpenSql(s.pointer,(function(e,t){t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}return t.log("VFS initialized."),n})).catch((async e=>(await t.removeVfs().catch((()=>{})),e)))})).catch((e=>r[s]=Promise.reject(e))):r[s]=Promise.reject(new Error("Missing required OPFS APIs."))}})),void 0!==e){const t=Object.assign(Object.create(null),{exports:void 0===Re?e.asm:Re,memory:e.wasmMemory},globalThis.sqlite3ApiConfig||{});let n;globalThis.sqlite3ApiConfig=t;try{n=globalThis.sqlite3ApiBootstrap()}catch(e){throw console.error("sqlite3ApiBootstrap() error:",e),e}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}e.sqlite3=n}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")})),e.ready});const i=function(){const e=s;if(!e)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const t=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:globalThis?.document?.currentScript,isWorker:"undefined"!=typeof WorkerGlobalScope,location:globalThis.location,urlParams:globalThis?.location?.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(t.debugModule=t.urlParams.has("sqlite3.debugModule")?(...e)=>console.warn("sqlite3.debugModule:",...e):()=>{},t.urlParams.has("sqlite3.dir"))t.sqlite3Dir=t.urlParams.get("sqlite3.dir")+"/";else if(t.moduleScript){const e=t.moduleScript.src.split("/");e.pop(),t.sqlite3Dir=e.join("/")+"/"}if(globalThis.sqlite3InitModule=function n(...r){return e(...r).then((e=>{const r=e.sqlite3;r.scriptInfo=t,n.__isUnderTest&&(r.__isUnderTest=!0);const s=r.asyncPostInit;return delete r.asyncPostInit,s()})).catch((e=>{throw console.error("Exception loading sqlite3 module:",e),e}))},globalThis.sqlite3InitModule.ready=e.ready,globalThis.sqlite3InitModuleState.moduleScript){const e=globalThis.sqlite3InitModuleState;let t=e.moduleScript.src.split("/");t.pop(),e.scriptDir=t.join("/")+"/"}return t.debugModule("sqlite3InitModuleState =",t),globalThis.sqlite3InitModule}(),o=s=i}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4025],{8168:(e,t,n)=>{e.exports=n.p+"4fb34c1567962ff5a6c9.wasm"},4025:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r,s=(r="file:///home/mmom/src/rlayers/node_modules/sqlite-wasm-http/deps/dist/sqlite3-bundler-friendly.mjs",function(e={}){var t,s,i=e;i.ready=new Promise(((e,n)=>{t=e,s=n})),["_malloc","_free","_realloc","_sqlite3_aggregate_context","_sqlite3_auto_extension","_sqlite3_bind_blob","_sqlite3_bind_double","_sqlite3_bind_int","_sqlite3_bind_int64","_sqlite3_bind_null","_sqlite3_bind_parameter_count","_sqlite3_bind_parameter_index","_sqlite3_bind_pointer","_sqlite3_bind_text","_sqlite3_busy_handler","_sqlite3_busy_timeout","_sqlite3_cancel_auto_extension","_sqlite3_changes","_sqlite3_changes64","_sqlite3_clear_bindings","_sqlite3_close_v2","_sqlite3_collation_needed","_sqlite3_column_blob","_sqlite3_column_bytes","_sqlite3_column_count","_sqlite3_column_double","_sqlite3_column_int","_sqlite3_column_int64","_sqlite3_column_name","_sqlite3_column_text","_sqlite3_column_type","_sqlite3_column_value","_sqlite3_commit_hook","_sqlite3_compileoption_get","_sqlite3_compileoption_used","_sqlite3_complete","_sqlite3_context_db_handle","_sqlite3_create_collation","_sqlite3_create_collation_v2","_sqlite3_create_function","_sqlite3_create_function_v2","_sqlite3_create_module","_sqlite3_create_module_v2","_sqlite3_create_window_function","_sqlite3_data_count","_sqlite3_db_filename","_sqlite3_db_handle","_sqlite3_db_name","_sqlite3_db_status","_sqlite3_declare_vtab","_sqlite3_deserialize","_sqlite3_drop_modules","_sqlite3_errcode","_sqlite3_errmsg","_sqlite3_error_offset","_sqlite3_errstr","_sqlite3_exec","_sqlite3_expanded_sql","_sqlite3_extended_errcode","_sqlite3_extended_result_codes","_sqlite3_file_control","_sqlite3_finalize","_sqlite3_free","_sqlite3_get_auxdata","_sqlite3_initialize","_sqlite3_keyword_count","_sqlite3_keyword_name","_sqlite3_keyword_check","_sqlite3_last_insert_rowid","_sqlite3_libversion","_sqlite3_libversion_number","_sqlite3_limit","_sqlite3_malloc","_sqlite3_malloc64","_sqlite3_msize","_sqlite3_open","_sqlite3_open_v2","_sqlite3_overload_function","_sqlite3_prepare_v2","_sqlite3_prepare_v3","_sqlite3_preupdate_blobwrite","_sqlite3_preupdate_count","_sqlite3_preupdate_depth","_sqlite3_preupdate_hook","_sqlite3_preupdate_new","_sqlite3_preupdate_old","_sqlite3_progress_handler","_sqlite3_randomness","_sqlite3_realloc","_sqlite3_realloc64","_sqlite3_reset","_sqlite3_reset_auto_extension","_sqlite3_result_blob","_sqlite3_result_double","_sqlite3_result_error","_sqlite3_result_error_code","_sqlite3_result_error_nomem","_sqlite3_result_error_toobig","_sqlite3_result_int","_sqlite3_result_int64","_sqlite3_result_null","_sqlite3_result_pointer","_sqlite3_result_subtype","_sqlite3_result_text","_sqlite3_result_zeroblob","_sqlite3_result_zeroblob64","_sqlite3_rollback_hook","_sqlite3_serialize","_sqlite3_set_authorizer","_sqlite3_set_auxdata","_sqlite3_set_last_insert_rowid","_sqlite3_shutdown","_sqlite3_sourceid","_sqlite3_sql","_sqlite3_status","_sqlite3_status64","_sqlite3_step","_sqlite3_stmt_isexplain","_sqlite3_stmt_readonly","_sqlite3_stmt_status","_sqlite3_strglob","_sqlite3_stricmp","_sqlite3_strlike","_sqlite3_strnicmp","_sqlite3_table_column_metadata","_sqlite3_total_changes","_sqlite3_total_changes64","_sqlite3_trace_v2","_sqlite3_txn_state","_sqlite3_update_hook","_sqlite3_uri_boolean","_sqlite3_uri_int64","_sqlite3_uri_key","_sqlite3_uri_parameter","_sqlite3_user_data","_sqlite3_value_blob","_sqlite3_value_bytes","_sqlite3_value_double","_sqlite3_value_dup","_sqlite3_value_free","_sqlite3_value_frombind","_sqlite3_value_int","_sqlite3_value_int64","_sqlite3_value_nochange","_sqlite3_value_numeric_type","_sqlite3_value_pointer","_sqlite3_value_subtype","_sqlite3_value_text","_sqlite3_value_type","_sqlite3_vfs_find","_sqlite3_vfs_register","_sqlite3_vfs_unregister","_sqlite3_vtab_collation","_sqlite3_vtab_distinct","_sqlite3_vtab_in","_sqlite3_vtab_in_first","_sqlite3_vtab_in_next","_sqlite3_vtab_nochange","_sqlite3_vtab_on_conflict","_sqlite3_vtab_rhs_value","_sqlite3changegroup_add","_sqlite3changegroup_add_strm","_sqlite3changegroup_delete","_sqlite3changegroup_new","_sqlite3changegroup_output","_sqlite3changegroup_output_strm","_sqlite3changeset_apply","_sqlite3changeset_apply_strm","_sqlite3changeset_apply_v2","_sqlite3changeset_apply_v2_strm","_sqlite3changeset_concat","_sqlite3changeset_concat_strm","_sqlite3changeset_conflict","_sqlite3changeset_finalize","_sqlite3changeset_fk_conflicts","_sqlite3changeset_invert","_sqlite3changeset_invert_strm","_sqlite3changeset_new","_sqlite3changeset_next","_sqlite3changeset_old","_sqlite3changeset_op","_sqlite3changeset_pk","_sqlite3changeset_start","_sqlite3changeset_start_strm","_sqlite3changeset_start_v2","_sqlite3changeset_start_v2_strm","_sqlite3session_attach","_sqlite3session_changeset","_sqlite3session_changeset_size","_sqlite3session_changeset_strm","_sqlite3session_config","_sqlite3session_create","_sqlite3session_delete","_sqlite3session_diff","_sqlite3session_enable","_sqlite3session_indirect","_sqlite3session_isempty","_sqlite3session_memory_used","_sqlite3session_object_config","_sqlite3session_patchset","_sqlite3session_patchset_strm","_sqlite3session_table_filter","_sqlite3_wasm_pstack_ptr","_sqlite3_wasm_pstack_restore","_sqlite3_wasm_pstack_alloc","_sqlite3_wasm_pstack_remaining","_sqlite3_wasm_pstack_quota","_sqlite3_wasm_db_error","_sqlite3_wasm_test_struct","_sqlite3_wasm_enum_json","_sqlite3_wasm_vfs_unlink","_sqlite3_wasm_db_vfs","_sqlite3_wasm_db_reset","_sqlite3_wasm_db_export_chunked","_sqlite3_wasm_db_serialize","_sqlite3_wasm_vfs_create_file","_sqlite3_wasm_posix_create_file","_sqlite3_wasm_kvvfsMakeKeyOnPstack","_sqlite3_wasm_kvvfs_methods","_sqlite3_wasm_vtab_config","_sqlite3_wasm_db_config_ip","_sqlite3_wasm_db_config_pii","_sqlite3_wasm_db_config_s","_sqlite3_wasm_config_i","_sqlite3_wasm_config_ii","_sqlite3_wasm_config_j","_sqlite3_wasm_init_wasmfs","_sqlite3_wasm_test_intptr","_sqlite3_wasm_test_voidptr","_sqlite3_wasm_test_int64_max","_sqlite3_wasm_test_int64_min","_sqlite3_wasm_test_int64_times2","_sqlite3_wasm_test_int64_minmax","_sqlite3_wasm_test_int64ptr","_sqlite3_wasm_test_stack_overflow","_sqlite3_wasm_test_str_hello","_sqlite3_wasm_SQLTester_strglob","___indirect_function_table","_fflush","onRuntimeInitialized"].forEach((e=>{Object.getOwnPropertyDescriptor(i.ready,e)||Object.defineProperty(i.ready,e,{get:()=>$("You are getting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>$("You are setting "+e+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));const o=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,o.debugModule("globalThis.location =",globalThis.location);const a="emscripten-bug-17951";i[a]=function e(t,n){t.env.foo=function(){};const r=i.locateFile(e.uri,void 0===g?"":g);o.debugModule("instantiateWasm() uri =",r);const s=()=>fetch(r,{credentials:"same-origin"});return(WebAssembly.instantiateStreaming?async()=>WebAssembly.instantiateStreaming(s(),t).then((e=>n(e.instance,e.module))):async()=>s().then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,t))).then((e=>n(e.instance,e.module))))(),{}},i[a].uri="sqlite3.wasm";var l=Object.assign({},i),c="./this.program",_="object"==typeof window,u="function"==typeof importScripts,d="object"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions&&"string"==typeof{env:{RLAYERS_DEBUG:void 0}}.versions.node,f=!_&&!d&&!u;if(i.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var p,m,h,g="";if(f){if("function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(p=read),h=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let t=read(e,"binary");return O("object"==typeof t),t},m=(e,t,n)=>{setTimeout((()=>t(h(e))))},"undefined"==typeof clearTimeout&&(globalThis.clearTimeout=e=>{}),"undefined"==typeof setTimeout&&(globalThis.setTimeout=e=>"function"==typeof e?e():$()),"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!_&&!u)throw new Error("environment detection error");if(u?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),m=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}}var b,y,q,E=i.print||console.log.bind(console),w=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,b="fetchSettings",Object.getOwnPropertyDescriptor(i,b)&&$(`\`Module.${b}\` was supplied but \`${b}\` not included in INCOMING_MODULE_JS_API`),i.arguments&&i.arguments,Z("arguments","arguments_"),i.thisProgram&&(c=i.thisProgram),Z("thisProgram","thisProgram"),i.quit&&i.quit,Z("quit","quit_"),O(void 0===i.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),O(void 0===i.read,"Module.read option was removed (modify read_ in JS)"),O(void 0===i.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),O(void 0===i.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),O(void 0===i.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"),O(void 0===i.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Z("asm","wasmExports"),Z("read","read_"),Z("readAsync","readAsync"),Z("readBinary","readBinary"),Z("setWindowTitle","setWindowTitle"),O(!d,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),O(!f,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),i.wasmBinary&&(y=i.wasmBinary),Z("wasmBinary","wasmBinary"),i.noExitRuntime,Z("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&$("no native wasm support detected");var S,A,x,T,I,k,F=!1;function O(e,t){e||$("Assertion failed"+(t?": "+t:""))}function P(){var e=q.buffer;i.HEAP8=S=new Int8Array(e),i.HEAP16=x=new Int16Array(e),i.HEAPU8=A=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=T=new Int32Array(e),i.HEAPU32=I=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=k=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}O(!i.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"),O("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support");var L=i.INITIAL_MEMORY||16777216;function C(){if(!F){var e=We();0==e&&(e+=4);var t=I[e>>2],n=I[e+4>>2];34821223==t&&2310721022==n||$(`Stack overflow! Stack cookie has been overwritten at ${se(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${se(n)} ${se(t)}`),1668509029!=I[0]&&$("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Z("INITIAL_MEMORY","INITIAL_MEMORY"),O(L>=524288,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+L+"! (STACK_SIZE=524288)"),q=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:L/65536,maximum:32768}),P(),O((L=q.buffer.byteLength)%65536==0),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],D=[],R=[],M=!1;O(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),O(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var j,U,B=0,z=null,W=null,H={};function Q(e){for(var t=e;;){if(!H[e])return e;e=t+Math.random()}}function G(e){B++,i.monitorRunDependencies&&i.monitorRunDependencies(B),e?(O(!H[e]),H[e]=1,null===z&&"undefined"!=typeof setInterval&&(z=setInterval((()=>{if(F)return clearInterval(z),void(z=null);var e=!1;for(var t in H)e||(e=!0,w("still waiting on run dependencies:")),w(`dependency: ${t}`);e&&w("(end of list)")}),1e4))):w("warning: run dependency added without ID")}function V(e){if(B--,i.monitorRunDependencies&&i.monitorRunDependencies(B),e?(O(H[e]),delete H[e]):w("warning: run dependency removed without ID"),0==B&&(null!==z&&(clearInterval(z),z=null),W)){var t=W;W=null,t()}}function $(e){i.onAbort&&i.onAbort(e),w(e="Aborted("+e+")"),F=!0;var t=new WebAssembly.RuntimeError(e);throw s(t),t}function K(e){return e.startsWith("data:application/octet-stream;base64,")}function J(e){return function(){O(M,`native function \`${e}\` called before runtime initialization`);var t=Re[e];return O(t,`exported native function \`${e}\` not found`),t.apply(null,arguments)}}function Y(e){if(e==j&&y)return new Uint8Array(y);if(h)return h(e);throw"both async and sync fetching of the wasm failed"}function X(e,t,n){return function(e){return y||!_&&!u||"function"!=typeof fetch?Promise.resolve().then((()=>Y(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>Y(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(n,(e=>{w(`failed to asynchronously prepare wasm: ${e}`),j.startsWith("file://")&&w(`warning: Loading from a file URI (${j}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),$(e)}))}function Z(e,t,n=!0){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){$(`\`Module.${e}\` has been replaced by \`${t}\``+(n?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":""))}})}function ee(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function te(e,t){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,e,{configurable:!0,get(){ie("`"+e+"` is not longer defined by emscripten. "+t)}})}function ne(e){Object.getOwnPropertyDescriptor(i,e)||Object.defineProperty(i,e,{configurable:!0,get(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)";ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),$(t)}})}i.locateFile?K(j="sqlite3.wasm")||(U=j,j=i.locateFile?i.locateFile(U,g):g+U):j=new URL(n(8168),n.b).href,te("buffer","Please use HEAP8.buffer or wasmMemory.buffer"),te("asm","Please use wasmExports instead");var re=e=>{for(;e.length>0;)e.shift()(i)},se=e=>(O("number"==typeof e),"0x"+(e>>>=0).toString(16).padStart(8,"0")),ie=e=>{ie.shown||(ie.shown={}),ie.shown[e]||(ie.shown[e]=1,w(e))},oe={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var s=e[r];"."===s?e.splice(r,1):".."===s?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=oe.isAbs(e),n="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.splitPath(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ae=e=>(ae=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);$("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")})())(e),le={resolve:function(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:we.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=oe.isAbs(r)}return(t?"/":"")+(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=le.resolve(e).substr(1),t=le.resolve(t).substr(1);for(var r=n(e.split("/")),s=n(t.split("/")),i=Math.min(r.length,s.length),o=i,a=0;a{for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&ce)return ce.decode(e.subarray(t,s));for(var i="";t>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i},ue=[],de=e=>{for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t},fe=(e,t,n,r)=>{if(O("string"==typeof e),!(r>0))return 0;for(var s=n,i=n+r-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;a>1114111&&ie("Invalid Unicode code point "+se(a)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-s};function pe(e,t,n){var r=n>0?n:de(e)+1,s=new Array(r),i=fe(e,s,0,s.length);return t&&(s.length=i),s}var me,he={ttys:[],init(){},shutdown(){},register(e,t){he.ttys[e]={input:[],output:[],ops:t},we.registerDevice(e,he.stream_ops)},stream_ops:{open(e){var t=he.ttys[e.node.rdev];if(!t)throw new we.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,s){if(!e.tty||!e.tty.ops.get_char)throw new we.ErrnoError(60);for(var i=0,o=0;o(()=>{if(!ue.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ue=pe(e,!0)}return ue.shift()})(),put_char(e,t){null===t||10===t?(E(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(E(_e(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,n)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(w(_e(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(_e(e.output,0)),e.output=[])}}},ge=e=>{e=((e,t)=>(O(t,"alignment argument is required"),Math.ceil(e/t)*t))(e,65536);var t=Be(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},be={ops_table:null,mount:e=>be.createNode(null,"/",16895,0),createNode(e,t,n,r){if(we.isBlkdev(n)||we.isFIFO(n))throw new we.ErrnoError(63);be.ops_table||(be.ops_table={dir:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,lookup:be.node_ops.lookup,mknod:be.node_ops.mknod,rename:be.node_ops.rename,unlink:be.node_ops.unlink,rmdir:be.node_ops.rmdir,readdir:be.node_ops.readdir,symlink:be.node_ops.symlink},stream:{llseek:be.stream_ops.llseek}},file:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:{llseek:be.stream_ops.llseek,read:be.stream_ops.read,write:be.stream_ops.write,allocate:be.stream_ops.allocate,mmap:be.stream_ops.mmap,msync:be.stream_ops.msync}},link:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr,readlink:be.node_ops.readlink},stream:{}},chrdev:{node:{getattr:be.node_ops.getattr,setattr:be.node_ops.setattr},stream:we.chrdev_stream_ops}});var s=we.createNode(e,t,n,r);return we.isDir(s.mode)?(s.node_ops=be.ops_table.dir.node,s.stream_ops=be.ops_table.dir.stream,s.contents={}):we.isFile(s.mode)?(s.node_ops=be.ops_table.file.node,s.stream_ops=be.ops_table.file.stream,s.usedBytes=0,s.contents=null):we.isLink(s.mode)?(s.node_ops=be.ops_table.link.node,s.stream_ops=be.ops_table.link.stream):we.isChrdev(s.mode)&&(s.node_ops=be.ops_table.chrdev.node,s.stream_ops=be.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),0!=n&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=we.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,we.isDir(e.mode)?t.size=4096:we.isFile(e.mode)?t.size=e.usedBytes:we.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&be.resizeFileStorage(e,t.size)},lookup(e,t){throw we.genericErrors[44]},mknod:(e,t,n,r)=>be.createNode(e,t,n,r),rename(e,t,n){if(we.isDir(e.mode)){var r;try{r=we.lookupNode(t,n)}catch(e){}if(r)for(var s in r.contents)throw new we.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=we.lookupNode(e,t);for(var r in n.contents)throw new we.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink(e,t,n){var r=be.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!we.isLink(e.mode))throw new we.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,s){var i=e.node.contents;if(s>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-s,r);if(O(o>=0),o>8&&i.subarray)t.set(i.subarray(s,s+o),n);else for(var a=0;a0||n+t(be.stream_ops.write(e,t,0,r,n,!1),0)}},ye=i.preloadPlugins||[],qe=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},Ee={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ve={},we={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=le.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new we.ErrnoError(32);for(var n=e.split("/").filter((e=>!!e)),r=we.root,s="/",i=0;i40)throw new we.ErrnoError(32)}}return{path:s,node:r}},getPath(e){for(var t;;){if(we.isRoot(e)){var n=e.mount.mountpoint;return t?"/"!==n[n.length-1]?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r>>0)%we.nameTable.length},hashAddNode(e){var t=we.hashName(e.parent.id,e.name);e.name_next=we.nameTable[t],we.nameTable[t]=e},hashRemoveNode(e){var t=we.hashName(e.parent.id,e.name);if(we.nameTable[t]===e)we.nameTable[t]=e.name_next;else for(var n=we.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=we.mayLookup(e);if(n)throw new we.ErrnoError(n,e);for(var r=we.hashName(e.id,t),s=we.nameTable[r];s;s=s.name_next){var i=s.name;if(s.parent.id===e.id&&i===t)return s}return we.lookup(e,t)},createNode(e,t,n,r){O("object"==typeof e);var s=new we.FSNode(e,t,n,r);return we.hashAddNode(s),s},destroyNode(e){we.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>we.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>we.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,t){try{return we.lookupNode(e,t),20}catch(e){}return we.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=we.lookupNode(e,t)}catch(e){return e.errno}var s=we.nodePermissions(e,"wx");if(s)return s;if(n){if(!we.isDir(r.mode))return 54;if(we.isRoot(r)||we.getPath(r)===we.cwd())return 10}else if(we.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?we.isLink(e.mode)?32:we.isDir(e.mode)&&("r"!==we.flagsToPermissionString(t)||512&t)?31:we.nodePermissions(e,we.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=we.MAX_OPEN_FDS;e++)if(!we.streams[e])return e;throw new we.ErrnoError(33)},getStreamChecked(e){var t=we.getStream(e);if(!t)throw new we.ErrnoError(8);return t},getStream:e=>we.streams[e],createStream:(e,t=-1)=>(we.FSStream||(we.FSStream=function(){this.shared={}},we.FSStream.prototype={},Object.defineProperties(we.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return!!(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new we.FSStream,e),-1==t&&(t=we.nextfd()),e.fd=t,we.streams[t]=e,e),closeStream(e){we.streams[e]=null},chrdev_stream_ops:{open(e){var t=we.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new we.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){we.devices[e]={stream_ops:t}},getDevice:e=>we.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),we.syncFSRequests++,we.syncFSRequests>1&&w(`warning: ${we.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=we.getMounts(we.root.mount),r=0;function s(e){return O(we.syncFSRequests>0),we.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,s(e));++r>=n.length&&s(null)}n.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,n){if("string"==typeof e)throw e;var r,s="/"===n,i=!n;if(s&&we.root)throw new we.ErrnoError(10);if(!s&&!i){var o=we.lookupPath(n,{follow_mount:!1});if(n=o.path,r=o.node,we.isMountpoint(r))throw new we.ErrnoError(10);if(!we.isDir(r.mode))throw new we.ErrnoError(54)}var a={type:e,opts:t,mountpoint:n,mounts:[]},l=e.mount(a);return l.mount=a,a.root=l,s?we.root=l:r&&(r.mounted=a,r.mount&&r.mount.mounts.push(a)),l},unmount(e){var t=we.lookupPath(e,{follow_mount:!1});if(!we.isMountpoint(t.node))throw new we.ErrnoError(28);var n=t.node,r=n.mounted,s=we.getMounts(r);Object.keys(we.nameTable).forEach((e=>{for(var t=we.nameTable[e];t;){var n=t.name_next;s.includes(t.mount)&&we.destroyNode(t),t=n}})),n.mounted=null;var i=n.mount.mounts.indexOf(r);O(-1!==i),n.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,n){var r=we.lookupPath(e,{parent:!0}).node,s=oe.basename(e);if(!s||"."===s||".."===s)throw new we.ErrnoError(28);var i=we.mayCreate(r,s);if(i)throw new we.ErrnoError(i);if(!r.node_ops.mknod)throw new we.ErrnoError(63);return r.node_ops.mknod(r,s,t,n)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,we.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,we.mknod(e,t,0)),mkdirTree(e,t){for(var n=e.split("/"),r="",s=0;s(void 0===n&&(n=t,t=438),t|=8192,we.mknod(e,t,n)),symlink(e,t){if(!le.resolve(e))throw new we.ErrnoError(44);var n=we.lookupPath(t,{parent:!0}).node;if(!n)throw new we.ErrnoError(44);var r=oe.basename(t),s=we.mayCreate(n,r);if(s)throw new we.ErrnoError(s);if(!n.node_ops.symlink)throw new we.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n,r,s=oe.dirname(e),i=oe.dirname(t),o=oe.basename(e),a=oe.basename(t);if(n=we.lookupPath(e,{parent:!0}).node,r=we.lookupPath(t,{parent:!0}).node,!n||!r)throw new we.ErrnoError(44);if(n.mount!==r.mount)throw new we.ErrnoError(75);var l,c=we.lookupNode(n,o),_=le.relative(e,i);if("."!==_.charAt(0))throw new we.ErrnoError(28);if("."!==(_=le.relative(t,s)).charAt(0))throw new we.ErrnoError(55);try{l=we.lookupNode(r,a)}catch(e){}if(c!==l){var u=we.isDir(c.mode),d=we.mayDelete(n,o,u);if(d)throw new we.ErrnoError(d);if(d=l?we.mayDelete(r,a,u):we.mayCreate(r,a))throw new we.ErrnoError(d);if(!n.node_ops.rename)throw new we.ErrnoError(63);if(we.isMountpoint(c)||l&&we.isMountpoint(l))throw new we.ErrnoError(10);if(r!==n&&(d=we.nodePermissions(n,"w")))throw new we.ErrnoError(d);we.hashRemoveNode(c);try{n.node_ops.rename(c,r,a)}catch(e){throw e}finally{we.hashAddNode(c)}}},rmdir(e){var t=we.lookupPath(e,{parent:!0}).node,n=oe.basename(e),r=we.lookupNode(t,n),s=we.mayDelete(t,n,!0);if(s)throw new we.ErrnoError(s);if(!t.node_ops.rmdir)throw new we.ErrnoError(63);if(we.isMountpoint(r))throw new we.ErrnoError(10);t.node_ops.rmdir(t,n),we.destroyNode(r)},readdir(e){var t=we.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new we.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=we.lookupPath(e,{parent:!0}).node;if(!t)throw new we.ErrnoError(44);var n=oe.basename(e),r=we.lookupNode(t,n),s=we.mayDelete(t,n,!1);if(s)throw new we.ErrnoError(s);if(!t.node_ops.unlink)throw new we.ErrnoError(63);if(we.isMountpoint(r))throw new we.ErrnoError(10);t.node_ops.unlink(t,n),we.destroyNode(r)},readlink(e){var t=we.lookupPath(e).node;if(!t)throw new we.ErrnoError(44);if(!t.node_ops.readlink)throw new we.ErrnoError(28);return le.resolve(we.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=we.lookupPath(e,{follow:!t}).node;if(!n)throw new we.ErrnoError(44);if(!n.node_ops.getattr)throw new we.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>we.stat(e,!0),chmod(e,t,n){var r;if(!(r="string"==typeof e?we.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new we.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod(e,t){we.chmod(e,t,!0)},fchmod(e,t){var n=we.getStreamChecked(e);we.chmod(n.node,t)},chown(e,t,n,r){var s;if(!(s="string"==typeof e?we.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new we.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,n){we.chown(e,t,n,!0)},fchown(e,t,n){var r=we.getStreamChecked(e);we.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new we.ErrnoError(28);var n;if(!(n="string"==typeof e?we.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new we.ErrnoError(63);if(we.isDir(n.mode))throw new we.ErrnoError(31);if(!we.isFile(n.mode))throw new we.ErrnoError(28);var r=we.nodePermissions(n,"w");if(r)throw new we.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=we.getStreamChecked(e);if(!(2097155&n.flags))throw new we.ErrnoError(28);we.truncate(n.node,t)},utime(e,t,n){var r=we.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(""===e)throw new we.ErrnoError(44);var r;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&n|32768:0,"object"==typeof e)r=e;else{e=oe.normalize(e);try{r=we.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(r){if(128&t)throw new we.ErrnoError(20)}else r=we.mknod(e,n,0),s=!0;if(!r)throw new we.ErrnoError(44);if(we.isChrdev(r.mode)&&(t&=-513),65536&t&&!we.isDir(r.mode))throw new we.ErrnoError(54);if(!s){var o=we.mayOpen(r,t);if(o)throw new we.ErrnoError(o)}512&t&&!s&&we.truncate(r,0),t&=-131713;var a=we.createStream({node:r,path:we.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(we.readFiles||(we.readFiles={}),e in we.readFiles||(we.readFiles[e]=1)),a},close(e){if(we.isClosed(e))throw new we.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{we.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,n){if(we.isClosed(e))throw new we.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new we.ErrnoError(70);if(0!=n&&1!=n&&2!=n)throw new we.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,s){if(O(n>=0),r<0||s<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(1==(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.read)throw new we.ErrnoError(28);var i=void 0!==s;if(i){if(!e.seekable)throw new we.ErrnoError(70)}else s=e.position;var o=e.stream_ops.read(e,t,n,r,s);return i||(e.position+=o),o},write(e,t,n,r,s,i){if(O(n>=0),r<0||s<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.write)throw new we.ErrnoError(28);e.seekable&&1024&e.flags&&we.llseek(e,0,2);var o=void 0!==s;if(o){if(!e.seekable)throw new we.ErrnoError(70)}else s=e.position;var a=e.stream_ops.write(e,t,n,r,s,i);return o||(e.position+=a),a},allocate(e,t,n){if(we.isClosed(e))throw new we.ErrnoError(8);if(t<0||n<=0)throw new we.ErrnoError(28);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(!we.isFile(e.node.mode)&&!we.isDir(e.node.mode))throw new we.ErrnoError(43);if(!e.stream_ops.allocate)throw new we.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,s){if(2&r&&!(2&s)&&2!=(2097155&e.flags))throw new we.ErrnoError(2);if(1==(2097155&e.flags))throw new we.ErrnoError(2);if(!e.stream_ops.mmap)throw new we.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,s)},msync:(e,t,n,r,s)=>(O(n>=0),e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,s):0),munmap:e=>0,ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new we.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=we.open(e,t.flags),s=we.stat(e).size,i=new Uint8Array(s);return we.read(r,i,0,s,0),"utf8"===t.encoding?n=_e(i,0):"binary"===t.encoding&&(n=i),we.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=we.open(e,n.flags,n.mode);if("string"==typeof t){var s=new Uint8Array(de(t)+1),i=fe(t,s,0,s.length);we.write(r,s,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");we.write(r,t,0,t.byteLength,void 0,n.canOwn)}we.close(r)},cwd:()=>we.currentPath,chdir(e){var t=we.lookupPath(e,{follow:!0});if(null===t.node)throw new we.ErrnoError(44);if(!we.isDir(t.node.mode))throw new we.ErrnoError(54);var n=we.nodePermissions(t.node,"x");if(n)throw new we.ErrnoError(n);we.currentPath=t.path},createDefaultDirectories(){we.mkdir("/tmp"),we.mkdir("/home"),we.mkdir("/home/web_user")},createDefaultDevices(){we.mkdir("/dev"),we.registerDevice(we.makedev(1,3),{read:()=>0,write:(e,t,n,r,s)=>r}),we.mkdev("/dev/null",we.makedev(1,3)),he.register(we.makedev(5,0),he.default_tty_ops),he.register(we.makedev(6,0),he.default_tty1_ops),we.mkdev("/dev/tty",we.makedev(5,0)),we.mkdev("/dev/tty1",we.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(0===t&&(t=ae(e).byteLength),e[--t]);we.createDevice("/dev","random",n),we.createDevice("/dev","urandom",n),we.mkdir("/dev/shm"),we.mkdir("/dev/shm/tmp")},createSpecialDirectories(){we.mkdir("/proc");var e=we.mkdir("/proc/self");we.mkdir("/proc/self/fd"),we.mount({mount(){var t=we.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var n=+t,r=we.getStreamChecked(n),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return s.parent=s,s}},t}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?we.createDevice("/dev","stdin",i.stdin):we.symlink("/dev/tty","/dev/stdin"),i.stdout?we.createDevice("/dev","stdout",null,i.stdout):we.symlink("/dev/tty","/dev/stdout"),i.stderr?we.createDevice("/dev","stderr",null,i.stderr):we.symlink("/dev/tty1","/dev/stderr");var e=we.open("/dev/stdin",0),t=we.open("/dev/stdout",1),n=we.open("/dev/stderr",1);O(0===e.fd,`invalid handle for stdin (${e.fd})`),O(1===t.fd,`invalid handle for stdout (${t.fd})`),O(2===n.fd,`invalid handle for stderr (${n.fd})`)},ensureErrnoError(){we.ErrnoError||(we.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){for(var t in this.errno=e,ve)if(ve[t]===e){this.code=t;break}},this.setErrno(e),this.message=Ee[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=this.stack.replace(/\b_Z[\w\d_]+/g,(function(e){var t,n=(t=e,ie("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),t);return e===n?e:n+" ["+e+"]"})))},we.ErrnoError.prototype=new Error,we.ErrnoError.prototype.constructor=we.ErrnoError,[44].forEach((e=>{we.genericErrors[e]=new we.ErrnoError(e),we.genericErrors[e].stack=""})))},staticInit(){we.ensureErrnoError(),we.nameTable=new Array(4096),we.mount(be,{},"/"),we.createDefaultDirectories(),we.createDefaultDevices(),we.createSpecialDirectories(),we.filesystems={MEMFS:be}},init(e,t,n){O(!we.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),we.init.initialized=!0,we.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=n||i.stderr,we.createStandardStreams()},quit(){we.init.initialized=!1,Ue(0);for(var e=0;ethis.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),s=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;s||(o=r);var a=this;a.setDataGetter((e=>{var t=e*o,s=(e+1)*o-1;if(s=Math.min(s,r-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var s=new XMLHttpRequest;if(s.open("GET",n,!1),r!==o&&s.setRequestHeader("Range","bytes="+e+"-"+t),s.responseType="arraybuffer",s.overrideMimeType&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.send(null),!(s.status>=200&&s.status<300||304===s.status))throw new Error("Couldn't load "+n+". Status: "+s.status);return void 0!==s.response?new Uint8Array(s.response||[]):pe(s.responseText||"",!0)})(t,s)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&r||(o=r=1,r=this.getter(0).length,o=r,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=o,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var o=new i;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:o}}else a={isDevice:!1,url:n};var l=we.createFile(e,t,a,r,s);a.contents?l.contents=a.contents:a.url&&(l.contents=null,l.url=a.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function _(e,t,n,r,s){var i=e.node.contents;if(s>=i.length)return 0;var o=Math.min(i.length-s,r);if(O(o>=0),i.slice)for(var a=0;a{var t=l.stream_ops[e];c[e]=function(){return we.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,n,r,s)=>(we.forceLoadFile(l),_(e,t,n,r,s)),c.mmap=(e,t,n,r,s)=>{we.forceLoadFile(l);var i=ge(t);if(!i)throw new we.ErrnoError(48);return _(e,S,i,t,n),{ptr:i,allocated:!0}},l.stream_ops=c,l},absolutePath(){$("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder(){$("FS.createFolder has been removed; use FS.mkdir instead")},createLink(){$("FS.createLink has been removed; use FS.symlink instead")},joinPath(){$("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc(){$("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath(){$("FS.standardizePath has been removed; use PATH.normalize instead")}},Se={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(oe.isAbs(t))return t;var r;if(r=-100===e?we.cwd():Se.getStreamFromFD(e).path,0==t.length){if(!n)throw new we.ErrnoError(44);return r}return oe.join2(r,t)},doStat(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(we.getPath(e.node)))return-54;throw e}T[n>>2]=r.dev,T[n+4>>2]=r.mode,I[n+8>>2]=r.nlink,T[n+12>>2]=r.uid,T[n+16>>2]=r.gid,T[n+20>>2]=r.rdev,k[n+24>>3]=BigInt(r.size),T[n+32>>2]=4096,T[n+36>>2]=r.blocks;var s=r.atime.getTime(),i=r.mtime.getTime(),o=r.ctime.getTime();return k[n+40>>3]=BigInt(Math.floor(s/1e3)),I[n+48>>2]=s%1e3*1e3,k[n+56>>3]=BigInt(Math.floor(i/1e3)),I[n+64>>2]=i%1e3*1e3,k[n+72>>3]=BigInt(Math.floor(o/1e3)),I[n+80>>2]=o%1e3*1e3,k[n+88>>3]=BigInt(r.ino),0},doMsync(e,t,n,r,s){if(!we.isFile(t.node.mode))throw new we.ErrnoError(43);if(2&r)return 0;var i=A.slice(e,e+n);we.msync(t,i,s,n,r)},varargs:void 0,get(){O(null!=Se.varargs);var e=T[+Se.varargs>>2];return Se.varargs+=4,e},getp:()=>Se.get(),getStr(e){var t=(e=>(O("number"==typeof e),e?_e(A,e,void 0):""))(e);return t},getStreamFromFD:e=>we.getStreamChecked(e)},Ae=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),xe=(e,t,n)=>(O("number"==typeof n,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),fe(e,A,t,n)),Te=e=>I[e>>2]+4294967296*T[e+4>>2],Ie=[0,31,60,91,121,152,182,213,244,274,305,335],ke=[0,31,59,90,120,151,181,212,243,273,304,334],Fe=e=>{var t=de(e)+1,n=je(t);return n&&xe(e,n,t),n};me=()=>performance.now();var Oe=e=>{var t=q.buffer,n=(e-t.byteLength+65535)/65536;try{return q.grow(n),P(),1}catch(n){w(`growMemory: Attempted to grow heap from ${t.byteLength} bytes to ${e} bytes, but got error: ${n}`)}},Pe={},Le=()=>{if(!Le.strings){var 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",_:c||"./this.program"};for(var t in Pe)void 0===Pe[t]?delete e[t]:e[t]=Pe[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);Le.strings=n}return Le.strings},Ce=function(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=we.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};Object.defineProperties(Ce.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return we.isDir(this.mode)}},isDevice:{get:function(){return we.isChrdev(this.mode)}}}),we.FSNode=Ce,we.createPreloadedFile=(e,t,n,r,s,i,o,a,l,c)=>{var _=t?le.resolve(oe.join2(e,t)):e,u=Q(`cp ${_}`);function d(n){function d(n){c&&c(),a||((e,t,n,r,s,i)=>{we.createDataFile(e,t,n,r,s,i)})(e,t,n,r,s,l),i&&i(),V(u)}((e,t,n,r)=>{"undefined"!=typeof Browser&&Browser.init();var s=!1;return ye.forEach((i=>{s||i.canHandle(t)&&(i.handle(e,t,n,r),s=!0)})),s})(n,_,d,(()=>{o&&o(),V(u)}))||d(n)}G(u),"string"==typeof n?((e,t,n)=>{var r=Q(`al ${e}`);m(e,(t=>{O(t,`Loading data file "${e}" failed (no arrayBuffer).`),d(new Uint8Array(t)),r&&V(r)}),(t=>{if(!n)throw`Loading data file "${e}" failed.`;n()})),r&&G(r)})(n,0,o):d(n)},we.staticInit(),ve={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var Ne,De={__syscall_chmod:function(e,t){try{return e=Se.getStr(e),we.chmod(e,t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_faccessat:function(e,t,n,r){try{if(t=Se.getStr(t),O(0===r),t=Se.calculateAt(e,t),-8&n)return-28;var s=we.lookupPath(t,{follow:!0}).node;if(!s)return-44;var i="";return 4&n&&(i+="r"),2&n&&(i+="w"),1&n&&(i+="x"),i&&we.nodePermissions(s,i)?-2:0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchmod:function(e,t){try{return we.fchmod(e,t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fchown32:function(e,t,n){try{return we.fchown(e,t,n),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fcntl64:function(e,t,n){Se.varargs=n;try{var r=Se.getStreamFromFD(e);switch(t){case 0:if((s=Se.get())<0)return-28;for(;we.streams[s];)s++;return we.createStream(r,s).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var s=Se.get();return r.flags|=s,0;case 5:return s=Se.getp(),x[s+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Me()>>2]=28,-1}}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_fstat64:function(e,t){try{var n=Se.getStreamFromFD(e);return Se.doStat(we.stat,n.path,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_ftruncate64:function(e,t){t=Ae(t);try{return isNaN(t)?61:(we.ftruncate(e,t),0)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_getcwd:function(e,t){try{if(0===t)return-28;var n=we.cwd(),r=de(n)+1;return t>2]=s.c_iflag||0,T[i+4>>2]=s.c_oflag||0,T[i+8>>2]=s.c_cflag||0,T[i+12>>2]=s.c_lflag||0;for(var o=0;o<32;o++)S[i+o+17|0]=s.c_cc[o]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){i=Se.getp();var a=T[i>>2],l=T[i+4>>2],c=T[i+8>>2],_=T[i+12>>2],u=[];for(o=0;o<32;o++)u.push(S[i+o+17|0]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:a,c_oflag:l,c_cflag:c,c_lflag:_,c_cc:u})}return 0;case 21519:return r.tty?(i=Se.getp(),T[i>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21531:return i=Se.getp(),we.ioctl(r,t,i);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var d=r.tty.ops.ioctl_tiocgwinsz(r.tty);i=Se.getp(),x[i>>1]=d[0],x[i+2>>1]=d[1]}return 0;default:return-28}}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_lstat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(we.lstat,e,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_mkdirat:function(e,t,n){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),"/"===(t=oe.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),we.mkdir(t,n,0),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_newfstatat:function(e,t,n,r){try{t=Se.getStr(t);var s=256&r,i=4096&r;return O(!(r&=-6401),`unknown flags in __syscall_newfstatat: ${r}`),t=Se.calculateAt(e,t,i),Se.doStat(s?we.lstat:we.stat,t,n)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_openat:function(e,t,n,r){Se.varargs=r;try{t=Se.getStr(t),t=Se.calculateAt(e,t);var s=r?Se.get():0;return we.open(t,n,s).fd}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_readlinkat:function(e,t,n,r){try{if(t=Se.getStr(t),t=Se.calculateAt(e,t),r<=0)return-28;var s=we.readlink(t),i=Math.min(r,de(s)),o=S[n+i];return xe(s,n,r+1),S[n+i]=o,i}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_rmdir:function(e){try{return e=Se.getStr(e),we.rmdir(e),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_stat64:function(e,t){try{return e=Se.getStr(e),Se.doStat(we.stat,e,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_unlinkat:function(e,t,n){try{return t=Se.getStr(t),t=Se.calculateAt(e,t),0===n?we.unlink(t):512===n?we.rmdir(t):$("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},__syscall_utimensat:function(e,t,n,r){try{if(t=Se.getStr(t),O(0===r),t=Se.calculateAt(e,t,!0),n){var s=Te(n),i=T[n+8>>2];o=1e3*s+i/1e6,a=1e3*(s=Te(n+=16))+(i=T[n+8>>2])/1e6}else var o=Date.now(),a=o;return we.utime(t,o,a),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_emscripten_get_now_is_monotonic:()=>!0,_localtime_js:function(e,t){e=Ae(e);var n=new Date(1e3*e);T[t>>2]=n.getSeconds(),T[t+4>>2]=n.getMinutes(),T[t+8>>2]=n.getHours(),T[t+12>>2]=n.getDate(),T[t+16>>2]=n.getMonth(),T[t+20>>2]=n.getFullYear()-1900,T[t+24>>2]=n.getDay();var r=0|(e=>{var t;return((t=e.getFullYear())%4!=0||t%100==0&&t%400!=0?ke:Ie)[e.getMonth()]+e.getDate()-1})(n);T[t+28>>2]=r,T[t+36>>2]=-60*n.getTimezoneOffset();var s=new Date(n.getFullYear(),0,1),i=new Date(n.getFullYear(),6,1).getTimezoneOffset(),o=s.getTimezoneOffset(),a=0|(i!=o&&n.getTimezoneOffset()==Math.min(o,i));T[t+32>>2]=a},_mmap_js:function(e,t,n,r,s,i,o){s=Ae(s);try{if(isNaN(s))return 61;var a=Se.getStreamFromFD(r),l=we.mmap(a,e,s,t,n),c=l.ptr;return T[i>>2]=l.allocated,I[o>>2]=c,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_munmap_js:function(e,t,n,r,s,i){i=Ae(i);try{if(isNaN(i))return 61;var o=Se.getStreamFromFD(s);2&n&&Se.doMsync(e,o,t,r,i),we.munmap(o)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_tzset_js:(e,t,n)=>{var r=(new Date).getFullYear(),s=new Date(r,0,1),i=new Date(r,6,1),o=s.getTimezoneOffset(),a=i.getTimezoneOffset(),l=Math.max(o,a);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[e>>2]=60*l,T[t>>2]=Number(o!=a);var _=c(s),u=c(i),d=Fe(_),f=Fe(u);a>2]=d,I[n+4>>2]=f):(I[n>>2]=f,I[n+4>>2]=d)},emscripten_date_now:()=>Date.now(),emscripten_get_now:me,emscripten_memcpy_js:(e,t,n)=>A.copyWithin(e,t,t+n),emscripten_resize_heap:e=>{var t=A.length;O((e>>>=0)>t);var n=2147483648;if(e>n)return w(`Cannot enlarge memory, requested ${e} bytes, but the limit is 2147483648 bytes!`),!1;for(var r,s=1;s<=4;s*=2){var i=t*(1+.2/s);i=Math.min(i,e+100663296);var o=Math.min(n,(r=Math.max(e,i))+(65536-r%65536)%65536);if(Oe(o))return!0}return w(`Failed to grow the heap from ${t} bytes to ${o} bytes, not enough memory!`),!1},environ_get:(e,t)=>{var n=0;return Le().forEach(((r,s)=>{var i=t+n;I[e+4*s>>2]=i,((e,t)=>{for(var n=0;n{var n=Le();I[e>>2]=n.length;var r=0;return n.forEach((e=>r+=e.length+1)),I[t>>2]=r,0},fd_close:function(e){try{var t=Se.getStreamFromFD(e);return we.close(t),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_fdstat_get:function(e,t){try{var n=Se.getStreamFromFD(e),r=n.tty?2:we.isDir(n.mode)?3:we.isLink(n.mode)?7:4;return S[0|t]=r,x[t+2>>1]=0,k[t+8>>3]=BigInt(0),k[t+16>>3]=BigInt(0),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_read:function(e,t,n,r){try{var s=((e,t,n,r)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=we.read(e,S,o,a,r);if(l<0)return-1;if(s+=l,l>2]=s,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_seek:function(e,t,n,r){t=Ae(t);try{if(isNaN(t))return 61;var s=Se.getStreamFromFD(e);return we.llseek(s,t,n),k[r>>3]=BigInt(s.position),s.getdents&&0===t&&0===n&&(s.getdents=null),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_sync:function(e){try{var t=Se.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},fd_write:function(e,t,n,r){try{var s=((e,t,n,r)=>{for(var s=0,i=0;i>2],a=I[t+4>>2];t+=8;var l=we.write(e,S,o,a,r);if(l<0)return-1;s+=l,void 0!==r&&(r+=l)}return s})(Se.getStreamFromFD(e),t,n);return I[r>>2]=s,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},memory:q},Re=function(){var e={env:De,wasi_snapshot_preview1:De};function t(e,t){var n;return n=(Re=e.exports).__wasm_call_ctors,D.unshift(n),V("wasm-instantiate"),Re}G("wasm-instantiate");var n,r,o,a,l=i;if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){w(`Module.instantiateWasm callback failed with error: ${e}`),s(e)}return(n=y,r=j,o=e,a=function(e){O(i===l,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),l=null,t(e.instance)},n||"function"!=typeof WebAssembly.instantiateStreaming||K(r)||"function"!=typeof fetch?X(r,o,a):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,o).then(a,(function(e){return w(`wasm streaming compile failed: ${e}`),w("falling back to ArrayBuffer instantiation"),X(r,o,a)}))))).catch(s),{}}(),Me=(J("__wasm_call_ctors"),i._sqlite3_status64=J("sqlite3_status64"),i._sqlite3_status=J("sqlite3_status"),i._sqlite3_db_status=J("sqlite3_db_status"),i._sqlite3_msize=J("sqlite3_msize"),i._sqlite3_vfs_find=J("sqlite3_vfs_find"),i._sqlite3_initialize=J("sqlite3_initialize"),i._sqlite3_vfs_register=J("sqlite3_vfs_register"),i._sqlite3_vfs_unregister=J("sqlite3_vfs_unregister"),i._sqlite3_malloc=J("sqlite3_malloc"),i._sqlite3_malloc64=J("sqlite3_malloc64"),i._sqlite3_free=J("sqlite3_free"),i._sqlite3_realloc=J("sqlite3_realloc"),i._sqlite3_realloc64=J("sqlite3_realloc64"),i._sqlite3_value_int64=J("sqlite3_value_int64"),i._sqlite3_value_double=J("sqlite3_value_double"),i._sqlite3_value_text=J("sqlite3_value_text"),i._sqlite3_randomness=J("sqlite3_randomness"),i._sqlite3_stricmp=J("sqlite3_stricmp"),i._sqlite3_strnicmp=J("sqlite3_strnicmp"),J("__errno_location")),je=(i._sqlite3_serialize=J("sqlite3_serialize"),i._sqlite3_prepare_v2=J("sqlite3_prepare_v2"),i._sqlite3_step=J("sqlite3_step"),i._sqlite3_column_int64=J("sqlite3_column_int64"),i._sqlite3_column_int=J("sqlite3_column_int"),i._sqlite3_finalize=J("sqlite3_finalize"),i._sqlite3_file_control=J("sqlite3_file_control"),i._sqlite3_reset=J("sqlite3_reset"),i._sqlite3_value_int=J("sqlite3_value_int"),i._sqlite3_deserialize=J("sqlite3_deserialize"),i._sqlite3_clear_bindings=J("sqlite3_clear_bindings"),i._sqlite3_value_blob=J("sqlite3_value_blob"),i._sqlite3_value_bytes=J("sqlite3_value_bytes"),i._sqlite3_value_subtype=J("sqlite3_value_subtype"),i._sqlite3_value_pointer=J("sqlite3_value_pointer"),i._sqlite3_value_type=J("sqlite3_value_type"),i._sqlite3_value_nochange=J("sqlite3_value_nochange"),i._sqlite3_value_frombind=J("sqlite3_value_frombind"),i._sqlite3_value_dup=J("sqlite3_value_dup"),i._sqlite3_value_free=J("sqlite3_value_free"),i._sqlite3_result_blob=J("sqlite3_result_blob"),i._sqlite3_result_error_toobig=J("sqlite3_result_error_toobig"),i._sqlite3_result_error_nomem=J("sqlite3_result_error_nomem"),i._sqlite3_result_double=J("sqlite3_result_double"),i._sqlite3_result_error=J("sqlite3_result_error"),i._sqlite3_result_int=J("sqlite3_result_int"),i._sqlite3_result_int64=J("sqlite3_result_int64"),i._sqlite3_result_null=J("sqlite3_result_null"),i._sqlite3_result_pointer=J("sqlite3_result_pointer"),i._sqlite3_result_subtype=J("sqlite3_result_subtype"),i._sqlite3_result_text=J("sqlite3_result_text"),i._sqlite3_result_zeroblob=J("sqlite3_result_zeroblob"),i._sqlite3_result_zeroblob64=J("sqlite3_result_zeroblob64"),i._sqlite3_result_error_code=J("sqlite3_result_error_code"),i._sqlite3_sql=J("sqlite3_sql"),i._sqlite3_user_data=J("sqlite3_user_data"),i._sqlite3_context_db_handle=J("sqlite3_context_db_handle"),i._sqlite3_vtab_nochange=J("sqlite3_vtab_nochange"),i._sqlite3_vtab_in_first=J("sqlite3_vtab_in_first"),i._sqlite3_vtab_in_next=J("sqlite3_vtab_in_next"),i._sqlite3_aggregate_context=J("sqlite3_aggregate_context"),i._sqlite3_get_auxdata=J("sqlite3_get_auxdata"),i._sqlite3_set_auxdata=J("sqlite3_set_auxdata"),i._sqlite3_column_count=J("sqlite3_column_count"),i._sqlite3_data_count=J("sqlite3_data_count"),i._sqlite3_column_blob=J("sqlite3_column_blob"),i._sqlite3_column_bytes=J("sqlite3_column_bytes"),i._sqlite3_column_double=J("sqlite3_column_double"),i._sqlite3_column_text=J("sqlite3_column_text"),i._sqlite3_column_value=J("sqlite3_column_value"),i._sqlite3_column_type=J("sqlite3_column_type"),i._sqlite3_column_name=J("sqlite3_column_name"),i._sqlite3_bind_blob=J("sqlite3_bind_blob"),i._sqlite3_bind_double=J("sqlite3_bind_double"),i._sqlite3_bind_int=J("sqlite3_bind_int"),i._sqlite3_bind_int64=J("sqlite3_bind_int64"),i._sqlite3_bind_null=J("sqlite3_bind_null"),i._sqlite3_bind_pointer=J("sqlite3_bind_pointer"),i._sqlite3_bind_text=J("sqlite3_bind_text"),i._sqlite3_bind_parameter_count=J("sqlite3_bind_parameter_count"),i._sqlite3_bind_parameter_index=J("sqlite3_bind_parameter_index"),i._sqlite3_db_handle=J("sqlite3_db_handle"),i._sqlite3_stmt_readonly=J("sqlite3_stmt_readonly"),i._sqlite3_stmt_isexplain=J("sqlite3_stmt_isexplain"),i._sqlite3_stmt_status=J("sqlite3_stmt_status"),i._sqlite3_expanded_sql=J("sqlite3_expanded_sql"),i._sqlite3_preupdate_old=J("sqlite3_preupdate_old"),i._sqlite3_preupdate_count=J("sqlite3_preupdate_count"),i._sqlite3_preupdate_depth=J("sqlite3_preupdate_depth"),i._sqlite3_preupdate_blobwrite=J("sqlite3_preupdate_blobwrite"),i._sqlite3_preupdate_new=J("sqlite3_preupdate_new"),i._sqlite3_value_numeric_type=J("sqlite3_value_numeric_type"),i._sqlite3_errmsg=J("sqlite3_errmsg"),i._sqlite3_set_authorizer=J("sqlite3_set_authorizer"),i._sqlite3_strglob=J("sqlite3_strglob"),i._sqlite3_strlike=J("sqlite3_strlike"),i._sqlite3_exec=J("sqlite3_exec"),i._sqlite3_auto_extension=J("sqlite3_auto_extension"),i._sqlite3_cancel_auto_extension=J("sqlite3_cancel_auto_extension"),i._sqlite3_reset_auto_extension=J("sqlite3_reset_auto_extension"),i._sqlite3_prepare_v3=J("sqlite3_prepare_v3"),i._sqlite3_create_module=J("sqlite3_create_module"),i._sqlite3_create_module_v2=J("sqlite3_create_module_v2"),i._sqlite3_drop_modules=J("sqlite3_drop_modules"),i._sqlite3_declare_vtab=J("sqlite3_declare_vtab"),i._sqlite3_vtab_on_conflict=J("sqlite3_vtab_on_conflict"),i._sqlite3_vtab_collation=J("sqlite3_vtab_collation"),i._sqlite3_vtab_in=J("sqlite3_vtab_in"),i._sqlite3_vtab_rhs_value=J("sqlite3_vtab_rhs_value"),i._sqlite3_vtab_distinct=J("sqlite3_vtab_distinct"),i._sqlite3_keyword_name=J("sqlite3_keyword_name"),i._sqlite3_keyword_count=J("sqlite3_keyword_count"),i._sqlite3_keyword_check=J("sqlite3_keyword_check"),i._sqlite3_complete=J("sqlite3_complete"),i._sqlite3_libversion=J("sqlite3_libversion"),i._sqlite3_libversion_number=J("sqlite3_libversion_number"),i._sqlite3_shutdown=J("sqlite3_shutdown"),i._sqlite3_last_insert_rowid=J("sqlite3_last_insert_rowid"),i._sqlite3_set_last_insert_rowid=J("sqlite3_set_last_insert_rowid"),i._sqlite3_changes64=J("sqlite3_changes64"),i._sqlite3_changes=J("sqlite3_changes"),i._sqlite3_total_changes64=J("sqlite3_total_changes64"),i._sqlite3_total_changes=J("sqlite3_total_changes"),i._sqlite3_txn_state=J("sqlite3_txn_state"),i._sqlite3_close_v2=J("sqlite3_close_v2"),i._sqlite3_busy_handler=J("sqlite3_busy_handler"),i._sqlite3_progress_handler=J("sqlite3_progress_handler"),i._sqlite3_busy_timeout=J("sqlite3_busy_timeout"),i._sqlite3_create_function=J("sqlite3_create_function"),i._sqlite3_create_function_v2=J("sqlite3_create_function_v2"),i._sqlite3_create_window_function=J("sqlite3_create_window_function"),i._sqlite3_overload_function=J("sqlite3_overload_function"),i._sqlite3_trace_v2=J("sqlite3_trace_v2"),i._sqlite3_commit_hook=J("sqlite3_commit_hook"),i._sqlite3_update_hook=J("sqlite3_update_hook"),i._sqlite3_rollback_hook=J("sqlite3_rollback_hook"),i._sqlite3_preupdate_hook=J("sqlite3_preupdate_hook"),i._sqlite3_error_offset=J("sqlite3_error_offset"),i._sqlite3_errcode=J("sqlite3_errcode"),i._sqlite3_extended_errcode=J("sqlite3_extended_errcode"),i._sqlite3_errstr=J("sqlite3_errstr"),i._sqlite3_limit=J("sqlite3_limit"),i._sqlite3_open=J("sqlite3_open"),i._sqlite3_open_v2=J("sqlite3_open_v2"),i._sqlite3_create_collation=J("sqlite3_create_collation"),i._sqlite3_create_collation_v2=J("sqlite3_create_collation_v2"),i._sqlite3_collation_needed=J("sqlite3_collation_needed"),i._sqlite3_table_column_metadata=J("sqlite3_table_column_metadata"),i._sqlite3_extended_result_codes=J("sqlite3_extended_result_codes"),i._sqlite3_uri_parameter=J("sqlite3_uri_parameter"),i._sqlite3_uri_key=J("sqlite3_uri_key"),i._sqlite3_uri_boolean=J("sqlite3_uri_boolean"),i._sqlite3_uri_int64=J("sqlite3_uri_int64"),i._sqlite3_db_name=J("sqlite3_db_name"),i._sqlite3_db_filename=J("sqlite3_db_filename"),i._sqlite3_compileoption_used=J("sqlite3_compileoption_used"),i._sqlite3_compileoption_get=J("sqlite3_compileoption_get"),i._sqlite3session_diff=J("sqlite3session_diff"),i._sqlite3session_attach=J("sqlite3session_attach"),i._sqlite3session_create=J("sqlite3session_create"),i._sqlite3session_delete=J("sqlite3session_delete"),i._sqlite3session_table_filter=J("sqlite3session_table_filter"),i._sqlite3session_changeset=J("sqlite3session_changeset"),i._sqlite3session_changeset_strm=J("sqlite3session_changeset_strm"),i._sqlite3session_patchset_strm=J("sqlite3session_patchset_strm"),i._sqlite3session_patchset=J("sqlite3session_patchset"),i._sqlite3session_enable=J("sqlite3session_enable"),i._sqlite3session_indirect=J("sqlite3session_indirect"),i._sqlite3session_isempty=J("sqlite3session_isempty"),i._sqlite3session_memory_used=J("sqlite3session_memory_used"),i._sqlite3session_object_config=J("sqlite3session_object_config"),i._sqlite3session_changeset_size=J("sqlite3session_changeset_size"),i._sqlite3changeset_start=J("sqlite3changeset_start"),i._sqlite3changeset_start_v2=J("sqlite3changeset_start_v2"),i._sqlite3changeset_start_strm=J("sqlite3changeset_start_strm"),i._sqlite3changeset_start_v2_strm=J("sqlite3changeset_start_v2_strm"),i._sqlite3changeset_next=J("sqlite3changeset_next"),i._sqlite3changeset_op=J("sqlite3changeset_op"),i._sqlite3changeset_pk=J("sqlite3changeset_pk"),i._sqlite3changeset_old=J("sqlite3changeset_old"),i._sqlite3changeset_new=J("sqlite3changeset_new"),i._sqlite3changeset_conflict=J("sqlite3changeset_conflict"),i._sqlite3changeset_fk_conflicts=J("sqlite3changeset_fk_conflicts"),i._sqlite3changeset_finalize=J("sqlite3changeset_finalize"),i._sqlite3changeset_invert=J("sqlite3changeset_invert"),i._sqlite3changeset_invert_strm=J("sqlite3changeset_invert_strm"),i._sqlite3changeset_apply_v2=J("sqlite3changeset_apply_v2"),i._sqlite3changeset_apply=J("sqlite3changeset_apply"),i._sqlite3changeset_apply_v2_strm=J("sqlite3changeset_apply_v2_strm"),i._sqlite3changeset_apply_strm=J("sqlite3changeset_apply_strm"),i._sqlite3changegroup_new=J("sqlite3changegroup_new"),i._sqlite3changegroup_add=J("sqlite3changegroup_add"),i._sqlite3changegroup_output=J("sqlite3changegroup_output"),i._sqlite3changegroup_add_strm=J("sqlite3changegroup_add_strm"),i._sqlite3changegroup_output_strm=J("sqlite3changegroup_output_strm"),i._sqlite3changegroup_delete=J("sqlite3changegroup_delete"),i._sqlite3changeset_concat=J("sqlite3changeset_concat"),i._sqlite3changeset_concat_strm=J("sqlite3changeset_concat_strm"),i._sqlite3session_config=J("sqlite3session_config"),i._sqlite3_sourceid=J("sqlite3_sourceid"),i._sqlite3_wasm_pstack_ptr=J("sqlite3_wasm_pstack_ptr"),i._sqlite3_wasm_pstack_restore=J("sqlite3_wasm_pstack_restore"),i._sqlite3_wasm_pstack_alloc=J("sqlite3_wasm_pstack_alloc"),i._sqlite3_wasm_pstack_remaining=J("sqlite3_wasm_pstack_remaining"),i._sqlite3_wasm_pstack_quota=J("sqlite3_wasm_pstack_quota"),i._sqlite3_wasm_db_error=J("sqlite3_wasm_db_error"),i._sqlite3_wasm_test_struct=J("sqlite3_wasm_test_struct"),i._sqlite3_wasm_enum_json=J("sqlite3_wasm_enum_json"),i._sqlite3_wasm_vfs_unlink=J("sqlite3_wasm_vfs_unlink"),i._sqlite3_wasm_db_vfs=J("sqlite3_wasm_db_vfs"),i._sqlite3_wasm_db_reset=J("sqlite3_wasm_db_reset"),i._sqlite3_wasm_db_export_chunked=J("sqlite3_wasm_db_export_chunked"),i._sqlite3_wasm_db_serialize=J("sqlite3_wasm_db_serialize"),i._sqlite3_wasm_vfs_create_file=J("sqlite3_wasm_vfs_create_file"),i._sqlite3_wasm_posix_create_file=J("sqlite3_wasm_posix_create_file"),i._sqlite3_wasm_kvvfsMakeKeyOnPstack=J("sqlite3_wasm_kvvfsMakeKeyOnPstack"),i._sqlite3_wasm_kvvfs_methods=J("sqlite3_wasm_kvvfs_methods"),i._sqlite3_wasm_vtab_config=J("sqlite3_wasm_vtab_config"),i._sqlite3_wasm_db_config_ip=J("sqlite3_wasm_db_config_ip"),i._sqlite3_wasm_db_config_pii=J("sqlite3_wasm_db_config_pii"),i._sqlite3_wasm_db_config_s=J("sqlite3_wasm_db_config_s"),i._sqlite3_wasm_config_i=J("sqlite3_wasm_config_i"),i._sqlite3_wasm_config_ii=J("sqlite3_wasm_config_ii"),i._sqlite3_wasm_config_j=J("sqlite3_wasm_config_j"),i._sqlite3_wasm_init_wasmfs=J("sqlite3_wasm_init_wasmfs"),i._sqlite3_wasm_test_intptr=J("sqlite3_wasm_test_intptr"),i._sqlite3_wasm_test_voidptr=J("sqlite3_wasm_test_voidptr"),i._sqlite3_wasm_test_int64_max=J("sqlite3_wasm_test_int64_max"),i._sqlite3_wasm_test_int64_min=J("sqlite3_wasm_test_int64_min"),i._sqlite3_wasm_test_int64_times2=J("sqlite3_wasm_test_int64_times2"),i._sqlite3_wasm_test_int64_minmax=J("sqlite3_wasm_test_int64_minmax"),i._sqlite3_wasm_test_int64ptr=J("sqlite3_wasm_test_int64ptr"),i._sqlite3_wasm_test_stack_overflow=J("sqlite3_wasm_test_stack_overflow"),i._sqlite3_wasm_test_str_hello=J("sqlite3_wasm_test_str_hello"),i._sqlite3_wasm_SQLTester_strglob=J("sqlite3_wasm_SQLTester_strglob"),i._malloc=J("malloc")),Ue=(i._free=J("free"),i._realloc=J("realloc"),i._fflush=J("fflush")),Be=J("emscripten_builtin_memalign"),ze=()=>(ze=Re.emscripten_stack_init)(),We=()=>(We=Re.emscripten_stack_get_end)();function He(){function e(){Ne||(Ne=!0,i.calledRun=!0,F||(O(!M),M=!0,C(),i.noFSInit||we.init.initialized||we.init(),we.ignorePermissions=!1,he.init(),re(D),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),O(!i._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(C(),i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),R.unshift(e);var e;re(R)}()))}var n;B>0||(ze(),O(!(3&(n=We()))),0==n&&(n+=4),I[n>>2]=34821223,I[n+4>>2]=2310721022,I[0]=1668509029,function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),N.unshift(e);var e;re(N)}(),B>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e(),C()))}if(J("stackSave"),J("stackRestore"),J("stackAlloc"),i.wasmMemory=q,["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","exitJS","arraySum","addDays","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","handleAllocatorInit","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToUTF8OnStack","writeArrayToMemory","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","__glGenObject","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","SDL_unicode","SDL_ttfContext","SDL_audio","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory"].forEach((function(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",n=e;n.startsWith("_")||(n="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='"+n+"')",ee(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),ie(t)}}),ne(e)})),["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","keepRuntimeAlive","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","ptrToString","zeroMemory","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","getExecutableName","asyncLoad","alignMemory","mmapAlloc","wasmTable","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToNewUTF8","JSEvents","specialHTMLTargets","currentFullscreenStrategy","restoreOldWindowedStyle","demangle","demangleAll","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","emscripten_webgl_power_preferences","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"].forEach(ne),W=function e(){Ne||He(),Ne||(W=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return He(),i.postRun||(i.postRun=[]),i.postRun.push((function(e){if(globalThis.sqlite3ApiBootstrap=function t(n=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return console.warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const r=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:void 0!==e?!!e.HEAPU64:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},n||{});Object.assign(r,{allocExportName:r.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:r.useStdAlloc?"free":"sqlite3_free",reallocExportName:r.useStdAlloc?"realloc":"sqlite3_realloc"},r),["exports","memory","wasmfsOpfsDir"].forEach((e=>{"function"==typeof r[e]&&(r[e]=r[e]())}));const s=Object.create(null),i=Object.create(null),o=e=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(e)||"Unknown result code #"+e;class a extends Error{constructor(...e){let t;if(e.length)if("number"==typeof(n=e[0])&&n===(0|n))if(t=e[0],1===e.length)super(o(e[0]));else{const n=o(t);"object"==typeof e[1]?super(n,e[1]):(e[0]=n+":",super(e.join(" ")))}else 2===e.length&&"object"==typeof e[1]?super(...e):super(e.join(" "));var n;this.resultCode=t||s.SQLITE_ERROR,this.name="SQLite3Error"}}a.toss=(...e)=>{throw new a(...e)};const l=a.toss;r.wasmfsOpfsDir&&!/^\/[^/]+$/.test(r.wasmfsOpfsDir)&&l("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const c=e=>"bigint"!=typeof e&&!!(e===(0|e)&&e<=2147483647&&e>=-2147483648),_="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,u=e=>e.buffer instanceof _,d=(e,t,n)=>u(e)?e.slice(t,n):e.subarray(t,n),f=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),p=e=>e&&(e instanceof Uint8Array||e instanceof Int8Array||e instanceof ArrayBuffer),m=e=>f(e)||l("Value is not of a supported TypedArray type."),h=new TextDecoder("utf-8"),g=function(e,t,n){return h.decode(d(e,t,n))},b=function(e){return p(e)?g(e instanceof ArrayBuffer?new Uint8Array(e):e):Array.isArray(e)?e.join(""):(i.isPtr(e)&&(e=i.cstrToJs(e)),e)};class y extends Error{constructor(...e){2===e.length&&"object"==typeof e[1]?super(...e):e.length?super(e.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}y.toss=(...e)=>{throw new y(...e)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(e,t,n,r,s,i,o,a,l)=>{},sqlite3_create_function:(e,t,n,r,s,i,o,a)=>{},sqlite3_create_window_function:(e,t,n,r,s,i,o,a,l,c)=>{},sqlite3_prepare_v3:(e,t,n,r,s,i)=>{},sqlite3_prepare_v2:(e,t,n,r,s)=>{},sqlite3_exec:(e,t,n,r,s)=>{},sqlite3_randomness:(e,t)=>{}});const q={affirmBindableTypedArray:m,flexibleString:b,bigIntFits32:e=>e>=-2147483648n&&e<=0x7fffffffn,bigIntFits64:function e(t){return e._max||(e._max=BigInt("0x7fffffffffffffff"),e._min=~e._max),t>=e._min&&t<=e._max},bigIntFitsDouble:function e(t){return e._min||(e._min=Number.MIN_SAFE_INTEGER,e._max=Number.MAX_SAFE_INTEGER),t>=e._min&&t<=e._max},isBindableTypedArray:f,isInt32:c,isSQLableTypedArray:p,isTypedArray:e=>!!(e&&e.constructor&&c(e.constructor.BYTES_PER_ELEMENT))&&e,typedArrayToString:g,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:u,toss:function(...e){throw new Error(e.join(" "))},toss3:l,typedArrayPart:d,affirmDbHeader:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));15>e.byteLength&&l("Input does not contain an SQLite3 database header.");for(let t=0;t<15;++t)"SQLite format 3".charCodeAt(t)!==e[t]&&l("Input does not contain an SQLite3 database header.")},affirmIsDb:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const t=e.byteLength;(t<512||t%512!=0)&&l("Byte array size",t,"is invalid for an SQLite3 db."),q.affirmDbHeader(e)}};Object.assign(i,{ptrSizeof:r.wasmPtrSizeof||4,ptrIR:r.wasmPtrIR||"i32",bigIntEnabled:!!r.bigIntEnabled,exports:r.exports||l("Missing API config.exports (WASM module exports)."),memory:r.memory||r.exports.memory||l("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),i.allocFromTypedArray=function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e)),m(e);const t=i.alloc(e.byteLength||1);return i.heapForSize(e.constructor).set(e.byteLength?e:[0],t),t};{const e=r.allocExportName,t=r.deallocExportName,n=r.reallocExportName;for(const r of[e,t,n])i.exports[r]instanceof Function||l("Missing required exports[",r,"] function.");i.alloc=function e(t){return e.impl(t)||y.toss("Failed to allocate",t," bytes.")},i.alloc.impl=i.exports[e],i.realloc=function e(t,n){const r=e.impl(t,n);return n?r||y.toss("Failed to reallocate",n," bytes."):0},i.realloc.impl=i.exports[n],i.dealloc=i.exports[t]}let E;if(i.compileOptionUsed=function e(t){if(!arguments.length){if(e._result)return e._result;e._opt||(e._rx=/^([^=]+)=(.+)/,e._rxInt=/^-?\d+$/,e._opt=function(t,n){const r=e._rx.exec(t);n[0]=r?r[1]:t,n[1]=!r||(e._rxInt.test(r[2])?+r[2]:r[2])});const t={},n=[0,0];let r,i=0;for(;r=s.sqlite3_compileoption_get(i++);)e._opt(r,n),t[n[0]]=n[1];return e._result=t}if(Array.isArray(t)){const e={};return t.forEach((t=>{e[t]=s.sqlite3_compileoption_used(t)})),e}return"object"==typeof t?(Object.keys(t).forEach((e=>{t[e]=s.sqlite3_compileoption_used(e)})),t):"string"==typeof t&&!!s.sqlite3_compileoption_used(t)},i.pstack=Object.assign(Object.create(null),{restore:i.exports.sqlite3_wasm_pstack_restore,alloc:function(e){return"string"!=typeof e||(e=i.sizeofIR(e))||y.toss("Invalid value for pstack.alloc(",arguments[0],")"),i.exports.sqlite3_wasm_pstack_alloc(e)||y.toss("Could not allocate",e,"bytes from the pstack.")},allocChunks:function(e,t){"string"!=typeof t||(t=i.sizeofIR(t))||y.toss("Invalid size value for allocChunks(",arguments[1],")");const n=i.pstack.alloc(e*t),r=[];let s=0,o=0;for(;s1===e?i.pstack.alloc(t?8:i.ptrSizeof):i.pstack.allocChunks(e,t?8:i.ptrSizeof),call:function(e){const t=i.pstack.pointer;try{return e(S)}finally{i.pstack.restore(t)}}}),Object.defineProperties(i.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:i.exports.sqlite3_wasm_pstack_remaining}}),s.sqlite3_randomness=(...e)=>{if(1===e.length&&q.isTypedArray(e[0])&&1===e[0].BYTES_PER_ELEMENT){const t=e[0];if(0===t.byteLength)return i.exports.sqlite3_randomness(0,0),t;const n=i.pstack.pointer;try{let e=t.byteLength,n=0;const r=i.exports.sqlite3_randomness,s=i.heap8u(),o=e<512?e:512,a=i.pstack.alloc(o);do{const i=e>o?o:e;r(i,a),t.set(d(s,a,a+i),n),e-=i,n+=i}while(e>0)}catch(e){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",e)}finally{i.pstack.restore(n)}return t}i.exports.sqlite3_randomness(...e)},s.sqlite3_wasmfs_opfs_dir=function(){if(void 0!==E)return E;const e=r.wasmfsOpfsDir;if(!(e&&globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle))return E="";try{return E=e&&0===i.xCallWrapped("sqlite3_wasm_init_wasmfs","i32",["string"],e)?e:""}catch(e){return E=""}},s.sqlite3_wasmfs_filename_is_persistent=function(e){const t=s.sqlite3_wasmfs_opfs_dir();return!(!t||!e)&&e.startsWith(t+"/")},s.sqlite3_js_db_uses_vfs=function(e,t,n=0){try{const r=s.sqlite3_vfs_find(t);return!!r&&(e?r===s.sqlite3_js_db_vfs(e,n)&&r:r===s.sqlite3_vfs_find(0)&&r)}catch(e){return!1}},s.sqlite3_js_vfs_list=function(){const e=[];let t=s.sqlite3_vfs_find(0);for(;t;){const n=new s.sqlite3_vfs(t);e.push(i.cstrToJs(n.$zName)),t=n.$pNext,n.dispose()}return e},s.sqlite3_js_db_export=function(e,t=0){(e=i.xWrap.testConvertArg("sqlite3*",e))||l("Invalid sqlite3* argument."),i.bigIntEnabled||l("BigInt64 support is not enabled.");const n=i.scopedAllocPush();let r;try{const n=i.scopedAlloc(8+i.ptrSizeof),s=n+8,o=t?i.isPtr(t)?t:i.scopedAllocCString(""+t):0;let a=i.exports.sqlite3_wasm_db_serialize(e,o,s,n,0);a&&l("Database serialization failed with code",S.capi.sqlite3_js_rc_str(a)),r=i.peekPtr(s);const c=i.peek(n,"i64");return a=c?i.heap8u().slice(r,r+Number(c)):new Uint8Array,a}finally{r&&i.exports.sqlite3_free(r),i.scopedAllocPop(n)}},s.sqlite3_js_db_vfs=(e,t=0)=>i.sqlite3_wasm_db_vfs(e,t),s.sqlite3_js_aggregate_context=(e,t)=>s.sqlite3_aggregate_context(e,t)||(t?y.toss("Cannot allocate",t,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(e,t,n){let r;t&&i.isPtr(t)?r=t:t instanceof ArrayBuffer||t instanceof Uint8Array?(r=i.allocFromTypedArray(t),(arguments.length<3||!q.isInt32(n)||n<0)&&(n=t.byteLength)):a.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!q.isInt32(n)||n<0)&&a.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const t=i.sqlite3_wasm_posix_create_file(e,r,n);t&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(t))}finally{i.dealloc(r)}},s.sqlite3_js_vfs_create_file=function(e,t,n,o){let l;r.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options."),n?(i.isPtr(n)?l=n:n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array?(l=i.allocFromTypedArray(n),(arguments.length<4||!q.isInt32(o)||o<0)&&(o=n.byteLength)):a.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):l=0,(!q.isInt32(o)||o<0)&&(i.dealloc(l),a.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const n=i.sqlite3_wasm_vfs_create_file(e,t,l,o);n&&a.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(n))}finally{i.dealloc(l)}},s.sqlite3_js_sql_to_string=e=>{if("string"==typeof e)return e;const t=b(v);return t===v?void 0:t},q.isUIThread()){const e=function(e){const t=Object.create(null);return t.prefix="kvvfs-"+e,t.stores=[],"session"!==e&&""!==e||t.stores.push(globalThis.sessionStorage),"local"!==e&&""!==e||t.stores.push(globalThis.localStorage),t};s.sqlite3_js_kvvfs_clear=function(t=""){let n=0;const r=e(t);return r.stores.forEach((e=>{const t=[];let s;for(s=0;se.removeItem(t))),n+=t.length})),n},s.sqlite3_js_kvvfs_size=function(t=""){let n=0;const r=e(t);return r.stores.forEach((e=>{let t;for(t=0;tw(e,t,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(e,t)=>w(e,t,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(e,t)=>w(e,t,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(e,t)=>w(e,t,"sqlite3changeset_old");const S={WasmAllocError:y,SQLite3Error:a,capi:s,util:q,wasm:i,config:r,version:Object.create(null),client:void 0,asyncPostInit:async function e(){if(e.isReady instanceof Promise)return e.isReady;let n=t.initializersAsync;delete t.initializersAsync;const s=async()=>(S.__isUnderTest||(delete S.util,delete S.StructBinder),S),i=e=>{throw r.error("an async sqlite3 initializer failed:",e),e};if(!n||!n.length)return e.isReady=s().catch(i);n=n.map((e=>e instanceof Function?async t=>e(S):e)),n.push(s);let o=Promise.resolve(S);for(;n.length;)o=o.then(n.shift());return e.isReady=o.catch(i)},scriptInfo:void 0};try{t.initializers.forEach((e=>{e(S)}))}catch(e){throw console.error("sqlite3 bootstrap initializer threw:",e),e}return delete t.initializers,t.sqlite3=S,S},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(e){void 0===e.bigIntEnabled&&(e.bigIntEnabled=!!globalThis.BigInt64Array);const t=(...e)=>{throw new Error(e.join(" "))};e.exports||Object.defineProperty(e,"exports",{enumerable:!0,configurable:!0,get:()=>e.instance&&e.instance.exports});const n=e.pointerIR||"i32",r=e.ptrSizeof="i32"===n?4:"i64"===n?8:t("Unhandled ptrSizeof:",n),s=Object.create(null);s.heapSize=0,s.memory=null,s.freeFuncIndexes=[],s.scopedAlloc=[],s.utf8Decoder=new TextDecoder,s.utf8Encoder=new TextEncoder("utf-8"),e.sizeofIR=e=>{switch(e){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return r;default:return(""+e).endsWith("*")?r:void 0}};const i=function(){if(s.memory){if(s.heapSize===s.memory.buffer.byteLength)return s}else s.memory=e.memory instanceof WebAssembly.Memory?e.memory:e.exports.memory;const t=s.memory.buffer;return s.HEAP8=new Int8Array(t),s.HEAP8U=new Uint8Array(t),s.HEAP16=new Int16Array(t),s.HEAP16U=new Uint16Array(t),s.HEAP32=new Int32Array(t),s.HEAP32U=new Uint32Array(t),e.bigIntEnabled&&(s.HEAP64=new BigInt64Array(t),s.HEAP64U=new BigUint64Array(t)),s.HEAP32F=new Float32Array(t),s.HEAP64F=new Float64Array(t),s.heapSize=t.byteLength,s};e.heap8=()=>i().HEAP8,e.heap8u=()=>i().HEAP8U,e.heap16=()=>i().HEAP16,e.heap16u=()=>i().HEAP16U,e.heap32=()=>i().HEAP32,e.heap32u=()=>i().HEAP32U,e.heapForSize=function(n,r=!0){const o=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();switch(n){case Int8Array:return o.HEAP8;case Uint8Array:return o.HEAP8U;case Int16Array:return o.HEAP16;case Uint16Array:return o.HEAP16U;case Int32Array:return o.HEAP32;case Uint32Array:return o.HEAP32U;case 8:return r?o.HEAP8U:o.HEAP8;case 16:return r?o.HEAP16U:o.HEAP16;case 32:return r?o.HEAP32U:o.HEAP32;case 64:if(o.HEAP64)return r?o.HEAP64U:o.HEAP64;break;default:if(e.bigIntEnabled){if(n===globalThis.BigUint64Array)return o.HEAP64U;if(n===globalThis.BigInt64Array)return o.HEAP64;break}}t("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},e.functionTable=function(){return e.exports.__indirect_function_table},e.functionEntry=function(t){const n=e.functionTable();return t>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(t){const n=e._.rxJSig.exec(t);return n?n[2]:t.substr(1)},letterType:n=>e._.sigTypes[n]||t("Invalid signature letter:",n),pushSigType:(t,n)=>t.push(e._.typeCodes[e._.letterType(n)])}),"string"==typeof n){const e=r;r=n,n=e}const s=e._.sigParams(r),i=[1,96];e._.uleb128Encode(i,"push",s.length);for(const t of s)e._.pushSigType(i,t);return"v"===r[0]?i.push(0):(i.push(1),e._.pushSigType(i,r[0])),e._.uleb128Encode(i,"unshift",i.length),i.unshift(0,97,115,109,1,0,0,0,1),i.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(i)),{e:{f:n}}).exports.f};const o=function(n,r,i){if(i&&!s.scopedAlloc.length&&t("No scopedAllocPush() scope is active."),"string"==typeof n){const e=r;r=n,n=e}"string"==typeof r&&n instanceof Function||t("Invalid arguments: expecting (function,signature) or (signature,function).");const o=e.functionTable(),a=o.length;let l;for(;s.freeFuncIndexes.length&&(l=s.freeFuncIndexes.pop(),o.get(l));)l=null;l||(l=a,o.grow(1));try{return o.set(l,n),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l),l}catch(e){if(!(e instanceof TypeError))throw l===a&&s.freeFuncIndexes.push(a),e}try{const t=e.jsFuncToWasm(n,r);o.set(l,t),i&&s.scopedAlloc[s.scopedAlloc.length-1].push(l)}catch(e){throw l===a&&s.freeFuncIndexes.push(a),e}return l};e.installFunction=(e,t)=>o(e,t,!1),e.scopedInstallFunction=(e,t)=>o(e,t,!0),e.uninstallFunction=function(t){if(!t&&0!==t)return;const n=s.freeFuncIndexes,r=e.functionTable();n.push(t);const i=r.get(t);return r.set(t,null),i},e.peek=function(r,o="i8"){o.endsWith("*")&&(o=n);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i(),l=Array.isArray(r)?[]:void 0;let c;do{switch(l&&(r=arguments[0].shift()),o){case"i1":case"i8":c=a.HEAP8[0|r];break;case"i16":c=a.HEAP16[r>>1];break;case"i32":c=a.HEAP32[r>>2];break;case"float":case"f32":c=a.HEAP32F[r>>2];break;case"double":case"f64":c=Number(a.HEAP64F[r>>3]);break;case"i64":if(e.bigIntEnabled){c=BigInt(a.HEAP64[r>>3]);break}default:t("Invalid type for peek():",o)}l&&l.push(c)}while(l&&arguments[0].length);return l||c},e.poke=function(e,r,o="i8"){o.endsWith("*")&&(o=n);const a=s.memory&&s.heapSize===s.memory.buffer.byteLength?s:i();for(const n of Array.isArray(e)?e:[e])switch(o){case"i1":case"i8":a.HEAP8[0|n]=r;continue;case"i16":a.HEAP16[n>>1]=r;continue;case"i32":a.HEAP32[n>>2]=r;continue;case"float":case"f32":a.HEAP32F[n>>2]=r;continue;case"double":case"f64":a.HEAP64F[n>>3]=r;continue;case"i64":if(a.HEAP64){a.HEAP64[n>>3]=BigInt(r);continue}default:t("Invalid type for poke(): "+o)}return this},e.peekPtr=(...t)=>e.peek(1===t.length?t[0]:t,n),e.pokePtr=(t,r=0)=>e.poke(t,r,n),e.peek8=(...t)=>e.peek(1===t.length?t[0]:t,"i8"),e.poke8=(t,n)=>e.poke(t,n,"i8"),e.peek16=(...t)=>e.peek(1===t.length?t[0]:t,"i16"),e.poke16=(t,n)=>e.poke(t,n,"i16"),e.peek32=(...t)=>e.peek(1===t.length?t[0]:t,"i32"),e.poke32=(t,n)=>e.poke(t,n,"i32"),e.peek64=(...t)=>e.peek(1===t.length?t[0]:t,"i64"),e.poke64=(t,n)=>e.poke(t,n,"i64"),e.peek32f=(...t)=>e.peek(1===t.length?t[0]:t,"f32"),e.poke32f=(t,n)=>e.poke(t,n,"f32"),e.peek64f=(...t)=>e.peek(1===t.length?t[0]:t,"f64"),e.poke64f=(t,n)=>e.poke(t,n,"f64"),e.getMemValue=e.peek,e.getPtrValue=e.peekPtr,e.setMemValue=e.poke,e.setPtrValue=e.pokePtr,e.isPtr32=e=>"number"==typeof e&&e===(0|e)&&e>=0,e.isPtr=e.isPtr32,e.cstrlen=function(t){if(!t||!e.isPtr(t))return null;const n=i().HEAP8U;let r=t;for(;0!==n[r];++r);return r-t};const a="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer;e.cstrToJs=function(t){const n=e.cstrlen(t);return n?(r=i().HEAP8U,o=t,l=t+n,s.utf8Decoder.decode(r.buffer instanceof a?r.slice(o,l):r.subarray(o,l))):null===n?n:"";var r,o,l},e.jstrlen=function(e){if("string"!=typeof e)return null;const t=e.length;let n=0;for(let r=0;r=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++r)),t<=127?++n:n+=t<=2047?2:t<=65535?3:4}return n},e.jstrcpy=function(e,n,r=0,s=-1,i=!0){if(n&&(n instanceof Int8Array||n instanceof Uint8Array)||t("jstrcpy() target must be an Int8Array or Uint8Array."),s<0&&(s=n.length-r),!(s>0&&r>=0))return 0;let o=0,a=e.length;const l=r,c=r+s-(i?1:0);for(;o=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++o)),t<=127){if(r>=c)break;n[r++]=t}else if(t<=2047){if(r+1>=c)break;n[r++]=192|t>>6,n[r++]=128|63&t}else if(t<=65535){if(r+2>=c)break;n[r++]=224|t>>12,n[r++]=128|t>>6&63,n[r++]=128|63&t}else{if(r+3>=c)break;n[r++]=240|t>>18,n[r++]=128|t>>12&63,n[r++]=128|t>>6&63,n[r++]=128|63&t}}return i&&(n[r++]=0),r-l},e.cstrncpy=function(n,r,s){if(n&&r||t("cstrncpy() does not accept NULL strings."),s<0)s=e.cstrlen(strPtr)+1;else if(!(s>0))return 0;const i=e.heap8u();let o,a=0;for(;as.utf8Encoder.encode(t?e+"\0":e);const l=(e,n)=>{e.alloc instanceof Function&&e.dealloc instanceof Function||t("Object is missing alloc() and/or dealloc() function(s)","required by",n+"().")},c=function(t,n,r,o){if(l(e,o),"string"!=typeof t)return null;{const e=s.utf8Encoder.encode(t),o=r(e.length+1),a=i().HEAP8U;return a.set(e,o),a[o+e.length]=0,n?[o,e.length]:o}};e.allocCString=(t,n=!1)=>c(t,n,e.alloc,"allocCString()"),e.scopedAllocPush=function(){l(e,"scopedAllocPush");const t=[];return s.scopedAlloc.push(t),t},e.scopedAllocPop=function(n){l(e,"scopedAllocPop");const r=arguments.length?s.scopedAlloc.indexOf(n):s.scopedAlloc.length-1;r<0&&t("Invalid state object for scopedAllocPop()."),0===arguments.length&&(n=s.scopedAlloc[r]),s.scopedAlloc.splice(r,1);for(let t;t=n.pop();)e.functionEntry(t)?e.uninstallFunction(t):e.dealloc(t)},e.scopedAlloc=function(n){s.scopedAlloc.length||t("No scopedAllocPush() scope is active.");const r=e.alloc(n);return s.scopedAlloc[s.scopedAlloc.length-1].push(r),r},Object.defineProperty(e.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>s.scopedAlloc.length,set:()=>t("The 'active' property is read-only.")}),e.scopedAllocCString=(t,n=!1)=>c(t,n,e.scopedAlloc,"scopedAllocCString()");const _=function(t,n){const r=e[t?"scopedAlloc":"alloc"]((n.length+1)*e.ptrSizeof);let s=0;return n.forEach((n=>{e.pokePtr(r+e.ptrSizeof*s++,e[t?"scopedAllocCString":"allocCString"](""+n))})),e.pokePtr(r+e.ptrSizeof*s,0),r};e.scopedAllocMainArgv=e=>_(!0,e),e.allocMainArgv=e=>_(!1,e),e.cArgvToJs=(t,n)=>{const r=[];for(let s=0;su(e,t,"alloc"),e.scopedAllocPtr=(e=1,t=!0)=>u(e,t,"scopedAlloc"),e.xGet=function(n){return e.exports[n]||t("Cannot find exported symbol:",n)};const d=(e,n)=>t(e+"() requires",n,"argument(s).");e.xCall=function(n,...r){const s=e.xGet(n);return s instanceof Function||t("Exported symbol",n,"is not a function."),s.length!==r.length&&d(n,s.length),2===arguments.length&&Array.isArray(arguments[1])?s.apply(null,arguments[1]):s.apply(null,r)},s.xWrap=Object.create(null),s.xWrap.convert=Object.create(null),s.xWrap.convert.arg=new Map,s.xWrap.convert.result=new Map;const f=s.xWrap.convert.arg,p=s.xWrap.convert.result;e.bigIntEnabled&&f.set("i64",(e=>BigInt(e)));const m="i32"===n?e=>0|e:e=>BigInt(e)|BigInt(0);f.set("i32",m).set("i16",(e=>65535&e)).set("i8",(e=>255&e)).set("f32",(e=>Number(e).valueOf())).set("float",f.get("f32")).set("f64",f.get("f32")).set("double",f.get("f64")).set("int",f.get("i32")).set("null",(e=>e)).set(null,f.get("null")).set("**",m).set("*",m),p.set("*",m).set("pointer",m).set("number",(e=>Number(e))).set("void",(e=>{})).set("null",(e=>e)).set(null,p.get("null"));{const r=["i8","i16","i32","int","f32","float","f64","double"];e.bigIntEnabled&&r.push("i64");const s=f.get(n);for(const e of r)f.set(e+"*",s),p.set(e+"*",s),p.set(e,f.get(e)||t("Missing arg converter:",e))}const h=function(t){return"string"==typeof t?e.scopedAllocCString(t):t?m(t):null};f.set("string",h).set("utf8",h).set("pointer",h),p.set("string",(t=>e.cstrToJs(t))).set("utf8",p.get("string")).set("string:dealloc",(t=>{try{return t?e.cstrToJs(t):null}finally{e.dealloc(t)}})).set("utf8:dealloc",p.get("string:dealloc")).set("json",(t=>JSON.parse(e.cstrToJs(t)))).set("json:dealloc",(t=>{try{return t?JSON.parse(e.cstrToJs(t)):null}finally{e.dealloc(t)}}));const g=class{constructor(e){this.name=e.name||"unnamed adapter"}convertArg(e,n,r){t("AbstractArgAdapter must be subclassed.")}};f.FuncPtrAdapter=class n extends g{constructor(e){super(e),f.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",e),this.name=e.name||"unnamed",this.signature=e.signature,e.contextKey instanceof Function&&(this.contextKey=e.contextKey,e.bindScope||(e.bindScope="context")),this.bindScope=e.bindScope||t("FuncPtrAdapter options requires a bindScope (explicit or implied)."),n.bindScopes.indexOf(e.bindScope)<0&&t("Invalid options.bindScope ("+e.bindMod+") for FuncPtrAdapter. Expecting one of: ("+n.bindScopes.join(", ")+")"),this.isTransient="transient"===this.bindScope,this.isContext="context"===this.bindScope,this.isPermanent="permanent"===this.bindScope,this.singleton="singleton"===this.bindScope?[]:void 0,this.callProxy=e.callProxy instanceof Function?e.callProxy:void 0}contextKey(e,t){return this}contextMap(e){const t=this.__cmap||(this.__cmap=new Map);let n=t.get(e);return void 0===n&&t.set(e,n=[]),n}convertArg(t,r,i){let a=this.singleton;if(!a&&this.isContext&&(a=this.contextMap(this.contextKey(r,i))),a&&a[0]===t)return a[1];if(t instanceof Function){this.callProxy&&(t=this.callProxy(t));const e=o(t,this.signature,this.isTransient);if(n.debugFuncInstall&&n.debugOut("FuncPtrAdapter installed",this,this.contextKey(r,i),"@"+e,t),a){if(a[1]){n.debugFuncInstall&&n.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(r,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}}a[0]=t,a[1]=e}return e}if(e.isPtr(t)||null==t){if(a&&a[1]&&a[1]!==t){n.debugFuncInstall&&n.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(r,i),"@"+a[1],t);try{s.scopedAlloc[s.scopedAlloc.length-1].push(a[1])}catch(e){}a[0]=a[1]=0|t}return t||0}throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},f.FuncPtrAdapter.warnOnUse=!1,f.FuncPtrAdapter.debugFuncInstall=!1,f.FuncPtrAdapter.debugOut=console.debug.bind(console),f.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const b=e=>f.get(e)||t("Argument adapter not found:",e),y=e=>p.get(e)||t("Result adapter not found:",e);s.xWrap.convertArg=(e,...t)=>b(e)(...t),s.xWrap.convertArgNoCheck=(e,...t)=>f.get(e)(...t),s.xWrap.convertResult=(e,t)=>null===e?t:e?y(e)(t):void 0,s.xWrap.convertResultNoCheck=(e,t)=>null===e?t:e?p.get(e)(t):void 0,e.xWrap=function(n,r,...i){3===arguments.length&&Array.isArray(arguments[2])&&(i=arguments[2]),e.isPtr(n)&&(n=e.functionEntry(n)||t("Function pointer not found in WASM function table."));const o=n instanceof Function,a=o?n:e.xGet(n);if(o&&(n=a.name||"unnamed function"),i.length!==a.length&&d(n,a.length),null===r&&0===a.length)return a;null!=r&&y(r);for(const e of i)e instanceof g?f.set(e,((...t)=>e.convertArg(...t))):b(e);const l=s.xWrap;return 0===a.length?(...e)=>e.length?d(n,a.length):l.convertResult(r,a.call(null)):function(...t){t.length!==a.length&&d(n,a.length);const s=e.scopedAllocPush();try{for(const e in t)t[e]=l.convertArgNoCheck(i[e],t[e],t,e);return l.convertResultNoCheck(r,a.apply(null,t))}finally{e.scopedAllocPop(s)}}};const q=function(e,n,r,s,i,o){if("string"==typeof r){if(1===n)return o.get(r);if(2===n)return s?(s instanceof Function||t(i,"requires a function argument."),o.set(r,s),e):(o.get(r),e)}t("Invalid arguments to",i)};return e.xWrap.resultAdapter=function e(t,n){return q(e,arguments.length,t,n,"resultAdapter()",p)},e.xWrap.argAdapter=function e(t,n){return q(e,arguments.length,t,n,"argAdapter()",f)},e.xWrap.FuncPtrAdapter=f.FuncPtrAdapter,e.xCallWrapped=function(t,n,r,...s){return Array.isArray(arguments[3])&&(s=arguments[3]),e.xWrap(t,n,r||[]).apply(null,s||[])},e.xWrap.testConvertArg=s.xWrap.convertArg,e.xWrap.testConvertResult=s.xWrap.convertResult,e},globalThis.WhWasmUtilInstaller.yawl=function(e){const t=()=>fetch(e.uri,{credentials:"same-origin"}),n=this,r=function(t){if(e.wasmUtilTarget){const r=(...e)=>{throw new Error(e.join(" "))},s=e.wasmUtilTarget;if(s.module=t.module,s.instance=t.instance,s.instance.exports.memory||(s.memory=e.imports&&e.imports.env&&e.imports.env.memory||r("Missing 'memory' object!")),!s.alloc&&t.instance.exports.malloc){const e=t.instance.exports;s.alloc=function(t){return e.malloc(t)||r("Allocation of",t,"bytes failed.")},s.dealloc=function(t){e.free(t)}}n(s)}return e.onload&&e.onload(t,e),t};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(t(),e.imports||{}).then(r)}:function(){return t().then((e=>e.arrayBuffer())).then((t=>WebAssembly.instantiate(t,e.imports||{}))).then(r)}}.bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function e(t){const n=(...e)=>{throw new Error(e.join(" "))};t.heap instanceof WebAssembly.Memory||t.heap instanceof Function||n("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach((function(e){t[e]instanceof Function||n("Config option '"+e+"' must be a function.")}));const r=e,s=t.heap instanceof Function?t.heap:()=>new Uint8Array(t.heap.buffer),i=t.alloc,o=t.dealloc,a=t.log||console.log.bind(console),l=t.memberPrefix||"",c=t.memberSuffix||"",_=void 0===t.bigIntEnabled?!!globalThis.BigInt64Array:!!t.bigIntEnabled,u=globalThis.BigInt,d=globalThis.BigInt64Array,f=t.ptrSizeof||4,p=t.ptrIR||"i32";r.debugFlags||(r.__makeDebugFlags=function(e=null){e&&e.__flags&&(e=e.__flags);const t=function e(t){return 0===arguments.length?e.__flags:(t<0?(delete e.__flags.getter,delete e.__flags.setter,delete e.__flags.alloc,delete e.__flags.dealloc):(e.__flags.getter=!!(1&t),e.__flags.setter=!!(2&t),e.__flags.alloc=!!(4&t),e.__flags.dealloc=!!(8&t)),e._flags)};return Object.defineProperty(t,"__flags",{iterable:!1,writable:!1,value:Object.create(e)}),e||t(0),t},r.debugFlags=r.__makeDebugFlags());const m=function(){const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),h=e=>(e=>"("===e[1])(e)?"p":e[0],g=function(e){switch(h(e)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return p;case"j":return"i64";case"f":return"float";case"d":return"double"}n("Unhandled signature IR:",e)},b=d?()=>!0:()=>n("BigInt64Array is not available."),y=(e,t)=>e+"::"+t,q=new WeakMap,E="(pointer-is-external)",v=function(e,t,n){if(n||(n=q.get(t)),n){if(q.delete(t),Array.isArray(t.ondispose)){let r;for(;r=t.ondispose.shift();)try{r instanceof Function?r.call(t):r instanceof D?r.dispose():"number"==typeof r&&o(r)}catch(t){console.warn("ondispose() for",e.structName,"@",n,"threw. NOT propagating it.",t)}}else if(t.ondispose instanceof Function)try{t.ondispose()}catch(t){console.warn("ondispose() for",e.structName,"@",n,"threw. NOT propagating it.",t)}delete t.ondispose,e.debugFlags.__flags.dealloc&&a("debug.dealloc:",t[E]?"EXTERNAL":"",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+n),t[E]||o(n)}},w=e=>({configurable:!1,writable:!1,iterable:!1,value:e}),S=function(e,t,r){let o=!r;r?Object.defineProperty(t,E,w(r)):(r=i(e.structInfo.sizeof))||n("Allocation of",e.structName,"structure failed.");try{e.debugFlags.__flags.alloc&&a("debug.alloc:",o?"":"EXTERNAL",e.structName,"instance:",e.structInfo.sizeof,"bytes @"+r),o&&s().fill(0,r,r+e.structInfo.sizeof),q.set(t,r)}catch(n){throw v(e,t,r),n}},A=w((e=>l+e+c)),x=function(e,t,r=!0){let s=e.members[t];if(!s&&(l||c)){for(const n of Object.values(e.members))if(n.key===t){s=n;break}!s&&r&&n(y(e.name,t),"is not a mapped struct member.")}return s},T=function e(t,n,r=!1){e._||(e._=e=>e.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const s=x(t.structInfo,n,!0);return r?e._(s.signature):s.signature},I={configurable:!1,enumerable:!1,get:function(){return q.get(this)},set:()=>n("Cannot assign the 'pointer' property of a struct.")},k=w((function(){const e=[];for(const t of Object.keys(this.structInfo.members))e.push(this.memberKey(t));return e})),F=new TextDecoder("utf-8"),O=new TextEncoder,P="undefined"==typeof SharedArrayBuffer?function(){}:SharedArrayBuffer,L=function(e){"s"!==e.signature&&n("Invalid member type signature for C-string value:",JSON.stringify(e))},C=function(e,...t){e.ondispose?Array.isArray(e.ondispose)||(e.ondispose=[e.ondispose]):e.ondispose=[],e.ondispose.push(...t)},N=function(e){const t=O.encode(e),r=i(t.length+1);r||n("Allocation error while duplicating string:",e);const o=s();return o.set(t,r),o[r+t.length]=0,r},D=function(e,t){arguments[2]!==w&&n("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:w(e),structInfo:w(t)})};D.prototype=Object.create(null,{dispose:w((function(){v(this.constructor,this)})),lookupMember:w((function(e,t=!0){return x(this.structInfo,e,t)})),memberToJsString:w((function(e){return function(e,t){const n=x(e.structInfo,t,!0);L(n);const r=e[n.key];if(!r)return null;let i=r;const o=s();for(;0!==o[i];++i);return r===i?"":(a=o,l=r,c=i,F.decode(a.buffer instanceof P?a.slice(l,c):a.subarray(l,c)));var a,l,c}(this,e)})),memberIsString:w((function(e,t=!0){return function(e,t,n=!1){const r=x(e.structInfo,t,n);return!(!r||1!==r.signature.length||"s"!==r.signature[0])&&r}(this,e,t)})),memberKey:A,memberKeys:k,memberSignature:w((function(e,t=!1){return T(this,e,t)})),memoryDump:w((function(){const e=this.pointer;return e?new Uint8Array(s().slice(e,e+this.structInfo.sizeof)):null})),pointer:I,setMemberCString:w((function(e,t){return function(e,t,n){const r=x(e.structInfo,t,!0);L(r);const s=N(n);return e[r.key]=s,C(e,s),e}(this,e,t)}))}),Object.assign(D.prototype,{addOnDispose:function(...e){return C(this,...e),this}}),Object.defineProperties(D,{allocCString:w(N),isA:w((e=>e instanceof D)),hasExternalPointer:w((e=>e instanceof D&&!!e[E])),memberKey:A});const R=e=>Number.isFinite(e)||e instanceof(u||Number),M=function e(t,r,i){if(!e._){e._={getters:{},setters:{},sw:{}};const t=["i","c","C","p","P","s","f","d","v()"];_&&t.push("j"),t.forEach((function(t){e._.getters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"getInt32";case 8:return b()&&"getBigInt64"}break;case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return b()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}n("Unhandled DataView getter for signature:",e)}(t),e._.setters[t]=function(e){switch(h(e)){case"p":case"P":case"s":switch(f){case 4:return"setInt32";case 8:return b()&&"setBigInt64"}break;case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return b()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}n("Unhandled DataView setter for signature:",e)}(t),e._.sw[t]=function(e){switch(h(e)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return b()&&u;case"p":case"P":case"s":switch(f){case 4:return Number;case 8:return b()&&u}}n("Unhandled DataView set wrapper for signature:",e)}(t)}));const r=/^[ipPsjfdcC]$/,s=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;e.sigCheck=function(e,t,i,o){Object.prototype.hasOwnProperty.call(e,i)&&n(e.structName,"already has a property named",i+"."),r.test(o)||s.test(o)||n("Malformed signature for",y(e.structName,t)+":",o)}}const o=t.memberKey(r);e.sigCheck(t.prototype,r,o,i.signature),i.key=o,i.name=r;const l=h(i.signature),c=y(t.prototype.structName,o),d=t.prototype.debugFlags.__flags,p=Object.create(null);var q,E;p.configurable=!1,p.enumerable=!1,p.get=function(){d.getter&&a("debug.getter:",e._.getters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof);let t=new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.getters[l]](0,m);return d.getter&&a("debug.getter:",c,"result =",t),t},i.readOnly?p.set=(q=t.prototype.structName,E=o,()=>n(y(q,E),"is read-only.")):p.set=function(t){if(d.setter&&a("debug.setter:",e._.setters[l],"for",g(l),c,"@",this.pointer,"+",i.offset,"sz",i.sizeof,t),this.pointer||n("Cannot set struct property on disposed instance."),null===t)t=0;else for(;!R(t);){if("P"===i.signature&&t instanceof D){t=t.pointer||0,d.setter&&a("debug.setter:",c,"resolved to",t);break}n("Invalid value for pointer-type",c+".")}new DataView(s().buffer,this.pointer+i.offset,i.sizeof)[e._.setters[l]](0,e._.sw[l](t),m)},Object.defineProperty(t.prototype,o,p)},j=function e(t,s){1===arguments.length?t=(s=t).name:s.name||(s.name=t),t||n("Struct name is required.");let i=!1;Object.keys(s.members).forEach((e=>{const r=s.members[e];r.sizeof?1===r.sizeof?"c"===r.signature||"C"===r.signature||n("Unexpected sizeof==1 member",y(s.name,e),"with signature",r.signature):(0!=r.sizeof%4&&(console.warn("Invalid struct member description =",r,"from",s),n(t,"member",e,"sizeof is not aligned. sizeof="+r.sizeof)),0!=r.offset%4&&(console.warn("Invalid struct member description =",r,"from",s),n(t,"member",e,"offset is not aligned. offset="+r.offset))):n(t,"member",e,"is missing sizeof."),(!i||i.offsete instanceof a)),memberKey:A,memberKeys:k,methodInfoForKey:w((function(e){})),structInfo:w(s),structName:w(t)}),a.prototype=new D(t,s,w),Object.defineProperties(a.prototype,{debugFlags:o,constructor:w(a)}),Object.keys(s.members).forEach((e=>M(a,e,s.members[e]))),a};return j.StructType=D,j.config=t,j.allocCString=N,j.debugFlags||(j.debugFlags=r.__makeDebugFlags(r.debugFlags)),j},globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...e)=>{throw new Error(e.join(" "))},n=(e.SQLite3Error.toss,e.capi),r=e.wasm,s=e.util;if(globalThis.WhWasmUtilInstaller(r),delete globalThis.WhWasmUtilInstaller,r.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new r.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:e=>{let t;return(s,i,o,a)=>{try{const n=r.cArgvToJs(i,o);return t||(t=r.cArgvToJs(i,a)),0|e(n,t)}catch(e){return e.resultCode||n.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_codes","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_progress_handler",void 0,["sqlite3*","int",new r.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:e=>e[0]}),"*"]],["sqlite3_set_authorizer","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(e,t)=>e[0],callProxy:e=>(t,s,i,o,a,l)=>{try{return i=i&&r.cstrToJs(i),o=o&&r.cstrToJs(o),a=a&&r.cstrToJs(a),l=l&&r.cstrToJs(l),e(t,s,i,o,a,l)||0}catch(e){return e.resultCode||n.SQLITE_ERROR}}}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*",new r.xWrap.FuncPtrAdapter({name:"xDestroyAuxData",signature:"v(*)",contextKey:(e,t)=>e[0]})]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_isexplain","int",["sqlite3_stmt*"]],["sqlite3_stmt_readonly","int",["sqlite3_stmt*"]],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new r.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(e,t)=>e[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],r.exports.sqlite3_activate_see instanceof Function&&r.bindingSignatures.push(["sqlite3_key","int","sqlite3*","string","int"],["sqlite3_key_v2","int","sqlite3*","string","*","int"],["sqlite3_rekey","int","sqlite3*","string","int"],["sqlite3_rekey_v2","int","sqlite3*","string","*","int"],["sqlite3_activate_see",void 0,"string"]),r.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:e=>e[0],callProxy:e=>(t,n,s,i,o,a,l)=>{e(t,n,s,r.cstrToJs(i),r.cstrToJs(o),a,l)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:e=>e[0],callProxy:e=>(t,n,s,i,o)=>{e(t,n,r.cstrToJs(s),r.cstrToJs(i),o)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]],r.bigIntEnabled&&r.exports.sqlite3changegroup_add){const e={signature:"i(ps)",callProxy:e=>(t,s)=>{try{return 0|e(t,r.cstrToJs(s))}catch(e){return e.resultCode||n.SQLITE_ERROR}}};r.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...e}),new r.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new r.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new r.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new r.xWrap.FuncPtrAdapter({name:"xFilter",...e,contextKey:(e,t)=>e[0]}),"*"]])}r.bindingSignatures.wasm=[["sqlite3_wasm_db_reset","int","sqlite3*"],["sqlite3_wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3_wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3_wasm_posix_create_file","int","string","*","int"],["sqlite3_wasm_vfs_unlink","int","sqlite3_vfs*","string"]],e.StructBinder=globalThis.Jaccwabyt({heap:r.heap8u,alloc:r.alloc,dealloc:r.dealloc,bigIntEnabled:r.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const i=r.xWrap.argAdapter("string");r.xWrap.argAdapter("string:flexible",(e=>i(s.flexibleString(e)))),r.xWrap.argAdapter("string:static",function(e){return r.isPtr(e)?e:this[e=""+e]||(this[e]=r.allocCString(e))}.bind(Object.create(null)));const o=r.xWrap.argAdapter("*"),a=function(){};r.xWrap.argAdapter("sqlite3_filename",o)("sqlite3_context*",o)("sqlite3_value*",o)("void*",o)("sqlite3_changegroup*",o)("sqlite3_changeset_iter*",o)("sqlite3_session*",o)("sqlite3_stmt*",(t=>o(t instanceof(e?.oo1?.Stmt||a)?t.pointer:t)))("sqlite3*",(t=>o(t instanceof(e?.oo1?.DB||a)?t.pointer:t)))("sqlite3_index_info*",(e=>o(e instanceof(n.sqlite3_index_info||a)?e.pointer:e)))("sqlite3_module*",(e=>o(e instanceof(n.sqlite3_module||a)?e.pointer:e)))("sqlite3_vfs*",(t=>"string"==typeof t?n.sqlite3_vfs_find(t)||e.SQLite3Error.toss(n.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",t):o(t instanceof(n.sqlite3_vfs||a)?t.pointer:t)));const l=r.xWrap.resultAdapter("*");r.xWrap.resultAdapter("sqlite3*",l)("sqlite3_context*",l)("sqlite3_stmt*",l)("sqlite3_value*",l)("sqlite3_vfs*",l)("void*",l),0===r.exports.sqlite3_step.length&&(r.xWrap.doArgcCheck=!1,e.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const e of r.bindingSignatures)n[e[0]]=r.xWrap.apply(null,e);for(const e of r.bindingSignatures.wasm)r[e[0]]=r.xWrap.apply(null,e);const c=function(e){return()=>t(e+"() is unavailable due to lack","of BigInt support in this build.")};for(const e of r.bindingSignatures.int64)n[e[0]]=r.bigIntEnabled?r.xWrap.apply(null,e):c(e[0]);if(delete r.bindingSignatures,r.exports.sqlite3_wasm_db_error){const t=r.xWrap("sqlite3_wasm_db_error","int","sqlite3*","int","string");s.sqlite3_wasm_db_error=function(r,s,i){return s instanceof e.WasmAllocError?(s=n.SQLITE_NOMEM,i=0):s instanceof Error&&(i=i||""+s,s=s.resultCode||n.SQLITE_ERROR),r?t(r,s,i):s}}else s.sqlite3_wasm_db_error=function(e,t,n){return console.warn("sqlite3_wasm_db_error() is not exported.",arguments),t}}{const i=r.xCall("sqlite3_wasm_enum_json");i||t("Maintenance required: increase sqlite3_wasm_enum_json()'s","static buffer size!"),r.ctype=JSON.parse(r.cstrToJs(i));const o=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];r.bigIntEnabled&&o.push("serialize","session","vtab");for(const e of o)for(const t of Object.entries(r.ctype[e]))n[t[0]]=t[1];r.functionEntry(n.SQLITE_WASM_DEALLOC)||t("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+n.SQLITE_WASM_DEALLOC+").");const a=Object.create(null);for(const e of["resultCodes"])for(const t of Object.entries(r.ctype[e]))a[t[1]]=t[0];n.sqlite3_js_rc_str=e=>a[e];const l=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!s.isUIThread(),sqlite3_index_info:!r.bigIntEnabled,sqlite3_index_constraint:!r.bigIntEnabled,sqlite3_index_orderby:!r.bigIntEnabled,sqlite3_index_constraint_usage:!r.bigIntEnabled});for(const t of r.ctype.structs)l[t.name]||(n[t.name]=e.StructBinder(t));if(n.sqlite3_index_info){for(const e of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])n.sqlite3_index_info[e]=n[e],delete n[e];n.sqlite3_vtab_config=r.xWrap("sqlite3_wasm_vtab_config","int",["sqlite3*","int","int"])}}const i=(e,t,r)=>s.sqlite3_wasm_db_error(e,n.SQLITE_MISUSE,t+"() requires "+r+" argument"+(1===r?"":"s")+"."),o=e=>s.sqlite3_wasm_db_error(e,n.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),a=e=>r.xWrap.argAdapter("sqlite3*")(e),l=e=>r.isPtr(e)?r.cstrToJs(e):e,c=function(e,t){e=a(e);let n=this.dbMap.get(e);return t?(!n&&t>0&&this.dbMap.set(e,n=Object.create(null)),n):(this.dbMap.delete(e),n)}.bind(Object.assign(Object.create(null),{dbMap:new Map}));c.addCollation=function(e,t){const n=c(e,1);n.collation||(n.collation=new Set),n.collation.add(l(t).toLowerCase())},c._addUDF=function(e,t,n,r){t=l(t).toLowerCase();let s=r.get(t);s||r.set(t,s=new Set),s.add(n<0?-1:n)},c.addFunction=function(e,t,n){const r=c(e,1);r.udf||(r.udf=new Map),this._addUDF(e,t,n,r.udf)},c.addWindowFunc=function(e,t,n){const r=c(e,1);r.wudf||(r.wudf=new Map),this._addUDF(e,t,n,r.wudf)},c.cleanup=function(e){const t=[e=a(e)];for(const e of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const s=r.exports[e];t.length=s.length;try{n[e](...t)}catch(n){console.warn("close-time call of",e+"(",t,") threw:",n)}}const s=c(e,0);if(!s)return;if(s.collation){for(const t of s.collation)try{n.sqlite3_create_collation_v2(e,t,n.SQLITE_UTF8,0,0,0)}catch(e){}delete s.collation}let i;for(i=0;i<2;++i){const t=i?s.wudf:s.udf;if(!t)continue;const r=i?n.sqlite3_create_window_function:n.sqlite3_create_function_v2;for(const s of t){const t=s[0],o=s[1],a=[e,t,0,n.SQLITE_UTF8,0,0,0,0,0];i&&a.push(0);for(const e of o)try{a[2]=e,r.apply(null,a)}catch(e){}o.clear()}t.clear()}delete s.udf,delete s.wudf};{const e=r.xWrap("sqlite3_close_v2","int","sqlite3*");n.sqlite3_close_v2=function(t){if(1!==arguments.length)return i(t,"sqlite3_close_v2",1);if(t)try{c.cleanup(t)}catch(e){}return e(t)}}if(n.sqlite3session_table_filter){const e=r.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);n.sqlite3session_delete=function(t){if(1!==arguments.length)return i(pDb,"sqlite3session_delete",1);t&&n.sqlite3session_table_filter(t,0,0),e(t)}}{const e=(e,t)=>"argv["+t+"]:"+e[0]+":"+r.cstrToJs(e[1]).toLowerCase(),t=r.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new r.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:e}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:e})]);n.sqlite3_create_collation_v2=function(e,r,a,l,_,u){if(6!==arguments.length)return i(e,"sqlite3_create_collation_v2",6);if(15&a){if(n.SQLITE_UTF8!==(15&a))return o(e)}else a|=n.SQLITE_UTF8;try{const n=t(e,r,a,l,_,u);return 0===n&&_ instanceof Function&&c.addCollation(e,r),n}catch(t){return s.sqlite3_wasm_db_error(e,t)}},n.sqlite3_create_collation=(e,t,r,s,o)=>5===arguments.length?n.sqlite3_create_collation_v2(e,t,r,s,o,0):i(e,"sqlite3_create_collation",5)}{const e=function(e,t){return e[0]+":"+(e[2]<0?-1:e[2])+":"+t+":"+r.cstrToJs(e[1]).toLowerCase()},t=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,r,s)=>{try{e(t,...n.sqlite3_values_to_js(r,s))}catch(e){n.sqlite3_result_error_js(t,e)}}},xFinalAndValue:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{n.sqlite3_result_js(t,e(t))}catch(e){n.sqlite3_result_error_js(t,e)}}},xFunc:{signature:"v(pip)",contextKey:e,callProxy:e=>(t,r,s)=>{try{n.sqlite3_result_js(t,e(t,...n.sqlite3_values_to_js(r,s)))}catch(e){n.sqlite3_result_error_js(t,e)}}},xDestroy:{signature:"v(p)",contextKey:e,callProxy:e=>t=>{try{e(t)}catch(e){console.error("UDF xDestroy method threw:",e)}}}}),a=r.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new r.xWrap.FuncPtrAdapter({name:"xFunc",...t.xFunc}),new r.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]),l=r.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new r.xWrap.FuncPtrAdapter({name:"xStep",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xFinal",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xValue",...t.xFinalAndValue}),new r.xWrap.FuncPtrAdapter({name:"xInverse",...t.xInverseAndStep}),new r.xWrap.FuncPtrAdapter({name:"xDestroy",...t.xDestroy})]);n.sqlite3_create_function_v2=function e(t,r,l,_,u,d,f,p,m){if(e.length!==arguments.length)return i(t,"sqlite3_create_function_v2",e.length);if(15&_){if(n.SQLITE_UTF8!==(15&_))return o(t)}else _|=n.SQLITE_UTF8;try{const e=a(t,r,l,_,u,d,f,p,m);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function)&&c.addFunction(t,r,l),e}catch(e){return console.error("sqlite3_create_function_v2() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},n.sqlite3_create_function=function e(t,r,s,o,a,l,c,_){return e.length===arguments.length?n.sqlite3_create_function_v2(t,r,s,o,a,l,c,_,0):i(t,"sqlite3_create_function",e.length)},n.sqlite3_create_window_function=function e(t,r,a,_,u,d,f,p,m,h){if(e.length!==arguments.length)return i(t,"sqlite3_create_window_function",e.length);if(15&_){if(n.SQLITE_UTF8!==(15&_))return o(t)}else _|=n.SQLITE_UTF8;try{const e=l(t,r,a,_,u,d,f,p,m,h);return 0===e&&(d instanceof Function||f instanceof Function||p instanceof Function||m instanceof Function||h instanceof Function)&&c.addWindowFunc(t,r,a),e}catch(e){return console.error("sqlite3_create_window_function() setup threw:",e),s.sqlite3_wasm_db_error(t,e,"Creation of UDF threw: "+e)}},n.sqlite3_create_function_v2.udfSetResult=n.sqlite3_create_function.udfSetResult=n.sqlite3_create_window_function.udfSetResult=n.sqlite3_result_js,n.sqlite3_create_function_v2.udfConvertArgs=n.sqlite3_create_function.udfConvertArgs=n.sqlite3_create_window_function.udfConvertArgs=n.sqlite3_values_to_js,n.sqlite3_create_function_v2.udfSetError=n.sqlite3_create_function.udfSetError=n.sqlite3_create_window_function.udfSetError=n.sqlite3_result_error_js}{const e=(e,t)=>("string"==typeof e?t=-1:s.isSQLableTypedArray(e)?(t=e.byteLength,e=s.typedArrayToString(e instanceof ArrayBuffer?new Uint8Array(e):e)):Array.isArray(e)&&(e=e.join(""),t=-1),[e,t]),t={basic:r.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:r.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};n.sqlite3_prepare_v3=function r(o,a,l,c,_,u){if(r.length!==arguments.length)return i(o,"sqlite3_prepare_v3",r.length);const[d,f]=e(a,l);switch(typeof d){case"string":return t.basic(o,d,f,c,_,null);case"number":return t.full(o,d,f,c,_,u);default:return s.sqlite3_wasm_db_error(o,n.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},n.sqlite3_prepare_v2=function e(t,r,s,o,a){return e.length===arguments.length?n.sqlite3_prepare_v3(t,r,s,0,o,a):i(t,"sqlite3_prepare_v2",e.length)}}{const e=r.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),t=r.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);n.sqlite3_bind_text=function t(o,a,l,c,_){if(t.length!==arguments.length)return i(n.sqlite3_db_handle(o),"sqlite3_bind_text",t.length);if(r.isPtr(l)||null===l)return e(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(pMem)&&(l=pMem.join(""));try{if(s.isSQLableTypedArray(l))u=r.allocFromTypedArray(l),d=l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),n.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");[u,d]=r.allocCString(l)}return e(o,a,u,d,n.SQLITE_WASM_DEALLOC)}catch(e){return r.dealloc(u),s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),e)}},n.sqlite3_bind_blob=function e(o,a,l,c,_){if(e.length!==arguments.length)return i(n.sqlite3_db_handle(o),"sqlite3_bind_blob",e.length);if(r.isPtr(l)||null===l)return t(o,a,l,c,_);let u,d;l instanceof ArrayBuffer?l=new Uint8Array(l):Array.isArray(l)&&(l=l.join(""));try{if(s.isBindableTypedArray(l))u=r.allocFromTypedArray(l),d=c>=0?c:l.byteLength;else{if("string"!=typeof l)return s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),n.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");[u,d]=r.allocCString(l)}return t(o,a,u,d,n.SQLITE_WASM_DEALLOC)}catch(e){return r.dealloc(u),s.sqlite3_wasm_db_error(n.sqlite3_db_handle(o),e)}}}n.sqlite3_config=function(e,...t){if(arguments.length<2)return n.SQLITE_MISUSE;switch(e){case n.SQLITE_CONFIG_COVERING_INDEX_SCAN:case n.SQLITE_CONFIG_MEMSTATUS:case n.SQLITE_CONFIG_SMALL_MALLOC:case n.SQLITE_CONFIG_SORTERREF_SIZE:case n.SQLITE_CONFIG_STMTJRNL_SPILL:case n.SQLITE_CONFIG_URI:return r.exports.sqlite3_wasm_config_i(e,t[0]);case n.SQLITE_CONFIG_LOOKASIDE:return r.exports.sqlite3_wasm_config_ii(e,t[0],t[1]);case n.SQLITE_CONFIG_MEMDB_MAXSIZE:return r.exports.sqlite3_wasm_config_j(e,t[0]);case n.SQLITE_CONFIG_GETMALLOC:case n.SQLITE_CONFIG_GETMUTEX:case n.SQLITE_CONFIG_GETPCACHE2:case n.SQLITE_CONFIG_GETPCACHE:case n.SQLITE_CONFIG_HEAP:case n.SQLITE_CONFIG_LOG:case n.SQLITE_CONFIG_MALLOC:case n.SQLITE_CONFIG_MMAP_SIZE:case n.SQLITE_CONFIG_MULTITHREAD:case n.SQLITE_CONFIG_MUTEX:case n.SQLITE_CONFIG_PAGECACHE:case n.SQLITE_CONFIG_PCACHE2:case n.SQLITE_CONFIG_PCACHE:case n.SQLITE_CONFIG_PCACHE_HDRSZ:case n.SQLITE_CONFIG_PMASZ:case n.SQLITE_CONFIG_SERIALIZED:case n.SQLITE_CONFIG_SINGLETHREAD:case n.SQLITE_CONFIG_SQLLOG:case n.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return n.SQLITE_NOTFOUND}};{const e=new Set;n.sqlite3_auto_extension=function(t){if(t instanceof Function)t=r.installFunction("i(ppp)",t);else if(1!==arguments.length||!r.isPtr(t))return n.SQLITE_MISUSE;const s=r.exports.sqlite3_auto_extension(t);return t!==arguments[0]&&(0===s?e.add(t):r.uninstallFunction(t)),s},n.sqlite3_cancel_auto_extension=function(e){return e&&1===arguments.length&&r.isPtr(e)?r.exports.sqlite3_cancel_auto_extension(e):0},n.sqlite3_reset_auto_extension=function(){r.exports.sqlite3_reset_auto_extension();for(const t of e)r.uninstallFunction(t);e.clear()}}const _=n.sqlite3_vfs_find("kvvfs");if(_)if(s.isUIThread()){const e=new n.sqlite3_kvvfs_methods(r.exports.sqlite3_wasm_kvvfs_methods());delete n.sqlite3_kvvfs_methods;const t=r.exports.sqlite3_wasm_kvvfsMakeKeyOnPstack,s=r.pstack,i=e=>115===r.peek(e)?sessionStorage:localStorage,o={xRead:(e,n,o,a)=>{const l=s.pointer,c=r.scopedAllocPush();try{const s=t(e,n);if(!s)return-3;const l=r.cstrToJs(s),c=i(e).getItem(l);if(!c)return-1;const _=c.length;if(a<=0)return _;if(1===a)return r.poke(o,0),_;const u=r.scopedAllocCString(c);return a>_+1&&(a=_+1),r.heap8u().copyWithin(o,u,u+a-1),r.poke(o+a-1,0),a-1}catch(e){return console.error("kvstorageRead()",e),-2}finally{s.restore(l),r.scopedAllocPop(c)}},xWrite:(e,o,a)=>{const l=s.pointer;try{const n=t(e,o);if(!n)return 1;const s=r.cstrToJs(n);return i(e).setItem(s,r.cstrToJs(a)),0}catch(e){return console.error("kvstorageWrite()",e),n.SQLITE_IOERR}finally{s.restore(l)}},xDelete:(e,o)=>{const a=s.pointer;try{const n=t(e,o);return n?(i(e).removeItem(r.cstrToJs(n)),0):1}catch(e){return console.error("kvstorageDelete()",e),n.SQLITE_IOERR}finally{s.restore(a)}}};for(const t of Object.keys(o))e[e.memberKey(t)]=r.installFunction(e.memberSignature(t),o[t])}else n.sqlite3_vfs_unregister(_);r.xWrap.FuncPtrAdapter.warnOnUse=!0})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.version={libVersion:"3.44.2",libVersionNumber:3044002,sourceId:"2023-11-24 11:41:44 ebead0e7230cd33bcec9f95d2183069565b9e709bf745c9b5db65cc0cbf92c0f",downloadVersion:3440200}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=(...t)=>{throw new e.SQLite3Error(...t)},n=e.capi,r=e.wasm,s=e.util,i=new WeakMap,o=new WeakMap,a=(e,t,n)=>{const r=Object.getOwnPropertyDescriptor(e,t);return r?r.value:n},l=function(e,r){return r&&(e instanceof d&&(e=e.pointer),t(r,"sqlite3 result code",r+":",e?n.sqlite3_errmsg(e):n.sqlite3_errstr(r))),arguments[0]},c=r.installFunction("i(ippp)",function(e,t,s,i){n.SQLITE_TRACE_STMT===e&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+t+":",r.cstrToJs(i))}.bind({counter:0})),_=Object.create(null),u=function s(...a){if(!s._name2vfs){s._name2vfs=Object.create(null);const e="function"==typeof importScripts&&(e=>t("The VFS for",e,"is only available in the main window thread."));s._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:e||(()=>"local")},s._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:e||(()=>"session")}}const u=s.normalizeArgs(...a);let d=u.filename,f=u.vfs,p=u.flags;("string"!=typeof d&&"number"!=typeof d||"string"!=typeof p||f&&"string"!=typeof f&&"number"!=typeof f)&&(e.config.error("Invalid DB ctor args",u,arguments),t("Invalid arguments for DB constructor."));let m="number"==typeof d?r.cstrToJs(d):d;const h=s._name2vfs[m];h&&(f=h.vfs,d=m=h.filename(m));let g,b=0;p.indexOf("c")>=0&&(b|=n.SQLITE_OPEN_CREATE|n.SQLITE_OPEN_READWRITE),p.indexOf("w")>=0&&(b|=n.SQLITE_OPEN_READWRITE),0===b&&(b|=n.SQLITE_OPEN_READONLY),b|=n.SQLITE_OPEN_EXRESCODE;const y=r.pstack.pointer;try{const e=r.pstack.allocPtr();let t=n.sqlite3_open_v2(d,e,b,f||0);g=r.peekPtr(e),l(g,t),n.sqlite3_extended_result_codes(g,1),p.indexOf("t")>=0&&n.sqlite3_trace_v2(g,n.SQLITE_TRACE_STMT,c,g)}catch(e){throw g&&n.sqlite3_close_v2(g),e}finally{r.pstack.restore(y)}this.filename=m,i.set(this,g),o.set(this,Object.create(null));try{const r=n.sqlite3_js_db_vfs(g);r||t("Internal error: cannot get VFS for new db handle.");const s=_[r];s instanceof Function?s(this,e):s&&l(g,n.sqlite3_exec(g,s,0,0,0))}catch(e){throw this.close(),e}};u.setVfsPostOpenSql=function(e,t){_[e]=t},u.normalizeArgs=function(e=":memory:",t="c",n=null){const r={};return 1===arguments.length&&arguments[0]&&"object"==typeof arguments[0]?(Object.assign(r,arguments[0]),void 0===r.flags&&(r.flags="c"),void 0===r.vfs&&(r.vfs=null),void 0===r.filename&&(r.filename=":memory:")):(r.filename=e,r.flags=t,r.vfs=n),r};const d=function(...e){u.apply(this,e)};d.dbCtorHelper=u;const f={null:1,number:2,string:3,boolean:4,blob:5};f[void 0],f.null,r.bigIntEnabled&&(f.bigint=f.number);const p=function(){f!==arguments[2]&&t(n.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],i.set(this,arguments[1]),this.parameterCount=n.sqlite3_bind_parameter_count(this.pointer)},m=function(e){return e.pointer||t("DB has been closed."),e},h=function(e,n){return(n!==(0|n)||n<0||n>=e.columnCount)&&t("Column index",n,"is out of range."),e},g=(e,t,n,...r)=>{const s=e.prepare(t);try{const e=s.bind(n).step()?s.get(...r):void 0;return s.reset(),e}finally{s.finalize()}},b=(e,t,n,r)=>e.exec({sql:t,bind:n,rowMode:r,returnValue:"resultRows"});d.checkRc=(e,t)=>l(e,t),d.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return m(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch(e){}const e=this.pointer;if(Object.keys(o.get(this)).forEach(((e,t)=>{if(t&&t.pointer)try{t.finalize()}catch(e){}})),i.delete(this),o.delete(this),n.sqlite3_close_v2(e),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch(e){}delete this.filename}},changes:function(e=!1,t=!1){const r=m(this).pointer;return e?t?n.sqlite3_total_changes64(r):n.sqlite3_total_changes(r):t?n.sqlite3_changes64(r):n.sqlite3_changes(r)},dbFilename:function(e="main"){return n.sqlite3_db_filename(m(this).pointer,e)},dbName:function(e=0){return n.sqlite3_db_name(m(this).pointer,e)},dbVfsName:function(e=0){let t;const s=n.sqlite3_js_db_vfs(m(this).pointer,e);if(s){const e=new n.sqlite3_vfs(s);try{t=r.cstrToJs(e.$zName)}finally{e.dispose()}}return t},prepare:function(e){m(this);const s=r.pstack.pointer;let i,a;try{i=r.pstack.alloc(8),d.checkRc(this,n.sqlite3_prepare_v2(this.pointer,e,-1,i,null)),a=r.peekPtr(i)}finally{r.pstack.restore(s)}a||t("Cannot prepare empty SQL.");const l=new p(this,a,f);return o.get(this)[a]=l,l},exec:function(){m(this);const e=function(e,r){const i=Object.create(null);switch(i.opt=Object.create(null),r.length){case 1:"string"==typeof r[0]||s.isSQLableTypedArray(r[0])||Array.isArray(r[0])?i.sql=r[0]:r[0]&&"object"==typeof r[0]&&(i.opt=r[0],i.sql=i.opt.sql);break;case 2:i.sql=r[0],i.opt=r[1];break;default:t("Invalid argument count for exec().")}i.sql=s.flexibleString(i.sql),"string"!=typeof i.sql&&t("Missing SQL argument or unsupported SQL value type.");const o=i.opt;switch(o.returnValue){case"resultRows":o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows;break;case"saveSql":o.saveSql||(o.saveSql=[]),i.returnVal=()=>o.saveSql;break;case void 0:case"this":i.returnVal=()=>e;break;default:t("Invalid returnValue value:",o.returnValue)}if(o.callback||o.returnValue||void 0===o.rowMode||(o.resultRows||(o.resultRows=[]),i.returnVal=()=>o.resultRows),o.callback||o.resultRows)switch(void 0===o.rowMode?"array":o.rowMode){case"object":i.cbArg=e=>e.get(Object.create(null));break;case"array":i.cbArg=e=>e.get([]);break;case"stmt":Array.isArray(o.resultRows)&&t("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),i.cbArg=e=>e;break;default:if(s.isInt32(o.rowMode)){i.cbArg=e=>e.get(o.rowMode);break}if("string"==typeof o.rowMode&&o.rowMode.length>1&&"$"===o.rowMode[0]){const e=o.rowMode.substr(1);i.cbArg=r=>{const s=r.get(Object.create(null))[e];return void 0===s?t(n.SQLITE_NOTFOUND,"exec(): unknown result column:",e):s};break}t("Invalid rowMode:",o.rowMode)}return i}(this,arguments);if(!e.sql)return t("exec() requires an SQL string.");const i=e.opt,o=i.callback,a=Array.isArray(i.resultRows)?i.resultRows:void 0;let l,c=i.bind,_=!!(e.cbArg||i.columnNames||a);const u=r.scopedAllocPush(),h=Array.isArray(i.saveSql)?i.saveSql:void 0;try{const t=s.isSQLableTypedArray(e.sql);let u=t?e.sql.byteLength:r.jstrlen(e.sql);const m=r.scopedAlloc(2*r.ptrSizeof+(u+1)),g=m+r.ptrSizeof;let b=g+r.ptrSizeof;const y=b+u;for(t?r.heap8().set(e.sql,b):r.jstrcpy(e.sql,r.heap8(),b,u,!1),r.poke(b+u,0);b&&r.peek(b,"i8");){r.pokePtr([m,g],0),d.checkRc(this,n.sqlite3_prepare_v3(this.pointer,b,u,0,m,g));const t=r.peekPtr(m);if(b=r.peekPtr(g),u=y-b,t){if(h&&h.push(n.sqlite3_sql(t).trim()),l=new p(this,t,f),c&&l.parameterCount&&(l.bind(c),c=null),_&&l.columnCount){let t=Array.isArray(i.columnNames)?0:1;if(_=!1,e.cbArg||a){for(;l.step();l._lockedByExec=!1){0==t++&&l.getColumnNames(i.columnNames),l._lockedByExec=!0;const n=e.cbArg(l);if(a&&a.push(n),o&&!1===o.call(i,n,l))break}l._lockedByExec=!1}0===t&&l.getColumnNames(i.columnNames)}else l.step();l.reset().finalize(),l=null}}}finally{r.scopedAllocPop(u),l&&(delete l._lockedByExec,l.finalize())}return e.returnVal()},createFunction:function(e,r,i){const o=e=>e instanceof Function;switch(arguments.length){case 1:e=(i=e).name,r=i.xFunc||0;break;case 2:o(r)||(r=(i=r).xFunc||0)}i||(i={}),"string"!=typeof e&&t("Invalid arguments: missing function name.");let l=i.xStep||0,c=i.xFinal||0;const _=i.xValue||0,u=i.xInverse||0;let f;o(r)?(f=!1,(o(l)||o(c))&&t("Ambiguous arguments: scalar or aggregate?"),l=c=null):o(l)?(o(c)||t("Missing xFinal() callback for aggregate or window UDF."),r=null):o(c)?t("Missing xStep() callback for aggregate or window UDF."):t("Missing function-type properties."),!1===f?(o(_)||o(u))&&t("xValue and xInverse are not permitted for non-window UDFs."):o(_)?(o(u)||t("xInverse must be provided if xValue is."),f=!0):o(u)&&t("xValue must be provided if xInverse is.");const p=i.pApp;null==p||"number"==typeof p&&s.isInt32(p)||t("Invalid value for pApp property. Must be a legal WASM pointer value.");const m=i.xDestroy||0;m&&!o(m)&&t("xDestroy property must be a function.");let h=0;a(i,"deterministic")&&(h|=n.SQLITE_DETERMINISTIC),a(i,"directOnly")&&(h|=n.SQLITE_DIRECTONLY),a(i,"innocuous")&&(h|=n.SQLITE_INNOCUOUS),e=e.toLowerCase();const g=r||l,b=a(i,"arity"),y="number"==typeof b?b:g.length?g.length-1:0;let q;return q=f?n.sqlite3_create_window_function(this.pointer,e,y,n.SQLITE_UTF8|h,p||0,l,c,_,u,m):n.sqlite3_create_function_v2(this.pointer,e,y,n.SQLITE_UTF8|h,p||0,r,l,c,m),d.checkRc(this,q),this},selectValue:function(e,t,n){return g(this,e,t,0,n)},selectValues:function(e,t,n){const r=this.prepare(e),s=[];try{for(r.bind(t);r.step();)s.push(r.get(0,n));r.reset()}finally{r.finalize()}return s},selectArray:function(e,t){return g(this,e,t,[])},selectObject:function(e,t){return g(this,e,t,{})},selectArrays:function(e,t){return b(this,e,t,"array")},selectObjects:function(e,t){return b(this,e,t,"object")},openStatementCount:function(){return this.pointer?Object.keys(o.get(this)).length:0},transaction:function(e){let r="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&t(n.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),r+=" "+arguments[0],e=arguments[1]),m(this).exec(r);try{const t=e(this);return this.exec("COMMIT"),t}catch(e){throw this.exec("ROLLBACK"),e}},savepoint:function(e){m(this).exec("SAVEPOINT oo1");try{const t=e(this);return this.exec("RELEASE oo1"),t}catch(e){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),e}},checkRc:function(e){return l(this,e)}};const y=function(e){return e.pointer||t("Stmt has been closed."),e},q=function(e){return function(e){let t=f[null==e?"null":typeof e];switch(t){case f.boolean:case f.null:case f.number:case f.string:return t;case f.bigint:if(r.bigIntEnabled)return t;default:return s.isBindableTypedArray(e)?f.blob:void 0}}(e)||t("Unsupported bind() argument type:",typeof e)},E=function(e,n){return e._lockedByExec&&t("Operation is illegal when statement is locked:",n),e},v=function i(o,a,l,c){E(y(o),"bind()"),i._||(i._tooBigInt=e=>t("BigInt value is too big to store without precision loss:",e),i._={string:function(e,t,s,i){const[o,a]=r.allocCString(s,!0);return(i?n.sqlite3_bind_blob:n.sqlite3_bind_text)(e.pointer,t,o,a,n.SQLITE_WASM_DEALLOC)}}),q(c),a=function(e,r){const i="number"==typeof r?r:n.sqlite3_bind_parameter_index(e.pointer,r);return 0!==i&&s.isInt32(i)?(i<1||i>e.parameterCount)&&t("Bind index",r,"is out of range."):t("Invalid bind() parameter name: "+r),i}(o,a);let _=0;switch(null==c?f.null:l){case f.null:_=n.sqlite3_bind_null(o.pointer,a);break;case f.string:_=i._.string(o,a,c,!1);break;case f.number:{let e;s.isInt32(c)?e=n.sqlite3_bind_int:"bigint"==typeof c?s.bigIntFits64(c)?r.bigIntEnabled?e=n.sqlite3_bind_int64:s.bigIntFitsDouble(c)?(c=Number(c),e=n.sqlite3_bind_double):i._tooBigInt(c):i._tooBigInt(c):(c=Number(c),e=r.bigIntEnabled&&Number.isInteger(c)?n.sqlite3_bind_int64:n.sqlite3_bind_double),_=e(o.pointer,a,c);break}case f.boolean:_=n.sqlite3_bind_int(o.pointer,a,c?1:0);break;case f.blob:{if("string"==typeof c){_=i._.string(o,a,c,!0);break}c instanceof ArrayBuffer?c=new Uint8Array(c):s.isBindableTypedArray(c)||t("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const e=r.alloc(c.byteLength||1);r.heap8().set(c.byteLength?c:[0],e),_=n.sqlite3_bind_blob(o.pointer,a,e,c.byteLength,n.SQLITE_WASM_DEALLOC);break}default:e.config.warn("Unsupported bind() argument type:",c),t("Unsupported bind() argument type: "+typeof c)}return _&&d.checkRc(o.db.pointer,_),o._mayGet=!1,o};p.prototype={finalize:function(){if(this.pointer){E(this,"finalize()");const e=n.sqlite3_finalize(this.pointer);return delete o.get(this.db)[this.pointer],i.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,e}},clearBindings:function(){return E(y(this),"clearBindings()"),n.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(e){E(this,"reset()"),e&&this.clearBindings();const t=n.sqlite3_reset(y(this).pointer);return this._mayGet=!1,l(this.db,t),this},bind:function(){let e,n;switch(y(this),arguments.length){case 1:e=1,n=arguments[0];break;case 2:e=arguments[0],n=arguments[1];break;default:t("Invalid bind() arguments.")}return void 0===n?this:(this.parameterCount||t("This statement has no bindable parameters."),this._mayGet=!1,null===n?v(this,e,f.null,n):Array.isArray(n)?(1!==arguments.length&&t("When binding an array, an index argument is not permitted."),n.forEach(((e,t)=>v(this,t+1,q(e),e))),this):(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),"object"!=typeof n||s.isBindableTypedArray(n)?v(this,e,q(n),n):(1!==arguments.length&&t("When binding an object, an index argument is not permitted."),Object.keys(n).forEach((e=>v(this,e,q(n[e]),n[e]))),this)))},bindAsBlob:function(e,n){y(this),1===arguments.length&&(n=e,e=1);const r=q(n);return f.string!==r&&f.blob!==r&&f.null!==r&&t("Invalid value type for bindAsBlob()"),v(this,e,f.blob,n)},step:function(){E(this,"step()");const t=n.sqlite3_step(y(this).pointer);switch(t){case n.SQLITE_DONE:return this._mayGet=!1;case n.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,e.config.warn("sqlite3_step() rc=",t,n.sqlite3_js_rc_str(t),"SQL =",n.sqlite3_sql(this.pointer)),d.checkRc(this.db.pointer,t)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const e=this.step();return this.reset(),e}finally{try{this.finalize()}catch(e){}}},get:function(e,i){if(y(this)._mayGet||t("Stmt.step() has not (recently) returned true."),Array.isArray(e)){let t=0;const n=this.columnCount;for(;t=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t).valueOf():t}{const r=n.sqlite3_column_double(this.pointer,e);return(r>Number.MAX_SAFE_INTEGER||rt("The pointer property is read-only.")};Object.defineProperty(p.prototype,"pointer",e),Object.defineProperty(d.prototype,"pointer",e)}if(Object.defineProperty(p.prototype,"columnCount",{enumerable:!1,get:function(){return n.sqlite3_column_count(this.pointer)},set:()=>t("The columnCount property is read-only.")}),e.oo1={DB:d,Stmt:p},s.isUIThread()){e.oo1.JsStorageDb=function(e="session"){"session"!==e&&"local"!==e&&t("JsStorageDb db name must be one of 'session' or 'local'."),u.call(this,{filename:e,flags:"c",vfs:"kvvfs"})};const r=e.oo1.JsStorageDb;r.prototype=Object.create(d.prototype),r.clearStorage=n.sqlite3_js_kvvfs_clear,r.prototype.clearStorage=function(){return r.clearStorage(m(this).filename)},r.storageSize=n.sqlite3_js_kvvfs_size,r.prototype.storageSize=function(){return r.storageSize(m(this).filename)}}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){e.initWorker1API=function(){const e=(...e)=>{throw new Error(e.join(" "))};globalThis.WorkerGlobalScope instanceof Function||e("initWorker1API() must be run from a Worker thread.");const t=this.sqlite3||e("Missing this.sqlite3 object."),n=t.oo1.DB,r=function(e){let t=s.idMap.get(e);return t||(t="db#"+ ++s.idSeq+"@"+e.pointer,s.idMap.set(e,t),t)},s={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(e){const t=new n(e);return this.dbs[r(t)]=t,this.dbList.indexOf(t)<0&&this.dbList.push(t),t},close:function(e,n){if(e){delete this.dbs[r(e)];const s=e.filename,i=t.wasm.sqlite3_wasm_db_vfs(e.pointer,0);e.close();const o=this.dbList.indexOf(e);o>=0&&this.dbList.splice(o,1),n&&s&&i&&t.wasm.sqlite3_wasm_vfs_unlink(i,s)}},post:function(e,t){t&&t.length?(globalThis.postMessage(e,Array.from(t)),t.length=0):globalThis.postMessage(e)},dbs:Object.create(null),getDb:function(t,n=!0){return this.dbs[t]||(n?e("Unknown (or closed) DB ID:",t):void 0)}},i=function(t,n=!0){const r=s.getDb(t.dbId,!1)||s.dbList[0];return n?function(t=s.dbList[0]){return t&&t.pointer?t:e("DB is not opened.")}(r):r},o={open:function(n){const i=Object.create(null),o=n.args||Object.create(null);o.simulateError&&e("Throwing because of simulateError flag.");const a=Object.create(null);let l,c;var _;if(i.vfs=o.vfs,""===(_=o.filename)||":"===_[0]?i.filename=o.filename||"":(i.filename=o.filename,l=o.byteArray,l&&(c=function(e){const n=/^file:.+(vfs=(\w+))/.exec(e);return t.capi.sqlite3_vfs_find(n?n[2]:0)}(o.filename))),c){let e;try{e=t.wasm.allocFromTypedArray(l);const n=t.wasm.sqlite3_wasm_vfs_create_file(c,i.filename,e,l.byteLength);n&&t.SQLite3Error.toss(n)}catch(e){throw new t.SQLite3Error(e.name+" creating "+o.filename+": "+e.message,{cause:e})}finally{e&&t.wasm.dealloc(e)}}const u=s.open(i);return a.filename=u.filename,a.persistent=!!t.capi.sqlite3_js_db_uses_vfs(u.pointer,"opfs"),a.dbId=r(u),a.vfs=u.dbVfsName(),a},close:function(e){const t=i(e,!1),n={filename:t&&t.filename};if(t){const n=!(!e.args||"object"!=typeof e.args||!e.args.unlink);s.close(t,n)}return n},exec:function(t){const n="string"==typeof t.args?{sql:t.args}:t.args||Object.create(null);"stmt"===n.rowMode?e("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):n.sql||e("'exec' requires input SQL.");const r=i(t);(n.callback||Array.isArray(n.resultRows))&&(r._blobXfer=s.xfer);const o=n.callback;let a=0;const l=!!n.columnNames;"string"==typeof o&&(l||(n.columnNames=[]),n.callback=function(e,t){s.post({type:o,columnNames:n.columnNames,rowNumber:++a,row:e},s.xfer)});try{const e=n.countChanges?r.changes(!0,64===n.countChanges):void 0;r.exec(n),void 0!==e&&(n.changeCount=r.changes(!0,64===n.countChanges)-e),n.callback instanceof Function&&(n.callback=o,s.post({type:o,columnNames:n.columnNames,rowNumber:null,row:void 0}))}finally{delete r._blobXfer,n.callback&&(n.callback=o)}return n},"config-get":function(){const e=Object.create(null),n=t.config;return["bigIntEnabled"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)&&(e[t]=n[t])})),e.version=t.version,e.vfsList=t.capi.sqlite3_js_vfs_list(),e.opfsEnabled=!!t.opfs,e},export:function(e){const n=i(e),r={byteArray:t.capi.sqlite3_js_db_export(n.pointer),filename:n.filename,mimetype:"application/x-sqlite3"};return s.xfer.push(r.byteArray.buffer),r},toss:function(t){e("Testing worker exception")},"opfs-tree":async function(n){return t.opfs||e("OPFS support is unavailable."),await t.opfs.treeList()}};globalThis.onmessage=async function(t){let n,i=(t=t.data).dbId,a=t.type;const l=performance.now();try{o.hasOwnProperty(a)&&o[a]instanceof Function?n=await o[a](t):e("Unknown db worker message type:",t.type)}catch(e){a="error",n={operation:t.type,message:e.message,errorClass:e.name,input:t},e.stack&&(n.stack="string"==typeof e.stack?e.stack.split(/\n\s*/):e.stack)}i||(i=n.dbId||s.dbList[0]&&r(s.dbList[0])),s.post({type:a,dbId:i,messageId:t.messageId,workerReceivedTime:l,workerRespondTime:performance.now(),departureTime:t.departureTime,result:n},s.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}.bind({sqlite3:e})})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.wasm,n=e.capi,r=e.util.toss3,s=Object.create(null),i=Object.create(null),o=e.StructBinder;e.vfs=s,e.vtab=i;const a=n.sqlite3_index_info;a.prototype.nthConstraint=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const n=this.$aConstraint+a.sqlite3_index_constraint.structInfo.sizeof*e;return t?n:new a.sqlite3_index_constraint(n)},a.prototype.nthConstraintUsage=function(e,t=!1){if(e<0||e>=this.$nConstraint)return!1;const n=this.$aConstraintUsage+a.sqlite3_index_constraint_usage.structInfo.sizeof*e;return t?n:new a.sqlite3_index_constraint_usage(n)},a.prototype.nthOrderBy=function(e,t=!1){if(e<0||e>=this.$nOrderBy)return!1;const n=this.$aOrderBy+a.sqlite3_index_orderby.structInfo.sizeof*e;return t?n:new a.sqlite3_index_orderby(n)};const l=function e(n,s,i,a=e.installMethodArgcCheck){if(n instanceof o.StructType?i instanceof Function||t.isPtr(i)||r("Usage errror: expecting a Function or WASM pointer to one."):r("Usage error: target object is-not-a StructType."),1===arguments.length)return(t,r)=>e(n,t,r,a);e.argcProxy||(e.argcProxy=function(e,t,n,s){return function(...i){return n.length!==arguments.length&&r("Argument mismatch for",e.structInfo.name+"::"+t+": Native signature is:",s),n.apply(this,i)}},e.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach(((e,n)=>{if("number"==typeof e)try{t.uninstallFunction(e)}catch(e){}})),delete this.ondispose.__removeFuncList)});const l=n.memberSignature(s);l.length<2&&r("Member",s,"does not have a function pointer signature:",l);const c=n.memberKey(s),_=a&&!t.isPtr(i)?e.argcProxy(n,c,i,l):i;if(t.isPtr(_))_&&!t.functionEntry(_)&&r("Pointer",_,"is not a WASM function table entry."),n[c]=_;else{const r=t.installFunction(_,n.memberSignature(s,!0));n[c]=r,n.ondispose&&n.ondispose.__removeFuncList||(n.addOnDispose("ondispose.__removeFuncList handler",e.removeFuncList),n.ondispose.__removeFuncList=[]),n.ondispose.__removeFuncList.push(c,r)}return(t,r)=>e(n,t,r,a)};l.installMethodArgcCheck=!1;const c=function(e,t,n=l.installMethodArgcCheck){const r=new Map;for(const s of Object.keys(t)){const i=t[s],o=r.get(i);if(o){const t=e.memberKey(s);e[t]=e[e.memberKey(o)]}else l(e,s,i,n),r.set(i,s)}return e};o.StructType.prototype.installMethod=function(e,t,n=l.installMethodArgcCheck){return arguments.length<3&&e&&"object"==typeof e?c(this,...arguments):l(this,...arguments)},o.StructType.prototype.installMethods=function(e,t=l.installMethodArgcCheck){return c(this,e,t)},n.sqlite3_vfs.prototype.registerVfs=function(t=!1){this instanceof e.capi.sqlite3_vfs||r("Expecting a sqlite3_vfs-type argument.");const s=n.sqlite3_vfs_register(this,t?1:0);return s&&r("sqlite3_vfs_register(",this,") failed with rc",s),this.pointer!==n.sqlite3_vfs_find(this.$zName)&&r("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},s.installVfs=function(e){let n=0;const s=["io","vfs"];for(const r of s){const s=e[r];s&&(++n,c(s.struct,s.methods,!!s.applyArgcCheck),"vfs"===r&&(s.struct.$zName||"string"!=typeof s.name||s.struct.addOnDispose(s.struct.$zName=t.allocCString(s.name)),s.struct.registerVfs(!!s.asDefault)))}return n||r("Misuse: installVfs() options object requires at least","one of:",s),this};const _=function(n,r){const s=function(n,r){return function(s,i=!1){if(0===arguments.length&&(s=new r),s instanceof r)return this.set(s.pointer,s),s;t.isPtr(s)||e.SQLite3Error.toss("Invalid argument to",n+"()");let o=this.get(s);return i&&this.delete(s),o}.bind(new Map)}(n,r);return Object.assign(Object.create(null),{StructType:r,create:e=>{const n=s();return t.pokePtr(e,n.pointer),n},get:e=>s(e),unget:e=>s(e,!0),dispose:e=>{const t=s(e,!0);t&&t.dispose()}})};i.xVtab=_("xVtab",n.sqlite3_vtab),i.xCursor=_("xCursor",n.sqlite3_vtab_cursor),i.xIndexInfo=e=>new n.sqlite3_index_info(e),i.xError=function t(r,s,i){if(t.errorReporter instanceof Function)try{t.errorReporter("sqlite3_module::"+r+"(): "+s.message)}catch(e){}let o;return s instanceof e.WasmAllocError?o=n.SQLITE_NOMEM:arguments.length>2?o=i:s instanceof e.SQLite3Error&&(o=s.resultCode),o||n.SQLITE_ERROR},i.xError.errorReporter=console.error.bind(console),i.xRowid=(e,n)=>t.poke(e,n,"i64"),i.setupModule=function(s){let o=!1;const a=this instanceof n.sqlite3_module?this:s.struct||(o=new n.sqlite3_module);try{const n=s.methods||r("Missing 'methods' object.");for(const e of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const t=e[0],r=e[1];!0===n[t]?n[t]=n[r]:!0===n[r]&&(n[r]=n[t])}if(s.catchExceptions){const r=function(n,r){return["xConnect","xCreate"].indexOf(n)>=0?function(s,o,a,l,c,_){try{return r(...arguments)||0}catch(r){return r instanceof e.WasmAllocError||(t.dealloc(t.peekPtr(_)),t.pokePtr(_,t.allocCString(r.message))),i.xError(n,r)}}:function(...e){try{return r(...e)||0}catch(e){return i.xError(n,e)}}},s=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],o=Object.create(null);for(const e of s){const t=n[e];t instanceof Function&&("xConnect"===e&&n.xCreate===t?o[e]=n.xCreate:"xCreate"===e&&n.xConnect===t?o[e]=n.xConnect:o[e]=r(e,t))}c(a,o,!1)}else c(a,n,!!s.applyArgcCheck);if(0===a.$iVersion){let e;e="number"==typeof s.iVersion?s.iVersion:a.$xShadowName?3:a.$xSavePoint||a.$xRelease||a.$xRollbackTo?2:1,a.$iVersion=e}}catch(e){throw o&&o.dispose(),e}return a},n.sqlite3_module.prototype.setupModule=function(e){return i.setupModule.call(this,e)}})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=function t(r){if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if("undefined"==typeof WorkerGlobalScope)return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!(globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&navigator?.storage?.getDirectory))return Promise.reject(new Error("Missing required OPFS APIs."));r&&"object"==typeof r||(r=Object.create(null));const s=new URL(globalThis.location.href).searchParams;if(s.has("opfs-disable"))return Promise.resolve(e);void 0===r.verbose&&(r.verbose=s.has("opfs-verbose")?+s.get("opfs-verbose")||2:1),void 0===r.sanityChecks&&(r.sanityChecks=s.has("opfs-sanity-check")),void 0===r.proxyUri&&(r.proxyUri=t.defaultProxyUri),"function"==typeof r.proxyUri&&(r.proxyUri=r.proxyUri());const i=new Promise((function(t,s){const i=[e.config.error,e.config.warn,e.config.log],o=(e,...t)=>{r.verbose>e&&i[e]("OPFS syncer:",...t)},a=(...e)=>o(2,...e),l=(...e)=>o(1,...e),c=(...e)=>o(0,...e),_=e.util.toss,u=e.capi,d=e.util,f=e.wasm,p=u.sqlite3_vfs,m=u.sqlite3_file,h=u.sqlite3_io_methods,g=Object.create(null);g.metrics={dump:function(){let t,n=0,r=0,s=0;for(t in x.opIds){const e=T[t];n+=e.count,r+=e.time,s+=e.wait,e.avgTime=e.count&&e.time?e.time/e.count:0,e.avgWait=e.count&&e.wait?e.wait/e.count:0}e.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",T,"\nTotal of",n,"op(s) for",r,"ms (incl. "+s+" ms of waiting on the async side)"),e.config.log("Serialization metrics:",T.s11n),w.postMessage({type:"opfs-async-metrics"})},reset:function(){let e;for(e in x.opIds)(t=T[e]=Object.create(null)).count=t.time=t.wait=0;var t;let n=T.s11n=Object.create(null);n=n.serialize=Object.create(null),n.count=n.time=0,n=T.s11n.deserialize=Object.create(null),n.count=n.time=0}};const b=new h,y=(new p).addOnDispose((()=>b.dispose()));let q;const E=e=>(q=!0,y.dispose(),s(e)),v=()=>(q=!1,t(e)),w=new Worker(new URL(n.p+n.u(892),n.b));setTimeout((()=>{void 0===q&&E(new Error("Timeout while waiting for OPFS async proxy worker."))}),4e3),w._originalOnError=w.onerror,w.onerror=function(e){c("Error initializing OPFS asyncer:",e),E(new Error("Loading OPFS async Worker failed for unknown reasons."))};const S=u.sqlite3_vfs_find(null),A=S?new p(S):null;b.$iVersion=1,y.$iVersion=2,y.$szOsFile=u.sqlite3_file.structInfo.sizeof,y.$mxPathname=1024,y.$zName=f.allocCString("opfs"),y.$xDlOpen=y.$xDlError=y.$xDlSym=y.$xDlClose=null,y.addOnDispose("$zName",y.$zName,"cleanup default VFS wrapper",(()=>A?A.dispose():null));const x=Object.create(null);x.verbose=r.verbose,x.littleEndian=(()=>{const e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]})(),x.asyncIdleWaitTime=150,x.asyncS11nExceptions=1,x.fileBufferSize=65536,x.sabS11nOffset=x.fileBufferSize,x.sabS11nSize=2*y.$mxPathname,x.sabIO=new SharedArrayBuffer(x.fileBufferSize+x.sabS11nSize),x.opIds=Object.create(null);const T=Object.create(null);{let e=0;x.opIds.whichOp=e++,x.opIds.rc=e++,x.opIds.xAccess=e++,x.opIds.xClose=e++,x.opIds.xDelete=e++,x.opIds.xDeleteNoWait=e++,x.opIds.xFileSize=e++,x.opIds.xLock=e++,x.opIds.xOpen=e++,x.opIds.xRead=e++,x.opIds.xSleep=e++,x.opIds.xSync=e++,x.opIds.xTruncate=e++,x.opIds.xUnlock=e++,x.opIds.xWrite=e++,x.opIds.mkdir=e++,x.opIds["opfs-async-metrics"]=e++,x.opIds["opfs-async-shutdown"]=e++,x.opIds.retry=e++,x.sabOP=new SharedArrayBuffer(4*e),g.metrics.reset()}x.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_PENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach((e=>{void 0===(x.sq3Codes[e]=u[e])&&_("Maintenance required: not found:",e)})),x.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,defaultUnlockAsap:!1});const I=(e,...t)=>{const n=x.opIds[e]||_("Invalid op ID:",e);x.s11n.serialize(...t),Atomics.store(x.sabOPView,x.opIds.rc,-1),Atomics.store(x.sabOPView,x.opIds.whichOp,n),Atomics.notify(x.sabOPView,x.opIds.whichOp);const r=performance.now();Atomics.wait(x.sabOPView,x.opIds.rc,-1);const s=Atomics.load(x.sabOPView,x.opIds.rc);if(T[e].wait+=performance.now()-r,s&&x.asyncS11nExceptions){const t=x.s11n.deserialize();t&&c(e+"() async error:",...t)}return s};g.debug={asyncShutdown:()=>{l("Shutting down OPFS async listener. The OPFS VFS will no longer work."),I("opfs-async-shutdown")},asyncRestart:()=>{l("Attempting to restart OPFS VFS async listener. Might work, might not."),w.postMessage({type:"opfs-async-restart"})}};const k=function e(t=16){e._chars||(e._n=(e._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789").length);const n=[];let r=0;for(;r{O.start=performance.now(),O.op=e,++T[e].count},L=()=>T[O.op].time+=performance.now()-O.start,C={xCheckReservedLock:function(e,t){const n=F[e];return f.poke(t,n.lockType?1:0,"i32"),0},xClose:function(e){P("xClose");let t=0;const n=F[e];return n&&(delete F[e],t=I("xClose",e),n.sq3File&&n.sq3File.dispose()),L(),t},xDeviceCharacteristics:function(e){return u.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,n){return u.SQLITE_NOTFOUND},xFileSize:function(e,t){P("xFileSize");let n=I("xFileSize",e);if(0==n)try{const e=x.s11n.deserialize()[0];f.poke(t,e,"i64")}catch(e){c("Unexpected error reading xFileSize() result:",e),n=x.sq3Codes.SQLITE_IOERR}return L(),n},xLock:function(e,t){P("xLock");const n=F[e];let r=0;return n.lockType?n.lockType=t:(r=I("xLock",e,t),0===r&&(n.lockType=t)),L(),r},xRead:function(e,t,n,r){P("xRead");const s=F[e];let i;try{i=I("xRead",e,n,Number(r)),0!==i&&u.SQLITE_IOERR_SHORT_READ!==i||f.heap8u().set(s.sabView.subarray(0,n),t)}catch(e){c("xRead(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_READ}return L(),i},xSync:function(e,t){P("xSync"),++T.xSync.count;const n=I("xSync",e,t);return L(),n},xTruncate:function(e,t){P("xTruncate");const n=I("xTruncate",e,Number(t));return L(),n},xUnlock:function(e,t){P("xUnlock");const n=F[e];let r=0;return u.SQLITE_LOCK_NONE===t&&n.lockType&&(r=I("xUnlock",e,t)),0===r&&(n.lockType=t),L(),r},xWrite:function(e,t,n,r){P("xWrite");const s=F[e];let i;try{s.sabView.set(f.heap8u().subarray(t,t+n)),i=I("xWrite",e,n,Number(r))}catch(e){c("xWrite(",arguments,") failed:",e,s),i=u.SQLITE_IOERR_WRITE}return L(),i}},N={xAccess:function(e,t,n,r){P("xAccess");const s=I("xAccess",f.cstrToJs(t));return f.poke(r,s?0:1,"i32"),L(),0},xCurrentTime:function(e,t){return f.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return f.poke(t,21086676e7+(new Date).getTime(),"i64"),0},xDelete:function(e,t,n){P("xDelete");const r=I("xDelete",f.cstrToJs(t),n,!1);return L(),r},xFullPathname:function(e,t,n,r){return f.cstrncpy(r,t,n)!!e)):n},g.getDirForFilename=async function(e,t=!1){const n=g.getResolvedPath(e,!0),r=n.pop();let s=g.rootDirectory;for(const e of n)e&&(s=await s.getDirectoryHandle(e,{create:!!t}));return[s,r]},g.mkdir=async function(e){try{return await g.getDirForFilename(e+"/filepart",!0),!0}catch(e){return!1}},g.entryExists=async function(e){try{const[t,n]=await g.getDirForFilename(e);return await t.getFileHandle(n),!0}catch(e){return!1}},g.randomFilename=k,g.registerVfs=(e=!1)=>f.exports.sqlite3_vfs_register(y.pointer,e?1:0),g.treeList=async function(){const e=Object.create(null);return await async function e(t,n){n.name=t.name,n.dirs=[],n.files=[];for await(const r of t.values())if("directory"===r.kind){const t=Object.create(null);n.dirs.push(t),await e(r,t)}else n.files.push(r.name)}(g.rootDirectory,e),e},g.rmfr=async function(){const e=g.rootDirectory,t={recurse:!0};for await(const n of e.values())e.removeEntry(n.name,t)},g.unlink=async function(e,t=!1,n=!1){try{const[n,r]=await g.getDirForFilename(e,!1);return await n.removeEntry(r,{recursive:t}),!0}catch(e){if(n)throw new Error("unlink(",arguments[0],") failed: "+e.message,{cause:e});return!1}},g.traverse=async function(e){const t={recursive:!0,directory:g.rootDirectory};"function"==typeof e&&(e={callback:e}),async function t(n,r){for await(const s of n.values()){if(!1===e.callback(s,n,r))return!1;if(e.recursive&&"directory"===s.kind&&!1===await t(s,r+1))break}}((e=Object.assign(t,e||{})).directory,0)},g.importDb=async function(e,t){if(t instanceof Function)return async function(e,t){const[n,r]=await g.getDirForFilename(e,!0),s=await n.getFileHandle(r,{create:!0});let i,o=await s.createSyncAccessHandle(),a=0,l=!1;try{for(o.truncate(0);void 0!==(i=await t());)i instanceof ArrayBuffer&&(i=new Uint8Array(i)),0===a&&i.byteLength>=15&&(d.affirmDbHeader(i),l=!0),o.write(i,{at:a}),a+=i.byteLength;if((a<512||0!=a%512)&&_("Input size",a,"is not correct for an SQLite database."),!l){const e=new Uint8Array(20);o.read(e,{at:0}),d.affirmDbHeader(e)}return o.write(new Uint8Array([1,1]),{at:18}),a}catch(e){throw await o.close(),o=void 0,await n.removeEntry(r).catch((()=>{})),e}finally{o&&await o.close()}}(e,t);t instanceof ArrayBuffer&&(t=new Uint8Array(t)),d.affirmIsDb(t);const n=t.byteLength,[r,s]=await g.getDirForFilename(e,!0);let i,o=0;try{const e=await r.getFileHandle(s,{create:!0});return i=await e.createSyncAccessHandle(),i.truncate(0),o=i.write(t,{at:0}),o!=n&&_("Expected to write "+n+" bytes but wrote "+o+"."),i.write(new Uint8Array([1,1]),{at:18}),o}catch(e){throw i&&(await i.close(),i=void 0),await r.removeEntry(s).catch((()=>{})),e}finally{i&&await i.close()}},e.oo1){const t=function(...t){const n=e.oo1.DB.dbCtorHelper.normalizeArgs(...t);n.vfs=y.$zName,e.oo1.DB.dbCtorHelper.call(this,n)};t.prototype=Object.create(e.oo1.DB.prototype),e.oo1.OpfsDb=t,t.importDb=g.importDb,e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(y.pointer,(function(e,t){t.capi.sqlite3_busy_timeout(e,1e4),t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}w.onmessage=function({data:t}){switch(t.type){case"opfs-unavailable":E(new Error(t.payload.join(" ")));break;case"opfs-async-loaded":w.postMessage({type:"opfs-async-init",args:x});break;case"opfs-async-inited":if(!0===q)break;try{e.vfs.installVfs({io:{struct:b,methods:C},vfs:{struct:y,methods:N}}),x.sabOPView=new Int32Array(x.sabOP),x.sabFileBufView=new Uint8Array(x.sabIO,0,x.fileBufferSize),x.sabS11nView=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),(()=>{if(x.s11n)return x.s11n;const e=new TextDecoder,t=new TextEncoder("utf-8"),n=new Uint8Array(x.sabIO,x.sabS11nOffset,x.sabS11nSize),r=new DataView(x.sabIO,x.sabS11nOffset,x.sabS11nSize);x.s11n=Object.create(null);const s=Object.create(null);s.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},s.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},s.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},s.string={id:4};const i=e=>s[typeof e]||_("Maintenance required: this value type cannot be serialized.",e),o=e=>{switch(e){case s.number.id:return s.number;case s.bigint.id:return s.bigint;case s.boolean.id:return s.boolean;case s.string.id:return s.string;default:_("Invalid type ID:",e)}};x.s11n.deserialize=function(t=!1){++T.s11n.deserialize.count;const s=performance.now(),i=n[0],a=i?[]:null;if(i){const t=[];let s,l,c,_=1;for(s=0;s{w.onerror=w._originalOnError,delete w._originalOnError,e.opfs=g,g.rootDirectory=t,a("End of OPFS sqlite3_vfs setup.",y),v()})).catch(E):v()}catch(e){c(e),E(e)}break;default:{const e="Unexpected message from the OPFS async worker: "+JSON.stringify(t);c(e),E(new Error(e));break}}}}));return i};t.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push((async e=>{try{let n=t.defaultProxyUri;return e.scriptInfo.sqlite3Dir&&(t.defaultProxyUri=e.scriptInfo.sqlite3Dir+n),t().catch((t=>{e.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",t.message)}))}catch(t){return e.config.error("installOpfsVfs() exception:",t),Promise.reject(t)}}))})),globalThis.sqlite3ApiBootstrap.initializers.push((function(e){const t=e.util.toss,n=e.util.toss3,r=Object.create(null),s=e.capi,i=e.util,o=e.wasm,a=4096,l=s.SQLITE_OPEN_MAIN_DB|s.SQLITE_OPEN_MAIN_JOURNAL|s.SQLITE_OPEN_SUPER_JOURNAL|s.SQLITE_OPEN_WAL,c=".opaque",_=()=>Math.random().toString(36).slice(2),u=new TextDecoder,d=new TextEncoder,f=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2}),p=[e.config.error,e.config.warn,e.config.log],m=(e.config.log,e.config.warn),h=(e.config.error,new Map),g=e=>h.get(e),b=(e,t)=>{t?h.set(e,t):h.delete(e)},y=new Map,q=e=>y.get(e),E=(e,t)=>{t?y.set(e,t):y.delete(e)},v={xCheckReservedLock:function(e,t){const n=q(e);return n.log("xCheckReservedLock"),n.storeErr(),o.poke32(t,1),0},xClose:function(e){const t=q(e);t.storeErr();const n=t.getOFileForS3File(e);if(n)try{t.log(`xClose ${n.path}`),t.mapS3FileToOFile(e,!1),n.sah.flush(),n.flags&s.SQLITE_OPEN_DELETEONCLOSE&&t.deletePath(n.path)}catch(e){return t.storeErr(e,s.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(e){return s.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(e,t,n){return s.SQLITE_NOTFOUND},xFileSize:function(e,t){const n=q(e);n.log("xFileSize");const r=n.getOFileForS3File(e).sah.getSize()-a;return o.poke64(t,BigInt(r)),0},xLock:function(e,t){const n=q(e);return n.log(`xLock ${t}`),n.storeErr(),n.getOFileForS3File(e).lockType=t,0},xRead:function(e,t,n,r){const i=q(e);i.storeErr();const l=i.getOFileForS3File(e);i.log(`xRead ${l.path} ${n} @ ${r}`);try{const e=l.sah.read(o.heap8u().subarray(t,t+n),{at:a+Number(r)});return et&&o.poke8(n+t-1,0)}catch(i){return s.SQLITE_NOMEM}finally{o.scopedAllocPop(e)}}return i?i.sqlite3Rc||s.SQLITE_IOERR:0},xOpen:function(e,n,r,i,a){const l=g(e);try{l.log(`xOpen ${o.cstrToJs(n)} ${i}`);const e=n&&o.peek8(n)?l.getPath(n):_();let c=l.getSAHForPath(e);!c&&i&s.SQLITE_OPEN_CREATE&&(l.getFileCount()b(r.pointer,0))),a&&(r.$xRandomness=a.$xRandomness,r.$xSleep=a.$xSleep,a.dispose()),r.$xRandomness||S.xRandomness||(S.xRandomness=function(e,t,n){const r=o.heap8u();let s=0;for(;s0),e.vfs.installVfs({vfs:{struct:r,methods:S}}),r}(this.vfsName),b(this.#c.pointer,this),this.vfsDir=t.directory||"."+this.vfsName,this.#l=new DataView(this.#a.buffer,this.#a.byteOffset),this.isReady=this.reset(!!(t.clearOnInit??f.clearOnInit)).then((()=>{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(t.initialCapacity||f.initialCapacity)}))}#u(e,...t){this.#_>e&&p[e](this.vfsName+":",...t)}log(...e){this.#u(2,...e)}warn(...e){this.#u(1,...e)}error(...e){this.#u(0,...e)}getVfs(){return this.#c}getCapacity(){return this.#r.size}getFileCount(){return this.#s.size}getFileNames(){const e=[],t=this.#s.keys();for(const n of t)e.push(n);return e}async addCapacity(e){for(let t=0;t{try{const r=await n.createSyncAccessHandle();if(this.#r.set(r,t),e)r.truncate(a),this.setAssociatedPath(r,"",0);else{const e=this.getAssociatedPath(r);e?this.#s.set(e,r):this.#i.add(r)}}catch(e){throw this.storeErr(e),this.releaseAccessHandles(),e}})))}getAssociatedPath(e){e.read(this.#a,{at:0});const t=this.#l.getUint32(512);if(this.#a[0]&&(t&s.SQLITE_OPEN_DELETEONCLOSE||!(t&l)))return m(`Removing file with unexpected flags ${t.toString(16)}`,this.#a),this.setAssociatedPath(e,"",0),"";const n=new Uint32Array(2);e.read(n,{at:516});const r=this.computeDigest(this.#a);if(n.every(((e,t)=>e===r[t]))){const t=this.#a.findIndex((e=>0===e));return 0===t&&e.truncate(a),t?u.decode(this.#a.subarray(0,t)):""}return m("Disassociating file with bad digest."),this.setAssociatedPath(e,"",0),""}setAssociatedPath(e,n,r){const s=d.encodeInto(n,this.#a);512<=s.written+1&&t("Path too long:",n),this.#a.fill(0,s.written,512),this.#l.setUint32(512,r);const i=this.computeDigest(this.#a);e.write(this.#a,{at:0}),e.write(i,{at:516}),e.flush(),n?(this.#s.set(n,e),this.#i.delete(e)):(e.truncate(a),this.#i.add(e))}computeDigest(e){let t=3735928559,n=1103547991;for(const r of e)t=31*t+307*r,n=31*n+307*r;return new Uint32Array([t>>>0,n>>>0])}async reset(e){await this.isReady;let t,n=await navigator.storage.getDirectory();for(const e of this.vfsDir.split("/"))e&&(t=n,n=await n.getDirectoryHandle(e,{create:!0}));return this.#e=n,this.#n=t,this.#t=await this.#e.getDirectoryHandle(c,{create:!0}),this.releaseAccessHandles(),this.acquireAccessHandles(e)}getPath(e){return o.isPtr(e)&&(e=o.cstrToJs(e)),(e instanceof URL?e:new URL(e,"file://localhost/")).pathname}deletePath(e){const t=this.#s.get(e);return t&&(this.#s.delete(e),this.setAssociatedPath(t,"",0)),!!t}storeErr(e,t){return e&&(e.sqlite3Rc=t||s.SQLITE_IOERR,this.error(e)),this.$error=e,t}popErr(){const e=this.$error;return this.$error=void 0,e}nextAvailableSAH(){const[e]=this.#i.keys();return e}getOFileForS3File(e){return this.#o.get(e)}mapS3FileToOFile(e,t){t?(this.#o.set(e,t),E(e,this)):(this.#o.delete(e),E(e,!1))}hasFilename(e){return this.#s.has(e)}getSAHForPath(e){return this.#s.get(e)}async removeVfs(){if(!this.#c.pointer||!this.#t)return!1;s.sqlite3_vfs_unregister(this.#c.pointer),this.#c.dispose();try{this.releaseAccessHandles(),await this.#e.removeEntry(c,{recursive:!0}),this.#t=void 0,await this.#n.removeEntry(this.#e.name,{recursive:!0}),this.#e=this.#n=void 0}catch(t){e.config.error(this.vfsName,"removeVfs() failed:",t)}return!0}exportFile(e){const n=this.#s.get(e)||t("File not found:",e),r=n.getSize()-a,s=new Uint8Array(r>0?r:0);if(r>0){const e=n.read(s,{at:a});e!=r&&t("Expected to read "+r+" bytes but read "+e+".")}return s}async importDbChunked(e,n){const r=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to.");r.truncate(0);let o,l=0,c=!1;try{for(;void 0!==(o=await n());)o instanceof ArrayBuffer&&(o=new Uint8Array(o)),0===l&&o.byteLength>=15&&(i.affirmDbHeader(o),c=!0),r.write(o,{at:a+l}),l+=o.byteLength;if((l<512||0!=l%512)&&t("Input size",l,"is not correct for an SQLite database."),!c){const e=new Uint8Array(20);r.read(e,{at:0}),i.affirmDbHeader(e)}r.write(new Uint8Array([1,1]),{at:4114})}catch(e){throw this.setAssociatedPath(r,"",0),e}return this.setAssociatedPath(r,e,s.SQLITE_OPEN_MAIN_DB),l}importDb(e,n){if(n instanceof ArrayBuffer)n=new Uint8Array(n);else if(n instanceof Function)return this.importDbChunked(e,n);const r=this.#s.get(e)||this.nextAvailableSAH()||t("No available handles to import to."),i=n.byteLength;(i<512||i%512!=0)&&t("Byte array size is invalid for an SQLite db.");for(let e=0;e<15;++e)"SQLite format 3".charCodeAt(e)!==n[e]&&t("Input does not contain an SQLite database header.");const o=r.write(n,{at:a});return o!=i?(this.setAssociatedPath(r,"",0),t("Expected to write "+i+" bytes but wrote "+o+".")):(r.write(new Uint8Array([1,1]),{at:4114}),this.setAssociatedPath(r,e,s.SQLITE_OPEN_MAIN_DB)),o}}class x{#d;constructor(e){this.#d=e,this.vfsName=e.vfsName}async addCapacity(e){return this.#d.addCapacity(e)}async reduceCapacity(e){return this.#d.reduceCapacity(e)}getCapacity(){return this.#d.getCapacity(this.#d)}getFileCount(){return this.#d.getFileCount()}getFileNames(){return this.#d.getFileNames()}async reserveMinimumCapacity(e){const t=this.#d.getCapacity();return t{const e=await navigator.storage.getDirectory(),n=".opfs-sahpool-sync-check-"+_(),r=await e.getFileHandle(n,{create:!0}),s=(await r.createSyncAccessHandle()).close();return await s,await e.removeEntry(n),s?.then&&t("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0})().then((async function(){if(n.$testThrowInInit)throw n.$testThrowInInit;const t=new A(n);return t.isReady.then((async()=>{const n=new x(t);if(e.oo1){const r=e.oo1,s=t.getVfs(),i=function(...e){const t=r.DB.dbCtorHelper.normalizeArgs(...e);t.vfs=s.$zName,r.DB.dbCtorHelper.call(this,t)};i.prototype=Object.create(r.DB.prototype),n.OpfsSAHPoolDb=i,r.DB.dbCtorHelper.setVfsPostOpenSql(s.pointer,(function(e,t){t.capi.sqlite3_exec(e,["pragma journal_mode=DELETE;","pragma cache_size=-16384;"],0,0,0)}))}return t.log("VFS initialized."),n})).catch((async e=>(await t.removeVfs().catch((()=>{})),e)))})).catch((e=>r[s]=Promise.reject(e))):r[s]=Promise.reject(new Error("Missing required OPFS APIs."))}})),void 0!==e){const t=Object.assign(Object.create(null),{exports:void 0===Re?e.asm:Re,memory:e.wasmMemory},globalThis.sqlite3ApiConfig||{});let n;globalThis.sqlite3ApiConfig=t;try{n=globalThis.sqlite3ApiBootstrap()}catch(e){throw console.error("sqlite3ApiBootstrap() error:",e),e}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}e.sqlite3=n}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")})),e.ready});const i=function(){const e=s;if(!e)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const t=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:globalThis?.document?.currentScript,isWorker:"undefined"!=typeof WorkerGlobalScope,location:globalThis.location,urlParams:globalThis?.location?.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(t.debugModule=t.urlParams.has("sqlite3.debugModule")?(...e)=>console.warn("sqlite3.debugModule:",...e):()=>{},t.urlParams.has("sqlite3.dir"))t.sqlite3Dir=t.urlParams.get("sqlite3.dir")+"/";else if(t.moduleScript){const e=t.moduleScript.src.split("/");e.pop(),t.sqlite3Dir=e.join("/")+"/"}if(globalThis.sqlite3InitModule=function n(...r){return e(...r).then((e=>{const r=e.sqlite3;r.scriptInfo=t,n.__isUnderTest&&(r.__isUnderTest=!0);const s=r.asyncPostInit;return delete r.asyncPostInit,s()})).catch((e=>{throw console.error("Exception loading sqlite3 module:",e),e}))},globalThis.sqlite3InitModule.ready=e.ready,globalThis.sqlite3InitModuleState.moduleScript){const e=globalThis.sqlite3InitModuleState;let t=e.moduleScript.src.split("/");t.pop(),e.scriptDir=t.join("/")+"/"}return t.debugModule("sqlite3InitModuleState =",t),globalThis.sqlite3InitModule}(),o=s=i}}]); \ No newline at end of file diff --git a/4629.bundle.js b/4629.bundle.js new file mode 100644 index 00000000..50ab63f0 --- /dev/null +++ b/4629.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4629],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var t=e(1601),r=e.n(t),a=e(6314),l=e.n(a)()(r());l.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=l},5045:(n,o,e)=>{var t=e(5072),r=e.n(t),a=e(7825),l=e.n(a),i=e(7659),s=e.n(i),c=e(5056),u=e.n(c),d=e(540),p=e.n(d),m=e(1113),b=e.n(m),g=e(4096),h={};h.styleTagTransform=b(),h.setAttributes=u(),h.insert=s().bind(null,"head"),h.domAPI=l(),h.insertStyleElement=p(),r()(g.A,h),g.A&&g.A.locals&&g.A.locals},8217:(n,o,e)=>{e.d(o,{Ay:()=>g,Bs:()=>f,hX:()=>h,te:()=>y});var t=e(6717),r=e(4778),a=e(4294),l=e(1217),i=e(1064),s=e(503),c=e(6702),u=e(2871),d=e(4338),p=e(4087),m=e(3407),b=e(3402);const g=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=t.A,this.supportedMediaTypes=null}getReadOptions(n,o){if(o){let e=o.dataProjection?(0,m.Jt)(o.dataProjection):this.readProjection(n);o.extent&&e&&"tile-pixels"===e.getUnits()&&(e=(0,m.Jt)(e),e.setWorldExtent(o.extent)),o={dataProjection:e,featureProjection:o.featureProjection}}return this.adaptOptions(o)}adaptOptions(n){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},n)}getType(){return(0,p.b0)()}readFeature(n,o){return(0,p.b0)()}readFeatures(n,o){return(0,p.b0)()}readGeometry(n,o){return(0,p.b0)()}readProjection(n){return(0,p.b0)()}writeFeature(n,o){return(0,p.b0)()}writeFeatures(n,o){return(0,p.b0)()}writeGeometry(n,o){return(0,p.b0)()}};function h(n,o,e){const t=e?(0,m.Jt)(e.featureProjection):null,r=e?(0,m.Jt)(e.dataProjection):null;let a=n;if(t&&r&&!(0,m.tI)(t,r)){o&&(a=n.clone());const e=o?t:r,l=o?r:t;"tile-pixels"===e.getUnits()?a.transform(e,l):a.applyTransform((0,m.RG)(e,l))}if(o&&e&&void 0!==e.decimals){const o=Math.pow(10,e.decimals),t=function(n){for(let e=0,t=n.length;ef({...n,geometry:o}))).flat();const t="MultiPolygon"===e.type?"Polygon":e.type;if("GeometryCollection"===t||"Circle"===t)throw new Error("Unsupported geometry type: "+t);const a=e.layout.length;return h(new r.Ay(t,"Polygon"===t?function(n,o,e){return Array.isArray(o[0])?((0,b.mb)(n,0,o,e)||(n=n.slice(),(0,b.NK)(n,0,o,e)),n):((0,b.PA)(n,0,o,e)||(n=n.slice(),(0,b.ug)(n,0,o,e)),n)}(e.flatCoordinates,e.ends,a):e.flatCoordinates,e.ends?.flat(),a,n.properties||{},n.id).enableSimplifyTransformed(),!1,o)}function y(n,o){if(!n)return null;if(Array.isArray(n)){const e=n.map((n=>y(n,o)));return new d.A(e)}return h(new(0,x[n.type])(n.flatCoordinates,n.layout,n.ends),!1,o)}},4662:(n,o,e)=>{e.d(o,{A:()=>v});var t=e(8217),r=e(1217),a=e(6702),l=e(503),i=e(2871),s=e(8112),c=e(4294),u=e(1064),d=e(5286),p=e(4778),m=e(3407),b=e(3402);class g extends t.Ay{constructor(n){super(),n=n||{},this.dataProjection=new d.A({code:"",units:"tile-pixels"}),this.featureClass=n.featureClass?n.featureClass:p.Ay,this.geometryName_=n.geometryName,this.layerName_=n.layerName?n.layerName:"layer",this.layers_=n.layers?n.layers:null,this.idProperty_=n.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(n,o,e,t){n.pos=o.geometry;const r=n.readVarint()+n.pos;let a=1,l=0,i=0,s=0,c=0,u=0;for(;n.pos>3}if(l--,1===a||2===a)i+=n.readSVarint(),s+=n.readSVarint(),1===a&&c>u&&(t.push(c),u=c),e.push(i,s),c+=2;else{if(7!==a)throw new Error("Invalid command found in the PBF");c>u&&(e.push(e[u],e[u+1]),c+=2)}}c>u&&(t.push(c),u=c)}createFeature_(n,o,e){const s=o.type;if(0===s)return null;let d;const m=o.properties;let g;this.idProperty_?(g=m[this.idProperty_],delete m[this.idProperty_]):g=o.id,m[this.layerName_]=o.layer.name;const h=[],x=[];this.readRawGeometry_(n,o,h,x);const f=function(n,o){let e;return 1===n?e=1===o?"Point":"MultiPoint":2===n?e=1===o?"LineString":"MultiLineString":3===n&&(e="Polygon"),e}(s,x.length);if(this.featureClass===p.Ay)d=new this.featureClass(f,h,x,2,m,g),d.transform(e.dataProjection);else{let n;if("Polygon"==f){const o=(0,b.yJ)(h,x);n=o.length>1?new i.A(h,"XY",o):new u.Ay(h,"XY",x)}else n="Point"===f?new c.A(h,"XY"):"LineString"===f?new r.A(h,"XY"):"MultiPoint"===f?new l.A(h,"XY"):"MultiLineString"===f?new a.A(h,"XY",x):null;d=new(0,this.featureClass),this.geometryName_&&d.setGeometryName(this.geometryName_);const o=(0,t.hX)(n,!1,e);d.setGeometry(o),void 0!==g&&d.setId(g),d.setProperties(m,!0)}return d}getType(){return"arraybuffer"}readFeatures(n,o){const e=this.layers_;o=this.adaptOptions(o);const t=(0,m.Jt)(o.dataProjection);t.setWorldExtent(o.extent),o.dataProjection=t;const r=new s.A(n),a=r.readFields(h,{}),l=[];for(const n in a){if(e&&!e.includes(n))continue;const i=a[n],s=i?[0,0,i.extent,i.extent]:null;t.setExtent(s);for(let n=0,e=i.length;n>3)?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null;o.values.push(t)}}function f(n,o,e){if(1==n)o.id=e.readVarint();else if(2==n){const n=e.readVarint()+e.pos;for(;e.pos{e.d(o,{A:()=>s});var t=e(702),r=e(7896);const a={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},l={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends t.A{constructor(n){const o=n.layer.indexOf("-"),e=-1==o?n.layer:n.layer.slice(0,o),t=l[e]||{minZoom:0,maxZoom:20,retina:!0},i=a[n.layer],s=n.apiKey?"?api_key="+n.apiKey:"",c=t.retina&&n.retina?"@2x":"",u=void 0!==n.url?n.url:"https://tiles.stadiamaps.com/tiles/"+n.layer+"/{z}/{x}/{y}"+c+"."+i.extension+s,d=['© Stadia Maps','© OpenMapTiles',r.o];n.layer.startsWith("stamen_")&&d.splice(1,0,'© Stamen Design'),super({attributions:d,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:n.interpolate,maxZoom:void 0!==n.maxZoom?n.maxZoom:t.maxZoom,minZoom:void 0!==n.minZoom?n.minZoom:t.minZoom,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:u,tilePixelRatio:c?2:1,wrapX:n.wrapX,zDirection:n.zDirection})}}const s=i}}]); \ No newline at end of file diff --git a/4783.bundle.js b/4783.bundle.js index d90a3d10..7bff13f1 100644 --- a/4783.bundle.js +++ b/4783.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4783],{6308:(e,a,t)=>{t.d(a,{A:()=>n});const n=t.p+"32ba7744565a0c818ef0e2e35126abbb.geojson"},4783:(e,a,t)=>{t.r(a),t.d(a,{default:()=>p});var n=t(6540),r=t(3407),s=t(1365),o=t(6717),i=(t(5045),t(7240)),l=t(2381),m=t(6308);const c=new s.A({featureProjection:"EPSG:3857",featureClass:o.A});function p(){const[e,a]=n.useState(15),[t,s]=n.useState(8);return n.createElement(n.Fragment,null,n.createElement(i.f9,{className:"example-map",initial:{center:(0,r.Rb)([0,0]),zoom:1}},n.createElement(l.A,{layer:"stamen_toner"}),n.createElement(i.KL,{blur:e,radius:t,format:c,url:m.A,weight:(0,n.useCallback)((e=>parseFloat(e.get("mag"))-5),[])})),n.createElement("div",{className:"d-flex flex-row w-100"},n.createElement("div",{className:"w-50 me-2"},n.createElement("label",{htmlFor:"blur"},"Blur"),n.createElement("div",{className:"w-100"},n.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"0",max:"50",id:"blur",value:e,onChange:(0,n.useCallback)((e=>a(parseInt(e.currentTarget.value))),[])}))),n.createElement("div",{className:"w-50"},n.createElement("label",{htmlFor:"radius"},"Radius"),n.createElement("div",{className:"w-100"},n.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"0",max:"20",id:"radius",value:t,onChange:(0,n.useCallback)((e=>s(parseInt(e.currentTarget.value))),[])})))))}},2381:(e,a,t)=>{t.d(a,{A:()=>o});var n=t(945),r=t(5042),s=t(2662);class o extends s.A{constructor(e,a){var t;super(e,a),this.source=new r.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(t=this.props.retina)&&void 0!==t&&t}),this.ol=new n.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(e,a,t)=>{t.d(a,{A:()=>l});var n=t(702),r=t(7896);const s={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},o={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends n.A{constructor(e){const a=e.layer.indexOf("-"),t=-1==a?e.layer:e.layer.slice(0,a),n=o[t]||{minZoom:0,maxZoom:20,retina:!0},i=s[e.layer],l=e.apiKey?"?api_key="+e.apiKey:"",m=n.retina&&e.retina?"@2x":"",c=void 0!==e.url?e.url:"https://tiles.stadiamaps.com/tiles/"+e.layer+"/{z}/{x}/{y}"+m+"."+i.extension+l,p=['© Stadia Maps','© OpenMapTiles',r.o];e.layer.startsWith("stamen_")&&p.splice(1,0,'© Stamen Design'),super({attributions:p,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:e.interpolate,maxZoom:void 0!==e.maxZoom?e.maxZoom:n.maxZoom,minZoom:void 0!==e.minZoom?e.minZoom:n.minZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:c,tilePixelRatio:m?2:1,wrapX:e.wrapX,zDirection:e.zDirection})}}const l=i}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4783],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var r=e(1601),t=e.n(r),l=e(6314),a=e.n(l)()(t());a.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=a},6308:(n,o,e)=>{e.d(o,{A:()=>r});const r=e.p+"32ba7744565a0c818ef0e2e35126abbb.geojson"},5045:(n,o,e)=>{var r=e(5072),t=e.n(r),l=e(7825),a=e.n(l),i=e(7659),s=e.n(i),c=e(5056),p=e.n(c),u=e(540),m=e.n(u),d=e(1113),b=e.n(d),g=e(4096),x={};x.styleTagTransform=b(),x.setAttributes=p(),x.insert=s().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=m(),t()(g.A,x),g.A&&g.A.locals&&g.A.locals},4783:(n,o,e)=>{e.r(o),e.d(o,{default:()=>u});var r=e(6540),t=e(3407),l=e(1365),a=e(6717),i=(e(5045),e(7240)),s=e(2381),c=e(6308);const p=new l.A({featureProjection:"EPSG:3857",featureClass:a.A});function u(){const[n,o]=r.useState(15),[e,l]=r.useState(8);return r.createElement(r.Fragment,null,r.createElement(i.f9,{className:"example-map",initial:{center:(0,t.Rb)([0,0]),zoom:1}},r.createElement(s.A,{layer:"stamen_toner"}),r.createElement(i.KL,{blur:n,radius:e,format:p,url:c.A,weight:(0,r.useCallback)((n=>parseFloat(n.get("mag"))-5),[])})),r.createElement("div",{className:"d-flex flex-row w-100"},r.createElement("div",{className:"w-50 me-2"},r.createElement("label",{htmlFor:"blur"},"Blur"),r.createElement("div",{className:"w-100"},r.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"0",max:"50",id:"blur",value:n,onChange:(0,r.useCallback)((n=>o(parseInt(n.currentTarget.value))),[])}))),r.createElement("div",{className:"w-50"},r.createElement("label",{htmlFor:"radius"},"Radius"),r.createElement("div",{className:"w-100"},r.createElement("input",{type:"range",className:"range-slider range-slider--primary w-100",min:"0",max:"20",id:"radius",value:e,onChange:(0,r.useCallback)((n=>l(parseInt(n.currentTarget.value))),[])})))))}},2381:(n,o,e)=>{e.d(o,{A:()=>a});var r=e(945),t=e(5042),l=e(2662);class a extends l.A{constructor(n,o){var e;super(n,o),this.source=new t.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(e=this.props.retina)&&void 0!==e&&e}),this.ol=new r.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(n,o,e)=>{e.d(o,{A:()=>s});var r=e(702),t=e(7896);const l={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},a={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends r.A{constructor(n){const o=n.layer.indexOf("-"),e=-1==o?n.layer:n.layer.slice(0,o),r=a[e]||{minZoom:0,maxZoom:20,retina:!0},i=l[n.layer],s=n.apiKey?"?api_key="+n.apiKey:"",c=r.retina&&n.retina?"@2x":"",p=void 0!==n.url?n.url:"https://tiles.stadiamaps.com/tiles/"+n.layer+"/{z}/{x}/{y}"+c+"."+i.extension+s,u=['© Stadia Maps','© OpenMapTiles',t.o];n.layer.startsWith("stamen_")&&u.splice(1,0,'© Stamen Design'),super({attributions:u,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:n.interpolate,maxZoom:void 0!==n.maxZoom?n.maxZoom:r.maxZoom,minZoom:void 0!==n.minZoom?n.minZoom:r.minZoom,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:p,tilePixelRatio:c?2:1,wrapX:n.wrapX,zDirection:n.zDirection})}}const s=i}}]); \ No newline at end of file diff --git a/4804.bundle.js b/4804.bundle.js index 4686c05c..61374ecc 100644 --- a/4804.bundle.js +++ b/4804.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4804],{4804:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const t='/**\n * This example shows how to extend RLayers to include support for your custom component\n */\n\nimport React from "react";\nimport { fromLonLat } from "ol/proj";\nimport { MapboxVector as VectorMapbox } from "ol/layer";\n\nimport { RMap, RLayer, RLayerProps, RContextType } from "rlayers";\n\n/**\n * The properties interface definition\n */\ninterface MyLayerMapboxProps extends RLayerProps {\n styleUrl: string;\n accessToken: string;\n}\n\n/**\n * A component wrapper for ol/layer/MapboxVector\n */\nclass MyLayerMapbox extends RLayer<MyLayerMapboxProps> {\n ol: VectorMapbox;\n\n // Tiled layers must extend RLayerRaster, non-tiled vector layers must extend RLayerVector\n // This allows you to have the same features as RLayers built-in components\n // Completely custom layers must extend RLayer\n constructor(\n props: Readonly<MyLayerMapboxProps>,\n context?: React.Context<RContextType>\n ) {\n // You must call the parent constructor\n super(props, context);\n\n // You must create the this.ol object which must be compatible with the this.ol of the parent\n this.ol = new VectorMapbox({\n ...props,\n });\n\n // You must enumerate all OpenLayers event sources here\n this.eventSources = [this.ol];\n\n // And call this function for the event handlers to work\n this.attachEventHandlers();\n }\n}\n\n/**\n * Using your custom component\n */\nexport default function Addon(): JSX.Element {\n return (\n <RMap\n className="example-map"\n initial={{ center: fromLonLat([2.364, 48.82]), zoom: 11 }}\n >\n <MyLayerMapbox\n styleUrl={"mapbox://styles/mapbox/bright-v9"}\n // Be sure to get your own Mapbox token\n // (this won\'t work in CodePen)\n accessToken={MAPBOX_TOKEN}\n />\n </RMap>\n );\n}\n'}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[4804],{4804:(n,s,a)=>{a.r(s),a.d(s,{default:()=>t});const t='/**\n * This example shows how to extend RLayers to include support for your custom component\n */\n\nimport React from "react";\nimport { fromLonLat } from "ol/proj";\nimport { MapboxVectorLayer as VectorMapbox } from "ol-mapbox-style";\n\nimport { RMap, RLayer, RLayerProps, RContextType } from "rlayers";\n\n/**\n * The properties interface definition\n */\ninterface MyLayerMapboxProps extends RLayerProps {\n styleUrl: string;\n accessToken: string;\n}\n\n/**\n * A component wrapper for ol/layer/MapboxVector\n */\nclass MyLayerMapbox extends RLayer<MyLayerMapboxProps> {\n ol: VectorMapbox;\n\n // Tiled layers must extend RLayerRaster, non-tiled vector layers must extend RLayerVector\n // This allows you to have the same features as RLayers built-in components\n // Completely custom layers must extend RLayer\n constructor(\n props: Readonly<MyLayerMapboxProps>,\n context?: React.Context<RContextType>\n ) {\n // You must call the parent constructor\n super(props, context);\n\n // You must create the this.ol object which must be compatible with the this.ol of the parent\n this.ol = new VectorMapbox({\n ...props,\n });\n\n // You must enumerate all OpenLayers event sources here\n this.eventSources = [this.ol];\n\n // And call this function for the event handlers to work\n this.attachEventHandlers();\n }\n}\n\n/**\n * Using your custom component\n */\nexport default function Addon(): JSX.Element {\n return (\n <RMap\n className="example-map"\n initial={{ center: fromLonLat([2.364, 48.82]), zoom: 11 }}\n >\n <MyLayerMapbox\n styleUrl={"mapbox://styles/mapbox/bright-v9"}\n // Be sure to get your own Mapbox token\n // (this won\'t work in CodePen)\n accessToken={MAPBOX_TOKEN}\n />\n </RMap>\n );\n}\n'}}]); \ No newline at end of file diff --git a/5645.bundle.js b/5645.bundle.js new file mode 100644 index 00000000..cdca35e7 --- /dev/null +++ b/5645.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[5645],{5645:(e,s,t)=>{t.r(s),t.d(s,{default:()=>i});var a=t(6540),r=t(3407),l=t(6214),n=t(7240);class c extends n.Am{constructor(e,s){super(e,s),this.ol=new l.Gt({...e}),this.eventSources=[this.ol],this.attachEventHandlers()}}function i(){return a.createElement(n.f9,{className:"example-map",initial:{center:(0,r.Rb)([2.364,48.82]),zoom:11}},a.createElement(c,{styleUrl:"mapbox://styles/mapbox/bright-v9",accessToken:"pk.eyJ1IjoibW1vbXRjaGV2IiwiYSI6ImNrejZ5eGRlejB1dWQydHBrenF4a2o4ZjMifQ.sEJ43dNJgBkKJI_zTFcV3Q"}))}}}]); \ No newline at end of file diff --git a/5806.bundle.js b/5806.bundle.js index 723475ea..4c68edbc 100644 --- a/5806.bundle.js +++ b/5806.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e,r,t={5806:(e,r,t)=>{var i=t(9663),n=t(9523),o=t(8595),s=function(e,r,t,i){return new(t||(t=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,a)}c((i=i.apply(e,r||[])).next())}))};let a;const c={},l=new i.A({max:32});let d,u=1;const f={xOpen:function(e){return s(this,void 0,void 0,(function*(){let r=l.get(e.url);return r instanceof Promise&&(r=yield r),void 0!==r||(r=fetch(e.url,{method:"HEAD",headers:Object.assign({},null==a?void 0:a.headers)}).then((r=>{var t;return"bytes"!==r.headers.get("Accept-Ranges")&&console.warn(`Server for ${e.url} does not advertise 'Accept-Ranges'. If the server supports it, in order to remove this message, add "Accept-Ranges: bytes". Additionally, if using CORS, add "Access-Control-Expose-Headers: *".`),{url:e.url,id:u++,size:BigInt(null!==(t=r.headers.get("Content-Length"))&&void 0!==t?t:0),pageSize:null}})),l.set(e.url,r),l.set(e.url,yield r)),0}))},xAccess:function(e,r){return s(this,void 0,void 0,(function*(){const t=new Uint32Array(r.shm,0,1);try{const i=yield f.xOpen(e,r);t[0]=0===i?1:0}catch(e){t[0]=0}return 0}))},xRead:function(e,r){var t,i,c;return s(this,void 0,void 0,(function*(){let s=l.get(e.url);if(!s)throw new Error(`File ${e.url} not open`);if(s instanceof Promise&&(s=yield s),void 0===e.n||void 0===e.offset)throw new Error("Mandatory arguments missing");if(!s.pageSize){s.pageSize=1024;const r=new ArrayBuffer(2),c=yield f.xRead({msg:"xRead",url:e.url,offset:BigInt(16),n:2},{buffer:new Uint8Array(r)}),l=new Uint16Array(r);if(0!==c)return c;if((0,o.l)(l),s.pageSize=l[0],n.Yz.vfs(`page size is ${s.pageSize}`),1024!=s.pageSize&&(console.warn(`Page size for ${e.url} is ${s.pageSize}, recommended size is 1024`),d.delete(s.id+"|0")),s.pageSize>(null!==(t=null==a?void 0:a.maxPageSize)&&void 0!==t?t:n.KQ.maxPageSize))throw new Error(`${s.pageSize} is over the maximum configured ${null!==(i=null==a?void 0:a.maxPageSize)&&void 0!==i?i:n.KQ.maxPageSize}`)}const u=BigInt(s.pageSize),g=BigInt(e.n),h=e.offset/u;h*u!==e.offset&&n.Yz.vfs(`Read chunk ${e.offset}:${e.n} is not page-aligned`);let p=h*u;if(p+u0&&d.get(s.id+"|"+(Number(h)-1));t&&(t instanceof Promise&&(t=yield t),"number"==typeof t&&(t=d.get(s.id+"|"+t)),t instanceof Promise&&(t=yield t),t instanceof Uint8Array&&(r=2*t.byteLength,n.Yz.cache(`downloading super page of size ${r}`)));const i=r/s.pageSize;n.Yz.http(`downloading page ${h} of size ${r} starting at ${p}`);const o=fetch(e.url,{method:"GET",headers:Object.assign(Object.assign({},null!==(c=null==a?void 0:a.headers)&&void 0!==c?c:n.KQ.headers),{Range:`bytes=${p}-${p+BigInt(r-1)}`})}).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e)));d.set(v,o);for(let e=Number(h)+1;eNumber(h))));if(m=yield o,!(m instanceof Uint8Array)||0===m.length)throw new Error(`Invalid HTTP response received: ${JSON.stringify(o)}`);d.set(v,m);for(let e=Number(h)+1;e{var r,t,o,s;switch(n.Yz.threads("Received new control message",e),e.msg){case"handshake":{const i=new SharedArrayBuffer((null!==(r=null==a?void 0:a.maxPageSize)&&void 0!==r?r:n.KQ.maxPageSize)+Int32Array.BYTES_PER_ELEMENT),s=new Int32Array(i,null!==(t=null==a?void 0:a.maxPageSize)&&void 0!==t?t:n.KQ.maxPageSize),l=new Uint8Array(i,0,null!==(o=null==a?void 0:a.maxPageSize)&&void 0!==o?o:n.KQ.maxPageSize);Atomics.store(s,0,n.a9.HANDSHAKE),c[e.id]={id:e.id,port:e.port,shm:i,lock:s,buffer:l},e.port.onmessage=g.bind(c[e.id]),postMessage({msg:"ack",id:e.id,shm:i,lock:s})}break;case"init":a=e.options,d=new i.A({maxSize:1024*(null!==(s=null==a?void 0:a.cacheSize)&&void 0!==s?s:n.KQ.cacheSize),sizeCalculation:e=>{var r;return null!==(r=e.byteLength)&&void 0!==r?r:4}});break;case"close":postMessage({msg:"ack"}),close();break;default:throw new Error(`Invalid message received by backend: ${e}`)}},"undefined"==typeof SharedArrayBuffer)throw new Error('SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers.')}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,n.x=()=>{var e=n.O(void 0,[1917],(()=>n(5806)));return n.O(e)},e=[],n.O=(r,t,i,o)=>{if(!t){var s=1/0;for(d=0;d=o)&&Object.keys(n.O).every((e=>n.O[e](t[c])))?t.splice(c--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[t,i,o]},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+".bundle.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var i=t.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=t[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={5806:1};n.f.i=(r,t)=>{e[r]||importScripts(n.p+n.u(r))};var r=self.webpackChunkrlayers=self.webpackChunkrlayers||[],t=r.push.bind(r);r.push=r=>{var[i,o,s]=r;for(var a in o)n.o(o,a)&&(n.m[a]=o[a]);for(s&&s(n);i.length;)e[i.pop()]=1;t(r)}})(),r=n.x,n.x=()=>n.e(1917).then(r),n.x()})(); \ No newline at end of file +(()=>{"use strict";var e,r,t={5806:(e,r,t)=>{var i=t(9663),n=t(9523),o=t(8595),s=function(e,r,t,i){return new(t||(t=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,a)}c((i=i.apply(e,r||[])).next())}))};let a;const c={},l=new i.A({max:32});let d,u=1;const f={xOpen:function(e){return s(this,void 0,void 0,(function*(){let r=l.get(e.url);return r instanceof Promise&&(r=yield r),void 0!==r||(r=fetch(e.url,{method:"HEAD",headers:Object.assign({},null==a?void 0:a.headers)}).then((r=>{var t;return"bytes"!==r.headers.get("Accept-Ranges")&&console.warn(`Server for ${e.url} does not advertise 'Accept-Ranges'. If the server supports it, in order to remove this message, add "Accept-Ranges: bytes". Additionally, if using CORS, add "Access-Control-Expose-Headers: *".`),{url:e.url,id:u++,size:BigInt(null!==(t=r.headers.get("Content-Length"))&&void 0!==t?t:0),pageSize:null}})),l.set(e.url,r),l.set(e.url,yield r)),0}))},xAccess:function(e,r){return s(this,void 0,void 0,(function*(){const t=new Uint32Array(r.shm,0,1);try{const i=yield f.xOpen(e,r);t[0]=0===i?1:0}catch(e){t[0]=0}return 0}))},xRead:function(e,r){var t,i,c;return s(this,void 0,void 0,(function*(){let s=l.get(e.url);if(!s)throw new Error(`File ${e.url} not open`);if(s instanceof Promise&&(s=yield s),void 0===e.n||void 0===e.offset)throw new Error("Mandatory arguments missing");if(!s.pageSize){s.pageSize=1024;const r=new ArrayBuffer(2),c=yield f.xRead({msg:"xRead",url:e.url,offset:BigInt(16),n:2},{buffer:new Uint8Array(r)}),l=new Uint16Array(r);if(0!==c)return c;if((0,o.l)(l),s.pageSize=l[0],n.Yz.vfs(`page size is ${s.pageSize}`),1024!=s.pageSize&&(console.warn(`Page size for ${e.url} is ${s.pageSize}, recommended size is 1024`),d.delete(s.id+"|0")),s.pageSize>(null!==(t=null==a?void 0:a.maxPageSize)&&void 0!==t?t:n.KQ.maxPageSize))throw new Error(`${s.pageSize} is over the maximum configured ${null!==(i=null==a?void 0:a.maxPageSize)&&void 0!==i?i:n.KQ.maxPageSize}`)}const u=BigInt(s.pageSize),g=BigInt(e.n),h=e.offset/u;h*u!==e.offset&&n.Yz.vfs(`Read chunk ${e.offset}:${e.n} is not page-aligned`);let p=h*u;if(p+u0&&d.get(s.id+"|"+(Number(h)-1));t&&(t instanceof Promise&&(t=yield t),"number"==typeof t&&(t=d.get(s.id+"|"+t)),t instanceof Promise&&(t=yield t),t instanceof Uint8Array&&(r=2*t.byteLength,n.Yz.cache(`downloading super page of size ${r}`)));const i=r/s.pageSize;n.Yz.http(`downloading page ${h} of size ${r} starting at ${p}`);const o=fetch(e.url,{method:"GET",headers:Object.assign(Object.assign({},null!==(c=null==a?void 0:a.headers)&&void 0!==c?c:n.KQ.headers),{Range:`bytes=${p}-${p+BigInt(r-1)}`})}).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e)));d.set(m,o);for(let e=Number(h)+1;eNumber(h))));if(v=yield o,!(v instanceof Uint8Array)||0===v.length)throw new Error(`Invalid HTTP response received: ${JSON.stringify(o)}`);d.set(m,v);for(let e=Number(h)+1;e{var r,t,o,s;switch(n.Yz.threads("Received new control message",e),e.msg){case"handshake":{const i=new SharedArrayBuffer((null!==(r=null==a?void 0:a.maxPageSize)&&void 0!==r?r:n.KQ.maxPageSize)+Int32Array.BYTES_PER_ELEMENT),s=new Int32Array(i,null!==(t=null==a?void 0:a.maxPageSize)&&void 0!==t?t:n.KQ.maxPageSize),l=new Uint8Array(i,0,null!==(o=null==a?void 0:a.maxPageSize)&&void 0!==o?o:n.KQ.maxPageSize);Atomics.store(s,0,n.a9.HANDSHAKE),c[e.id]={id:e.id,port:e.port,shm:i,lock:s,buffer:l},e.port.onmessage=g.bind(c[e.id]),postMessage({msg:"ack",id:e.id,shm:i,lock:s})}break;case"init":a=e.options,d=new i.A({maxSize:1024*(null!==(s=null==a?void 0:a.cacheSize)&&void 0!==s?s:n.KQ.cacheSize),sizeCalculation:e=>{var r;return null!==(r=e.byteLength)&&void 0!==r?r:4}});break;case"close":postMessage({msg:"ack"}),close();break;default:throw new Error(`Invalid message received by backend: ${e}`)}},"undefined"==typeof SharedArrayBuffer)throw new Error('SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers.')}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,n.x=()=>{var e=n.O(void 0,[1917],(()=>n(5806)));return n.O(e)},e=[],n.O=(r,t,i,o)=>{if(!t){var s=1/0;for(d=0;d=o)&&Object.keys(n.O).every((e=>n.O[e](t[c])))?t.splice(c--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[t,i,o]},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+".bundle.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var i=t.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=t[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={5806:1};n.f.i=(r,t)=>{e[r]||importScripts(n.p+n.u(r))};var r=self.webpackChunkrlayers=self.webpackChunkrlayers||[],t=r.push.bind(r);r.push=r=>{var[i,o,s]=r;for(var a in o)n.o(o,a)&&(n.m[a]=o[a]);for(s&&s(n);i.length;)e[i.pop()]=1;t(r)}})(),r=n.x,n.x=()=>n.e(1917).then(r),n.x()})(); \ No newline at end of file diff --git a/6025.bundle.js b/6025.bundle.js index 29145b4b..87a516d8 100644 --- a/6025.bundle.js +++ b/6025.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[6025],{783:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(1601),a=n.n(r),o=n(6314),s=n.n(o)()(a());s.push([e.id,".ol-layers-control {\n right: 0.5em;\n top: 2.5em;\n background-color: rgba(255,255,255,0.6);\n}\n\n.ol-layers-control:hover {\n background-color: rgba(255,255,255,0.9);\n}\n\n.ol-layers-control label {\n margin-left: 0.25em;\n}\n\n.ol-layers-control>div {\n padding: 0.25em;\n}\n\n.ol-layers-control>span>*:first-child {\n margin-left: auto;\n}",""]);const l=s},7601:(e,t,n)=>{var r=n(5072),a=n.n(r),o=n(7825),s=n.n(o),l=n(7659),i=n.n(l),m=n(5056),p=n.n(m),c=n(540),u=n.n(c),g=n(1113),d=n.n(g),h=n(783),x={};x.styleTagTransform=d(),x.setAttributes=p(),x.insert=i().bind(null,"head"),x.domAPI=s(),x.insertStyleElement=u(),a()(h.A,x),h.A&&h.A.locals&&h.A.locals},6025:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(6540),a=n(3407),o=n(1365),s=n(7240),l=n(2381),i=(n(5045),n(7601),n(6717));const m=r.createElement("button",null,"☰");function p(){return r.createElement("div",null,r.createElement("p",null,"Use the layers controls in the upper right corner to switch the active layer"),r.createElement(s.f9,{className:"example-map",initial:{center:(0,a.Rb)([2.364,48.82]),zoom:7}},r.createElement(s.E6.bc,{element:m},r.createElement(s.ej,{properties:{label:"OpenStreetMap"}}),r.createElement(s.HS,{properties:{label:"OpenTopo"},url:"https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png",attributions:"Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)"}),r.createElement(s.HS,{properties:{label:"Transport"},url:"http://tile.thunderforest.com/transport/{z}/{x}/{y}.png"}),r.createElement(l.A,{properties:{label:"Stadia Terrain Background"},layer:"stamen_terrain_background"}),r.createElement(s.QN,{properties:{label:"Mapbox TileJSON"},url:"https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json?secure=1"}),r.createElement(s.Tw,{properties:{label:"Magellium OSM France Schools WMS"},url:"https://magosm.magellium.com/geoserver/ows",params:{LAYERS:"magosm:france_schools_point",FORMAT:"image/jpeg"}}),r.createElement(s.Ff,{properties:{label:"Switzerland ArcGIS TileWMS"},url:"https://wms.geo.admin.ch/",params:{LAYERS:"ch.swisstopo.pixelkarte-farbe-pk1000.noscale",FORMAT:"image/jpeg",serverType:"mapserver"}})),r.createElement(s.j9,{zIndex:5,format:new o.A({featureProjection:"EPSG:3857",featureClass:i.A}),url:"https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson"},r.createElement(s.cq.RStyle,null,r.createElement(s.cq.RStroke,{color:"#007bff",width:3}),r.createElement(s.cq.RFill,{color:"transparent"})))))}},2381:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(945),a=n(5042),o=n(2662);class s extends o.A{constructor(e,t){var n;super(e,t),this.source=new a.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(n=this.props.retina)&&void 0!==n&&n}),this.ol=new r.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(702),a=n(7896);const o={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},s={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class l extends r.A{constructor(e){const t=e.layer.indexOf("-"),n=-1==t?e.layer:e.layer.slice(0,t),r=s[n]||{minZoom:0,maxZoom:20,retina:!0},l=o[e.layer],i=e.apiKey?"?api_key="+e.apiKey:"",m=r.retina&&e.retina?"@2x":"",p=void 0!==e.url?e.url:"https://tiles.stadiamaps.com/tiles/"+e.layer+"/{z}/{x}/{y}"+m+"."+l.extension+i,c=['© Stadia Maps','© OpenMapTiles',a.o];e.layer.startsWith("stamen_")&&c.splice(1,0,'© Stamen Design'),super({attributions:c,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:e.interpolate,maxZoom:void 0!==e.maxZoom?e.maxZoom:r.maxZoom,minZoom:void 0!==e.minZoom?e.minZoom:r.minZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:p,tilePixelRatio:m?2:1,wrapX:e.wrapX,zDirection:e.zDirection})}}const i=l}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[6025],{4096:(n,o,e)=>{e.d(o,{A:()=>i});var r=e(1601),t=e.n(r),l=e(6314),a=e.n(l)()(t());a.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const i=a},783:(n,o,e)=>{e.d(o,{A:()=>i});var r=e(1601),t=e.n(r),l=e(6314),a=e.n(l)()(t());a.push([n.id,".ol-layers-control {\n right: 0.5em;\n top: 2.5em;\n background-color: rgba(255,255,255,0.6);\n}\n\n.ol-layers-control:hover {\n background-color: rgba(255,255,255,0.9);\n}\n\n.ol-layers-control label {\n margin-left: 0.25em;\n}\n\n.ol-layers-control>div {\n padding: 0.25em;\n}\n\n.ol-layers-control>span>*:first-child {\n margin-left: auto;\n}",""]);const i=a},5045:(n,o,e)=>{var r=e(5072),t=e.n(r),l=e(7825),a=e.n(l),i=e(7659),s=e.n(i),c=e(5056),p=e.n(c),m=e(540),u=e.n(m),d=e(1113),b=e.n(d),g=e(4096),x={};x.styleTagTransform=b(),x.setAttributes=p(),x.insert=s().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=u(),t()(g.A,x),g.A&&g.A.locals&&g.A.locals},7601:(n,o,e)=>{var r=e(5072),t=e.n(r),l=e(7825),a=e.n(l),i=e(7659),s=e.n(i),c=e(5056),p=e.n(c),m=e(540),u=e.n(m),d=e(1113),b=e.n(d),g=e(783),x={};x.styleTagTransform=b(),x.setAttributes=p(),x.insert=s().bind(null,"head"),x.domAPI=a(),x.insertStyleElement=u(),t()(g.A,x),g.A&&g.A.locals&&g.A.locals},6025:(n,o,e)=>{e.r(o),e.d(o,{default:()=>p});var r=e(6540),t=e(3407),l=e(1365),a=e(7240),i=e(2381),s=(e(5045),e(7601),e(6717));const c=r.createElement("button",null,"☰");function p(){return r.createElement("div",null,r.createElement("p",null,"Use the layers controls in the upper right corner to switch the active layer"),r.createElement(a.f9,{className:"example-map",initial:{center:(0,t.Rb)([2.364,48.82]),zoom:7}},r.createElement(a.E6.bc,{element:c},r.createElement(a.ej,{properties:{label:"OpenStreetMap"}}),r.createElement(a.HS,{properties:{label:"OpenTopo"},url:"https://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png",attributions:"Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)"}),r.createElement(a.HS,{properties:{label:"Transport"},url:"http://tile.thunderforest.com/transport/{z}/{x}/{y}.png"}),r.createElement(i.A,{properties:{label:"Stadia Terrain Background"},layer:"stamen_terrain_background"}),r.createElement(a.QN,{properties:{label:"Mapbox TileJSON"},url:"https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json?secure=1"}),r.createElement(a.Tw,{properties:{label:"Magellium OSM France Schools WMS"},url:"https://magosm.magellium.com/geoserver/ows",params:{LAYERS:"magosm:france_schools_point",FORMAT:"image/jpeg"}}),r.createElement(a.Ff,{properties:{label:"Switzerland ArcGIS TileWMS"},url:"https://wms.geo.admin.ch/",params:{LAYERS:"ch.swisstopo.pixelkarte-farbe-pk1000.noscale",FORMAT:"image/jpeg",serverType:"mapserver"}})),r.createElement(a.j9,{zIndex:5,format:new l.A({featureProjection:"EPSG:3857",featureClass:s.A}),url:"https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements.geojson"},r.createElement(a.cq.RStyle,null,r.createElement(a.cq.RStroke,{color:"#007bff",width:3}),r.createElement(a.cq.RFill,{color:"transparent"})))))}},2381:(n,o,e)=>{e.d(o,{A:()=>a});var r=e(945),t=e(5042),l=e(2662);class a extends l.A{constructor(n,o){var e;super(n,o),this.source=new t.A({layer:this.props.layer,apiKey:this.props.apiKey,retina:null!==(e=this.props.retina)&&void 0!==e&&e}),this.ol=new r.A({source:this.source}),this.eventSources=[this.ol,this.source]}}},5042:(n,o,e)=>{e.d(o,{A:()=>s});var r=e(702),t=e(7896);const l={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},a={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class i extends r.A{constructor(n){const o=n.layer.indexOf("-"),e=-1==o?n.layer:n.layer.slice(0,o),r=a[e]||{minZoom:0,maxZoom:20,retina:!0},i=l[n.layer],s=n.apiKey?"?api_key="+n.apiKey:"",c=r.retina&&n.retina?"@2x":"",p=void 0!==n.url?n.url:"https://tiles.stadiamaps.com/tiles/"+n.layer+"/{z}/{x}/{y}"+c+"."+i.extension+s,m=['© Stadia Maps','© OpenMapTiles',t.o];n.layer.startsWith("stamen_")&&m.splice(1,0,'© Stamen Design'),super({attributions:m,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:n.interpolate,maxZoom:void 0!==n.maxZoom?n.maxZoom:r.maxZoom,minZoom:void 0!==n.minZoom?n.minZoom:r.minZoom,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:p,tilePixelRatio:c?2:1,wrapX:n.wrapX,zDirection:n.zDirection})}}const s=i}}]); \ No newline at end of file diff --git a/6214.bundle.js b/6214.bundle.js new file mode 100644 index 00000000..366041ff --- /dev/null +++ b/6214.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[6214],{6214:(e,t,r)=>{r.d(t,{Gt:()=>ea});var n=r(7733),a=r(3628),i=r(9700),o=r(4778),s=r(953),l=r(9276),u=r(1426),p=r(4238),c=r(8774),f=r(1078),d=r(8756),m=r(4465),y=r(4087),h=r(1365),g=r(764),v=r(5598),b=r(4662),x=r(6679),w=r(6444),k=r(6758),z=r(4218),A=r(2757),S=r(4602),M=r(8063),_=r(5923),q=r(8100),$=r(942),C=r(4863),E=r(3407),T=r(915),I=r(1685),j=r(6837);function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,D={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function R(e){return(e=Math.round(e))<0?0:e>255?255:e}function O(e){return e<0?0:e>1?1:e}function N(e){return"%"===e[e.length-1]?R(parseFloat(e)/100*255):R(parseInt(e))}function L(e){return"%"===e[e.length-1]?O(parseFloat(e)/100):O(parseFloat(e))}function U(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{P={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in D)return D[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),a=r.indexOf(")");if(-1!==n&&a+1===r.length){var i=r.substr(0,n),o=r.substr(n+1,a-(n+1)).split(","),s=1;switch(i){case"rgba":if(4!==o.length)return null;s=L(o.pop());case"rgb":return 3!==o.length?null:[N(o[0]),N(o[1]),N(o[2]),s];case"hsla":if(4!==o.length)return null;s=L(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,u=L(o[1]),p=L(o[2]),c=p<=.5?p*(u+1):p+u-p*u,f=2*p-c;return[R(255*U(f,c,l+1/3)),R(255*U(f,c,l)),R(255*U(f,c,l-1/3)),s];default:return null}}return null}}catch(e){}class V{constructor(e,t,r,n=1){this.r=e,this.g=t,this.b=r,this.a=n}static parse(e){if(!e)return;if(e instanceof V)return e;if("string"!=typeof e)return;const t=P(e);return t?new V(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,r,n]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${n})`}toArray(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}toArray01(){const{r:e,g:t,b:r,a:n}=this;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:r,a:n}=this;return[e,t,r,n]}}V.black=new V(0,0,0,1),V.white=new V(1,1,1,1),V.transparent=new V(0,0,0,0),V.red=new V(1,0,0,1),V.blue=new V(0,0,1,1);var G=V;function J(e){return"object"==typeof e?["literal",e]:e}function W(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Z(e,t){const r=J((n=e.default,a=t.default,void 0!==n?n:void 0!==a?a:void 0));var n,a;return void 0===r&&"resolvedImage"===t.type?"":r}function X(e,t,r){const n=H(e,t),a=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",a,e[0]],e[1]);return n.push(Z(e,t)),n}if("categorical"===n){const n=["match",a];for(const e of r)Y(n,e[0],e[1],!1);return n.push(Z(e,t)),n}if("interval"===n){const t=["step",["number",a]];for(const e of r)Y(t,e[0],e[1],!0);return B(t),void 0===e.default?t:["case",["==",["typeof",a],"number"],t,J(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[W(e),1===t?["linear"]:["exponential",t],["number",a]];for(const e of r)Y(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",a],"number"],n,J(e.default)]}throw new Error(`Unknown property function type ${n}`)}function B(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function Y(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function H(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function K(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let a=r.exec(e);null!==a;a=r.exec(e)){const i=e.slice(n,r.lastIndex-a[0].length);n=r.lastIndex,i.length>0&&t.push(i),t.push(["get",a[1]])}if(1===t.length)return e;if(n`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const ye=[ne,ae,ie,oe,se,ce,le,de(ue),fe];function he(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!he(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of ye)if(!he(e,t))return null}return`Expected ${me(e)} but found ${me(t)} instead.`}function ge(e,t){return t.some((t=>t.kind===e.kind))}function ve(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class be{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class xe{constructor(e,t,r,n,a){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=a}}class we{constructor(e){this.sections=e}static fromString(e){return new we([new xe(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof we?e:we.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const r={};t.fontStack&&(r["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(r["font-scale"]=t.scale),t.textColor&&(r["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(r)}return e}}class ke{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ke({name:e,available:!1}):null}serialize(){return["image",this.name]}}function ze(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ae(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof G)return!0;if(e instanceof be)return!0;if(e instanceof we)return!0;if(e instanceof ke)return!0;if(Array.isArray(e)){for(const t of e)if(!Ae(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Ae(e[t]))return!1;return!0}return!1}function Se(e){if(null===e)return ne;if("string"==typeof e)return ie;if("boolean"==typeof e)return oe;if("number"==typeof e)return ae;if(e instanceof G)return se;if(e instanceof be)return pe;if(e instanceof we)return ce;if(e instanceof ke)return fe;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Se(t);if(r){if(r===e)continue;r=ue;break}r=e}return de(r||ue,t)}return le}function Me(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof G||e instanceof we||e instanceof ke?e.toString():JSON.stringify(e)}class _e{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ae(e[1]))return t.error("invalid value");const r=e[1];let n=Se(r);const a=t.expectedType;return"array"!==n.kind||0!==n.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(n=a),new _e(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof G?["rgba"].concat(this.value.toArray()):this.value instanceof we?this.value.serialize():this.value}}var qe=_e,$e=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};const Ce={string:ie,number:ae,boolean:oe,object:le};class Ee{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const a=e[0];if("array"===a){let a,i;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in Ce)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ce[r],n++}else a=ue;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);i=e[2],n++}r=de(a,i)}else r=Ce[a];const i=[];for(;ne.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);const n=e.N;("number"==typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((e=>e.serialize())))}}var Te=Ee;class Ie{constructor(e){this.type=ce,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let a=!1;for(let r=1;r<=e.length-1;++r){const i=e[r];if(a&&"object"==typeof i&&!Array.isArray(i)){a=!1;let e=null;if(i["font-scale"]&&(e=t.parse(i["font-scale"],1,ae),!e))return null;let r=null;if(i["text-font"]&&(r=t.parse(i["text-font"],1,de(ie)),!r))return null;let o=null;if(i["text-color"]&&(o=t.parse(i["text-color"],1,se),!o))return null;const s=n[n.length-1];s.scale=e,s.font=r,s.textColor=o}else{const i=t.parse(e[r],1,ue);if(!i)return null;const o=i.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new Ie(n)}evaluate(e){return new we(this.sections.map((t=>{const r=t.content.evaluate(e);return Se(r)===fe?new xe("",r,null,null,null):new xe(Me(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const r={};t.scale&&(r["font-scale"]=t.scale.serialize()),t.font&&(r["text-font"]=t.font.serialize()),t.textColor&&(r["text-color"]=t.textColor.serialize()),e.push(r)}return e}}class je{constructor(e){this.type=fe,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ie);return r?new je(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=ke.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Fe={"to-boolean":oe,"to-color":se,"to-number":ae,"to-string":ie};class Pe{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=Fe[r],a=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:ze(t[0],t[1],t[2],t[3]),!r))return new G(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new $e(r||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new $e(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?we.fromString(Me(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?ke.fromString(Me(this.args[0].evaluate(e))):Me(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Ie([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new je(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}var De=Pe;const Re=["Unknown","Point","LineString","Polygon"];var Oe=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Re[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord,a=r*t-e[0],i=n*t-e[1];return this.featureDistanceData.bearing[0]*a+this.featureDistanceData.bearing[1]*i}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=G.parse(e)),t}};class Ne{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const r=e[0],n=Ne.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const a=Array.isArray(n)?n[0]:n.type,i=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=i.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[n,i]of o){s=new mt(t.registry,t.path,null,t.scope);const o=[];let l=!1;for(let t=1;t{return t=e,Array.isArray(t)?`(${t.map(me).join(", ")})`:`(${me(t.type)}...)`;var t})).join(" | "),n=[];for(let r=1;r=t[2]||e[1]<=t[1]||e[3]>=t[3])}function We(e,t){const r=(180+e[0])/360,n=(a=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360);var a;const i=Math.pow(2,t.z);return[Math.round(r*i*Ve),Math.round(n*i*Ve)]}function Ze(e,t,r){const n=e[0]-t[0],a=e[1]-t[1],i=e[0]-r[0],o=e[1]-r[1];return n*o-i*a==0&&n*i<=0&&a*o<=0}function Xe(e,t){let r=!1;for(let o=0,s=t.length;on[1]!=i[1]>n[1]&&n[0]<(i[0]-a[0])*(n[1]-a[1])/(i[1]-a[1])+a[0]&&(r=!r)}}var n,a,i;return r}function Be(e,t){for(let r=0;r0&&c<0||p<0&&c>0}function He(e,t,r,n){const a=[t[0]-e[0],t[1]-e[1]];return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(o=a)[1]-i[1]*o[0]&&!(!Ye(e,t,r,n)||!Ye(r,n,e,t));var i,o}function Ke(e,t,r){for(const n of r)for(let r=0;rr[2]){const t=.5*n;let a=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===a&&(a=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=a}Ge(t,e)}function at(e,t,r,n){const a=Math.pow(2,n.z)*Ve,i=[n.x*Ve,n.y*Ve],o=[];if(!e)return o;for(const n of e)for(const e of n){const n=[e.x+i[0],e.y+i[1]];nt(n,t,r,a),o.push(n)}return o}function it(e,t,r,n){const a=Math.pow(2,n.z)*Ve,i=[n.x*Ve,n.y*Ve],o=[];if(!e)return o;for(const r of e){const e=[];for(const n of r){const r=[n.x+i[0],n.y+i[1]];Ge(t,r),e.push(r)}o.push(e)}if(t[2]-t[0]<=a/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of o)for(const n of e)nt(n,t,r,a)}var s;return o}class ot{constructor(e,t){this.type=oe,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ae(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e{t&&!lt(e)&&(t=!1)})),t}function ut(e){if(e instanceof Le&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!ut(e)&&(t=!1)})),t}function pt(e,t){if(e instanceof Le&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!pt(e,t)&&(r=!1)})),r}class ct{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new ct(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var ft=ct;class dt{constructor(e,t=[],r,n=new re,a=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=a,this.expectedType=r}parse(e,t,r,n,a={}){return t?this.concat(t,r,n)._parse(e,a):this._parse(e,a)}_parse(e,t){function r(e,t,r){return"assert"===r?new Te(t,[e]):"coerce"===r?new De(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const a=this.registry[n];if(a){let n=a.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,a=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==a.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(e,a))return null}else n=r(n,e,t.typeAnnotation||"coerce");else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof qe)&&"resolvedImage"!==n.type.kind&&yt(n)){const e=new Oe;try{n=new qe(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,a=r?this.scope.concat(r):this.scope;return new dt(this.registry,n,t||null,a,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new ee(r,e))}checkSubtype(e,t){const r=he(e,t);return r&&this.error(r),r}}var mt=dt;function yt(e){if(e instanceof ft)return yt(e.boundExpression);if(e instanceof Le&&"error"===e.name)return!1;if(e instanceof Ue)return!1;if(e instanceof st)return!1;const t=e instanceof De||e instanceof Te;let r=!0;return e.eachChild((e=>{r=t?r&&yt(e):r&&e instanceof qe})),!!r&<(e)&&pt(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ht(e,t){const r=e.length-1;let n,a,i=0,o=r,s=0;for(;i<=o;)if(s=Math.floor((i+o)/2),n=e[s],a=e[s+1],n<=t){if(s===r||tt))throw new $e("Input is not a number.");o=s-1}return 0}class gt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,ae);if(!r)return null;const n=[];let a=null;t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let r=1;r=i)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(o,l,a);if(!u)return null;a=a||u.type,n.push([i,u])}return new gt(a,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const a=t.length;return n>=t[a-1]?r[a-1].evaluate(e):r[ht(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var vt=gt,bt=xt;function xt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}xt.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},xt.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},xt.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},xt.prototype.solveCurveX=function(e,t){var r,n,a,i,o;for(void 0===t&&(t=1e-6),a=e,o=0;o<8;o++){if(i=this.sampleCurveX(a)-e,Math.abs(i)(n=1))return n;for(;ri?r=a:n=a,a=.5*(n-r)+r}return a},xt.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var wt=F(bt);function kt(e,t,r){return e*(1-r)+t*r}var zt=Object.freeze({__proto__:null,number:kt,color:function(e,t,r){return new G(kt(e.r,t.r,r),kt(e.g,t.g,r),kt(e.b,t.b,r),kt(e.a,t.a,r))},array:function(e,t,r){return e.map(((e,n)=>kt(e,t[n],r)))}});const At=.95047,St=1.08883,Mt=4/29,_t=6/29,qt=3*_t*_t,$t=_t*_t*_t,Ct=Math.PI/180,Et=180/Math.PI;function Tt(e){return e>$t?Math.pow(e,1/3):e/qt+Mt}function It(e){return e>_t?e*e*e:qt*(e-Mt)}function jt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ft(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pt(e){const t=Ft(e.r),r=Ft(e.g),n=Ft(e.b),a=Tt((.4124564*t+.3575761*r+.1804375*n)/At),i=Tt((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*i-16,a:500*(a-i),b:200*(i-Tt((.0193339*t+.119192*r+.9503041*n)/St)),alpha:e.a}}function Dt(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*It(t),r=At*It(r),n=St*It(n),new G(jt(3.2404542*r-1.5371385*t-.4985314*n),jt(-.969266*r+1.8760108*t+.041556*n),jt(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function Rt(e,t,r){const n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const Ot={forward:Pt,reverse:Dt,interpolate:function(e,t,r){return{l:kt(e.l,t.l,r),a:kt(e.a,t.a,r),b:kt(e.b,t.b,r),alpha:kt(e.alpha,t.alpha,r)}}},Nt=function(e){const{l:t,a:r,b:n}=Pt(e),a=Math.atan2(n,r)*Et;return{h:a<0?a+360:a,c:Math.sqrt(r*r+n*n),l:t,alpha:e.a}},Lt=function(e){const t=e.h*Ct,r=e.c;return Dt({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},Ut=function(e,t,r){return{h:Rt(e.h,t.h,r),c:kt(e.c,t.c,r),l:kt(e.l,t.l,r),alpha:kt(e.alpha,t.alpha,r)}};class Vt{constructor(e,t,r,n,a){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of a)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let a=0;if("exponential"===e.name)a=Gt(t,e.base,r,n);else if("linear"===e.name)a=Gt(t,1,r,n);else if("cubic-bezier"===e.name){const i=e.controlPoints;a=new wt(i[0],i[1],i[2],i[3]).solve(Gt(t,1,r,n))}return a}static parse(e,t){let[r,n,a,...i]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(a=t.parse(a,2,ae),!a)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=se:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',a);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,o.push([r,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Vt(s,r,n,a,o):t.error(`Type ${me(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const a=t.length;if(n>=t[a-1])return r[a-1].evaluate(e);const i=ht(t,n),o=t[i],s=t[i+1],l=Vt.interpolationFactor(this.interpolation,n,o,s),u=r[i].evaluate(e),p=r[i+1].evaluate(e);return"interpolate"===this.operator?zt[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?Lt(Ut(Nt(u),Nt(p),l)):Ot.reverse(Ot.interpolate(Ot.forward(u),Ot.forward(p),l))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;ehe(n,e.type)));return new Wt(i?ue:r,a)}evaluate(e){let t,r=null,n=0;for(const a of this.args){if(n++,r=a.evaluate(e),r&&r instanceof ke&&!r.available&&(t||(t=r),r=null,n===this.args.length))return t;if(null!==r)break}return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Zt=Wt;class Xt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n=r.length)throw new $e(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new $e(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var Ht=Yt;class Kt{constructor(e,t){this.type=oe,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ue),n=t.parse(e[2],2,ue);return r&&n?ge(r.type,[oe,ie,ae,ne,ue])?new Kt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${me(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!ve(t,["boolean","string","number","null"]))throw new $e(`Expected first argument to be of type boolean, string, number or null, but found ${me(Se(t))} instead.`);if(!ve(r,["string","array"]))throw new $e(`Expected second argument to be of type array or string, but found ${me(Se(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Qt=Kt;class er{constructor(e,t,r){this.type=ae,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ue),n=t.parse(e[2],2,ue);if(!r||!n)return null;if(!ge(r.type,[oe,ie,ae,ne,ue]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${me(r.type)} instead`);if(4===e.length){const a=t.parse(e[3],3,ae);return a?new er(r,n,a):null}return new er(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ve(t,["boolean","string","number","null"]))throw new $e(`Expected first argument to be of type boolean, string, number or null, but found ${me(Se(t))} instead.`);if(!ve(r,["string","array"]))throw new $e(`Expected second argument to be of type array or string, but found ${me(Se(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var tr=er;class rr{constructor(e,t,r,n,a,i){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=a,this.otherwise=i}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const a={},i=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,Se(e)))return null}else r=Se(e);if(void 0!==a[String(e)])return u.error("Branch labels must be unique.");a[String(e)]=i.length}const p=t.parse(l,o,n);if(!p)return null;n=n||p.type,i.push(p)}const o=t.parse(e[1],1,ue);if(!o)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new rr(r,n,o,a,i,s):null}evaluate(e){const t=this.input.evaluate(e);return(Se(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),r=[],n={};for(const e of t){const t=n[this.cases[e]];void 0===t?(n[this.cases[e]]=r.length,r.push([this.cases[e],[e]])):r[t][1].push(e)}const a=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,n]of r)1===n.length?e.push(a(n[0])):e.push(n.map(a)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}var nr=rr;class ar{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let a=1;at.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var ir=ar;class or{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ue),n=t.parse(e[2],2,ae);if(!r||!n)return null;if(!ge(r.type,[de(ue),ie,ue]))return t.error(`Expected first argument to be of type array or string, but found ${me(r.type)} instead`);if(4===e.length){const a=t.parse(e[3],3,ae);return a?new or(r.type,r,n,a):null}return new or(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!ve(t,["string","array"]))throw new $e(`Expected first argument to be of type array or string, but found ${me(Se(t))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var sr=or;function lr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function ur(e,t,r,n){return 0===n.compare(t,r)}function pr(e,t,r){const n="=="!==e&&"!="!==e;return class a{constructor(e,t,r){this.type=oe,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let i=t.parse(e[1],1,ue);if(!i)return null;if(!lr(r,i.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${me(i.type)}'.`);let o=t.parse(e[2],2,ue);if(!o)return null;if(!lr(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${me(o.type)}'.`);if(i.type.kind!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${me(i.type)}' and '${me(o.type)}'.`);n&&("value"===i.type.kind&&"value"!==o.type.kind?i=new Te(o.type,[i]):"value"!==i.type.kind&&"value"===o.type.kind&&(o=new Te(i.type,[o])));let s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==o.type.kind&&"value"!==i.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,pe),!s)return null}return new a(i,o,s)}evaluate(a){const i=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){const t=Se(i),r=Se(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new $e(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=Se(i),r=Se(o);if("string"!==e.kind||"string"!==r.kind)return t(a,i,o)}return this.collator?r(a,i,o,this.collator.evaluate(a)):t(a,i,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const cr=pr("==",(function(e,t,r){return t===r}),ur),fr=pr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!ur(0,t,r,n)})),dr=pr("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),yr=pr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),hr=pr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class gr{constructor(e,t,r,n,a,i){this.type=ie,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ae);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=t.parse(n.locale,1,ie),!a))return null;let i=null;if(n.currency&&(i=t.parse(n.currency,1,ie),!i))return null;let o=null;if(n.unit&&(o=t.parse(n.unit,1,ie),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,ae),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,ae),!l)?null:new gr(r,a,i,o,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class vr{constructor(e){this.type=ae,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${me(r.type)} instead.`):new vr(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new $e(`Expected value to be of type string or array, but found ${me(Se(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}const br={"==":cr,"!=":fr,">":mr,"<":dr,">=":hr,"<=":yr,array:Te,at:Ht,boolean:Te,case:ir,coalesce:Zt,collator:Ue,format:Ie,image:je,in:Qt,"index-of":tr,interpolate:Jt,"interpolate-hcl":Jt,"interpolate-lab":Jt,length:vr,let:Bt,literal:qe,match:nr,number:Te,"number-format":gr,object:Te,slice:sr,step:vt,string:Te,"to-boolean":De,"to-color":De,"to-number":De,"to-string":De,var:ft,within:st};function xr(e,[t,r,n,a]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const i=a?a.evaluate(e):1,o=ze(t,r,n,i);if(o)throw new $e(o);return new G(t/255*i,r/255*i,n/255*i,i)}function wr(e,t){return e in t}function kr(e,t){const r=t[e];return void 0===r?null:r}function zr(e){return{type:e}}Le.register(br,{error:[{kind:"error"},[ie],(e,[t])=>{throw new $e(t.evaluate(e))}],typeof:[ie,[ue],(e,[t])=>me(Se(t.evaluate(e)))],"to-rgba":[de(ae,4),[se],(e,[t])=>t.evaluate(e).toArray()],rgb:[se,[ae,ae,ae],xr],rgba:[se,[ae,ae,ae,ae],xr],has:{type:oe,overloads:[[[ie],(e,[t])=>wr(t.evaluate(e),e.properties())],[[ie,le],(e,[t,r])=>wr(t.evaluate(e),r.evaluate(e))]]},get:{type:ue,overloads:[[[ie],(e,[t])=>kr(t.evaluate(e),e.properties())],[[ie,le],(e,[t,r])=>kr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ue,[ie],(e,[t])=>kr(t.evaluate(e),e.featureState||{})],properties:[le,[],e=>e.properties()],"geometry-type":[ie,[],e=>e.geometryType()],id:[ue,[],e=>e.id()],zoom:[ae,[],e=>e.globals.zoom],pitch:[ae,[],e=>e.globals.pitch||0],"distance-from-center":[ae,[],e=>e.distanceFromCenter()],"heatmap-density":[ae,[],e=>e.globals.heatmapDensity||0],"line-progress":[ae,[],e=>e.globals.lineProgress||0],"sky-radial-progress":[ae,[],e=>e.globals.skyRadialProgress||0],accumulated:[ue,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ae,zr(ae),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[ae,zr(ae),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:ae,overloads:[[[ae,ae],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[ae],(e,[t])=>-t.evaluate(e)]]},"/":[ae,[ae,ae],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[ae,[ae,ae],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[ae,[],()=>Math.LN2],pi:[ae,[],()=>Math.PI],e:[ae,[],()=>Math.E],"^":[ae,[ae,ae],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[ae,[ae],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))],log2:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ae,[ae],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ae,[ae],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ae,[ae],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ae,[ae],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ae,[ae],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ae,[ae],(e,[t])=>Math.atan(t.evaluate(e))],min:[ae,zr(ae),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[ae,zr(ae),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[ae,[ae],(e,[t])=>Math.abs(t.evaluate(e))],round:[ae,[ae],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ae,[ae],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ae,[ae],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[oe,[ie,ue],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[oe,[ue],(e,[t])=>e.id()===t.value],"filter-type-==":[oe,[ie],(e,[t])=>e.geometryType()===t.value],"filter-<":[oe,[ie,ue],(e,[t,r])=>{const n=e.properties()[t.value],a=r.value;return typeof n==typeof a&&n{const r=e.id(),n=t.value;return typeof r==typeof n&&r":[oe,[ie,ue],(e,[t,r])=>{const n=e.properties()[t.value],a=r.value;return typeof n==typeof a&&n>a}],"filter-id->":[oe,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[oe,[ie,ue],(e,[t,r])=>{const n=e.properties()[t.value],a=r.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[oe,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[oe,[ie,ue],(e,[t,r])=>{const n=e.properties()[t.value],a=r.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[oe,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[oe,[ue],(e,[t])=>t.value in e.properties()],"filter-has-id":[oe,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[oe,[de(ie)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[oe,[de(ue)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[oe,[ie,de(ue)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[oe,[ie,de(ue)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const a=r+n>>1;if(t[a]===e)return!0;t[a]>e?n=a-1:r=a+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:oe,overloads:[[[oe,oe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[zr(oe),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:oe,overloads:[[[oe,oe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[zr(oe),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[oe,[oe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[oe,[ie],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[ie,[ie],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[ie,[ie],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[ie,zr(ue),(e,t)=>t.map((t=>Me(t.evaluate(e)))).join("")],"resolved-locale":[ie,[pe],(e,[t])=>t.evaluate(e).resolvedLocale()]});var Ar=br;function Sr(e){return{result:"success",value:e}}function Mr(e){return{result:"error",value:e}}function _r(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}class qr{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Oe,this._defaultValue=t?function(e){return"color"===e.type&&(_r(e.default)||Array.isArray(e.default))?new G(0,0,0,0):"color"===e.type?G.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,a,i,o,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,a,i,o,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=i||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new $e(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function $r(e,t){const r=new mt(Ar,[],t?function(e){const t={color:se,string:ie,number:ae,enum:ie,boolean:oe,formatted:ce,resolvedImage:fe};return"array"===e.type?de(t[e.value]||ue,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Sr(new qr(n,t)):Mr(r.errors)}class Cr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ut(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,a,i)}evaluate(e,t,r,n,a,i){return this._styleExpression.evaluate(e,t,r,n,a,i)}}class Er{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ut(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,a,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,a,i)}evaluate(e,t,r,n,a,i){return this._styleExpression.evaluate(e,t,r,n,a,i)}interpolationFactor(e,t,r){return this.interpolationType?Jt.interpolationFactor(this.interpolationType,e,t,r):0}}function Tr(e,t){if("error"===(e=$r(e,t)).result)return e;const r=e.value.expression,n=lt(r);if(!n&&!function(e){return"data-driven"===e["property-type"]}(t))return Mr([new ee("","data expressions not supported")]);const a=pt(r,["zoom","pitch","distance-from-center"]);if(!a&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return Mr([new ee("","zoom expressions not supported")]);const i=Ir(r);if(!i&&!a)return Mr([new ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof ee)return Mr([i]);if(i instanceof Jt&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return Mr([new ee("",'"interpolate" expressions cannot be used with this property')]);if(!i)return Sr(new Cr(n?"constant":"source",e.value));const o=i instanceof Jt?i.interpolation:void 0;return Sr(new Er(n?"camera":"composite",e.value,i.labels,o))}function Ir(e){let t=null;if(e instanceof Bt)t=Ir(e.result);else if(e instanceof Zt){for(const r of e.args)if(t=Ir(r),t)break}else(e instanceof vt||e instanceof Jt)&&e.input instanceof Le&&"zoom"===e.input.name&&(t=e);return t instanceof ee||e.eachChild((e=>{const r=Ir(e);r instanceof ee?t=r:!t&&r?t=new ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new ee("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function jr(e){if(Array.isArray(e))return e.map(jr);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=jr(e[r]);return t}return function(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}(e)}var Fr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["fill-extrusion-edge-radius"]}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Pr(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Pr(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function Dr(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Pr(e)||(e=Gr(e));const r=e;let n=!0;try{n=function(e){if(!Nr(e))return e;let t=jr(e);return Or(t),t=Rr(t),t}(r)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const a=Fr[`filter_${t}`],i=$r(n,a);let o=null;if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));o=(e,t,r)=>i.value.evaluate(e,t,{},r);let s=null,l=null;if(n!==r){const e=$r(r,a);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(t,r,n,a,i)=>e.value.evaluate(t,r,{},n,void 0,void 0,a,i),l=!lt(e.value.expression)}return{filter:o,dynamicFilter:s||void 0,needGeometry:Vr(n),needFeature:!!l}}function Rr(e){if(!Array.isArray(e))return e;const t=function(e){if(Lr.has(e[0]))for(let t=1;tRr(e)))}function Or(e){let t=!1;const r=[];if("case"===e[0]){for(let n=1;n",">=","<","<=","to-boolean"]);function Ur(e,t){return et?1:0}function Vr(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?Jr(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Gr))):"all"===t?["all"].concat(e.slice(1).map(Gr)):"none"===t?["all"].concat(e.slice(1).map(Gr).map(Xr)):"in"===t?Wr(e[1],e.slice(2)):"!in"===t?Xr(Wr(e[1],e.slice(2))):"has"===t?Zr(e[1]):"!has"===t?Xr(Zr(e[1])):"within"!==t||e;var r}function Jr(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Wr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Ur)]]:["filter-in-small",e,["literal",t]]}}function Zr(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Xr(e){return["!",e]}var Br=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Yr(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return Br.forEach((e=>{e in t&&(r[e]=t[e])})),r}var Hr={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Kr=" ",Qr=/(italic|oblique)$/i,en={},tn=F((function(e,t,r){var n=en[e];if(!n){Array.isArray(e)||(e=[e]);for(var a,i,o=400,s="normal",l=[],u=0,p=e.length;u1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){o=a?o:Hr[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}a||"number"!=typeof f||(o=f,a=!0);var y=c.join(Kr).replace("Klokantech Noto Sans","Noto Sans");-1!==y.indexOf(Kr)&&(y='"'+y+'"'),l.push(y)}n=en[e]=[s,o,l]}return n[0]+Kr+n[1]+Kr+t+"px"+(r?"/"+r:"")+Kr+n[2]}));const rn="https://api.mapbox.com";function nn(e){return 0!==e.indexOf("mapbox://")?"":e.slice(9)}function an(e,t){const r=nn(e);if(!r)return decodeURI(new URL(e,location.href).href);if(0!==r.indexOf("styles/"))throw new Error(`unexpected style url: ${e}`);const n=r.slice(7);return`${rn}/styles/v1/${n}?&access_token=${t}`}function on(e,t,r,n){const a=new URL(e,n),i=nn(e);return i?"mapbox.satellite"===i?`https://api.mapbox.com/v4/${i}/{z}/{x}/{y}${window.devicePixelRatio>=1.5?"@2x":""}.webp?access_token=${t}`:`https://{a-d}.tiles.mapbox.com/v4/${i}/{z}/{x}/{y}.vector.pbf?access_token=${t}`:t?(a.searchParams.has(r)||a.searchParams.set(r,t),decodeURI(a.href)):decodeURI(a.href)}const sn={},ln={};let un=0;function pn(e){return e.id||(e.id=un++),e.id}function cn(e){return e*Math.PI/180}const fn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function dn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function mn(e,t){let r=0;const n=t.length;for(;ra)).then((e=>(e instanceof Request||(e=new Request(e)),e.headers.get("Accept")||e.headers.set("Accept","application/json"),n&&(n.request=e),fetch(e).then((function(e){return delete yn[t],e.ok?e.json():Promise.reject(new Error("Error fetching source "+t))})).catch((function(e){return delete yn[t],Promise.reject(new Error("Error fetching source "+t))})))));return yn[t]=[a,i],i}function gn(e,t){if("string"!=typeof e)return Promise.resolve(e);if(!e.trim().startsWith("{"))return hn("Style",e=an(e,t.accessToken),t);try{const t=JSON.parse(e);return Promise.resolve(t)}catch(e){return Promise.reject(e)}}const vn={};function bn(e,t,r,n){const a=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],i=dn(a[0],a[1]),o=i.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=o.getImageData(0,0,a[0],a[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e0&&o.arc(e,a,r*t.pixelRatio,0,2*Math.PI);return o.fill(),i}function xn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function wn(e,t,r){const n=dn(t.width,t.height),a=n.getContext("2d");a.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const i=a.getImageData(0,0,t.width,t.height),o=i.data;for(let e=0,t=i.width;e0?(o[a+0]=Math.round(255*r.r*l),o[a+1]=Math.round(255*r.g*l),o[a+2]=Math.round(255*r.b*l),o[a+3]=Math.round(255*l)):o[a+3]=0}return a.putImageData(i,0,0),n}const kn=Array(256).join(" ");function zn(e,t){if(t>=.05){let r="";const n=e.split("\n"),a=kn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e0&&(r+="\n"),r+=n[e].split("").join(a);return r}return e}let An;function Sn(){return An||(An=dn(1,1).getContext("2d")),An}function Mn(e,t){return Sn().measureText(e).width+(e.length-1)*t}const _n={};function qn(e,t,r,n){if(-1!==e.indexOf("\n")){const a=e.split("\n"),i=[];for(let e=0,o=a.length;e1){const e=Sn();e.font=t;const a=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=o.length;e1;++e){const r=l[e];if(Mn(r,n)<.35*a){const a=e>0?Mn(l[e-1],n):1/0,i=e.7*a&&Mn(i,n)<.6*a){const o=r.split(" "),s=o.pop();Mn(s,n)<.2*a&&(l[e]=o.join(" "),l[e+1]=s+" "+i),t-=1}}i=l.join("\n")}else i=e;i=zn(i,n),_n[a]=i}return i}const $n=/font-family: ?([^;]*);/,Cn=/("|')/g;let En;function Tn(e){if(!En){En={};const e=document.styleSheets;for(let t=0,r=e.length;t0&&"string"==typeof u[0]&&u[0]in Ar);if(!i&&_r(n)&&(n=function(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,J(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],a=n||void 0!==e.property,i=n||!a;return r=r.map((e=>!a&&t.tokens&&"string"==typeof e[1]?[e[0],K(e[1])]:[e[0],J(e[1])])),n?function(e,t,r){const n={},a={},i=[];for(let t=0;t`${e.key}: ${e.message}`)).join(", "));return r.value}(n,a);l[r]=e.evaluate.bind(e)}else"color"==a.type&&(n=G.parse(n)),l[r]=function(){return n}}var u;return Dn.zoom=n,l[r](Dn,a,o)}function Ln(e,t,r,n,a){return Nn(e,"layout",`${n}-allow-overlap`,t,r,a)?Nn(e,"layout",`${n}-ignore-placement`,t,r,a)?"none":"obstacle":"declutter"}function Un(e,t,r,n,a){return a||console.warn("No filterCache provided to evaluateFilter()"),e in a||(a[e]=Dr(t).filter),Dn.zoom=n,a[e](Dn,r)}function Vn(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const Gn=/\{[^{}}]*\}/g;function Jn(e,t){return e.replace(Gn,(function(e){return t[e.slice(1,-1)]||""}))}const Wn={};function Zn(e,t,r,c=fn,f=void 0,d=void 0,m=void 0,h=void 0){if("string"==typeof t&&(t=JSON.parse(t)),8!=t.version)throw new Error("glStyle version 8 required.");let g,v,b;if(Wn[function(e,t){return pn(e)+"."+(0,y.v6)(t)}(t,e)]=Array.from(arguments),d)if("undefined"!=typeof Image){const t=new Image;let r;(0,p.hq)((()=>d)).then((e=>{e instanceof Request?fetch(e).then((e=>e.blob())).then((e=>{r=URL.createObjectURL(e),t.src=r})).catch((()=>{})):(t.crossOrigin="anonymous",t.src=e,r&&URL.revokeObjectURL(r))})),t.onload=function(){g=t,v=[t.width,t.height],e.changed(),t.onload=null}}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const e=self;e.postMessage({action:"loadImage",src:d}),e.addEventListener("message",(function(e){"imageLoaded"===e.data.action&&e.data.src===d&&(g=e.data.image,v=[g.width,g.height])}))}const x=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r=F.maxzoom)continue;const O=F.filter;if(!O||Un(P,O,E,k,M)){let c,d,x,M,P,O;I=F;const N=w.index;if(3==_&&("fill"==F.type||"fill-extrusion"==F.type))if(d=Nn(F,"paint",F.type+"-opacity",k,E,S,T),F.type+"-pattern"in R){const e=Nn(F,"paint",F.type+"-pattern",k,E,S,T);if(e){const t="string"==typeof e?Jn(e,y):e.toString();if(g&&f&&f[t]){++j,O=C[j],O&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=new l.Ay({fill:new a.A}),C[j]=O),x=O.getFill(),O.setZIndex(N);const e=t+"."+d;let r=A[e];if(!r){const n=f[t],a=dn(n.width,n.height),i=a.getContext("2d");i.globalAlpha=d,i.drawImage(g,n.x,n.y,n.width,n.height,0,0,n.width,n.height),r=i.createPattern(a,"repeat"),A[e]=r}x.setColor(r)}}}else c=Vn(Nn(F,"paint",F.type+"-color",k,E,S,T),d),F.type+"-outline-color"in R&&(P=Vn(Nn(F,"paint",F.type+"-outline-color",k,E,S,T),d)),P||(P=c),(c||P)&&(++j,O=C[j],(!O||c&&!O.getFill()||!c&&O.getFill()||P&&!O.getStroke()||!P&&O.getStroke()||O.getText())&&(O=new l.Ay({fill:c?new a.A:void 0,stroke:P?new s.A:void 0}),C[j]=O),c&&(x=O.getFill(),x.setColor(c)),P&&(M=O.getStroke(),M.setColor(P),M.setWidth(.5)),O.setZIndex(N));if(1!=_&&"line"==F.type){c="line-pattern"in R?void 0:Vn(Nn(F,"paint","line-color",k,E,S,T),Nn(F,"paint","line-opacity",k,E,S,T));const e=Nn(F,"paint","line-width",k,E,S,T);c&&e>0&&(++j,O=C[j],O&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=new l.Ay({stroke:new s.A}),C[j]=O),M=O.getStroke(),M.setLineCap(Nn(F,"layout","line-cap",k,E,S,T)),M.setLineJoin(Nn(F,"layout","line-join",k,E,S,T)),M.setMiterLimit(Nn(F,"layout","line-miter-limit",k,E,S,T)),M.setColor(c),M.setWidth(e),M.setLineDash(R["line-dasharray"]?Nn(F,"paint","line-dasharray",k,E,S,T).map((function(t){return t*e})):null),O.setZIndex(N))}let L,U,V,G,J,W,Z,X,B,Y=!1,H=null,K=0;if((1==_||2==_)&&"icon-image"in D){const t=Nn(F,"layout","icon-image",k,E,S,T);if(t){let n;L="string"==typeof t?Jn(t,y):t.toString();const a=h?h(e,L):void 0;if(g&&f&&f[L]||a){const e=Nn(F,"layout","icon-rotation-alignment",k,E,S,T);if(2==_){const t=r.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const r=t.getExtent();if(Math.sqrt(Math.max(Math.pow((r[2]-r[0])/p,2),Math.pow((r[3]-r[1])/p,2)))>150){const r="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();if(On||(Rn=[NaN,NaN],On=new o.Ay("Point",Rn,[],2,{},void 0)),n=On,Rn[0]=r[0],Rn[1]=r[1],"line"===Nn(F,"layout","symbol-placement",k,E,S,T)&&"map"===e){const e=t.getStride(),n=t.getFlatCoordinates();for(let t=0,a=n.length-e;t=l&&r[0]<=p&&r[1]>=u&&r[1]<=c){K=Math.atan2(i-s,o-a);break}}}}}}if(2!==_||n){const t=Nn(F,"layout","icon-size",k,E,S,T),r=void 0!==R["icon-color"]?Nn(F,"paint","icon-color",k,E,S,T):null;if(!r||0!==r.a){const n=Nn(F,"paint","icon-halo-color",k,E,S,T),o=Nn(F,"paint","icon-halo-width",k,E,S,T);let s=`${L}.${t}.${o}.${n}`;if(null!==r&&(s+=`.${r}`),U=z[s],!U){const l=Ln(F,k,E,"icon",S);let u;"icon-offset"in D&&(u=Nn(F,"layout","icon-offset",k,E,S,T).slice(0),u[0]*=t,u[1]*=-t);let p=r?[255*r.r,255*r.g,255*r.b,r.a]:void 0;if(a){const r={color:p,rotateWithView:"map"===e,displacement:u,declutterMode:l,scale:t};"string"==typeof a?r.src=a:(r.img=a,r.imgSize=[a.width,a.height]),U=new i.A(r)}else{const a=f[L];let s,c,d;o?a.sdf?(s=bn(wn(g,a,r||[0,0,0,1]),{x:0,y:0,width:a.width,height:a.height,pixelRatio:a.pixelRatio},o,n),p=void 0):s=bn(g,a,o,n):(a.sdf?(b||(b=wn(g,{x:0,y:0,width:v[0],height:v[1]},{r:1,g:1,b:1,a:1})),s=b):s=g,c=[a.width,a.height],d=[a.x,a.y]),U=new i.A({color:p,img:s,imgSize:v,size:c,offset:d,rotateWithView:"map"===e,scale:t/a.pixelRatio,displacement:u,declutterMode:l})}z[s]=U}}U&&(++j,O=C[j],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new l.Ay,C[j]=O),O.setGeometry(n),U.setRotation(K+cn(Nn(F,"layout","icon-rotate",k,E,S,T))),U.setOpacity(Nn(F,"paint","icon-opacity",k,E,S,T)),U.setAnchor(Fn[Nn(F,"layout","icon-anchor",k,E,S,T)]),O.setImage(U),H=O.getText(),O.setText(void 0),O.setZIndex(N),Y=!0,V=!1)}else V=!0}}}if(1==_&&"circle"===F.type){++j,O=C[j],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new l.Ay,C[j]=O);const e="circle-radius"in R?Nn(F,"paint","circle-radius",k,E,S,T):5,t=Vn(Nn(F,"paint","circle-stroke-color",k,E,S,T),Nn(F,"paint","circle-stroke-opacity",k,E,S,T)),r=Nn(F,"paint","circle-translate",k,E,S,T),i=Vn(Nn(F,"paint","circle-color",k,E,S,T),Nn(F,"paint","circle-opacity",k,E,S,T)),o=Nn(F,"paint","circle-stroke-width",k,E,S,T),u=e+"."+t+"."+i+"."+o+"."+r[0]+"."+r[1];U=z[u],U||(U=new n.A({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new s.A({width:o,color:t}):void 0,fill:i?new a.A({color:i}):void 0,declutterMode:"none"}),z[u]=U),O.setImage(U),H=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(N),Y=!0}if("text-field"in D){Z=Math.round(Nn(F,"layout","text-size",k,E,S,T));const e=Nn(F,"layout","text-font",k,E,S,T);W=Nn(F,"layout","text-line-height",k,E,S,T),J=tn(m?m(e,t.metadata?t.metadata["ol:webfonts"]:void 0):e,Z,W),J.includes("sans-serif")||(J+=",sans-serif"),X=Nn(F,"layout","text-letter-spacing",k,E,S,T),B=Nn(F,"layout","text-max-width",k,E,S,T);const r=Nn(F,"layout","text-field",k,E,S,T);G="object"==typeof r&&r.sections?1===r.sections.length?r.toString():r.sections.reduce(((t,r,n)=>{const a=r.fontStack?r.fontStack.split(","):e,i=tn(m?m(a):a,Z*(r.scale||1),W);let o=r.text;if("\n"===o)return t.push("\n",""),t;if(2!=_){o=qn(o,i,B,X).split("\n");for(let e=0,r=o.length;e0&&t.push("\n",""),t.push(o[e],i);return t}t.push(zn(o,X),i)}),[]):Jn(r,y).trim(),d=Nn(F,"paint","text-opacity",k,E,S,T)}if(G&&d&&!V){Y||(++j,O=C[j],O&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=new l.Ay,C[j]=O),O.setImage(void 0),O.setGeometry(void 0));const e=Ln(F,k,E,"text",S);O.getText()||O.setText(H),H=O.getText(),(!H||"getDeclutterMode"in H&&H.getDeclutterMode()!==e)&&(H=new u.A({padding:[2,2,2,2],declutterMode:e}),O.setText(H));const t=Nn(F,"layout","text-transform",k,E,S,T);"uppercase"==t?G=Array.isArray(G)?G.map(((e,t)=>t%2?e:e.toUpperCase())):G.toUpperCase():"lowercase"==t&&(G=Array.isArray(G)?G.map(((e,t)=>t%2?e:e.toLowerCase())):G.toLowerCase());const r=Array.isArray(G)?G:2==_?zn(G,X):qn(G,J,B,X);H.setText(r),H.setFont(J),H.setRotation(cn(Nn(F,"layout","text-rotate",k,E,S,T)));const n=Nn(F,"layout","text-anchor",k,E,S,T),a=Y||1==_?"point":Nn(F,"layout","symbol-placement",k,E,S,T);let i;if("line-center"===a?(H.setPlacement("line"),i="center"):H.setPlacement(a),"line"===a&&"function"==typeof H.setRepeat){const e=Nn(F,"layout","symbol-spacing",k,E,S,T);H.setRepeat(2*e)}H.setOverflow("point"===a);let o=Nn(F,"paint","text-halo-width",k,E,S,T);const s=Nn(F,"layout","text-offset",k,E,S,T),p=Nn(F,"paint","text-translate",k,E,S,T);let c=0,f=0;if("point"==a){i="center",-1!==n.indexOf("left")?(i="left",f=o):-1!==n.indexOf("right")&&(i="right",f=-o);const e=Nn(F,"layout","text-rotation-alignment",k,E,S,T);H.setRotateWithView("map"==e)}else H.setMaxAngle(cn(Nn(F,"layout","text-max-angle",k,E,S,T))*G.length/r.length),H.setRotateWithView(!1);H.setTextAlign(i);let m="middle";0==n.indexOf("bottom")?(m="bottom",c=-o-.5*(W-1)*Z):0==n.indexOf("top")&&(m="top",c=o+.5*(W-1)*Z),H.setTextBaseline(m);const y=Nn(F,"layout","text-justify",k,E,S,T);H.setJustify("auto"===y?void 0:y),H.setOffsetX(s[0]*Z+f+p[0]),H.setOffsetY(s[1]*Z+c+p[1]),$.setColor(Vn(Nn(F,"paint","text-color",k,E,S,T),d)),H.setFill($);const h=Vn(Nn(F,"paint","text-halo-color",k,E,S,T),d);if(h&&o>0){q.setColor(h),o*=2;const e=.5*Z;q.setWidth(o<=e?o:e),H.setStroke(q)}else H.setStroke(void 0);const g=Nn(F,"layout","text-padding",k,E,S,T),v=H.getPadding();g!==v[0]&&(v[0]=g,v[1]=g,v[2]=g,v[3]=g),O.setZIndex(N)}}}return j>-1?(C.length=j+1,C):void 0};return e.setStyle(E),e.set("mapbox-source",_),e.set("mapbox-layers",k),e.set("mapbox-featurestate",e.get("mapbox-featurestate")||{}),E}function Xn(e,t=512){return e.getExtent()?(0,C.EN)({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():fn}function Bn(e,t,r="",n={},a=void 0){let i,o,s,l,u=!0;return"string"==typeof r||Array.isArray(r)?l=r:(s=r,l=s.source||s.layers,n=s),"string"==typeof n?(i=n,s={}):(i=n.styleUrl,s=n),!1===s.updateSource&&(u=!1),a||(a=s.resolutions),i||"string"!=typeof t||t.trim().startsWith("{")||(i=t),i&&(i=i.startsWith("data:")?location.href:an(i,s.accessToken),s=function(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).searchParams.forEach(((e,r)=>{t.accessToken=e,t.accessTokenParam=r}))),t}(i,s)),new Promise((function(r,n){gn(t,s).then((function(t){if(8!=t.version)return n(new Error("glStyle version 8 required."));if(!(e instanceof A.A||e instanceof M.A))return n(new Error("Can only apply to VectorLayer or VectorTileLayer"));const y=e instanceof M.A?"vector":"geojson";if(l?o=Array.isArray(l)?t.layers.find((function(e){return e.id===l[0]})).source:l:(o=Object.keys(t.sources).find((function(e){return t.sources[e].type===y})),l=o),!o)return n(new Error(`No ${y} source found in the glStyle.`));function g(){if(!u)return Promise.resolve();if(e instanceof M.A)return function(e,t,r){return new Promise((function(n,a){(function(e,t,r={}){const n=[t,JSON.stringify(e)].toString();let a=vn[n];if(!a||r.transformRequest){let i;r.transformRequest&&(i=(e,t)=>{const n=r.transformRequest&&r.transformRequest(t,"Tiles")||t;if(e instanceof d.A)e.setLoader(((t,r,a)=>{(0,p.hq)((()=>n)).then((r=>{fetch(r).then((e=>e.arrayBuffer())).then((r=>{const n=e.getFormat().readFeatures(r,{extent:t,featureProjection:a});e.setFeatures(n)})).catch((t=>e.setState(f.A.ERROR)))}))}));else{const t=e.getImage();(0,p.hq)((()=>n)).then((r=>{r instanceof Request?fetch(r).then((e=>e.blob())).then((e=>{const r=URL.createObjectURL(e);t.addEventListener("load",(()=>URL.revokeObjectURL(r))),t.addEventListener("error",(()=>URL.revokeObjectURL(r))),t.src=r})).catch((t=>e.setState(f.A.ERROR))):t.src=r}))}});const o=e.url;if(o&&!e.tiles){const n=on(o,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(o.startsWith("mapbox://"))a=Promise.resolve({tileJson:Object.assign({},e,{url:void 0,tiles:(0,m.Uu)(n)}),tileLoadFunction:i});else{const e={};a=hn("Source",n,r,e).then((function(t){return t.tiles=t.tiles.map((function(n){return"tms"===t.scheme&&(n=n.replace("{y}","{-y}")),on(n,r.accessToken,r.accessTokenParam||"access_token",e.request.url)})),Promise.resolve({tileJson:t,tileLoadFunction:i})}))}}else e=Object.assign({},e,{tiles:e.tiles.map((function(n){return"tms"===e.scheme&&(n=n.replace("{y}","{-y}")),on(n,r.accessToken,r.accessTokenParam||"access_token",t||location.href)}))}),a=Promise.resolve({tileJson:Object.assign({},e),tileLoadFunction:i});vn[n]=a}return a})(e,t,r).then((function({tileJson:t,tileLoadFunction:a}){const i=function(e,t,r){const n=new z.A({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),a=n.getTileJSON(),i=n.getTileGrid(),o=(0,E.Jt)(r.projection||"EPSG:3857"),s=function(e,t){const r=e.bounds;if(r){const e=(0,E.Rb)([r[0],r[1]],t),n=(0,E.Rb)([r[2],r[3]],t);return[e[0],e[1],n[0],n[1]]}return(0,E.Jt)(t).getExtent()}(a,o),l=o.getExtent(),u=a.minzoom||0,p=a.maxzoom||22,c={attributions:n.getAttributions(),projection:o,tileGrid:new k.A({origin:l?(0,T.Py)(l):i.getOrigin(0),extent:s||i.getExtent(),minZoom:u,resolutions:Xn(o,t.tileSize).slice(0,p+1),tileSize:i.getTileSize(0)})};return Array.isArray(a.tiles)?c.urls=a.tiles:c.url=a.tiles,c}(e,t,r);i.tileLoadFunction=a,i.format=new b.A,n(new _.A(i))})).catch(a)}))}(t.sources[o],i,s).then((function(t){const r=e.getSource();r?t!==r&&(r.setTileUrlFunction(t.getTileUrlFunction()),"function"==typeof r.setUrls&&"function"==typeof t.getUrls&&r.setUrls(t.getUrls()),r.format_||(r.format_=t.format_),r.getAttributions()||r.setAttributions(t.getAttributions()),r.getTileLoadFunction()===_.Y&&r.setTileLoadFunction(t.getTileLoadFunction()),(0,E.tI)(r.getProjection(),t.getProjection())&&(r.tileGrid=t.getTileGrid())):e.setSource(t);const n=e.getSource().getTileGrid();!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())&&n.getMinZoom()>0&&e.setMaxResolution(function(e,t){const r=Math.floor(e),n=Math.pow(2,e-r);return t[r]/n}(Math.max(0,n.getMinZoom()-1e-12),n.getResolutions()))}));const r=t.sources[o];let n=e.getSource();n&&n.get("mapbox-source")===r||(n=function(e,t,r){const n=r.projection?new h.A({dataProjection:r.projection}):new h.A,a=e.data,i={};if("string"==typeof a){const i=on(a,r.accessToken,r.accessTokenParam||"access_token",t||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(i)){const t=(e,t,r)=>{const n=function(e){return`{bbox-${(e?e.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}(r);return i.replace(n,`${e.join(",")}`)},a=new S.A({attributions:e.attribution,format:n,loader:(e,n,i,o,s)=>{hn("GeoJSON","function"==typeof t?t(e,n,i):t,r).then((e=>{const t=a.getFormat().readFeatures(e,{featureProjection:i});a.addFeatures(t),o(t)})).catch((t=>{a.removeLoadedExtent(e),s()}))},strategy:$.Qk});return a.set("mapbox-source",e),a}const o=new S.A({attributions:e.attribution,format:n,url:i,loader:(e,t,n,a,s)=>{hn("GeoJSON",i,r).then((e=>{const t=o.getFormat().readFeatures(e,{featureProjection:n});o.addFeatures(t),a(t)})).catch((t=>{o.removeLoadedExtent(e),s()}))}});return o}i.features=n.readFeatures(a,{featureProjection:(0,E.Tf)()||"EPSG:3857"});const o=new S.A(Object.assign({attributions:e.attribution,format:n},i));return o.set("mapbox-source",e),o}(r,i,s));const a=e.getSource();return a?n!==a&&(a.getAttributions()||a.setAttributions(n.getAttributions()),a.format_||(a.format_=n.getFormat()),a.url_=n.getUrl()):e.setSource(n),Promise.resolve()}let v,x,w,C;function I(){if(C||t.sprite&&!x)C?(e.setStyle(C),g().then(r).catch(n)):n(new Error("Something went wrong trying to apply style."));else{if(s.projection&&!a){const e=(0,E.Jt)(s.projection).getUnits();"m"!==e&&(a=fn.map((t=>t/q.I[e])))}C=Zn(e,t,l,a,x,w,((e,t=s.webfonts)=>function(e,t="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){const r=e.toString();if(r in In)return In[r];const n=[];for(let t=0,r=e.length;t=1.5?.5:1;const r=.5==v?"@2x":"";let a=e.origin+e.pathname+r+".json"+e.search;new Promise((function(t,r){hn("Sprite",a,s).then(t).catch((function(n){a=e.origin+e.pathname+".json"+e.search,hn("Sprite",a,s).then(t).catch(r)}))})).then((function(t){if(void 0===t&&n(new Error("No sprites found.")),x=t,w=e.origin+e.pathname+r+".png"+e.search,s.transformRequest){const e=s.transformRequest(w,"SpriteImage")||w;(e instanceof Request||e instanceof Promise)&&(w=e)}I()})).catch((function(e){n(new Error(`Sprites cannot be loaded: ${a}: ${e.message}`))}))}else I()})).catch(n)}))}const Yn={};function Hn(e,t,r={}){return gn(t,r).then((function(t){!function(e,t,r){t.layers.some((function(t){if("background"===t.type){if(e instanceof g.A)return e.setBackground((function(e){return Kn(t,e,r,{})})),!0;if(e instanceof x.A||e instanceof v.A)return e.getLayers().insertAt(0,function(e,t,r){const n=document.createElement("div");return n.className="ol-mapbox-style-background",n.style.position="absolute",n.style.width="100%",n.style.height="100%",new g.A({source:new w.A({}),render(a){const i=Kn(e,a.viewState.resolution,t,r);return n.style.backgroundColor=i,n}})}(t,r,{})),!0}}))}(e,t,r)}))}function Kn(e,t,r,n){const a={id:e.id,type:e.type},i=e.layout||{},o=e.paint||{};a.paint=o;const s=mn(t,r.resolutions||fn);let l;const u=Nn(a,"paint","background-color",s,Yn,n);return void 0!==o["background-opacity"]&&(l=Nn(a,"paint","background-opacity",s,Yn,n)),"none"==i.visibility?void 0:Vn(u,l)}class Qn extends I.Ay{constructor(e){super(j.A.ERROR),this.error=e}}class ea extends M.A{constructor(e){const t=!("declutter"in e)||e.declutter,r=new _.A({state:"loading",format:new b.A});super({source:r,background:!1===e.background?null:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),e.accessToken&&(this.accessToken=e.accessToken);const n=[Bn(this,e.styleUrl,e.layers||e.source,{accessToken:this.accessToken})];void 0===this.getBackground()&&n.push(Hn(this,e.styleUrl,{accessToken:this.accessToken})),Promise.all(n).then((()=>{r.setState("ready")})).catch((e=>{this.dispatchEvent(new Qn(e)),this.getSource().setState("error")}))}}},4662:(e,t,r)=>{r.d(t,{A:()=>x});var n=r(8217),a=r(1217),i=r(6702),o=r(503),s=r(2871),l=r(8112),u=r(4294),p=r(1064),c=r(5286),f=r(4778),d=r(3407),m=r(3402);class y extends n.Ay{constructor(e){super(),e=e||{},this.dataProjection=new c.A({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:f.Ay,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,r,n){e.pos=t.geometry;const a=e.readVarint()+e.pos;let i=1,o=0,s=0,l=0,u=0,p=0;for(;e.pos>3}if(o--,1===i||2===i)s+=e.readSVarint(),l+=e.readSVarint(),1===i&&u>p&&(n.push(u),p=u),r.push(s,l),u+=2;else{if(7!==i)throw new Error("Invalid command found in the PBF");u>p&&(r.push(r[p],r[p+1]),u+=2)}}u>p&&(n.push(u),p=u)}createFeature_(e,t,r){const l=t.type;if(0===l)return null;let c;const d=t.properties;let y;this.idProperty_?(y=d[this.idProperty_],delete d[this.idProperty_]):y=t.id,d[this.layerName_]=t.layer.name;const h=[],g=[];this.readRawGeometry_(e,t,h,g);const v=function(e,t){let r;return 1===e?r=1===t?"Point":"MultiPoint":2===e?r=1===t?"LineString":"MultiLineString":3===e&&(r="Polygon"),r}(l,g.length);if(this.featureClass===f.Ay)c=new this.featureClass(v,h,g,2,d,y),c.transform(r.dataProjection);else{let e;if("Polygon"==v){const t=(0,m.yJ)(h,g);e=t.length>1?new s.A(h,"XY",t):new p.Ay(h,"XY",g)}else e="Point"===v?new u.A(h,"XY"):"LineString"===v?new a.A(h,"XY"):"MultiPoint"===v?new o.A(h,"XY"):"MultiLineString"===v?new i.A(h,"XY",g):null;c=new(0,this.featureClass),this.geometryName_&&c.setGeometryName(this.geometryName_);const t=(0,n.hX)(e,!1,r);c.setGeometry(t),void 0!==y&&c.setId(y),c.setProperties(d,!0)}return c}getType(){return"arraybuffer"}readFeatures(e,t){const r=this.layers_;t=this.adaptOptions(t);const n=(0,d.Jt)(t.dataProjection);n.setWorldExtent(t.extent),t.dataProjection=n;const a=new l.A(e),i=a.readFields(h,{}),o=[];for(const e in i){if(r&&!r.includes(e))continue;const s=i[e],l=s?[0,0,s.extent,s.extent]:null;n.setExtent(l);for(let e=0,r=s.length;e>3)?r.readString():2===e?r.readFloat():3===e?r.readDouble():4===e?r.readVarint64():5===e?r.readVarint():6===e?r.readSVarint():7===e?r.readBoolean():null;t.values.push(n)}}function v(e,t,r){if(1==e)t.id=r.readVarint();else if(2==e){const e=r.readVarint()+r.pos;for(;r.pos{i.d(s,{A:()=>r});var a=i(1601),h=i.n(a),e=i(6314),n=i.n(e)()(h());n.push([t.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const r=n},8110:(t,s,i)=>{i.d(s,{A:()=>oi});var a=1,h=2,e=3,n=5,r=6378137,o=6356752.314,l=.0066943799901413165,c=484813681109536e-20,u=Math.PI/2,M=1e-10,d=.017453292519943295,f=57.29577951308232,p=Math.PI/4,m=2*Math.PI,y=3.14159265359,g={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 x={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var _=/[\s_\-\/\(\)]/g;function v(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(_,""),e=-1;++e=this.text.length)return;t=this.text[this.place++]}switch(this.state){case N: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}},A.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(S.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)},A.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=N)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=N,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},A.prototype.number=function(t){if(!E.test(t)){if(S.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},A.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},A.prototype.keyword=function(t){if(P.test(t))this.word+=t;else{if("["===t){var s=[];return s.push(this.word),this.level++,null===this.root?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,void(this.state=N)}if(!S.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},A.prototype.neutral=function(t){if(C.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(!S.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},A.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=z(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(h),h}function G(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?G[t]=b(arguments[1]):G[t]=j(arguments[1]):G[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?G.apply(s,t):G(t)}));if("string"==typeof t){if(t in G)return G[t]}else"EPSG"in t?G["EPSG:"+t.EPSG]=t:"ESRI"in t?G["ESRI:"+t.ESRI]=t:"IAU2000"in t?G["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(G);const L=G;var R=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],B=["3857","900913","3785","102113"];function T(t,s){var i,a;if(t=t||{},!s)return t;for(a in s)void 0!==(i=s[a])&&(t[a]=i);return t}function F(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)}function D(t){return t<0?-1:1}function U(t){return Math.abs(t)<=y?t:t-D(t)*m}function Q(t,s,i){var a=t*i,h=.5*t;return a=Math.pow((1-a)/(1+a),h),Math.tan(.5*(u-s))/a}function W(t,s){for(var i,a,h=.5*t,e=u-2*Math.atan(s),n=0;n<=15;n++)if(i=t*Math.sin(e),e+=a=u-2*Math.atan(s*Math.pow((1-i)/(1+i),h))-e,Math.abs(a)<=1e-10)return e;return-9999}function J(t){return t}var X=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=F(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var s,i,a=t.x,h=t.y;if(h*f>90&&h*f<-90&&a*f>180&&a*f<-180)return null;if(Math.abs(Math.abs(h)-u)<=M)return null;if(this.sphere)s=this.x0+this.a*this.k0*U(a-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(p+.5*h));else{var e=Math.sin(h),n=Q(this.e,h,e);s=this.x0+this.a*this.k0*U(a-this.long0),i=this.y0-this.a*this.k0*Math.log(n)}return t.x=s,t.y=i,t},inverse:function(t){var s,i,a=t.x-this.x0,h=t.y-this.y0;if(this.sphere)i=u-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var e=Math.exp(-h/(this.a*this.k0));if(-9999===(i=W(this.e,e)))return null}return s=U(this.long0+a/(this.a*this.k0)),t.x=s,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:J,inverse:J,names:["longlat","identity"]}],H={},K=[];function V(t,s){var i=K.length;return t.names?(K[i]=t,t.names.forEach((function(t){H[t.toLowerCase()]=i})),this):(console.log(s),!0)}const Z={start:function(){X.forEach(V)},add:V,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==H[s]&&K[H[s]]?K[H[s]]: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."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},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"}},$=Y.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Y.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var tt={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"},militargeographische_institut:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},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 st={};function it(t){if(0===t.length)return null;var s="@"===t[0];return s&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:t,mandatory:!s,grid:st[t]||null,isNull:!1}}function at(t){return t/3600*Math.PI/180}function ht(t,s,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(s,i)))}function et(t){return t.map((function(t){return[at(t.longitudeShift),at(t.latitudeShift)]}))}function nt(t,s,i){return{name:ht(t,s+8,s+16).trim(),parent:ht(t,s+24,s+24+8).trim(),lowerLatitude:t.getFloat64(s+72,i),upperLatitude:t.getFloat64(s+88,i),lowerLongitude:t.getFloat64(s+104,i),upperLongitude:t.getFloat64(s+120,i),latitudeInterval:t.getFloat64(s+136,i),longitudeInterval:t.getFloat64(s+152,i),gridNodeCount:t.getInt32(s+168,i)}}function rt(t,s,i,a){for(var h=s+176,e=[],n=0;n-1}))}(t)){var s=j(t);if(function(t){var s=v(t,"authority");if(s){var i=v(s,"epsg");return i&&B.indexOf(i)>-1}}(s))return L["EPSG:3857"];var i=function(t){var s=v(t,"extension");if(s)return v(s,"proj4")}(s);return i?b(i):s}return function(t){return"+"===t[0]}(t)?b(t):void 0}(t);if("object"==typeof i){var r=ot.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var o=v(tt,i.datumCode);o&&(i.datum_params=i.datum_params||(o.towgs84?o.towgs84.split(","):null),i.ellps=o.ellipse,i.datumName=o.datumName?o.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var l,u,d,f,p,m,y=function(t,s,i,a,h){if(!t){var e=v(Y,a);e||(e=$),t=e.a,s=e.b,i=e.rf}return i&&!s&&(s=(1-1/i)*t),(0===i||Math.abs(t-s)3&&(0===M.datum_params[3]&&0===M.datum_params[4]&&0===M.datum_params[5]&&0===M.datum_params[6]||(M.datum_type=h,M.datum_params[3]*=c,M.datum_params[4]*=c,M.datum_params[5]*=c,M.datum_params[6]=M.datum_params[6]/1e6+1))),u&&(M.datum_type=e,M.grids=u),M.a=i,M.b=r,M.es=o,M.ep2=l,M}(i.datumCode,i.datum_params,y.a,y.b,g.es,g.ep2,x);T(this,i),T(this,r),this.a=y.a,this.b=y.b,this.rf=y.rf,this.sphere=y.sphere,this.es=g.es,this.e=g.e,this.ep2=g.ep2,this.datum=_,this.init(),s(null,this)}else s(t)}else s(t)}ot.projections=Z,ot.projections.start();const lt=ot;function ct(t,s,i){var a,h,e,n,r=t.x,o=t.y,l=t.z?t.z:0;if(o<-u&&o>-1.001*u)o=-u;else if(o>u&&o<1.001*u)o=u;else{if(o<-u)return{x:-1/0,y:-1/0,z:t.z};if(o>u)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),h=Math.sin(o),n=Math.cos(o),e=h*h,{x:((a=i/Math.sqrt(1-s*e))+l)*n*Math.cos(r),y:(a+l)*n*Math.sin(r),z:(a*(1-s)+l)*h}}function ut(t,s,i,a){var h,e,n,r,o,l,c,u,M,d,f,p,m,y,g,x=t.x,_=t.y,v=t.z?t.z:0;if(h=Math.sqrt(x*x+_*_),e=Math.sqrt(x*x+_*_+v*v),h/i<1e-12){if(y=0,e/i<1e-12)return g=-a,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(_,x);n=v/e,u=(r=h/e)*(1-s)*(o=1/Math.sqrt(1-s*(2-s)*r*r)),M=n*o,m=0;do{m++,l=s*(c=i/Math.sqrt(1-s*M*M))/(c+(g=h*u+v*M-c*(1-s*M*M))),p=(f=n*(o=1/Math.sqrt(1-l*(2-l)*r*r)))*u-(d=r*(1-l)*o)*M,u=d,M=f}while(p*p>1e-24&&m<30);return{x:y,y:Math.atan(f/Math.abs(d)),z:g}}function Mt(t){return t===a||t===h}function dt(t,s,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var a={x:-i.x,y:i.y},h={x:Number.NaN,y:Number.NaN},e=[];t:for(var n=0;na.y||d>a.x||y1e-12&&Math.abs(n.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=U(e.x+i.ll[0]),a.y=e.y+i.ll[1]}else isNaN(e.x)||(a.x=t.x+e.x,a.y=t.y+e.y);return a}function pt(t,s){var i,a={x:t.x/s.del[0],y:t.y/s.del[1]},h=Math.floor(a.x),e=Math.floor(a.y),n=a.x-1*h,r=a.y-1*e,o={x:Number.NaN,y:Number.NaN};if(h<0||h>=s.lim[0])return o;if(e<0||e>=s.lim[1])return o;i=e*s.lim[0]+h;var l=s.cvs[i][0],c=s.cvs[i][1];i++;var u=s.cvs[i][0],M=s.cvs[i][1];i+=s.lim[0];var d=s.cvs[i][0],f=s.cvs[i][1];i--;var p=s.cvs[i][0],m=s.cvs[i][1],y=n*r,g=n*(1-r),x=(1-n)*(1-r),_=(1-n)*r;return o.x=x*l+g*u+_*p+y*d,o.y=x*c+g*M+_*m+y*f,o}function mt(t,s,i){var a,h,e,n=i.x,r=i.y,o=i.z||0,l={};for(e=0;e<3;e++)if(!s||2!==e||void 0!==i.z)switch(0===e?(a=n,h=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(a=r,h=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(a=o,h="z"),t.axis[e]){case"e":case"n":l[h]=a;break;case"w":case"s":l[h]=-a;break;case"u":void 0!==i[h]&&(l.z=a);break;case"d":void 0!==i[h]&&(l.z=-a);break;default:return null}return l}function yt(t){var s={x:t[0],y:t[1]};return t.length>2&&(s.z=t[2]),t.length>3&&(s.m=t[3]),s}function gt(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 xt(t,s,i,c){var u,M=void 0!==(i=Array.isArray(i)?yt(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(function(t){gt(t.x),gt(t.y)}(i),t.datum&&s.datum&&function(t,s){return(t.datum.datum_type===a||t.datum.datum_type===h||t.datum.datum_type===e)&&"WGS84"!==s.datumCode||(s.datum.datum_type===a||s.datum.datum_type===h||s.datum.datum_type===e)&&"WGS84"!==t.datumCode}(t,s)&&(i=xt(t,u=new lt("WGS84"),i,c),t=u),c&&"enu"!==t.axis&&(i=mt(t,!1,i)),"longlat"===t.projName)i={x:i.x*d,y:i.y*d,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=function(t,s,i){if(function(t,s){return t.datum_type===s.datum_type&&!(t.a!==s.a||Math.abs(t.es-s.es)>5e-11)&&(t.datum_type===a?t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]:t.datum_type!==h||t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]&&t.datum_params[3]===s.datum_params[3]&&t.datum_params[4]===s.datum_params[4]&&t.datum_params[5]===s.datum_params[5]&&t.datum_params[6]===s.datum_params[6])}(t,s))return i;if(t.datum_type===n||s.datum_type===n)return i;var c=t.a,u=t.es;if(t.datum_type===e){if(0!==dt(t,!1,i))return;c=r,u=l}var M=s.a,d=s.b,f=s.es;return s.datum_type===e&&(M=r,d=o,f=l),u!==f||c!==M||Mt(t.datum_type)||Mt(s.datum_type)?(i=ct(i,u,c),Mt(t.datum_type)&&(i=function(t,s,i){if(s===a)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(s===h){var e=i[0],n=i[1],r=i[2],o=i[3],l=i[4],c=i[5],u=i[6];return{x:u*(t.x-c*t.y+l*t.z)+e,y:u*(c*t.x+t.y-o*t.z)+n,z:u*(-l*t.x+o*t.y+t.z)+r}}}(i,t.datum_type,t.datum_params)),Mt(s.datum_type)&&(i=function(t,s,i){if(s===a)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(s===h){var e=i[0],n=i[1],r=i[2],o=i[3],l=i[4],c=i[5],u=i[6],M=(t.x-e)/u,d=(t.y-n)/u,f=(t.z-r)/u;return{x:M+c*d-l*f,y:-c*M+d+o*f,z:l*M-o*d+f}}}(i,s.datum_type,s.datum_params)),i=ut(i,f,M,d),s.datum_type!==e||0===dt(s,!0,i)?i:void 0):i}(t.datum,s.datum,i))return s.from_greenwich&&(i={x:i.x-s.from_greenwich,y:i.y,z:i.z||0}),"longlat"===s.projName?i={x:i.x*f,y:i.y*f,z:i.z||0}:(i=s.forward(i),s.to_meter&&(i={x:i.x/s.to_meter,y:i.y/s.to_meter,z:i.z||0})),c&&"enu"!==s.axis?mt(s,!0,i):(i&&!M&&delete i.z,i)}var _t=lt("WGS84");function vt(t,s,i,a){var h,e,n;return Array.isArray(i)?(h=xt(t,s,i,a)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name?"number"==typeof h.z?[h.x,h.y,h.z].concat(i.splice(3)):[h.x,h.y,i[2]].concat(i.splice(3)):[h.x,h.y].concat(i.splice(2)):[h.x,h.y]):(e=xt(t,s,i,a),2===(n=Object.keys(i)).length||n.forEach((function(a){if(void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name){if("x"===a||"y"===a||"z"===a)return}else if("x"===a||"y"===a)return;e[a]=i[a]})),e)}function bt(t){return t instanceof lt?t:t.oProj?t.oProj:lt(t)}const wt=function(t,s,i){t=bt(t);var a,h=!1;return void 0===s?(s=t,t=_t,h=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=_t,h=!0),s=bt(s),i?vt(t,s,i):(a={forward:function(i,a){return vt(t,s,i,a)},inverse:function(i,a){return vt(s,t,i,a)}},h&&(a.oProj=s),a)};var Nt=6,kt="AJSAJS",Ct="AFAFAF",Pt=65,St=73,Et=79,At=86,It=90;const qt={forward:Ot,inverse:function(t){var s=Lt(Bt(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]},toPoint:zt};function Ot(t,s){return s=s||5,function(t,s){var i,a,h,e,n,r,o,l,c,u,M,d="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,u=t.northing,M=Rt(t.zoneNumber),i=Math.floor(c/1e5),a=Math.floor(u/1e5)%20,h=M-1,e=kt.charCodeAt(h),n=Ct.charCodeAt(h),l=!1,(r=e+i-1)>It&&(r=r-It+Pt-1,l=!0),(r===St||eSt||(r>St||eEt||(r>Et||eIt&&(r=r-It+Pt-1),(o=n+a)>At?(o=o-At+Pt-1,l=!0):l=!1,(o===St||nSt||(o>St||nEt||(o>Et||nAt&&(o=o-At+Pt-1),String.fromCharCode(r)+String.fromCharCode(o))+d.substr(d.length-5,s)+f.substr(f.length-5,s)}(function(t){var s,i,a,h,e,n,r,o=t.lat,l=t.lon,c=6378137,u=.00669438,M=.9996,d=jt(o),f=jt(l);r=Math.floor((l+180)/6)+1,180===l&&(r=60),o>=56&&o<64&&l>=3&&l<12&&(r=32),o>=72&&o<84&&(l>=0&&l<9?r=31:l>=9&&l<21?r=33:l>=21&&l<33?r=35:l>=33&&l<42&&(r=37)),n=jt(6*(r-1)-180+3),s=.006739496752268451,i=c/Math.sqrt(1-u*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),h=s*Math.cos(d)*Math.cos(d);var p,m,y=M*i*((e=Math.cos(d)*(f-n))+(1-a+h)*e*e*e/6+(5-18*a+a*a+72*h-58*s)*e*e*e*e*e/120)+5e5,g=M*(c*(.9983242984503243*d-.002514607064228144*Math.sin(2*d)+2639046602129982e-21*Math.sin(4*d)-3.418046101696858e-9*Math.sin(6*d))+i*Math.tan(d)*(e*e/2+(5-a+9*h+4*h*h)*e*e*e*e/24+(61-58*a+a*a+600*h-2.2240339282485886)*e*e*e*e*e*e/720));return o<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(y),zoneNumber:r,zoneLetter:(p=o,m="Z",84>=p&&p>=72?m="X":72>p&&p>=64?m="W":64>p&&p>=56?m="V":56>p&&p>=48?m="U":48>p&&p>=40?m="T":40>p&&p>=32?m="S":32>p&&p>=24?m="R":24>p&&p>=16?m="Q":16>p&&p>=8?m="P":8>p&&p>=0?m="N":0>p&&p>=-8?m="M":-8>p&&p>=-16?m="L":-16>p&&p>=-24?m="K":-24>p&&p>=-32?m="J":-32>p&&p>=-40?m="H":-40>p&&p>=-48?m="G":-48>p&&p>=-56?m="F":-56>p&&p>=-64?m="E":-64>p&&p>=-72?m="D":-72>p&&p>=-80&&(m="C"),m)}}({lat:t[1],lon:t[0]}),s)}function zt(t){var s=Lt(Bt(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function jt(t){return t*(Math.PI/180)}function Gt(t){return t/Math.PI*180}function Lt(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var e,n,r,o,l,c,u,M,d,f=.9996,p=6378137,m=.00669438,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=i-5e5,x=s;a<"N"&&(x-=1e7),u=6*(h-1)-180+3,e=.006739496752268451,d=(M=x/f/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*M)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*M)+151*y*y*y/96*Math.sin(6*M),n=p/Math.sqrt(1-m*Math.sin(d)*Math.sin(d)),r=Math.tan(d)*Math.tan(d),o=e*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-m*Math.sin(d)*Math.sin(d),1.5),c=g/(n*f);var _=d-n*Math.tan(d)/l*(c*c/2-(5+3*r+10*o-4*o*o-9*e)*c*c*c*c/24+(61+90*r+298*o+45*r*r-1.6983531815716497-3*o*o)*c*c*c*c*c*c/720);_=Gt(_);var v,b=(c-(1+2*r+o)*c*c*c/6+(5-2*o+28*r-3*o*o+8*e+24*r*r)*c*c*c*c*c/120)/Math.cos(d);if(b=u+Gt(b),t.accuracy){var w=Lt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});v={top:w.lat,right:w.lon,bottom:_,left:b}}else v={lat:_,lon:b};return v}function Rt(t){var s=t%Nt;return 0===s&&(s=Nt),s}function Bt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var s,i=t.length,a=null,h="",e=0;!/[A-Z]/.test(s=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;h+=s,e++}var n=parseInt(h,10);if(0===e||e+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(e++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(e,e+=2);for(var o=Rt(n),l=function(t,s){for(var i=kt.charCodeAt(s-1),a=1e5,h=!1;i!==t.charCodeAt(0);){if(++i===St&&i++,i===Et&&i++,i>It){if(h)throw"Bad character: "+t;i=Pt,h=!0}a+=1e5}return a}(a.charAt(0),o),c=function(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Ct.charCodeAt(s-1),a=0,h=!1;i!==t.charCodeAt(0);){if(++i===St&&i++,i===Et&&i++,i>At){if(h)throw"Bad character: "+t;i=Pt,h=!0}a+=1e5}return a}(a.charAt(1),o);c0&&(M=1e5/Math.pow(10,p),d=t.substring(e,e+p),m=parseFloat(d)*M,f=t.substring(e+p),y=parseFloat(f)*M),{easting:m+l,northing:y+c,zoneLetter:r,zoneNumber:n,accuracy:M}}function Tt(t){var s;switch(t){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+t}function Ft(t,s,i){if(!(this instanceof Ft))return new Ft(t,s,i);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===s){var a=t.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=t,this.y=s,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ft.fromMGRS=function(t){return new Ft(zt(t))},Ft.prototype.toMGRS=function(t){return Ot([this.x,this.y],t)};const Dt=Ft;var Ut=.046875,Qt=.01953125,Wt=.01068115234375;function Jt(t){var s=[];s[0]=1-t*(.25+t*(Ut+t*(Qt+t*Wt))),s[1]=t*(.75-t*(Ut+t*(Qt+t*Wt)));var i=t*t;return s[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,s[3]=i*(.3645833333333333-.005696614583333333*t),s[4]=i*t*.3076171875,s}function Xt(t,s,i,a){return i*=s,s*=s,a[0]*t-i*(a[1]+s*(a[2]+s*(a[3]+s*a[4])))}function Ht(t,s,i){for(var a=1/(1-s),h=t,e=20;e;--e){var n=Math.sin(h),r=1-s*n*n;if(h-=r=(Xt(h,n,Math.cos(h),i)-t)*(r*Math.sqrt(r))*a,Math.abs(r)M?Math.tan(e):0,p=Math.pow(f,2),m=Math.pow(p,2);s=1-this.es*Math.pow(r,2),l/=Math.sqrt(s);var y=Xt(e,r,o,this.en);i=this.a*(this.k0*l*(1+c/6*(1-p+u+c/20*(5-18*p+m+14*u-58*p*u+c/42*(61+179*m-m*p-479*p)))))+this.x0,a=this.a*(this.k0*(y-this.ml0+r*n*l/2*(1+c/12*(5-p+9*u+4*d+c/30*(61+m-58*p+270*u-330*p*u+c/56*(1385+543*m-m*p-3111*p))))))+this.y0}else{var g=o*Math.sin(n);if(Math.abs(Math.abs(g)-1)=1){if(g-1>M)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,e=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(i=Ht(s=this.ml0+n/this.k0,this.es,this.en),Math.abs(i)M?Math.tan(i):0,c=this.ep2*Math.pow(o,2),d=Math.pow(c,2),f=Math.pow(l,2),p=Math.pow(f,2);s=1-this.es*Math.pow(r,2);var m=e*Math.sqrt(s)/this.k0,y=Math.pow(m,2);a=i-(s*=l)*y/(1-this.es)*.5*(1-y/12*(5+3*f-9*c*f+c-4*d-y/30*(61+90*f-252*c*f+45*p+46*c-y/56*(1385+3633*f+4095*p+1574*p*f)))),h=U(this.long0+m*(1-y/6*(1+2*f+c-y/20*(5+28*f+24*p+8*c*f+6*c-y/42*(61+662*f+1320*p+720*p*f))))/o)}else a=u*D(n),h=0;else{var g=Math.exp(e/this.k0),x=.5*(g-1/g),_=this.lat0+n/this.k0,v=Math.cos(_);s=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(x,2))),a=Math.asin(s),n<0&&(a=-a),h=0===x&&0===v?0:U(Math.atan2(x,v)+this.long0)}return t.x=h,t.y=a,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Vt(t){var s=Math.exp(t);return(s-1/s)/2}function Zt(t,s){t=Math.abs(t),s=Math.abs(s);var i=Math.max(t,s),a=Math.min(t,s)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))}function Yt(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return s+i*Math.sin(2*s)}function $t(t,s,i){for(var a,h,e=Math.sin(s),n=Math.cos(s),r=Vt(i),o=function(t){var s=Math.exp(t);return(s+1/s)/2}(i),l=2*n*o,c=-2*e*r,u=t.length-1,M=t[u],d=0,f=0,p=0;--u>=0;)a=f,h=d,M=l*(f=M)-a-c*(d=p)+t[u],p=c*f-h+l*d;return[(l=e*o)*M-(c=n*r)*p,l*p+c*M]}const ts={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&&(Kt.init.apply(this),this.forward=Kt.forward,this.inverse=Kt.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)),s=t/(2-t),i=s;this.cgb[0]=s*(2+s*(-2/3+s*(s*(116/45+s*(26/45+s*(-2854/675)))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+s*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+s*(-12686/2835)))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=i*(1237/630+s*(s*(-24832/14175)-2.4)),i*=s,this.cgb[4]=i*(4174/315+s*(-144838/6237)),this.cbg[4]=i*(-734/315+s*(109598/31185)),i*=s,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+s*(-1983433/1935360)))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=i*(49561/161280+s*(-179/168+s*(6601661/7257600))),i*=s,this.utg[4]=i*(-4583/161280+s*(108847/3991680)),this.gtu[4]=i*(34729/80640+s*(-3418889/1995840)),i*=s,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var a=Yt(this.cbg,this.lat0);this.Zb=-this.Qn*(a+function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i}(this.gtu,2*a))},forward:function(t){var s=U(t.x-this.long0),i=t.y;i=Yt(this.cbg,i);var a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*h),s=Math.atan2(e*h,Zt(a,h*n)),s=function(t){var s=Math.abs(t);return s=function(t){var s=1+t,i=s-1;return 0===i?t:t*Math.log(s)/i}(s*(1+s/(Zt(1,s)+1))),t<0?-s:s}(Math.tan(s));var r,o,l=$t(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],Math.abs(s)<=2.623395162778?(r=this.a*(this.Qn*s)+this.x0,o=this.a*(this.Qn*i+this.Zb)+this.y0):(r=1/0,o=1/0),t.x=r,t.y=o,t},inverse:function(t){var s,i,a=(t.x-this.x0)*(1/this.a),h=(t.y-this.y0)*(1/this.a);if(h=(h-this.Zb)/this.Qn,a/=this.Qn,Math.abs(a)<=2.623395162778){var e=$t(this.utg,2*h,2*a);h+=e[0],a+=e[1],a=Math.atan(Vt(a));var n=Math.sin(h),r=Math.cos(h),o=Math.sin(a),l=Math.cos(a);h=Math.atan2(n*l,Zt(o,l*r)),s=U((a=Math.atan2(o,l*r))+this.long0),i=Yt(this.cgb,h)}else s=1/0,i=1/0;return t.x=s,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},ss={init:function(){var t=function(t,s){if(void 0===t){if((t=Math.floor(30*(U(s)+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)*d,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ts.init.apply(this),this.forward=ts.forward,this.inverse=ts.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function is(t,s){return Math.pow((1-t)/(1+t),s)}const as={init:function(){var t=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+p)/(Math.pow(Math.tan(.5*this.lat0+p),this.C)*is(this.e*t,this.ratexp))},forward:function(t){var s=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+p),this.C)*is(this.e*Math.sin(i),this.ratexp))-u,t.x=this.C*s,t},inverse:function(t){for(var s=t.x/this.C,i=t.y,a=Math.pow(Math.tan(.5*i+p)/this.K,1/this.C),h=20;h>0&&(i=2*Math.atan(a*is(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]},hs={init:function(){as.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 s,i,a,h;return t.x=U(t.x-this.long0),as.forward.apply(this,[t]),s=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*i*a),t.x=h*i*Math.sin(t.x),t.y=h*(this.cosc0*s-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var s,i,a,h,e;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,e=Zt(t.x,t.y)){var n=2*Math.atan2(e,this.R2);s=Math.sin(n),i=Math.cos(n),h=Math.asin(i*this.sinc0+t.y*s*this.cosc0/e),a=Math.atan2(t.x*s,e*this.cosc0*i-t.y*this.sinc0*s)}else h=this.phic0,a=0;return t.x=a,t.y=h,as.inverse.apply(this,[t]),t.x=U(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},es={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,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)<=M&&(this.k0=.5*(1+D(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=M&&(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)<=M&&Math.abs(Math.cos(this.lat_ts))>M&&(this.k0=.5*this.cons*F(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Q(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=F(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,e,n,r=t.x,o=t.y,l=Math.sin(o),c=Math.cos(o),d=U(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=M&&Math.abs(o+this.lat0)<=M?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(d)),t.x=this.a*s*c*Math.sin(d)+this.x0,t.y=this.a*s*(this.coslat0*l-this.sinlat0*c*Math.cos(d))+this.y0,t):(i=2*Math.atan(this.ssfn_(o,l,this.e))-u,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=M?(e=Q(this.e,o*this.con,this.con*l),n=2*this.a*this.k0*e/this.cons,t.x=this.x0+n*Math.sin(r-this.long0),t.y=this.y0-this.con*n*Math.cos(r-this.long0),t):(Math.abs(this.sinlat0)0?U(this.long0+Math.atan2(t.x,-1*t.y)):U(this.long0+Math.atan2(t.x,t.y)):U(this.long0+Math.atan2(t.x*Math.sin(r),n*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r))),t.x=s,t.y=i,t)}if(Math.abs(this.coslat0)<=M){if(n<=M)return i=this.lat0,s=this.long0,t.x=s,t.y=i,t;t.x*=this.con,t.y*=this.con,a=n*this.cons/(2*this.a*this.k0),i=this.con*W(this.e,a),s=this.con*U(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,n<=M?e=this.X0:(e=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/n),s=U(this.long0+Math.atan2(t.x*Math.sin(h),n*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),i=-1*W(this.e,Math.tan(.5*(u+e)));return t.x=s,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,s,i){return s*=i,Math.tan(.5*(u+t))*Math.pow((1-s)/(1+s),.5*i)}},ns={init:function(){var t=this.lat0;this.lambda0=this.long0;var s=Math.sin(t),i=this.a,a=1/this.rf,h=2*a-Math.pow(a,2),e=this.e=Math.sqrt(h);this.R=this.k0*i*Math.sqrt(1-h)/(1-h*Math.pow(s,2)),this.alpha=Math.sqrt(1+h/(1-h)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(s/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),r=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*s)/(1-e*s));this.K=n-this.alpha*r+this.alpha*e/2*o},forward:function(t){var s=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(s+i)+this.K,h=2*(Math.atan(Math.exp(a))-Math.PI/4),e=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(e)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(e))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(e));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*n+this.x0,t},inverse:function(t){for(var s=t.x-this.x0,i=t.y-this.y0,a=s/this.R,h=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),e=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(a)),n=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(h))),r=this.lambda0+n/this.alpha,o=0,l=e,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/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(o))-Math.PI/2}return t.x=r,t.y=l,t},names:["somerc"]};var rs=1e-7;const os={init:function(){var t,s,i,a,h,e,n,r,o,l,c,f,y,g=0,x=0,_=0,v=0,b=0,w=0,N=0;this.no_off=(y="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(y)),this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),k&&(N=this.alpha),C&&(g=this.rectified_grid_angle*d),k||C)x=this.longc;else if(_=this.long1,b=this.lat1,v=this.long2,w=this.lat2,Math.abs(b-w)<=rs||(t=Math.abs(b))<=rs||Math.abs(t-u)<=rs||Math.abs(Math.abs(this.lat0)-u)<=rs||Math.abs(Math.abs(w)-u)<=rs)throw new Error;var P=1-this.es;s=Math.sqrt(P),Math.abs(this.lat0)>M?(r=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*r*r,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*s/t,(h=(a=this.B*s/(i*Math.sqrt(t)))*a-1)<=0?h=0:(h=Math.sqrt(h),this.lat0<0&&(h=-h)),this.E=h+=a,this.E*=Math.pow(Q(this.e,this.lat0,r),this.B)):(this.B=1/s,this.A=this.k0,this.E=a=h=1),k||C?(k?(c=Math.asin(Math.sin(N)/a),C||(g=N)):(c=g,N=Math.asin(a*Math.sin(c))),this.lam0=x-Math.asin(.5*(h-1/h)*Math.tan(c))/this.B):(e=Math.pow(Q(this.e,b,Math.sin(b)),this.B),n=Math.pow(Q(this.e,w,Math.sin(w)),this.B),h=this.E/e,o=(n-e)/(n+e),l=((l=this.E*this.E)-n*e)/(l+n*e),(t=_-v)<-Math.pi?v-=m:t>Math.pi&&(v+=m),this.lam0=U(.5*(_+v)-Math.atan(l*Math.tan(.5*this.B*(_-v))/o)/this.B),c=Math.atan(2*Math.sin(this.B*U(_-this.lam0))/(h-1/h)),g=N=Math.asin(a*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),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(a*a-1)/Math.cos(N))),this.lat0<0&&(this.u_0=-this.u_0)),h=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(p-h)),this.v_pole_s=this.ArB*Math.log(Math.tan(p+h))},forward:function(t){var s,i,a,h,e,n,r,o,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-u)>M){if(s=.5*((e=this.E/Math.pow(Q(this.e,t.y,Math.sin(t.y)),this.B))-(n=1/e)),i=.5*(e+n),h=Math.sin(this.B*t.x),a=(s*this.singam-h*this.cosgam)/i,Math.abs(Math.abs(a)-1)0?this.v_pole_n:this.v_pole_s,r=this.ArB*t.y;return this.no_rot?(l.x=r,l.y=o):(r-=this.u_0,l.x=o*this.cosrot+r*this.sinrot,l.y=r*this.cosrot-o*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var s,i,a,h,e,n,r,o={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,s=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,s=t.y*this.cosrot+t.x*this.sinrot+this.u_0),h=.5*((a=Math.exp(-this.BrA*i))-1/a),e=.5*(a+1/a),r=((n=Math.sin(this.BrA*s))*this.cosgam+h*this.singam)/e,Math.abs(Math.abs(r)-1)M?this.ns=Math.log(a/r)/Math.log(h/o):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=M&&(i=D(i)*(u-2e-10));var a,h,e=Math.abs(Math.abs(i)-u);if(e>M)a=Q(this.e,i,Math.sin(i)),h=this.a*this.f0*Math.pow(a,this.ns);else{if((e=i*this.ns)<=0)return null;h=0}var n=this.ns*U(s-this.long0);return t.x=this.k0*(h*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-h*Math.cos(n))+this.y0,t},inverse:function(t){var s,i,a,h,e,n=(t.x-this.x0)/this.k0,r=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(n*n+r*r),i=1):(s=-Math.sqrt(n*n+r*r),i=-1);var o=0;if(0!==s&&(o=Math.atan2(i*n,i*r)),0!==s||this.ns>0){if(i=1/this.ns,a=Math.pow(s/(this.a*this.f0),i),-9999===(h=W(this.e,a)))return null}else h=-u;return e=U(o/this.ns+this.long0),t.x=e,t.y=h,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)"]},cs={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 s,i,a,h,e,n,r,o=t.x,l=t.y,c=U(o-this.long0);return s=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/s)-this.s45),a=-c*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),e=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(h)),n=this.n*e,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/2+this.s45),this.n),t.y=r*Math.cos(n)/1,t.x=r*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var s,i,a,h,e,n,r,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x)/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/e,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(h)),i=Math.asin(Math.cos(a)*Math.sin(h)/Math.cos(s)),t.x=this.long0-i/this.alfa,n=s,r=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(r=1),n=t.y,l+=1}while(0===r&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function us(t,s,i,a,h){return t*h-s*Math.sin(2*h)+i*Math.sin(4*h)-a*Math.sin(6*h)}function Ms(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function ds(t){return.375*t*(1+.25*t*(1+.46875*t))}function fs(t){return.05859375*t*t*(1+.75*t)}function ps(t){return t*t*t*(35/3072)}function ms(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)}function ys(t){return Math.abs(t)1e-7?(1-t*t)*(s/(1-(i=t*s)*i)-.5/t*Math.log((1-i)/(1+i))):2*s}const vs={init:function(){var t,s=Math.abs(this.lat0);if(Math.abs(s-u)0)switch(this.qp=_s(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var s,i=[];return i[0]=.3333333333333333*t,s=t*t,i[0]+=.17222222222222222*s,i[1]=.06388888888888888*s,s*=t,i[0]+=.10257936507936508*s,i[1]+=.0664021164021164*s,i[2]=.016415012942191543*s,i}(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=_s(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 s,i,a,h,e,n,r,o,l,c,d=t.x,f=t.y;if(d=U(d-this.long0),this.sphere){if(e=Math.sin(f),c=Math.cos(f),a=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*a:1+this.sinph0*e+this.cosph0*c*a)<=M)return null;s=(i=Math.sqrt(2/i))*c*Math.sin(d),i*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*c*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(f+this.lat0)=0?(s=(l=Math.sqrt(n))*h,i=a*(this.mode===this.S_POLE?l:-l)):s=i=0}}return t.x=this.a*s+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,n,r,o,l,c,d=t.x/this.a,f=t.y/this.a;if(this.sphere){var p,m=0,y=0;if((i=.5*(p=Math.sqrt(d*d+f*f)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(i),m=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=M?0:Math.asin(f*y/p),d*=y,f=m*p;break;case this.OBLIQ:i=Math.abs(p)<=M?this.lat0:Math.asin(m*this.sinph0+f*y*this.cosph0/p),d*=y*this.cosph0,f=(m-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:f=-f,i=u-i;break;case this.S_POLE:i-=u}s=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,f):0}else{if(r=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,f*=this.dd,(n=Math.sqrt(d*d+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const ws={init:function(){Math.abs(this.lat1+this.lat2)M?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 s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=_s(this.e3,this.sin_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*U(s-this.long0),n=h*Math.sin(e)+this.x0,r=this.rh-h*Math.cos(e)+this.y0;return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),h=0,0!==s&&(h=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,this.sphere?n=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,n=this.phi1z(this.e3,i)),e=U(h/this.ns0+this.long0),t.x=e,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,s){var i,a,h,e,n=bs(.5*s);if(t0||Math.abs(e)<=M?(n=this.x0+1*this.a*i*Math.sin(a)/e,r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)/e):(n=this.x0+this.infinity_dist*i*Math.sin(a),r=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;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,(s=Math.sqrt(t.x*t.x+t.y*t.y))?(h=Math.atan2(s,this.rc),i=Math.sin(h),n=bs((a=Math.cos(h))*this.sin_p14+t.y*i*this.cos_p14/s),e=Math.atan2(t.x*i,s*this.cos_p14*a-t.y*this.sin_p14*i),e=U(this.long0+e)):(n=this.phic0,e=0),t.x=e,t.y=n,t},names:["gnom"]},ks={init:function(){this.sphere||(this.k0=F(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var s,i,a=t.x,h=t.y,e=U(a-this.long0);if(this.sphere)s=this.x0+this.a*e*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var n=_s(this.e,Math.sin(h));s=this.x0+this.a*this.k0*e,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t},inverse:function(t){var s,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(s=U(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=function(t,s){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(s)-i)<1e-6)return s<0?-1*u:u;for(var a,h,e,n,r=Math.asin(.5*s),o=0;o<30;o++)if(h=Math.sin(r),e=Math.cos(r),n=t*h,r+=a=Math.pow(1-n*n,2)/(2*e)*(s/(1-t*t)-h/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),Math.abs(a)<=1e-10)return r;return NaN}(this.e,2*t.y*this.k0/this.a),s=U(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t},names:["cea"]},Cs={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 s=t.x,i=t.y,a=U(s-this.long0),h=ys(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var s=t.x,i=t.y;return t.x=U(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=ys(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ps={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ms(this.es),this.e1=ds(this.es),this.e2=fs(this.es),this.e3=ps(this.es),this.ml0=this.a*us(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=U(h-this.long0);if(a=n*Math.sin(e),this.sphere)Math.abs(e)<=M?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(e),i=this.a*(ys(e-this.lat0)+(1-Math.cos(a))/Math.tan(e)));else if(Math.abs(e)<=M)s=this.a*n,i=-1*this.ml0;else{var r=ms(this.a,this.e,Math.sin(e))/Math.tan(e);s=r*Math.sin(a),i=this.a*us(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+r*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){var s,i,a,h,e,n,r,o,l;if(a=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=M)s=U(a/this.a+this.long0),i=0;else{var c;for(n=this.lat0+h/this.a,r=a*a/this.a/this.a+n*n,o=n,e=20;e;--e)if(o+=l=-1*(n*(o*(c=Math.tan(o))+1)-o-.5*(o*o+r)*c)/((o-n)/c-1),Math.abs(l)<=M){i=o;break}s=U(this.long0+Math.asin(a*Math.tan(o)/this.a)/Math.sin(i))}else if(Math.abs(h+this.ml0)<=M)i=0,s=U(this.long0+a/this.a);else{var u,d,f,p,m;for(n=(this.ml0+h)/this.a,r=a*a/this.a/this.a+n*n,o=n,e=20;e;--e)if(m=this.e*Math.sin(o),u=Math.sqrt(1-m*m)*Math.tan(o),d=this.a*us(this.e0,this.e1,this.e2,this.e3,o),f=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=l=(n*(u*(p=d/this.a)+1)-p-.5*u*(p*p+r))/(this.es*Math.sin(2*o)*(p*p+r-2*n*p)/(4*u)+(n-p)*(u*f-2/Math.sin(2*o))-f),Math.abs(l)<=M){i=o;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=U(this.long0+Math.asin(a*u/this.a)/Math.sin(i))}return t.x=s,t.y=i,t},names:["Polyconic","poly"]},Ss={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 s,i=t.x,a=t.y-this.lat0,h=i-this.long0,e=a/c*1e-5,n=h,r=1,o=0;for(s=1;s<=10;s++)r*=e,o+=this.A[s]*r;var l,u=o,M=n,d=1,f=0,p=0,m=0;for(s=1;s<=6;s++)l=f*u+d*M,d=d*u-f*M,f=l,p=p+this.B_re[s]*d-this.B_im[s]*f,m=m+this.B_im[s]*d+this.B_re[s]*f;return t.x=m*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var s,i,a=t.x,h=t.y,e=a-this.x0,n=(h-this.y0)/this.a,r=e/this.a,o=1,l=0,u=0,M=0;for(s=1;s<=6;s++)i=l*n+o*r,o=o*n-l*r,l=i,u=u+this.C_re[s]*o-this.C_im[s]*l,M=M+this.C_im[s]*o+this.C_re[s]*l;for(var d=0;d.999999999999&&(i=.999999999999),s=Math.asin(i);var a=U(this.long0+t.x/(.900316316158*this.a*Math.cos(s)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*s+Math.sin(2*s))/Math.PI,Math.abs(i)>1&&(i=1);var h=Math.asin(i);return t.x=a,t.y=h,t},names:["Mollweide","moll"]},qs={init:function(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1);var e=0;return 0!==i&&(e=Math.atan2(s*t.x,s*t.y)),this.sphere?(h=U(this.long0+e/this.ns),a=ys(this.g-i/this.a),t.x=h,t.y=a,t):(a=gs(this.g-i/this.a,this.e0,this.e1,this.e2,this.e3),h=U(this.long0+e/this.ns),t.x=h,t.y=a,t)},names:["Equidistant_Conic","eqdc"]},Os={init:function(){this.R=this.a},forward:function(t){var s,i,a=t.x,h=t.y,e=U(a-this.long0);Math.abs(h)<=M&&(s=this.x0+this.R*e,i=this.y0);var n=bs(2*Math.abs(h/Math.PI));(Math.abs(e)<=M||Math.abs(Math.abs(h)-u)<=M)&&(s=this.x0,i=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*n):this.y0+Math.PI*this.R*-Math.tan(.5*n));var r=.5*Math.abs(Math.PI/e-e/Math.PI),o=r*r,l=Math.sin(n),c=Math.cos(n),d=c/(l+c-1),f=d*d,p=d*(2/l-1),m=p*p,y=Math.PI*this.R*(r*(d-m)+Math.sqrt(o*(d-m)*(d-m)-(m+o)*(f-m)))/(m+o);e<0&&(y=-y),s=this.x0+y;var g=o+d;return y=Math.PI*this.R*(p*g-r*Math.sqrt((m+o)*(o+1)-g*g))/(m+o),i=h>=0?this.y0+y:this.y0-y,t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,c,u,d;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,e=(a=t.x/u)*a+(h=t.y/u)*h,u=3*(h*h/(o=-2*(n=-Math.abs(h)*(1+e))+1+2*h*h+e*e)+(2*(r=n-2*h*h+a*a)*r*r/o/o/o-9*n*r/o/o)/27)/(l=(n-r*r/3/o)/o)/(c=2*Math.sqrt(-l/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(d+Math.PI/3)-r/3/o)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-r/3/o)*Math.PI,s=Math.abs(a)2*u*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),e=this.long0,Math.abs(s)<=M?n=this.lat0:(n=bs(h*this.sin_p12+t.y*a*this.cos_p12/s),r=Math.abs(this.lat0)-u,e=Math.abs(r)<=M?this.lat0>=0?U(this.long0+Math.atan2(t.x,-t.y)):U(this.long0-Math.atan2(-t.x,t.y)):U(this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=e,t.y=n,t}return o=Ms(this.es),l=ds(this.es),c=fs(this.es),d=ps(this.es),Math.abs(this.sin_p12-1)<=M?(n=gs(((f=this.a*us(o,l,c,d,u))-(s=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,o,l,c,d),e=U(this.long0+Math.atan2(t.x,-1*t.y)),t.x=e,t.y=n,t):Math.abs(this.sin_p12+1)<=M?(f=this.a*us(o,l,c,d,u),n=gs(((s=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,o,l,c,d),e=U(this.long0+Math.atan2(t.x,t.y)),t.x=e,t.y=n,t):(s=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=ms(this.a,this.e,this.sin_p12),g=Math.cos(y),_=-(x=this.e*this.cos_p12*g)*x/(1-this.es),v=3*this.es*(1-_)*this.sin_p12*this.cos_p12*g/(1-this.es),N=1-_*(w=(b=s/p)-_*(1+_)*Math.pow(b,3)/6-v*(1+3*_)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,m=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*g),e=U(this.long0+Math.asin(Math.sin(y)*Math.sin(w)/Math.cos(m))),k=Math.sin(m),n=Math.atan2((k-this.es*N*this.sin_p12)*Math.tan(m),k*(1-this.es)),t.x=e,t.y=n,t)},names:["Azimuthal_Equidistant","aeqd"]},js={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,r,o=t.x,l=t.y;return a=U(o-this.long0),s=Math.sin(l),i=Math.cos(l),h=Math.cos(a),((e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=M)&&(n=1*this.a*i*Math.sin(a),r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n,r;return t.x-=this.x0,t.y-=this.y0,i=bs((s=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),a=Math.sin(i),h=Math.cos(i),n=this.long0,Math.abs(s)<=M?(r=this.lat0,t.x=n,t.y=r,t):(r=bs(h*this.sin_p14+t.y*a*this.cos_p14/s),e=Math.abs(this.lat0)-u,Math.abs(e)<=M?(n=this.lat0>=0?U(this.long0+Math.atan2(t.x,-t.y)):U(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=r,t):(n=U(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a)),t.x=n,t.y=r,t))},names:["ortho"]};var Gs=1,Ls=2,Rs=3,Bs=4;function Ts(t,s,i,a){var h;return tp&&h<=u+p?(a.value=Ls,h-=u):h>u+p||h<=-(u+p)?(a.value=Rs,h=h>=0?h-y:h+y):(a.value=Bs,h+=u)),h}function Fs(t,s){var i=t+s;return i<-y?i+=m:i>+y&&(i-=m),i}const Ds={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>=u-p/2?this.face=5:this.lat0<=-(u-p/2)?this.face=6:Math.abs(this.long0)<=p?this.face=1:Math.abs(this.long0)<=u+p?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 s,i,a,h,e,n,r={x:0,y:0},o={value:0};if(t.x-=this.long0,s=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,5===this.face)h=u-s,i>=p&&i<=u+p?(o.value=Gs,a=i-u):i>u+p||i<=-(u+p)?(o.value=Ls,a=i>0?i-y:i+y):i>-(u+p)&&i<=-p?(o.value=Rs,a=i+u):(o.value=Bs,a=i);else if(6===this.face)h=u+s,i>=p&&i<=u+p?(o.value=Gs,a=-i+u):i=-p?(o.value=Ls,a=-i):i<-p&&i>=-(u+p)?(o.value=Rs,a=-i-u):(o.value=Bs,a=i>0?-i+y:-i-y);else{var l,c,M,d,f,m;2===this.face?i=Fs(i,+u):3===this.face?i=Fs(i,+y):4===this.face&&(i=Fs(i,-u)),d=Math.sin(s),f=Math.cos(s),m=Math.sin(i),l=f*Math.cos(i),c=f*m,M=d,1===this.face?a=Ts(h=Math.acos(l),M,c,o):2===this.face?a=Ts(h=Math.acos(c),M,-l,o):3===this.face?a=Ts(h=Math.acos(-l),M,-c,o):4===this.face?a=Ts(h=Math.acos(-c),M,l,o):(h=a=0,o.value=Gs)}return n=Math.atan(12/y*(a+Math.acos(Math.sin(a)*Math.cos(p))-u)),e=Math.sqrt((1-Math.cos(h))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),o.value===Ls?n+=u:o.value===Rs?n+=y:o.value===Bs&&(n+=1.5*y),r.x=e*Math.cos(n),r.y=e*Math.sin(n),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,t.x=r.x,t.y=r.y,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,c,M,d,f={lam:0,phi:0},p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Gs:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Ls,s-=u):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Rs,s=s<0?s+y:s-y):(p.value=Bs,s+=u),l=y/12*Math.tan(s),e=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),n=Math.atan(e),(r=1-(a=Math.cos(s))*a*(h=Math.tan(i))*h*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?r=-1:r>1&&(r=1),5===this.face)o=Math.acos(r),f.phi=u-o,p.value===Gs?f.lam=n+u:p.value===Ls?f.lam=n<0?n+y:n-y:p.value===Rs?f.lam=n-u:f.lam=n;else if(6===this.face)o=Math.acos(r),f.phi=o-u,p.value===Gs?f.lam=-n+u:p.value===Ls?f.lam=-n:p.value===Rs?f.lam=-n-u:f.lam=n<0?-n-y:-n+y;else{var m,g,x;l=(m=r)*m,g=(l+=(x=l>=1?0:Math.sqrt(1-l)*Math.sin(n))*x)>=1?0:Math.sqrt(1-l),p.value===Ls?(l=g,g=-x,x=l):p.value===Rs?(g=-g,x=-x):p.value===Bs&&(l=g,g=x,x=-l),2===this.face?(l=m,m=-g,g=l):3===this.face?(m=-m,g=-g):4===this.face&&(l=m,m=g,g=-l),f.phi=Math.acos(-x)-u,f.lam=Math.atan2(g,m),2===this.face?f.lam=Fs(f.lam,-u):3===this.face?f.lam=Fs(f.lam,-y):4===this.face&&(f.lam=Fs(f.lam,+u))}return 0!==this.es&&(c=f.phi<0?1:0,M=Math.tan(f.phi),d=this.b/Math.sqrt(M*M+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),c&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var Us=[[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]],Qs=[[-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]],Ws=.8487,Js=1.3523,Xs=f/5,Hs=1/Xs,Ks=function(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))};const Vs={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 s=U(t.x-this.long0),i=Math.abs(t.y),a=Math.floor(i*Xs);a<0?a=0:a>=18&&(a=17);var h={x:Ks(Us[a],i=f*(i-Hs*a))*s,y:Ks(Qs[a],i)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*Ws+this.x0,h.y=h.y*this.a*Js+this.y0,h},inverse:function(t){var s={x:(t.x-this.x0)/(this.a*Ws),y:Math.abs(t.y-this.y0)/(this.a*Js)};if(s.y>=1)s.x/=Us[18][0],s.y=t.y<0?-u:u;else{var i=Math.floor(18*s.y);for(i<0?i=0:i>=18&&(i=17);;)if(Qs[i][0]>s.y)--i;else{if(!(Qs[i+1][0]<=s.y))break;++i}var a=Qs[i],h=5*(s.y-a[0])/(Qs[i+1][0]-a[0]);h=function(t,s,i,a){for(var h=s;a;--a){var e=t(h);if(h-=e,Math.abs(e)<1e-10)break}return h}((function(t){return(Ks(a,t)-s.y)/function(t,s){return t[1]+s*(2*t[2]+3*s*t[3])}(a,t)}),h,0,100),s.x/=Ks(Us[i],h),s.y=(5*i+h)*d,t.y<0&&(s.y=-s.y)}return s.x=U(s.x+this.long0),s},names:["Robinson","robin"]},Zs={init:function(){this.name="geocent"},forward:function(t){return ct(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ys={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 $s={init:function(){if(Object.keys(Ys).forEach(function(t){if(void 0===this[t])this[t]=Ys[t].def;else{if(Ys[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ys[t].num&&(this[t]=parseFloat(this[t]))}Ys[t].degrees&&(this[t]=this[t]*d)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)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,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var s,i,a,h,e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x);switch(this.mode){case 3:i=this.sinph0*e+this.cosph0*n*r;break;case 2:i=n*r;break;case 1:i=-e;break;case 0:i=e}switch(s=(i=this.pn1/(this.p-i))*n*Math.sin(t.x),this.mode){case 3:i*=this.cosph0*e-this.sinph0*n*r;break;case 2:i*=e;break;case 0:i*=-n*r;break;case 1:i*=n*r}return h=1/((a=i*this.cg+s*this.sg)*this.sw*this.h1+this.cw),s=(s*this.cg-i*this.sg)*this.cw*h,i=a*h,t.x=s*this.a,t.y=i*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var s,i,a,h={x:t.x,y:t.y};a=1/(this.pn1-t.y*this.sw),s=this.pn1*t.x*a,i=this.pn1*t.y*this.cw*a,t.x=s*this.cg+i*this.sg,t.y=i*this.cg-s*this.sg;var e=Zt(t.x,t.y);if(Math.abs(e)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,s=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=s,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 s,i,a,h,e=t.x,n=t.y;if(e-=this.long0,"ellipse"===this.shape){n=Math.atan(this.radius_p2*Math.tan(n));var r=this.radius_p/Zt(this.radius_p*Math.cos(n),Math.sin(n));if(i=r*Math.cos(e)*Math.cos(n),a=r*Math.sin(e)*Math.cos(n),h=r*Math.sin(n),(this.radius_g-i)*i-a*a-h*h*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(a/Zt(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(a/s),t.y=this.radius_g_1*Math.atan(h/Zt(a,s)))}else"sphere"===this.shape&&(s=Math.cos(n),i=Math.cos(e)*s,a=Math.sin(e)*s,h=Math.sin(n),s=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(a/Zt(h,s)),t.y=this.radius_g_1*Math.atan(h/s)):(t.x=this.radius_g_1*Math.atan(a/s),t.y=this.radius_g_1*Math.atan(h/Zt(a,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var s,i,a,h,e=-1,n=0,r=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Zt(1,r)):(n=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Zt(1,n));var o=r/this.radius_p;if(s=n*n+o*o+e*e,(a=(i=2*this.radius_g*e)*i-4*s*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-i-Math.sqrt(a))/(2*s),e=this.radius_g+h*e,n*=h,r*=h,t.x=Math.atan2(n,e),t.y=Math.atan(r*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),n=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+n*n)),s=n*n+r*r+e*e,(a=(i=2*this.radius_g*e)*i-4*s*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-i-Math.sqrt(a))/(2*s),e=this.radius_g+h*e,n*=h,r*=h,t.x=Math.atan2(n,e),t.y=Math.atan(r*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var si=1.340264,ii=-.081106,ai=893e-6,hi=.003796,ei=Math.sqrt(3)/2;const ni={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var s=U(t.x-this.long0),i=t.y,a=Math.asin(ei*Math.sin(i)),h=a*a,e=h*h*h;return t.x=s*Math.cos(a)/(ei*(si+3*ii*h+e*(7*ai+9*hi*h))),t.y=a*(si+ii*h+e*(ai+hi*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var s,i,a,h,e=t.y;for(h=0;h<12&&(e-=a=(e*(si+ii*(s=e*e)+(i=s*s*s)*(ai+hi*s))-t.y)/(si+3*ii*s+i*(7*ai+9*hi*s)),!(Math.abs(a)<1e-9));++h);return i=(s=e*e)*s*s,t.x=ei*t.x*(si+3*ii*s+i*(7*ai+9*hi*s))/Math.cos(e),t.y=Math.asin(Math.sin(e)/ei),t.x=U(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};var ri;wt.defaultDatum="WGS84",wt.Proj=lt,wt.WGS84=new wt.Proj("WGS84"),wt.Point=Dt,wt.toPoint=yt,wt.defs=L,wt.nadgrid=function(t,s){var i=new DataView(s),a=function(t){var s=t.getInt32(8,!1);return 11!==s&&(11!==(s=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),h=function(t,s){return{nFields:t.getInt32(8,s),nSubgridFields:t.getInt32(24,s),nSubgrids:t.getInt32(40,s),shiftType:ht(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,s),fromSemiMinorAxis:t.getFloat64(136,s),toSemiMajorAxis:t.getFloat64(152,s),toSemiMinorAxis:t.getFloat64(168,s)}}(i,a),e=function(t,s,i){for(var a=176,h=[],e=0;e{var a=i(5072),h=i.n(a),e=i(7825),n=i.n(e),r=i(7659),o=i.n(r),l=i(5056),c=i.n(l),u=i(540),M=i.n(u),d=i(1113),f=i.n(d),p=i(4096),m={};m.styleTagTransform=f(),m.setAttributes=c(),m.insert=o().bind(null,"head"),m.domAPI=n(),m.insertStyleElement=M(),h()(p.A,m),p.A&&p.A.locals&&p.A.locals},4078:(t,s,i)=>{i.d(s,{kz:()=>r});var a=i(5286),h=i(3407),e=i(3158);let n=null;function r(t){n=t;const s=Object.keys(t.defs),i=s.length;let r,o;for(r=0;r{t.r(n),t.d(n,{default:()=>m});var o=t(6540);const r=JSON.parse('{"U$":{"yvL":{"rE":"5.3.3"},"Deh":{"rE":"10.0.0"},"N69":{"rE":"2.11.0"},"JDG":{"rE":"18.3.1"}}}'),l=r.U$.JDG.rE,s=r.U$.Deh.rE,a=r.U$.yvL.rE,i=r.U$.N69.rE,p=e=>e.replace(/\//g,".").replace(/rlayers\.style/g,"rlayers.RStyle").replace(/rlayers\.control/g,"rlayers.RControl").replace(/rlayers\.interaction/g,"rlayers.RInteraction").replace(/react/g,"React"),m=o.memo((function(e){const[n,t]=o.useState("loading()");o.useEffect((()=>{e.text.then((e=>{let n;const o=[];let r=/import .*\{([A-Za-z,\s\n]+)\}.* from '(.*)'/g;for(;null!==(n=r.exec(e));){const e=n[1].replace(/\s/g,"").replace(/\n/g,"").split(","),t=p(n[2]);for(const n of e)o.push({from:n,to:`${t}.${n}`})}for(r=/import ([A-Za-z]+) from '(ol.*)'/g;null!==(n=r.exec(e));){const e=p(n[2]);o.push({from:n[1],to:e})}for(r=/import ([A-Za-z]+) from '(.*\.svg)'/g;null!==(n=r.exec(e));){const e=`'https://cdn.jsdelivr.net/npm/rlayers/examples/${n[2]}'`;o.push({from:n[1],to:e})}e=(e=(e=e.replace(/import [^;]+;\n/g,"")).replace(/^\n+/,"")).replace(/export default function (.*)/,"function Comp() {"),e+="\nReactDOM.createRoot(document.getElementById('root')).render();\n",o.length>0&&(e="\n"+e);for(const n of o.reverse())e=`const ${n.from} = ${n.to};\n`+e;t(e)}))}),[e.text]);const r=o.useRef();return n&&n.match(/in CodePen/)?null:o.createElement("form",{className:"position-absolute my-2 mx-4",style:{top:"0px",right:"0px"},ref:r,action:"https://codepen.io/pen/define",method:"POST",target:"_blank"},o.createElement("input",{type:"hidden",name:"data",value:JSON.stringify({title:"rlayers "+e.title,description:"This is an editable example from rlayers - https://mmomtchev.githb.io/rlayers",tags:["openlayers","react","maps","rlayers"],html:'
    \n
    \n
    \n
    ',js:n,js_pre_processor:"typescript",css:".example-map p,\n.jumbotron p {\n margin: 0;\n padding: 0;\n}\n\n.example-map {\n width: 100%;\n height: 60vh;\n margin-bottom: 1em;\n}\n\n.no-interaction {\n user-select: none;\n pointer-events: none;\n}\n\n.example-overlay {\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n user-select: none;\n pointer-events: none;\n position: absolute;\n width: max-content;\n background-color: white;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n padding: 15px;\n border-radius: 10px;\n border: 1px solid #cccccc;\n}\n\n.example-control {\n top: 2.5em;\n right: 0.5em;\n}\n\n.example-list {\n width: 150px;\n max-width: 150px;\n min-width: 150px;\n font-size: 0.7em;\n list-style: lower-latin;\n padding: 0;\n overflow: hidden;\n}\n\n.example-list ul {\n padding: 0;\n overflow: hidden;\n}\n\n.example-list li {\n font-style: italic;\n overflow: hidden;\n}\n\n.example-overview .ol-overviewmap-map {\n border: none !important;\n width: 300px !important;\n}\n\n.example-overview .ol-overviewmap-box {\n border: 2px solid blue;\n}\n\n.example-overview,\n.example-overview.ol-uncollapsible {\n bottom: auto !important;\n left: auto !important;\n right: 0 !important;\n top: 0 !important;\n}\n\n.example-overview:not(.ol-collapsed) button {\n bottom: auto !important;\n left: auto !important;\n right: 1px !important;\n top: 1px !important;\n}\n\n.example-fullscreen {\n top: 5em;\n right: 0.5em;\n}\n\n.fullscreen:-webkit-full-screen {\n height: 100%;\n margin: 0;\n}\n\n.fullscreen:-ms-fullscreen {\n height: 100%;\n}\n\n.fullscreen:fullscreen {\n height: 100%;\n}\n\n.fullscreen {\n margin-bottom: 10px;\n width: 100%;\n height: 400px;\n}\n\n.example-spinner {\n position: absolute;\n top: 40%;\n left: 40%;\n width: 20%;\n height: 20%;\n z-index: 1000;\n}\n\n.example-spinner>img {\n width: 100%;\n}\n",js_external:`https://cdn.jsdelivr.net/npm/bootstrap@${a}/dist/js/bootstrap.min.js;https://cdnjs.cloudflare.com/ajax/libs/react/${l}/umd/react.development.min.js;https://cdnjs.cloudflare.com/ajax/libs/react-dom/${l}/umd/react-dom.development.min.js;https://cdnjs.cloudflare.com/ajax/libs/proj4js/${i}/proj4.js;https://cdn.jsdelivr.net/npm/ol@v${s}/dist/ol.js;https://cdn.jsdelivr.net/npm/rlayers@3.1.0`,css_external:`https://cdn.jsdelivr.net/npm/ol@v${s}/ol.css;https://cdn.jsdelivr.net/npm/bootstrap@${a}/dist/css/bootstrap.min.css`})}),o.createElement("button",{className:"btn border mb-2 bg-light",onClick:()=>{r.current.submit()}},o.createElement("span",{className:"me-2 align-middle"},"Edit on"),o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 138 26",height:"24px",fill:"none",stroke:"#000",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round"},o.createElement("path",{d:"M80 6h-9v14h9 M114 6h-9 v14h9 M111 13h-6 M77 13h-6 M122 20V6l11 14V6 M22 16.7L33 24l11-7.3V9.3L33 2L22 9.3V16.7z M44 16.7L33 9.3l-11 7.4 M22 9.3l11 7.3 l11-7.3 M33 2v7.3 M33 16.7V24 M88 14h6c2.2 0 4-1.8 4-4s-1.8-4-4-4h-6v14 M15 8c-1.3-1.3-3-2-5-2c-4 0-7 3-7 7s3 7 7 7 c2 0 3.7-0.8 5-2 M64 13c0 4-3 7-7 7h-5V6h5C61 6 64 9 64 13z"}))))}))}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[6782],{6782:(e,n,t)=>{t.r(n),t.d(n,{default:()=>m});var o=t(6540);const r=JSON.parse('{"U$":{"yvL":{"rE":"5.3.3"},"Deh":{"rE":"10.2.0"},"N69":{"rE":"2.12.1"},"JDG":{"rE":"18.3.1"}}}'),l=r.U$.JDG.rE,s=r.U$.Deh.rE,a=r.U$.yvL.rE,i=r.U$.N69.rE,p=e=>e.replace(/\//g,".").replace(/rlayers\.style/g,"rlayers.RStyle").replace(/rlayers\.control/g,"rlayers.RControl").replace(/rlayers\.interaction/g,"rlayers.RInteraction").replace(/react/g,"React"),m=o.memo((function(e){const[n,t]=o.useState("loading()");o.useEffect((()=>{e.text.then((e=>{let n;const o=[];let r=/import .*\{([A-Za-z,\s\n]+)\}.* from '(.*)'/g;for(;null!==(n=r.exec(e));){const e=n[1].replace(/\s/g,"").replace(/\n/g,"").split(","),t=p(n[2]);for(const n of e)o.push({from:n,to:`${t}.${n}`})}for(r=/import ([A-Za-z]+) from '(ol.*)'/g;null!==(n=r.exec(e));){const e=p(n[2]);o.push({from:n[1],to:e})}for(r=/import ([A-Za-z]+) from '(.*\.svg)'/g;null!==(n=r.exec(e));){const e=`'https://cdn.jsdelivr.net/npm/rlayers/examples/${n[2]}'`;o.push({from:n[1],to:e})}e=(e=(e=e.replace(/import [^;]+;\n/g,"")).replace(/^\n+/,"")).replace(/export default function (.*)/,"function Comp() {"),e+="\nReactDOM.createRoot(document.getElementById('root')).render();\n",o.length>0&&(e="\n"+e);for(const n of o.reverse())e=`const ${n.from} = ${n.to};\n`+e;t(e)}))}),[e.text]);const r=o.useRef();return n&&n.match(/in CodePen/)?null:o.createElement("form",{className:"position-absolute my-2 mx-4",style:{top:"0px",right:"0px"},ref:r,action:"https://codepen.io/pen/define",method:"POST",target:"_blank"},o.createElement("input",{type:"hidden",name:"data",value:JSON.stringify({title:"rlayers "+e.title,description:"This is an editable example from rlayers - https://mmomtchev.githb.io/rlayers",tags:["openlayers","react","maps","rlayers"],html:'
    \n
    \n
    \n
    ',js:n,js_pre_processor:"typescript",css:".example-map p,\n.jumbotron p {\n margin: 0;\n padding: 0;\n}\n\n.example-map {\n width: 100%;\n height: 60vh;\n margin-bottom: 1em;\n}\n\n.no-interaction {\n user-select: none;\n pointer-events: none;\n}\n\n.example-overlay {\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n user-select: none;\n pointer-events: none;\n position: absolute;\n width: max-content;\n background-color: white;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n padding: 15px;\n border-radius: 10px;\n border: 1px solid #cccccc;\n}\n\n.example-control {\n top: 2.5em;\n right: 0.5em;\n}\n\n.example-list {\n width: 150px;\n max-width: 150px;\n min-width: 150px;\n font-size: 0.7em;\n list-style: lower-latin;\n padding: 0;\n overflow: hidden;\n}\n\n.example-list ul {\n padding: 0;\n overflow: hidden;\n}\n\n.example-list li {\n font-style: italic;\n overflow: hidden;\n}\n\n.example-overview .ol-overviewmap-map {\n border: none !important;\n width: 300px !important;\n}\n\n.example-overview .ol-overviewmap-box {\n border: 2px solid blue;\n}\n\n.example-overview,\n.example-overview.ol-uncollapsible {\n bottom: auto !important;\n left: auto !important;\n right: 0 !important;\n top: 0 !important;\n}\n\n.example-overview:not(.ol-collapsed) button {\n bottom: auto !important;\n left: auto !important;\n right: 1px !important;\n top: 1px !important;\n}\n\n.example-fullscreen {\n top: 5em;\n right: 0.5em;\n}\n\n.fullscreen:-webkit-full-screen {\n height: 100%;\n margin: 0;\n}\n\n.fullscreen:-ms-fullscreen {\n height: 100%;\n}\n\n.fullscreen:fullscreen {\n height: 100%;\n}\n\n.fullscreen {\n margin-bottom: 10px;\n width: 100%;\n height: 400px;\n}\n\n.example-spinner {\n position: absolute;\n top: 40%;\n left: 40%;\n width: 20%;\n height: 20%;\n z-index: 1000;\n}\n\n.example-spinner>img {\n width: 100%;\n}\n",js_external:`https://cdn.jsdelivr.net/npm/bootstrap@${a}/dist/js/bootstrap.min.js;https://cdnjs.cloudflare.com/ajax/libs/react/${l}/umd/react.development.min.js;https://cdnjs.cloudflare.com/ajax/libs/react-dom/${l}/umd/react-dom.development.min.js;https://cdnjs.cloudflare.com/ajax/libs/proj4js/${i}/proj4.js;https://cdn.jsdelivr.net/npm/ol@v${s}/dist/ol.js;https://cdn.jsdelivr.net/npm/rlayers@3.2.0`,css_external:`https://cdn.jsdelivr.net/npm/ol@v${s}/ol.css;https://cdn.jsdelivr.net/npm/bootstrap@${a}/dist/css/bootstrap.min.css`})}),o.createElement("button",{className:"btn border mb-2 bg-light",onClick:()=>{r.current.submit()}},o.createElement("span",{className:"me-2 align-middle"},"Edit on"),o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 138 26",height:"24px",fill:"none",stroke:"#000",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round"},o.createElement("path",{d:"M80 6h-9v14h9 M114 6h-9 v14h9 M111 13h-6 M77 13h-6 M122 20V6l11 14V6 M22 16.7L33 24l11-7.3V9.3L33 2L22 9.3V16.7z M44 16.7L33 9.3l-11 7.4 M22 9.3l11 7.3 l11-7.3 M33 2v7.3 M33 16.7V24 M88 14h6c2.2 0 4-1.8 4-4s-1.8-4-4-4h-6v14 M15 8c-1.3-1.3-3-2-5-2c-4 0-7 3-7 7s3 7 7 7 c2 0 3.7-0.8 5-2 M64 13c0 4-3 7-7 7h-5V6h5C61 6 64 9 64 13z"}))))}))}}]); \ No newline at end of file diff --git a/7158.bundle.js b/7158.bundle.js new file mode 100644 index 00000000..26661ca6 --- /dev/null +++ b/7158.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7158],{9303:(t,e,i)=>{i.d(e,{q:()=>g});const n="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,r={env:{RLAYERS_DEBUG:void 0}},o=(t,e,i,n)=>{"function"==typeof r.emitWarning?r.emitWarning(t,e,i,n):console.error(`[${i}] ${e}: ${t}`)};let a=globalThis.AbortController,l=globalThis.AbortSignal;if(void 0===a){l=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},a=class{constructor(){e()}signal=new l;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==r.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,o("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const h=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),c=t=>h(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?u:null:null;class u extends Array{constructor(t){super(t),this.fill(0)}}class d{heap;length;static#t=!1;static create(t){const e=c(t);if(!e)return[];d.#t=!0;const i=new d(t,e);return d.#t=!1,i}constructor(t,e){if(!d.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class g{#e;#i;#n;#s;#r;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#h;#c;#u;#d;#g;#_;#f;#p;#m;#x;#v;#y;#E;#T;#A;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#y,sizes:t.#x,keyMap:t.#h,keyList:t.#c,valList:t.#u,next:t.#d,prev:t.#g,get head(){return t.#_},get tail(){return t.#f},free:t.#p,isBackgroundFetch:e=>t.#S(e),backgroundFetch:(e,i,n,s)=>t.#C(e,i,n,s),moveToTail:e=>t.#R(e),indexes:e=>t.#w(e),rindexes:e=>t.#b(e),isStale:e=>t.#I(e)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#r}get memoMethod(){return this.#o}get dispose(){return this.#n}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:u,dispose:_,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:x=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:E,memoMethod:T,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:R,ignoreFetchAbort:w}=t;if(0!==e&&!h(e))throw new TypeError("max option must be a nonnegative integer");const b=e?c(e):Array;if(!b)throw new Error("invalid max value: "+e);if(this.#e=e,this.#i=x,this.maxEntrySize=v||this.#i,this.sizeCalculation=y,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==T&&"function"!=typeof T)throw new TypeError("memoMethod must be a function if defined");if(this.#o=T,void 0!==E&&"function"!=typeof E)throw new TypeError("fetchMethod must be a function if specified");if(this.#r=E,this.#T=!!E,this.#h=new Map,this.#c=new Array(e).fill(void 0),this.#u=new Array(e).fill(void 0),this.#d=new b(e),this.#g=new b(e),this.#_=0,this.#f=0,this.#p=d.create(e),this.#a=0,this.#l=0,"function"==typeof _&&(this.#n=_),"function"==typeof f?(this.#s=f,this.#m=[]):(this.#s=void 0,this.#m=void 0),this.#E=!!this.#n,this.#A=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!h(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!h(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=h(n)||0===n?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!h(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(0===this.#e&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!s.has(t))(t)&&(s.add(t),o("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,g))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#P(){const t=new u(this.#e),e=new u(this.#e);this.#y=t,this.#v=e,this.#M=(i,s,r=n.now())=>{if(e[i]=0!==s?r:0,t[i]=s,0!==s&&this.ttlAutopurge){const t=setTimeout((()=>{this.#I(i)&&this.#F(this.#c[i],"expire")}),s+1);t.unref&&t.unref()}},this.#D=i=>{e[i]=0!==t[i]?n.now():0},this.#O=(n,r)=>{if(t[r]){const o=t[r],a=e[r];if(!o||!a)return;n.ttl=o,n.start=a,n.now=i||s();const l=n.now-a;n.remainingTTL=o-l}};let i=0;const s=()=>{const t=n.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=n=>{const r=this.#h.get(n);if(void 0===r)return 0;const o=t[r],a=e[r];return o&&a?o-((i||s())-a):1/0},this.#I=n=>{const r=e[n],o=t[n];return!!o&&!!r&&(i||s())-r>o}}#D=()=>{};#O=()=>{};#M=()=>{};#I=()=>!1;#L(){const t=new u(this.#e);this.#l=0,this.#x=t,this.#k=e=>{this.#l-=t[e],t[e]=0},this.#N=(t,e,i,n)=>{if(this.#S(e))return 0;if(!h(i)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(i=n(e,t),!h(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.#G=(e,i,n)=>{if(t[e]=i,this.#i){const i=this.#i-t[e];for(;this.#l>i;)this.#z(!0)}this.#l+=t[e],n&&(n.entrySize=i,n.totalCalculatedSize=this.#l)}}#k=t=>{};#G=(t,e,i)=>{};#N=(t,e,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#f;this.#j(e)&&(!t&&this.#I(e)||(yield e),e!==this.#_);)e=this.#g[e]}*#b({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#_;this.#j(e)&&(!t&&this.#I(e)||(yield e),e!==this.#f);)e=this.#d[e]}#j(t){return void 0!==t&&this.#h.get(this.#c[t])===t}*entries(){for(const t of this.#w())void 0===this.#u[t]||void 0===this.#c[t]||this.#S(this.#u[t])||(yield[this.#c[t],this.#u[t]])}*rentries(){for(const t of this.#b())void 0===this.#u[t]||void 0===this.#c[t]||this.#S(this.#u[t])||(yield[this.#c[t],this.#u[t]])}*keys(){for(const t of this.#w()){const e=this.#c[t];void 0===e||this.#S(this.#u[t])||(yield e)}}*rkeys(){for(const t of this.#b()){const e=this.#c[t];void 0===e||this.#S(this.#u[t])||(yield e)}}*values(){for(const t of this.#w())void 0===this.#u[t]||this.#S(this.#u[t])||(yield this.#u[t])}*rvalues(){for(const t of this.#b())void 0===this.#u[t]||this.#S(this.#u[t])||(yield this.#u[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#w()){const n=this.#u[i],s=this.#S(n)?n.__staleWhileFetching:n;if(void 0!==s&&t(s,this.#c[i],this))return this.get(this.#c[i],e)}}forEach(t,e=this){for(const i of this.#w()){const n=this.#u[i],s=this.#S(n)?n.__staleWhileFetching:n;void 0!==s&&t.call(e,s,this.#c[i],this)}}rforEach(t,e=this){for(const i of this.#b()){const n=this.#u[i],s=this.#S(n)?n.__staleWhileFetching:n;void 0!==s&&t.call(e,s,this.#c[i],this)}}purgeStale(){let t=!1;for(const e of this.#b({allowStale:!0}))this.#I(e)&&(this.#F(this.#c[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const i=this.#u[e],s=this.#S(i)?i.__staleWhileFetching:i;if(void 0===s)return;const r={value:s};if(this.#y&&this.#v){const t=this.#y[e],i=this.#v[e];if(t&&i){const e=t-(n.now()-i);r.ttl=e,r.start=Date.now()}}return this.#x&&(r.size=this.#x[e]),r}dump(){const t=[];for(const e of this.#w({allowStale:!0})){const i=this.#c[e],s=this.#u[e],r=this.#S(s)?s.__staleWhileFetching:s;if(void 0===r||void 0===i)continue;const o={value:r};if(this.#y&&this.#v){o.ttl=this.#y[e];const t=n.now()-this.#v[e];o.start=Math.floor(Date.now()-t)}this.#x&&(o.size=this.#x[e]),t.unshift([i,o])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=n.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:s,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:l=this.noUpdateTTL}=i;const h=this.#N(t,e,i.size||0,o);if(this.maxEntrySize&&h>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#F(t,"set"),this;let c=0===this.#a?void 0:this.#h.get(t);if(void 0===c)c=0===this.#a?this.#f:0!==this.#p.length?this.#p.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#c[c]=t,this.#u[c]=e,this.#h.set(t,c),this.#d[this.#f]=c,this.#g[c]=this.#f,this.#f=c,this.#a++,this.#G(c,h,a),a&&(a.set="add"),l=!1;else{this.#R(c);const i=this.#u[c];if(e!==i){if(this.#T&&this.#S(i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;void 0===e||r||(this.#E&&this.#n?.(e,t,"set"),this.#A&&this.#m?.push([e,t,"set"]))}else r||(this.#E&&this.#n?.(i,t,"set"),this.#A&&this.#m?.push([i,t,"set"]));if(this.#k(c),this.#G(c,h,a),this.#u[c]=e,a){a.set="replace";const t=i&&this.#S(i)?i.__staleWhileFetching:i;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#y||this.#P(),this.#y&&(l||this.#M(c,n,s),a&&this.#O(a,c)),!r&&this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#a;){const t=this.#u[this.#_];if(this.#z(!0),this.#S(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#z(t){const e=this.#_,i=this.#c[e],n=this.#u[e];return this.#T&&this.#S(n)?n.__abortController.abort(new Error("evicted")):(this.#E||this.#A)&&(this.#E&&this.#n?.(n,i,"evict"),this.#A&&this.#m?.push([n,i,"evict"])),this.#k(e),t&&(this.#c[e]=void 0,this.#u[e]=void 0,this.#p.push(e)),1===this.#a?(this.#_=this.#f=0,this.#p.length=0):this.#_=this.#d[e],this.#h.delete(i),this.#a--,e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=e,s=this.#h.get(t);if(void 0!==s){const t=this.#u[s];if(this.#S(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#I(s))return i&&this.#D(s),n&&(n.has="hit",this.#O(n,s)),!0;n&&(n.has="stale",this.#O(n,s))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!i&&this.#I(n))return;const s=this.#u[n];return this.#S(s)?s.__staleWhileFetching:s}#C(t,e,i,n){const s=void 0===e?void 0:this.#u[e];if(this.#S(s))return s;const r=new a,{signal:o}=i;o?.addEventListener("abort",(()=>r.abort(o.reason)),{signal:r.signal});const l={signal:r.signal,options:i,context:n},h=(n,s=!1)=>{const{aborted:o}=r.signal,a=i.ignoreFetchAbort&&void 0!==n;if(i.status&&(o&&!s?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,a&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),o&&!a&&!s)return c(r.signal.reason);const h=u;return this.#u[e]===u&&(void 0===n?h.__staleWhileFetching?this.#u[e]=h.__staleWhileFetching:this.#F(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,n,l.options))),n},c=n=>{const{aborted:s}=r.signal,o=s&&i.allowStaleOnFetchAbort,a=o||i.allowStaleOnFetchRejection,l=a||i.noDeleteOnFetchRejection,h=u;if(this.#u[e]===u&&(l&&void 0!==h.__staleWhileFetching?o||(this.#u[e]=h.__staleWhileFetching):this.#F(t,"fetch")),a)return i.status&&void 0!==h.__staleWhileFetching&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw n};i.status&&(i.status.fetchDispatched=!0);const u=new Promise(((e,n)=>{const o=this.#r?.(t,s,l);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),n),r.signal.addEventListener("abort",(()=>{i.ignoreFetchAbort&&!i.allowStaleOnFetchAbort||(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>h(t,!0)))}))})).then(h,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),c(t)))),d=Object.assign(u,{__abortController:r,__staleWhileFetching:s,__returned:void 0});return void 0===e?(this.set(t,d,{...l.options,status:void 0}),e=this.#h.get(t)):this.#u[e]=d,d}#S(t){if(!this.#T)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof a}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:_,forceRefresh:f=!1,status:p,signal:m}=e;if(!this.#T)return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:p});const x={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:r,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:p,signal:m};let v=this.#h.get(t);if(void 0===v){p&&(p.fetch="miss");const e=this.#C(t,v,x,_);return e.__returned=e}{const e=this.#u[v];if(this.#S(e)){const t=i&&void 0!==e.__staleWhileFetching;return p&&(p.fetch="inflight",t&&(p.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const s=this.#I(v);if(!f&&!s)return p&&(p.fetch="hit"),this.#R(v),n&&this.#D(v),p&&this.#O(p,v),e;const r=this.#C(t,v,x,_),o=void 0!==r.__staleWhileFetching&&i;return p&&(p.fetch=s?"stale":"refresh",o&&s&&(p.returnedStale=!0)),o?r.__staleWhileFetching:r.__returned=r}}async forceFetch(t,e={}){const i=await this.fetch(t,e);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(t,e={}){const i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:s,...r}=e,o=this.get(t,r);if(!s&&void 0!==o)return o;const a=i(t,o,{options:r,context:n});return this.set(t,a,r),a}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:r}=e,o=this.#h.get(t);if(void 0!==o){const e=this.#u[o],a=this.#S(e);return r&&this.#O(r,o),this.#I(o)?(r&&(r.get="stale"),a?(r&&i&&void 0!==e.__staleWhileFetching&&(r.returnedStale=!0),i?e.__staleWhileFetching:void 0):(s||this.#F(t,"expire"),r&&i&&(r.returnedStale=!0),i?e:void 0)):(r&&(r.get="hit"),a?e.__staleWhileFetching:(this.#R(o),n&&this.#D(o),e))}r&&(r.get="miss")}#B(t,e){this.#g[e]=t,this.#d[t]=e}#R(t){t!==this.#f&&(t===this.#_?this.#_=this.#d[t]:this.#B(this.#g[t],this.#d[t]),this.#B(this.#f,t),this.#f=t)}delete(t){return this.#F(t,"delete")}#F(t,e){let i=!1;if(0!==this.#a){const n=this.#h.get(t);if(void 0!==n)if(i=!0,1===this.#a)this.#U(e);else{this.#k(n);const i=this.#u[n];if(this.#S(i)?i.__abortController.abort(new Error("deleted")):(this.#E||this.#A)&&(this.#E&&this.#n?.(i,t,e),this.#A&&this.#m?.push([i,t,e])),this.#h.delete(t),this.#c[n]=void 0,this.#u[n]=void 0,n===this.#f)this.#f=this.#g[n];else if(n===this.#_)this.#_=this.#d[n];else{const t=this.#g[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#g[e]=this.#g[n]}this.#a--,this.#p.push(n)}}if(this.#A&&this.#m?.length){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}return i}clear(){return this.#U("delete")}#U(t){for(const e of this.#b({allowStale:!0})){const i=this.#u[e];if(this.#S(i))i.__abortController.abort(new Error("deleted"));else{const n=this.#c[e];this.#E&&this.#n?.(i,n,t),this.#A&&this.#m?.push([i,n,t])}}if(this.#h.clear(),this.#u.fill(void 0),this.#c.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#x&&this.#x.fill(0),this.#_=0,this.#f=0,this.#p.length=0,this.#l=0,this.#a=0,this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}}}},71:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(4120),s=i(2135),r=i(1685);const o="length";class a extends r.Ay{constructor(t,e,i){super(t),this.element=e,this.index=i}}class l extends n.A{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let t=0,e=this.array_.length;t0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new a(s.A.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new a(s.A.REMOVE,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new a(s.A.REMOVE,i,t)),this.dispatchEvent(new a(s.A.ADD,e,t))}updateLength_(){this.set(o,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i{i.d(e,{A:()=>n});const n={ADD:"add",REMOVE:"remove"}},7607:(t,e,i)=>{i.d(e,{$r:()=>c,Ay:()=>g,bL:()=>a,xo:()=>o});var n=i(8143),s=i(1078),r=i(8711);function o(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function a(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const l=new Error("disposed");let h=null;function c(t){h||(h=(0,r.Y)(t.width,t.height,void 0,{willReadFrequently:!0}));const e=h.canvas,i=t.width;e.width!==i&&(e.width=i);const n=t.height;return e.height!==n&&(e.height=n),h.clearRect(0,0,i,n),h.drawImage(t,0,0),h.getImageData(0,0,i,n).data}const u=[256,256];class d extends n.A{constructor(t){const e=s.A.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=o(this.data_);return t?[t.width,t.height]:u}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==s.A.IDLE&&this.state!==s.A.ERROR)return;this.state=s.A.LOADING,this.changed();const t=this;this.loader_().then((function(e){t.data_=e,t.state=s.A.LOADED,t.changed()})).catch((function(e){t.error_=e,t.state=s.A.ERROR,t.changed()}))}disposeInternal(){this.controller_&&(this.controller_.abort(l),this.controller_=null),super.disposeInternal()}}const g=d},25:(t,e,i)=>{i.d(e,{A:()=>n});const n=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}},6717:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(4120),s=i(6837),r=i(588),o=i(9438);class a extends n.A{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new a(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&((0,o.JH)(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=(0,o.KT)(t,s.A.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;let e;return Array.isArray(t)?e=t:((0,r.v)("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}const l=a},5213:(t,e,i)=>{i.d(e,{A:()=>y});var n=i(1685),s=i(4120),r=i(1064),o=i(3407),a=i(1597);const l="accuracy",h="accuracyGeometry",c="altitude",u="altitudeAccuracy",d="heading",g="position",_="projection",f="speed",p="tracking",m="trackingOptions";class x extends n.Ay{constructor(t){super("error"),this.code=t.code,this.message=t.message}}class v extends s.A{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.position_=null,this.transform_=o.R6,this.watchId_=void 0,this.addChangeListener(_,this.handleProjectionChanged_),this.addChangeListener(p,this.handleTrackingChanged_),void 0!==t.projection&&this.setProjection(t.projection),void 0!==t.trackingOptions&&this.setTrackingOptions(t.trackingOptions),this.setTracking(void 0!==t.tracking&&t.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const t=this.getProjection();t&&(this.transform_=(0,o.FO)((0,o.Jt)("EPSG:4326"),t),this.position_&&this.set(g,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(t){const e=t.coords;this.set(l,e.accuracy),this.set(c,null===e.altitude?void 0:e.altitude),this.set(u,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(d,null===e.heading?void 0:(0,a.eh)(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];const i=this.transform_(this.position_);this.set(g,i.slice()),this.set(f,null===e.speed?void 0:e.speed);const n=(0,r.kj)(this.position_,e.accuracy);n.applyTransform(this.transform_),this.set(h,n),this.changed()}positionError_(t){this.dispatchEvent(new x(t))}getAccuracy(){return this.get(l)}getAccuracyGeometry(){return this.get(h)||null}getAltitude(){return this.get(c)}getAltitudeAccuracy(){return this.get(u)}getHeading(){return this.get(d)}getPosition(){return this.get(g)}getProjection(){return this.get(_)}getSpeed(){return this.get(f)}getTracking(){return this.get(p)}getTrackingOptions(){return this.get(m)}setProjection(t){this.set(_,(0,o.Jt)(t))}setTracking(t){this.set(p,t)}setTrackingOptions(t){this.set(m,t)}}const y=v},3938:(t,e,i)=>{i.d(e,{Ay:()=>g,D4:()=>d,RA:()=>u,f6:()=>c});var n=i(9332),s=i(6837),r=i(6141),o=i(7771),a=i(9438),l=i(4238);class h extends n.A{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state="function"==typeof n?r.A.IDLE:n,this.image_=null,this.loader="function"==typeof n?n:null}changed(){this.dispatchEvent(s.A.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==r.A.IDLE&&this.loader){this.state=r.A.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;(0,l.hq)((()=>this.loader(this.getExtent(),e,this.getPixelRatio()))).then((t=>{"image"in t&&(this.image_=t.image),"extent"in t&&(this.extent=t.extent),"resolution"in t&&(this.resolution=t.resolution),"pixelRatio"in t&&(this.pixelRatio_=t.pixelRatio),(t instanceof HTMLImageElement||t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement)&&(this.image_=t),this.state=r.A.LOADED})).catch((t=>{this.state=r.A.ERROR,console.error(t)})).finally((()=>this.changed()))}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function c(t,e,i){const n=t;let r=!0,l=!1,h=!1;const c=[(0,a.Jz)(n,s.A.LOAD,(function(){h=!0,l||e()}))];return n.src&&o.DT?(l=!0,n.decode().then((function(){r&&e()})).catch((function(t){r&&(h?e():i())}))):c.push((0,a.Jz)(n,s.A.ERROR,i)),function(){r=!1,c.forEach(a.JH)}}function u(t,e){return e&&(t.src=e),t.src&&o.DT?new Promise(((e,i)=>t.decode().then((()=>e(t))).catch((n=>t.complete&&t.width?e(t):i(n))))):function(t){return new Promise(((e,i)=>{function n(){r(),e(t)}function s(){r(),i(new Error("Image load error"))}function r(){t.removeEventListener("load",n),t.removeEventListener("error",s)}t.addEventListener("load",n),t.addEventListener("error",s)}))}(t)}function d(t,e){return e&&(t.src=e),t.src&&o.DT&&o.XM?t.decode().then((()=>createImageBitmap(t))).catch((e=>{if(t.complete&&t.width)return t;throw e})):u(t)}const g=h},6141:(t,e,i)=>{i.d(e,{A:()=>n});const n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},190:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(8143),s=i(1078),r=i(8711),o=i(3938);class a extends n.A{constructor(t,e,i,n,s,r){super(t,e,r),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=s.A.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=s.A.ERROR,this.unlistenImage_(),this.image_=function(){const t=(0,r.Y)(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=s.A.LOADED:this.state=s.A.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==s.A.ERROR&&(this.state=s.A.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==s.A.IDLE&&(this.state=s.A.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=(0,o.f6)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}const l=a},6679:(t,e,i)=>{i.d(e,{A:()=>dt});var n=i(4120),s=i(71),r=i(2135),o=i(2284),a=i(25),l=i(4238),h=i(4087),c=i(9703),u=i(915),d=i(2241),g=i(764),_=i(6933);class f extends a.A{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){(0,h.b0)()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;(0,c.Zz)(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),(0,c.T9)(n,i)}forEachFeatureAtCoordinate(t,e,i,n,s,r,o,a){let l;const h=e.viewState;function c(t,e,i,n){return s.call(r,e,t?i:null,n)}const d=h.projection,f=(0,_.Li)(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&n){const t=d.getExtent(),e=(0,u.RG)(t);p.push([-e,0],[e,0])}const m=e.layerStatesArray,x=m.length,v=[],y=[];for(let n=0;n=0;--s){const r=m[s],u=r.layer;if(u.hasRenderer()&&(0,g.l)(r,h)&&o.call(a,u)){const s=u.getRenderer(),o=u.getSource();if(s&&o){const a=o.getWrapX()?f:t,h=c.bind(null,r.managed);y[0]=a[0]+p[n][0],y[1]=a[1]+p[n][1],l=s.forEachFeatureAtCoordinate(y,e,i,h,v)}if(l)return l}}if(0===v.length)return;const E=1/v.length;return v.forEach(((t,e)=>t.distanceSq+=e*E)),v.sort(((t,e)=>t.distanceSq-e.distanceSq)),v.some((t=>l=t.callback(t.feature,t.layer,t.geometry))),l}hasFeatureAtCoordinate(t,e,i,n,s,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,l.rT,this,s,r)}getMap(){return this.map_}renderFrame(t){(0,h.b0)()}scheduleExpireIconCache(t){d.ue.canExpireCache()&&t.postRenderFunctions.push(p)}}function p(t,e){d.ue.expire()}const m=f;var x=i(8450),v=i(9960),y=i(3984),E=i(5176),T=i(8774),A=i(9438),S=i(8711);const C=class extends m{constructor(t){super(t),this.fontChangeListenerKey_=(0,A.KT)(T.yY,x.A.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=E.XI+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new v.A(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){(0,A.JH)(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent(y.A.PRECOMPOSE,t);const e=t.layerStatesArray.sort(((t,e)=>t.zIndex-e.zIndex));e.some((t=>t.layer instanceof o.A&&t.layer.getDeclutter()))&&(t.declutter={});const i=t.viewState;this.children_.length=0;const n=[];let s=null;for(let r=0,o=e.length;r=0;--i){const n=e[i],s=n.layer;s.getDeclutter()&&s.renderDeclutter(t,n)}e.forEach((e=>e.layer.renderDeferred(t)))}}};var R=i(6837),w=i(5598),b=i(277),I=i(3445),L=i(613),P=i(9332),M=i(7771);class F extends P.A{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=(0,A.KT)(i,L.A.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=(0,A.KT)(i,L.A.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(R.A.TOUCHMOVE,this.boundHandleTouchMove_,!!M.FT&&{passive:!1})}emulateClick_(t){let e=new b.A(I.A.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new b.A(I.A.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=void 0;const e=new b.A(I.A.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==I.A.POINTERUP||e.type==I.A.POINTERCANCEL){delete this.trackedTouches_[i];for(const t in this.trackedTouches_)if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}else e.type!=I.A.POINTERDOWN&&e.type!=I.A.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new b.A(I.A.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(A.JH),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new b.A(I.A.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push((0,A.KT)(t,I.A.POINTERMOVE,this.handlePointerMove_,this),(0,A.KT)(t,I.A.POINTERUP,this.handlePointerUp_,this),(0,A.KT)(this.element_,I.A.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push((0,A.KT)(this.element_.getRootNode(),I.A.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new b.A(I.A.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new b.A(I.A.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&((0,A.JH)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(R.A.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&((0,A.JH)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(A.JH),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const D=F;var O=i(5801),k=i(2585),N=i(3116),G=i(588),z=i(3530);const j=1/0,B=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,(0,z.I)(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){(0,G.v)(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=j&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,s=e[t],r=i[t],o=t;for(;t>1;){const s=this.getLeftChildIndex_(t),r=this.getRightChildIndex_(t),o=rt;){const t=this.getParentIndex_(e);if(!(n[t]>r))break;i[e]=i[t],n[e]=n[t],e=t}i[e]=s,n[e]=r}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const s=e.length;let r,o,a;for(o=0;o0;){const t=this.dequeue()[0],e=t.getKey();t.getState()!==U.A.IDLE||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}};var W=i(3568),Y=i(2703),Z=i(7456),V=i(2898),H=i(9186),K=i(6068),q=i(4473),$=i(4051),J=i(4423),Q=i(9888),tt=i(6856);const et=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const s=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,s),this.initialVelocity_=Math.sqrt(s*s+r*r)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}};var it=i(8751),nt=i(3711),st=i(5243),rt=i(6514),ot=i(3407),at=i(4401),lt=i(4422);function ht(t){t instanceof g.A?t.setMapInternal(null):t instanceof w.A&&t.getLayers().forEach(ht)}function ct(t,e){if(t instanceof g.A)t.setMapInternal(e);else if(t instanceof w.A){const i=t.getLayers().getArray();for(let t=0,n=i.length;tthis.updateSize())),this.controls=e.controls||function(t){t=t||{};const e=new s.A;return(void 0===t.zoom||t.zoom)&&e.push(new H.A(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&e.push(new V.A(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&e.push(new Z.A(t.attributionOptions)),e}(),this.interactions=e.interactions||function(t){t=t||{};const e=new s.A,i=new et(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new $.A),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new K.A({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&e.push(new q.A({onFocusOnly:t.onFocusOnly,kinetic:i})),(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new nt.A),(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new st.A({duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(e.push(new Q.A),e.push(new tt.A({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new it.A({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new J.A({duration:t.zoomDuration})),e}({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new X(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(N.A.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(N.A.VIEW,this.handleViewChanged_),this.addChangeListener(N.A.SIZE,this.handleSizeChanged_),this.addChangeListener(N.A.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;!t.view||t.view instanceof W.Ay||t.view.then((function(t){i.setView(new W.Ay(t))})),this.controls.addEventListener(r.A.ADD,(t=>{t.element.setMap(this)})),this.controls.addEventListener(r.A.REMOVE,(t=>{t.element.setMap(null)})),this.interactions.addEventListener(r.A.ADD,(t=>{t.element.setMap(this)})),this.interactions.addEventListener(r.A.REMOVE,(t=>{t.element.setMap(null)})),this.overlays_.addEventListener(r.A.ADD,(t=>{this.addOverlayInternal_(t.element)})),this.overlays_.addEventListener(r.A.REMOVE,(t=>{const e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)})),this.controls.forEach((t=>{t.setMap(this)})),this.interactions.forEach((t=>{t.setMap(this)})),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){ct(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t),s=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:l.rT,o=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,s,o,e,null,r,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i}getAllLayers(){const t=[];return function e(i){i.forEach((function(i){i instanceof w.A?e(i.getLayers()):t.push(i)}))}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:l.rT,s=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,r,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const e=this.viewport_.getBoundingClientRect(),i=this.getSize(),n=e.width/i[0],s=e.height/i[1],r="changedTouches"in t?t.changedTouches[0]:t;return[(r.clientX-e.left)/n,(r.clientY-e.top)/s]}getTarget(){return this.get(N.A.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return(0,ot.te)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?(0,c.Bb)(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(N.A.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof s.A)return void e.setLayers(t);const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;i--){const n=e[i];if(n.getMap()===this&&n.getActive()&&this.getTargetElement()&&(!n.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,n=i;if(t){const e=t.viewHints;if(e[Y.A.ANIMATING]||e[Y.A.INTERACTING]){const e=Date.now()-t.time>8;i=e?0:8,n=e?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()}),0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new w.i("removelayer",e)),this.set(N.A.LAYERGROUP,t)}setSize(t){this.set(N.A.SIZE,t)}setTarget(t){this.set(N.A.TARGET,t)}setView(t){if(!t||t instanceof W.Ay)return void this.set(N.A.VIEW,t);this.set(N.A.VIEW,new W.Ay);const e=this;t.then((function(t){e.setView(new W.Ay(t))}))}updateSize(){const t=this.getTargetElement();let e;if(t){const i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),s=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(s)||(e=[Math.max(0,n),Math.max(0,s)],!(0,at.Ie)(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&(0,lt.R8)("No map visible because the map container's width or height are 0."))}const i=this.getSize();!e||i&&(0,rt.aI)(e,i)||(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}const dt=ut},277:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(5801);class s extends n.A{constructor(t,e,i,n,s,r){super(t,e,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=r}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const r=s},3445:(t,e,i)=>{i.d(e,{A:()=>s});var n=i(6837);const s={SINGLECLICK:"singleclick",CLICK:n.A.CLICK,DBLCLICK:n.A.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},5801:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(1685);class s extends n.Ay{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}}const r=s},2585:(t,e,i)=>{i.d(e,{A:()=>n});const n={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"}},3116:(t,e,i)=>{i.d(e,{A:()=>n});const n={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"}},4120:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(1685),s=i(8450),r=i(1854),o=i(4087),a=i(3530);class l extends n.Ay{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class h extends r.A{constructor(t){super(),this.on,this.once,this.un,(0,o.v6)(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new l(i,t,e)),i=s.A.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new l(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],(0,a.p)(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const c=h},8450:(t,e,i)=>{i.d(e,{A:()=>n});const n={PROPERTYCHANGE:"propertychange"}},1854:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(9332),s=i(6837),r=i(9438);class o extends n.A{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(s.A.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;s{i.d(e,{A:()=>f});var n=i(4120),s=i(2585),r=i(5176),o=i(915),a=i(9438),l=i(8711);const h="element",c="map",u="offset",d="position",g="positioning";class _ extends n.A{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container "+r.Q5,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(h,this.handleElementChanged),this.addChangeListener(c,this.handleMapChanged),this.addChangeListener(u,this.handleOffsetChanged),this.addChangeListener(d,this.handlePositionChanged),this.addChangeListener(g,this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get(h)}getId(){return this.id}getMap(){return this.get(c)||null}getOffset(){return this.get(u)}getPosition(){return this.get(d)}getPositioning(){return this.get(g)}handleElementChanged(){(0,l.gS)(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),(0,a.JH)(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=(0,a.KT)(t,s.A.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(h,t)}setMap(t){this.set(c,t)}setOffset(t){this.set(u,t)}setPosition(t){this.set(d,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(d))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),s=this.getRect(n,[(0,l.Gq)(n),(0,l.DK)(n)]),r=void 0===(t=t||{}).margin?20:t.margin;if(!(0,o.ms)(i,s)){const n=s[0]-i[0],o=i[2]-s[2],a=s[1]-i[1],l=i[3]-s[3],h=[0,0];if(n<0?h[0]=n-r:o<0&&(h[0]=Math.abs(o)+r),a<0?h[1]=a-r:l<0&&(h[1]=Math.abs(l)+r),0!==h[0]||0!==h[1]){const i=e.getView().getCenterInternal(),n=e.getPixelFromCoordinateInternal(i);if(!n)return;const s=[n[0]+h[0],n[1]+h[1]],r=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(s),duration:r.duration,easing:r.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,s=i.top+window.pageYOffset;return[n,s,n+e[0],s+e[1]]}setPositioning(t){this.set(g,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);const i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),s=this.getPositioning();this.setVisible(!0);let r="0%",o="0%";"bottom-right"==s||"center-right"==s||"top-right"==s?r="-100%":"bottom-center"!=s&&"center-center"!=s&&"top-center"!=s||(r="-50%"),"bottom-left"==s||"bottom-center"==s||"bottom-right"==s?o="-100%":"center-left"!=s&&"center-center"!=s&&"center-right"!=s||(o="-50%");const a=`translate(${r}, ${o}) translate(${Math.round(t[0]+n[0])+"px"}, ${Math.round(t[1]+n[1])+"px"})`;this.rendered.transform_!=a&&(this.rendered.transform_=a,i.transform=a)}getOptions(){return this.options}}const f=_},8143:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(9332),s=i(6837),r=i(1078),o=i(4087),a=i(3474);class l extends n.A{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(s.A.CHANGE)}release(){this.state===r.A.ERROR&&this.setState(r.A.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==r.A.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){(0,o.b0)()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;const n=e-i+1e3/60;return n>=this.transition_?1:(0,a.a6)(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}const h=l},61:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(4969),s=i(186);class r extends n.A{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(0===this.getCount())return;const t=this.peekFirstKey(),e=(0,s.K)(t)[0];this.forEach((t=>{t.tileCoord[0]!==e&&(this.remove((0,s.i7)(t.tileCoord)),t.release())}))}}const o=r},1110:(t,e,i)=>{i.d(e,{A:()=>r,N:()=>s});class n{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function s(t,e,i,s,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=s,r):new n(t,e,i,s)}const r=n},1078:(t,e,i)=>{i.d(e,{A:()=>n});const n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},8756:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(8143),s=i(1078);class r extends n.A{constructor(t,e,i,n,s,r){super(t,e,r),this.extent=null,this.format_=n,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==s.A.IDLE&&(this.setState(s.A.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(t,e){this.setFeatures(t)}onError(){this.setState(s.A.ERROR)}setFeatures(t){this.features_=t,this.setState(s.A.LOADED)}setLoader(t){this.loader_=t}}const o=r},3568:(t,e,i)=>{i.d(e,{Ay:()=>R});var n=i(4120),s=i(2703),r=i(9015),o=i(9496),a=i(3407),l=i(4238),h=i(6933),c=i(588),u=i(1597);function d(t,e,i){return function(n,s,r,o,a){if(!n)return;if(!s&&!e)return n;const l=e?0:r[0]*s,h=e?0:r[1]*s,c=a?a[0]:0,d=a?a[1]:0;let g=t[0]+l/2+c,_=t[2]-l/2+c,f=t[1]+h/2+d,p=t[3]-h/2+d;g>_&&(g=(_+g)/2,_=g),f>p&&(f=(p+f)/2,p=f);let m=(0,u.qE)(n[0],g,_),x=(0,u.qE)(n[1],f,p);if(o&&i&&s){const t=30*s;m+=-t*Math.log(1+Math.max(0,g-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-_)/t),x+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-p)/t)}return[m,x]}}function g(t){return t}var _=i(915),f=i(6514);function p(t,e,i,n){const s=(0,_.RG)(e)/i[0],r=(0,_.Oq)(e)/i[1];return n?Math.min(t,Math.max(s,r)):Math.min(t,Math.min(s,r))}function m(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),(0,u.qE)(n,i/2,2*e)}function x(t,e,i,n,s){return i=void 0===i||i,function(r,o,a,l){if(void 0!==r){const o=n?p(t,n,a,s):t;return i&&l?m(r,o,e):(0,u.qE)(r,e,o)}}}var v=i(4498),y=i(3474),E=i(1064);class T extends n.A{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=(0,a.Av)(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&(0,a.RJ)(),t.center&&(t.center=(0,a.Ad)(t.center,this.projection_)),t.extent&&(t.extent=(0,a.SD)(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in r.A)delete e[t];this.setProperties(e,!0);const i=function(t){let e,i,n;let s=void 0!==t.minZoom?t.minZoom:0,r=void 0!==t.maxZoom?t.maxZoom:28;const l=void 0!==t.zoomFactor?t.zoomFactor:2,h=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,g=(0,a.Av)(t.projection,"EPSG:3857"),v=g.getExtent();let y=t.constrainOnlyCenter,E=t.extent;if(h||E||!g.isGlobal()||(y=!1,E=v),void 0!==t.resolutions){const o=t.resolutions;i=o[s],n=void 0!==o[r]?o[r]:o[o.length-1],e=t.constrainResolution?function(t,e,i,n){return e=void 0===e||e,function(s,r,o,a){if(void 0!==s){const l=t[0],h=t[t.length-1],c=i?p(l,i,o,n):l;if(a)return e?m(s,c,h):(0,u.qE)(s,h,c);const d=Math.min(c,s),g=Math.floor((0,f.FT)(t,d,r));return t[g]>c&&g1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n0}getInteracting(){return this.hints_[s.A.INTERACTING]>0}cancelAnimations(){let t;this.setHint(s.A.ANIMATING,-this.hints_[s.A.ANIMATING]);for(let e=0,i=this.animations_.length;e=0;--i){const n=this.animations_[i];let r=!0;for(let i=0,s=n.length;i0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;const l=s.easing(a);if(s.sourceCenter){const t=s.sourceCenter[0],e=s.sourceCenter[1],i=s.targetCenter[0],n=s.targetCenter[1];this.nextCenter_=s.targetCenter;const r=t+l*(i-t),o=e+l*(n-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){const t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){const e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){const t=1===l?(0,u.xP)(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){const e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[i]=null,this.setHint(s.A.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=n[0].callback;t&&A(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return void 0!==n&&(i=[n[0]-e[0],n[1]-e[1]],(0,h.e$)(i,t-this.getRotation()),(0,h.WQ)(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),s=this.getResolution();return void 0!==n&&void 0!==s&&(i=[e[0]-t*(e[0]-n[0])/s,e[1]-t*(e[1]-n[1])/s]),i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t?(0,a.te)(t,this.getProjection()):t}getCenterInternal(){return this.get(r.A.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return(0,a.JR)(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();(0,c.v)(e,"The view center is not defined");const i=this.getResolution();(0,c.v)(void 0!==i,"The view resolution is not defined");const n=this.getRotation();return(0,c.v)(void 0!==n,"The view rotation is not defined"),(0,_.Bg)(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(r.A.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal((0,a.SD)(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=(0,_.RG)(t)/e[0],n=(0,_.Oq)(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(i){return e/Math.pow(t,i*n)}}getRotation(){return this.get(r.A.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const s=this.padding_;if(s){const t=this.getViewportSizeMinusPadding_();n=C(n,this.getViewportSize_(),[t[0]/2+s[3],t[1]/2+s[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){const s=(0,f.FT)(this.resolutions_,t,1);n=s,e=this.resolutions_[s],i=s==this.resolutions_.length-1?2:e/this.resolutions_[s+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];const e=(0,u.qE)(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,(0,u.qE)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if((0,c.v)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){(0,c.v)(!(0,_.Im)(t),"Cannot fit empty extent provided as `geometry`");const e=(0,a.SD)(t,this.getProjection());i=(0,E.VY)(e)}else if("Circle"===t.getType()){const e=(0,a.SD)(t.getExtent(),this.getProjection());i=(0,E.VY)(e),i.rotate(this.getRotation(),(0,_.q1)(e))}else{const e=(0,a.Tf)();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),s=t.getFlatCoordinates(),r=t.getStride();let o=1/0,a=1/0,l=-1/0,h=-1/0;for(let t=0,e=s.length;t{i.d(e,{A:()=>n});const n={ANIMATING:0,INTERACTING:1}},9015:(t,e,i)=>{i.d(e,{A:()=>n});const n={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"}},6514:(t,e,i)=>{function n(t,e,i){let n,r;i=i||s;let o=0,a=t.length,l=!1;for(;o>1),r=+i(t[n],e),r<0?o=n+1:(a=n,l=!r);return l?o:~o}function s(t,e){return t>e?1:te?-1:0}function o(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let s=1;s0?s-1:s}return n-1}if(i>0){for(let i=1;i0||i&&0===r)}))}i.d(e,{El:()=>n,FT:()=>o,V_:()=>s,WC:()=>c,X$:()=>l,aI:()=>h,gI:()=>a,rG:()=>r})},588:(t,e,i)=>{function n(t,e){if(!t)throw new Error(e)}i.d(e,{v:()=>n})},3730:(t,e,i)=>{i.d(e,{qV:()=>_,_j:()=>A,oJ:()=>f,sH:()=>T,cD:()=>E,S8:()=>S,eE:()=>y,dI:()=>C,fu:()=>v});const n={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var s={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};s.max=s.whitepoint[2].D65,s.rgb=function(t,e){e=e||s.whitepoint[2].E;var i,n,r,o=t[0]/e[0],a=t[1]/e[1],l=t[2]/e[2];return n=-.96924363628087*o+1.87596750150772*a+.041555057407175*l,r=.055630079696993*o+-.20397695888897*a+1.056971514242878*l,i=(i=3.240969941904521*o+-1.537383177570093*a+-.498610760293*l)>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*=12.92,[255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},n.xyz=function(t,e){var i=t[0]/255,n=t[1]/255,r=t[2]/255,o=.21263900587151*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.71516867876775*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.072192315360733*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92),a=.019330818715591*i+.11919477979462*n+.95053215224966*r;return[(.41239079926595*i+.35758433938387*n+.18048078840183*r)*(e=e||s.whitepoint[2].E)[0],o*e[1],a*e[2]]};const r=s,o={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,i){var n,s,o,a,l,h,c,u,d;return o=t[0],a=t[1],l=t[2],0===o?[0,0,0]:(e=e||"D65",i=i||2,n=a/(13*o)+4*(c=r.whitepoint[i][e][0])/(c+15*(u=r.whitepoint[i][e][1])+3*(d=r.whitepoint[i][e][2]))||0,s=l/(13*o)+9*u/(c+15*u+3*d)||0,[9*(h=o>8?u*Math.pow((o+16)/116,3):u*o*.0011070564598794539)*n/(4*s)||0,h,h*(12-3*n-20*s)/(4*s)||0])}};r.luv=function(t,e,i){var n,s,o,a,l,h,c,u,d,g,_;e=e||"D65",i=i||2,g=4*(c=r.whitepoint[i][e][0])/(c+15*(u=r.whitepoint[i][e][1])+3*(d=r.whitepoint[i][e][2])),_=9*u/(c+15*u+3*d),n=4*(a=t[0])/(a+15*(l=t[1])+3*(h=t[2]))||0,s=9*l/(a+15*l+3*h)||0;var f=l/u;return[o=f<=.008856451679035631?903.2962962962961*f:116*Math.pow(f,1/3)-16,13*o*(n-g),13*o*(s-_)]};var a={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},xyz:function(t){return o.xyz(a.luv(t))}};const l=a;o.lchuv=function(t){var e=t[0],i=t[1],n=t[2],s=Math.sqrt(i*i+n*n),r=360*Math.atan2(n,i)/2/Math.PI;return r<0&&(r+=360),[e,s,r]},r.lchuv=function(t){return o.lchuv(r.luv(t))};const h={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c=function(t){var e,i,n=[],s=1;if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),h[t])n=h[t].slice(),i="rgb";else if("transparent"===t)s=0,i="rgb",n=[0,0,0];else if("#"===t[0]){var r=t.slice(1),o=r.length;s=1,o<=4?(n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],4===o&&(s=parseInt(r[3]+r[3],16)/255)):(n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],8===o&&(s=parseInt(r[6]+r[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var a=e[1],l="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=n.shift()),s=(n=n.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]?100*t:"l"!==i[0]||e?"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t:100*t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==u[t])return u[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>l?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:n,alpha:s}};var u={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};const d={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,i,n,s,r,o=t[0]/360,a=t[1]/100,l=t[2]/100,h=0;if(0===a)return[r=255*l,r,r];for(e=2*l-(i=l<.5?l*(1+a):l+a-l*a),s=[0,0,0];h<3;)(n=o+1/3*-(h-1))<0?n++:n>1&&n--,r=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,s[h++]=255*r;return s}};n.hsl=function(t){var e,i,n=t[0]/255,s=t[1]/255,r=t[2]/255,o=Math.min(n,s,r),a=Math.max(n,s,r),l=a-o;return a===o?e=0:n===a?e=(s-r)/l:s===a?e=2+(r-n)/l:r===a&&(e=4+(n-s)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+a)/2,[e,100*(a===o?0:i<=.5?l/(a+o):l/(2-a-o)),100*i]};var g=i(1597);const _=[NaN,NaN,NaN,0];function f(t){return"string"==typeof t?t:C(t)}const p=1024,m={};let x=0;function v(t){if(4===t.length)return t;const e=t.slice();return e[3]=1,e}function y(t){const e=r.lchuv(n.xyz(t));return e[3]=t[3],e}function E(t){const e=r.rgb(l.xyz(t));return e[3]=t[3],e}function T(t){if("none"===t)return _;if(m.hasOwnProperty(t))return m[t];if(x>=p){let t=0;for(const e in m)3&t++||(delete m[e],--x)}const e=function(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var i=c(t);if(!i.space)return[];const s="h"===i.space[0]?d.min:n.min,r="h"===i.space[0]?d.max:n.max;return(e=Array(3))[0]=Math.min(Math.max(i.values[0],s[0]),r[0]),e[1]=Math.min(Math.max(i.values[1],s[1]),r[1]),e[2]=Math.min(Math.max(i.values[2],s[2]),r[2]),"h"===i.space[0]&&(e=d.rgb(e)),e.push(Math.min(Math.max(i.alpha,0),1)),e}(t);if(4!==e.length)throw new Error('failed to parse "'+t+'" as color');for(const i of e)if(isNaN(i))throw new Error('failed to parse "'+t+'" as color');return S(e),m[t]=e,++x,e}function A(t){return Array.isArray(t)?t:T(t)}function S(t){return t[0]=(0,g.qE)(t[0]+.5|0,0,255),t[1]=(0,g.qE)(t[1]+.5|0,0,255),t[2]=(0,g.qE)(t[2]+.5|0,0,255),t[3]=(0,g.qE)(t[3],0,1),t}function C(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}},7295:(t,e,i)=>{i.d(e,{F:()=>l});var n=i(6141),s=i(8711),r=i(7907),o=i(2241),a=i(3730);function l(t){return t?Array.isArray(t)?(0,a.dI)(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return o.ue.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,i=o.ue.getPattern(e,void 0,t.color);if(i)return i;const a=o.ue.get(t.src,"anonymous",null);if(a.getImageState()!==n.A.LOADED)return null;const l=(0,s.Y)(t.size[0],t.size[1]);return l.drawImage(a.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),(0,r.J)(l.canvas,e,void 0,n.A.LOADED,t.color,!0),o.ue.getPattern(e,void 0,t.color)}(t):t:null}},4422:(t,e,i)=>{i.d(e,{R8:()=>r,z3:()=>o});const n={info:1,warn:2,error:3,none:4};let s=n.info;function r(...t){s>n.warn||console.warn(...t)}function o(...t){s>n.error||console.error(...t)}},7456:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(972),s=i(6837),r=i(5176),o=i(6514),a=i(8711),l=i(4238);class h extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=void 0!==t.className?t.className:"ol-attribution",i=void 0!==t.tipLabel?t.tipLabel:"Attributions",n=void 0!==t.expandClassName?t.expandClassName:e+"-expand",o=void 0!==t.collapseLabel?t.collapseLabel:"›",a=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof o?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const l=void 0!==t.label?t.label:"i";"string"==typeof l?(this.label_=document.createElement("span"),this.label_.textContent=l,this.label_.className=n):this.label_=l;const h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(h),this.toggleButton_.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const c=e+" "+r.XI+" "+r.$N+(this.collapsed_&&this.collapsible_?" "+r.nT:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=c,u.appendChild(this.toggleButton_),u.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),i=new Set(e.flatMap((e=>e.getAttributions(t))));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach((t=>i.add(t))):i.add(this.attributions_)),!this.overrideCollapsible_){const t=!e.some((t=>!1===t.getSource()?.getAttributionsCollapsible()));this.setCollapsible(t)}return Array.from(i)}async updateElement_(t){if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=await Promise.all(this.collectSourceAttributions_(t).map((t=>(0,l.hq)((()=>t))))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!(0,o.aI)(e,this.renderedAttributions_)){(0,a.gS)(this.ulElement_);for(let t=0,i=e.length;t{i.d(e,{A:()=>l});var n=i(4120),s=i(2585),r=i(4238),o=i(9438);class a extends n.A{constructor(t){super();const e=t.element;!e||t.target||e.style.pointerEvents||(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let t=0,e=this.listenerKeys.length;t{i.d(e,{A:()=>_});var n=i(972),s=i(6837),r=i(3116),o=i(5176),a=i(9438),l=i(8711);const h=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"];class c extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=void 0!==t.keys&&t.keys,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=void 0!==t.className?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=void 0!==t.activeClassName?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=void 0!==t.inactiveClassName?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=void 0!==t.label?t.label:"⤢";this.labelNode_="string"==typeof e?document.createTextNode(e):e;const i=void 0!==t.labelActive?t.labelActive:"×";this.labelActiveNode_="string"==typeof i?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${o.XI} ${o.$N}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(u(e))if(d(e))!function(t){t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}(e);else{let i;i=this.source_?"string"==typeof this.source_?e.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():g(t)}(i):g(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=d(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?((0,l.fo)(this.labelActiveNode_,this.labelNode_),this.dispatchEvent("enterfullscreen")):((0,l.fo)(this.labelNode_,this.labelActiveNode_),this.dispatchEvent("leavefullscreen")),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(r.A.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(r.A.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,i=t.length;e{i.d(e,{A:()=>u});var n=i(972),s=i(613),r=i(3407),o=i(9438),a=i(6933);const l="projection",h="coordinateFormat";class c extends n.A{constructor(t){t=t||{};const e=document.createElement("div");e.className=void 0!==t.className?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(l,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=void 0!==t.placeholder,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=!1!==t.wrapX}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(h)}getProjection(){return this.get(l)}handleMouseMove(t){const e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){const e=t.getViewport();this.listenerKeys.push((0,o.KT)(e,s.A.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push((0,o.KT)(e,s.A.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(h,t)}setProjection(t){this.set(l,(0,r.Jt)(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){const t=this.getProjection();this.transform_=t?(0,r.FO)(this.mapProjection_,t):r.R6}const i=this.getMap().getCoordinateFromPixelInternal(t);if(i){const t=(0,r.Tf)();if(t&&(this.transform_=(0,r.FO)(this.mapProjection_,t)),this.transform_(i,i),this.wrapX_){const e=t||this.getProjection()||this.mapProjection_;(0,a.Li)(i,e)}const n=this.getCoordinateFormat();e=n?n(i):i.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){const e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}}const u=c},6950:(t,e,i)=>{i.d(e,{A:()=>v});var n=i(71),s=i(972),r=i(6837),o=i(6679),a=i(2585),l=i(3116),h=i(8450),c=i(1795),u=i(3568),d=i(9015),g=i(5176),_=i(915),f=i(9438),p=i(1064),m=i(8711);class x extends s.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=void 0===t.collapsed||t.collapsed,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=void 0!==t.rotateWithView&&t.rotateWithView,this.viewExtent_=void 0;const e=void 0!==t.className?t.className:"ol-overviewmap",i=void 0!==t.tipLabel?t.tipLabel:"Overview map",s=void 0!==t.collapseLabel?t.collapseLabel:"‹";"string"==typeof s?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const a=void 0!==t.label?t.label:"›";"string"==typeof a?(this.label_=document.createElement("span"),this.label_.textContent=a):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=i,h.appendChild(l),h.addEventListener(r.A.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view;const u=new o.A({view:t.view,controls:new n.A,interactions:new n.A});this.ovmap_=u,t.layers&&t.layers.forEach((function(t){u.addLayer(t)}));const d=document.createElement("div");d.className="ol-overviewmap-box",d.style.boxSizing="border-box",this.boxOverlay_=new c.A({position:[0,0],positioning:"center-center",element:d}),this.ovmap_.addOverlay(this.boxOverlay_);const _=e+" "+g.XI+" "+g.$N+(this.collapsed_&&this.collapsible_?" "+g.nT:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=_,f.appendChild(this.ovmapDiv_),f.appendChild(h);const p=this,m=this.boxOverlay_,x=this.boxOverlay_.getElement(),v=function(t){const e={clientX:(i=t).clientX,clientY:i.clientY};var i;const n=u.getEventCoordinate(e);m.setPosition(n)},y=function(t){const e=u.getEventCoordinateInternal(t);p.getMap().getView().setCenterInternal(e),window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",y)};this.ovmapDiv_.addEventListener("pointerdown",(function(){event.target===x&&window.addEventListener("pointermove",v),window.addEventListener("pointerup",y)}))}setMap(t){const e=this.getMap();if(t!==e){if(e){const t=e.getView();t&&this.unbindView_(t),this.ovmap_.setTarget(null)}if(super.setMap(t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push((0,f.KT)(t,h.A.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const e=t.getView();e&&this.bindView_(e),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===l.A.VIEW){const e=t.oldValue;e&&this.unbindView_(e);const i=this.getMap().getView();this.bindView_(i)}else this.ovmap_.isRendered()||t.key!==l.A.TARGET&&t.key!==l.A.SIZE||this.ovmap_.updateSize()}bindView_(t){if(!this.view_){const e=new u.Ay({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(d.A.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),t.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(t){t.removeChangeListener(d.A.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView().calculateExtentInternal(i);if(this.viewExtent_&&(0,_.aI)(n,this.viewExtent_))return;this.viewExtent_=n;const s=e.getSize(),r=e.getView().calculateExtentInternal(s),o=e.getPixelFromCoordinateInternal((0,_.Py)(n)),a=e.getPixelFromCoordinateInternal((0,_.k_)(n)),l=Math.abs(o[0]-a[0]),h=Math.abs(o[1]-a[1]),c=s[0],u=s[1];l<.1*c||h<.1*u||l>.75*c||h>.75*u?this.resetExtent_():(0,_.ms)(r,n)||this.recenter_()}resetExtent_(){const t=this.getMap(),e=this.ovmap_,i=t.getSize(),n=t.getView().calculateExtentInternal(i),s=e.getView(),r=Math.log(7.5)/Math.LN2,o=1/(.1*Math.pow(2,r/2));(0,_.Af)(n,o),s.fitInternal((0,p.VY)(n))}recenter_(){const t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView(),s=e.getView(),r=this.rotateWithView_?0:-n.getRotation(),o=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=n.getCenter(),h=n.getResolution(),c=s.getResolution(),u=i[0]*h/c,d=i[1]*h/c;if(o.setPosition(l),a){a.style.width=u+"px",a.style.height=d+"px";const t="rotate("+r+"rad)";a.style.transform=t}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=(0,f.Jz)(this.ovmap_,a.A.POSTRENDER,(t=>{delete this.ovmapPostrenderKey_,this.updateBox_()})))}handleClick_(t){t.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(g.nT),this.collapsed_?(0,m.fo)(this.collapseLabel_,this.label_):(0,m.fo)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())}setCollapsed(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(t){this.validateExtent_(),this.updateBox_()}}const v=x},2898:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(972),s=i(6837),r=i(5176),o=i(3474);class a extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",i=void 0!==t.label?t.label:"⇧",n=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof i?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const l=e+" "+r.XI+" "+r.$N,h=this.element;h.className=l,h.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(r.Si)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:o.vT}):t.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const t="rotate("+i+"rad)";if(this.autoHide_){const t=this.element.classList.contains(r.Si);t||0!==i?t&&0!==i&&this.element.classList.remove(r.Si):this.element.classList.add(r.Si)}this.label_.style.transform=t}this.rotation_=i}}const l=a},3965:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(972),s=i(5176),r=i(3407);const o="units",a=[1,2,5],l=25.4/.28;class h extends n.A{constructor(t){t=t||{};const e=document.createElement("div");e.style.pointerEvents="none",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un;const i=void 0!==t.className?t.className:t.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+s.XI,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==t.minWidth?t.minWidth:64,this.maxWidth_=t.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(o,this.handleUnitsChanged_),this.setUnits(t.units||"metric"),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(o)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(o,t)}setDpi(t){this.dpi_=t}updateElement_(){const t=this.viewState_;if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=t.center,i=t.projection,n=this.getUnits(),s="degrees"==n?"degrees":"m";let o=(0,r.hO)(i,t.resolution,e,s);const h=this.minWidth_*(this.dpi_||l)/l,c=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||l)/l:void 0;let u=h*o,d="";if("degrees"==n){const t=r.Ig.degrees;u*=t,u=c){g=p,_=m,f=x;break}if(_>=h)break;p=g,m=_,x=f,++v}const y=this.scaleBar_?this.createScaleBar(_,g,d):g.toFixed(f<0?-f:0)+" "+d;this.renderedHTML_!=y&&(this.innerElement_.innerHTML=y,this.renderedHTML_=y),this.renderedWidth_!=_&&(this.innerElement_.style.width=_+"px",this.renderedWidth_=_),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(t,e,i){const n=this.getScaleForResolution(),s=n<1?Math.round(1/n).toLocaleString()+" : 1":"1 : "+Math.round(n).toLocaleString(),r=this.scaleBarSteps_,o=t/r,a=[this.createMarker("absolute")];for(let n=0;n
    `+this.createMarker("relative")+(n%2==0||2===r?this.createStepText(n,t,!1,e,i):"")+"")}return a.push(this.createStepText(r,t,!0,e,i)),(this.scaleBarText_?`
    `+s+"
    ":"")+a.join("")}createMarker(t){return`
    `}createStepText(t,e,i,n,s){const r=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+s);return`
    `+r+"
    "}getScaleForResolution(){return(0,r.hO)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||l)}render(t){const e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}}const c=h},9186:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(972),s=i(6837),r=i(5176),o=i(3474);class a extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",i=void 0!==t.delta?t.delta:1,n=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",o=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",a=void 0!==t.zoomInLabel?t.zoomInLabel:"+",l=void 0!==t.zoomOutLabel?t.zoomOutLabel:"–",h=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",c=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=n,u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof a?document.createTextNode(a):a),u.addEventListener(s.A.CLICK,this.handleClick_.bind(this,i),!1);const d=document.createElement("button");d.className=o,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(s.A.CLICK,this.handleClick_.bind(this,-i),!1);const g=e+" "+r.XI+" "+r.$N,_=this.element;_.className=g,_.appendChild(u),_.appendChild(d),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const e=this.getMap().getView();if(!e)return;const i=e.getZoom();if(void 0!==i){const n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:o.vT})):e.setZoom(n)}}}const l=a},9439:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(972),s=i(6837),r=i(613),o=i(5176),a=i(1597),l=i(3474),h=i(9438),c=i(1685);class u extends n.A{constructor(t){super({target:(t=t||{}).target,element:document.createElement("div"),render:t.render}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=0,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.startX_,this.startY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==t.duration?t.duration:200;const e=void 0!==t.className?t.className:"ol-zoomslider",i=document.createElement("button");i.setAttribute("type","button"),i.className=e+"-thumb "+o.XI;const n=this.element;n.className=e+" "+o.XI+" "+o.$N,n.appendChild(i),n.addEventListener(r.A.POINTERDOWN,this.handleDraggerStart_.bind(this),!1),n.addEventListener(r.A.POINTERMOVE,this.handleDraggerDrag_.bind(this),!1),n.addEventListener(r.A.POINTERUP,this.handleDraggerEnd_.bind(this),!1),n.addEventListener(s.A.CLICK,this.handleContainerClick_.bind(this),!1),i.addEventListener(s.A.CLICK,c.dG,!1)}setMap(t){super.setMap(t),t&&t.render()}initSlider_(){const t=this.element;let e=t.offsetWidth,i=t.offsetHeight;if(0===e&&0===i)return this.sliderInitialized_=!1;const n=getComputedStyle(t);e-=parseFloat(n.paddingRight)+parseFloat(n.paddingLeft),i-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom);const s=t.firstElementChild,r=getComputedStyle(s),o=s.offsetWidth+parseFloat(r.marginRight)+parseFloat(r.marginLeft),a=s.offsetHeight+parseFloat(r.marginTop)+parseFloat(r.marginBottom);return this.thumbSize_=[o,a],e>i?(this.direction_=1,this.widthLimit_=e-o):(this.direction_=0,this.heightLimit_=i-a),this.sliderInitialized_=!0}handleContainerClick_(t){const e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(i),s=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:s,duration:this.duration_,easing:l.vT})}handleDraggerStart_(t){if(!this.dragging_&&t.target===this.element.firstElementChild){const e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){const t=this.handleDraggerDrag_,e=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push((0,h.KT)(i,r.A.POINTERMOVE,t,this),(0,h.KT)(i,r.A.POINTERUP,e,this))}}}handleDraggerDrag_(t){if(this.dragging_){const e=t.clientX-this.startX_,i=t.clientY-this.startY_,n=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}}handleDraggerEnd_(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(h.JH),this.dragListenerKeys_.length=0)}setThumbPosition_(t){const e=this.getPositionForResolution_(t),i=this.element.firstElementChild;1==this.direction_?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"}getRelativePosition_(t,e){let i;return i=1===this.direction_?t/this.widthLimit_:e/this.heightLimit_,(0,a.qE)(i,0,1)}getResolutionForPosition_(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)}getPositionForResolution_(t){const e=this.getMap().getView().getValueForResolutionFunction();return(0,a.qE)(1-e(t),0,1)}render(t){if(!t.frameState)return;if(!this.sliderInitialized_&&!this.initSlider_())return;const e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}const d=u},1727:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(972),s=i(6837),r=i(5176),o=i(3407),a=i(1064);class l extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.extent=t.extent?t.extent:null;const e=void 0!==t.className?t.className:"ol-zoom-extent",i=void 0!==t.label?t.label:"E",n=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=n,o.appendChild("string"==typeof i?document.createTextNode(i):i),o.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const a=e+" "+r.XI+" "+r.$N,l=this.element;l.className=a,l.appendChild(o)}handleClick_(t){t.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),e=this.extent?(0,o.SD)(this.extent,t.getProjection()):t.getProjection().getExtent();t.fitInternal((0,a.VY)(e))}}const h=l},6933:(t,e,i)=>{i.d(e,{$x:()=>_,Io:()=>g,Li:()=>f,U$:()=>p,WQ:()=>o,aI:()=>h,aP:()=>l,e$:()=>c,hG:()=>d,hs:()=>u,sG:()=>a});var n=i(915),s=i(1597),r=i(2806);function o(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function a(t,e){const i=t[0],n=t[1],s=e[0],r=e[1],o=s[0],a=s[1],l=r[0],h=r[1],c=l-o,u=h-a,d=0===c&&0===u?0:(c*(i-o)+u*(n-a))/(c*c+u*u||0);let g,_;return d<=0?(g=o,_=a):d>=1?(g=l,_=h):(g=o+d*c,_=a+d*u),[g,_]}function l(t,e,i){const n=(0,s.xP)(e+180,360)-180,o=Math.abs(3600*n),a=i||0;let l=Math.floor(o/3600),h=Math.floor((o-3600*l)/60),c=(0,s.Mg)(o-3600*l-60*h,a);c>=60&&(c=0,h+=1),h>=60&&(h=0,l+=1);let u=l+"°";return 0===h&&0===c||(u+=" "+(0,r.H)(h,2)+"′"),0!==c&&(u+=" "+(0,r.H)(c,2,a)+"″"),0!==n&&(u+=" "+t.charAt(n<0?1:0)),u}function h(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function c(t,e){const i=Math.cos(e),n=Math.sin(e),s=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=s,t[1]=r,t}function u(t,e){return t[0]*=e,t[1]*=e,t}function d(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function g(t,e){return Math.sqrt(d(t,e))}function _(t,e){return d(t,a(t,e))}function f(t,e){if(e.canWrapX()){const i=(0,n.RG)(e.getExtent()),s=p(t,e,i);s&&(t[0]-=s*i)}return t}function p(t,e,i){const s=e.getExtent();let r=0;return e.canWrapX()&&(t[0]s[2])&&(i=i||(0,n.RG)(s),r=Math.floor((t[0]-s[0])/i)),r}},5176:(t,e,i)=>{i.d(e,{$N:()=>a,K5:()=>u,Q5:()=>s,Si:()=>n,Vv:()=>o,XI:()=>r,nT:()=>l});const n="ol-hidden",s="ol-selectable",r="ol-unselectable",o="ol-unsupported",a="ol-control",l="ol-collapsed",h=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),c=["style","variant","weight","size","lineHeight","family"],u=function(t){const e=t.match(h);if(!e)return null;const i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let t=0,n=c.length;t{i.d(e,{DK:()=>h,Gq:()=>l,WM:()=>d,Y:()=>s,Yg:()=>a,fo:()=>c,gS:()=>u,lr:()=>o});var n=i(7771);function s(t,e,i,s){let r;return r=i&&i.length?i.shift():n.Wl?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",s)}let r;function o(){return r||(r=s(1,1)),r}function a(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function l(t){let e=t.offsetWidth;const i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),e}function h(t){let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),e}function c(t,e){const i=e.parentNode;i&&i.replaceChild(t,e)}function u(t){for(;t.lastChild;)t.lastChild.remove()}function d(t,e){const i=t.childNodes;for(let n=0;;++n){const s=i[n],r=e[n];if(!s&&!r)break;s!==r&&(s?r?t.insertBefore(r,s):(t.removeChild(s),--n):t.appendChild(r))}}},3474:(t,e,i)=>{function n(t){return Math.pow(t,3)}function s(t){return 1-n(1-t)}function r(t){return 3*t*t-2*t*t*t}function o(t){return t}i.d(e,{T9:()=>r,a6:()=>n,sn:()=>o,vT:()=>s})},9438:(t,e,i)=>{i.d(e,{JH:()=>o,Jz:()=>r,KT:()=>s});var n=i(3530);function s(t,e,i,n,s){if(s){const s=i;i=function(){t.removeEventListener(e,i),s.apply(n??this,arguments)}}else n&&n!==t&&(i=i.bind(n));const r={target:t,type:e,listener:i};return t.addEventListener(e,i),r}function r(t,e,i,n){return s(t,e,i,n,!0)}function o(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),(0,n.I)(t))}},1685:(t,e,i)=>{function n(t){t.stopPropagation()}i.d(e,{Ay:()=>s,dG:()=>n});const s=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}},6837:(t,e,i)=>{i.d(e,{A:()=>n});const n={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},9332:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(25),s=i(1685),r=i(4238),o=i(3530);class a extends n.A{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const o=e?new s.Ay(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});let h;i in a||(a[i]=0,l[i]=0),++a[i];for(let t=0,e=n.length;t0)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=r.tV,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}}const l=a},8704:(t,e,i)=>{i.d(e,{A4:()=>E,GB:()=>x,Gk:()=>u,IO:()=>h,Js:()=>l,Kg:()=>v,Q7:()=>a,TS:()=>p,Zm:()=>g,at:()=>d,eL:()=>c,fs:()=>T,k5:()=>m,qG:()=>f,t5:()=>_,tE:()=>y});var n=i(3445),s=i(4238),r=i(7771),o=i(588);function a(t){const e=arguments;return function(t){let i=!0;for(let n=0,s=e.length;n{i.d(e,{DG:()=>y,Fq:()=>u,SR:()=>E,T8:()=>a,Ye:()=>M,ZD:()=>A,_D:()=>v,cT:()=>h,go:()=>p,mE:()=>c,qA:()=>d,qg:()=>T,wl:()=>l});var n=i(6514),s=i(3730),r=i(4401);let o=0;const a=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},S={[A.Get]:P(w(1,1/0),C),[A.Var]:P(w(1,1),(function(t,e,i){const n=t[1];if("string"!=typeof n)throw new Error("expected a string argument for var operation");return i.variables.add(n),[new v(h,n)]})),[A.Has]:P(w(1,1/0),C),[A.Id]:P((function(t,e,i){i.featureId=!0}),R),[A.Concat]:P(w(2,1/0),I(h)),[A.GeometryType]:P((function(t,e,i){i.geometryType=!0}),R),[A.LineMetric]:P(R),[A.Resolution]:P(R),[A.Zoom]:P(R),[A.Time]:P(R),[A.Any]:P(w(2,1/0),I(a)),[A.All]:P(w(2,1/0),I(a)),[A.Not]:P(w(1,1),I(a)),[A.Equal]:P(w(2,2),I(g)),[A.NotEqual]:P(w(2,2),I(g)),[A.GreaterThan]:P(w(2,2),I(l)),[A.GreaterThanOrEqualTo]:P(w(2,2),I(l)),[A.LessThan]:P(w(2,2),I(l)),[A.LessThanOrEqualTo]:P(w(2,2),I(l)),[A.Multiply]:P(w(2,1/0),b),[A.Coalesce]:P(w(2,1/0),b),[A.Divide]:P(w(2,2),I(l)),[A.Add]:P(w(2,1/0),I(l)),[A.Subtract]:P(w(2,2),I(l)),[A.Clamp]:P(w(3,3),I(l)),[A.Mod]:P(w(2,2),I(l)),[A.Pow]:P(w(2,2),I(l)),[A.Abs]:P(w(1,1),I(l)),[A.Floor]:P(w(1,1),I(l)),[A.Ceil]:P(w(1,1),I(l)),[A.Round]:P(w(1,1),I(l)),[A.Sin]:P(w(1,1),I(l)),[A.Cos]:P(w(1,1),I(l)),[A.Atan]:P(w(1,2),I(l)),[A.Sqrt]:P(w(1,1),I(l)),[A.Match]:P(w(4,1/0),L,(function(t,e,i){const n=t.length-1,s=h|l|a,r=T(t[1],s,i),o=T(t[t.length-1],e,i),c=new Array(n-2);for(let e=0;ee)throw new Error(`expected ${e===1/0?`${t} or more`:`${t} to ${e}`} arguments for ${r}, got ${o}`)}}function b(t,e,i){const n=t.length-1,s=new Array(n);for(let r=0;r{i.d(e,{uZ:()=>x,nR:()=>v,VO:()=>c,Lm:()=>g,z0:()=>p,$R:()=>l,Tl:()=>_,Sl:()=>f});const n=class{constructor(t,e){this.name=t,this.data=e,this.texture_=null}getTexture(t){if(!this.texture_){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_}delete(t){this.texture_&&t.deleteTexture(this.texture_),this.texture_=null}};var s=i(9825),r=i(2323),o=i(3730),a=i(4401);function l(t){const e=t.toString();return e.includes(".")?e:e+".0"}function h(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${t.length}(${t.map(l).join(", ")})`}function c(t){const e=(0,o._j)(t),i=e.length>3?e[3]:1;return h([e[0]/255,e[1]/255,e[2]/255,i])}const u={};let d=0;function g(t){return t in u||(u[t]=d++),u[t]}function _(t){return l(g(t))}function f(t){return"u_var_"+t}function p(){return{inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}}}const m="getBandValue",x="u_paletteTextures";function v(t,e,i,n){return T((0,s.qg)(t,e,i),e,n)}function y(t){return(e,i,n)=>{const s=i.args.length,r=new Array(s);for(let t=0;t{const i=e.args[0].value;return i in t.properties||(t.properties[i]={name:i,type:e.type}),(t.inFragmentShader?"v_prop_":"a_prop_")+i},[s.ZD.GeometryType]:(t,e,i)=>{const n="geometryType";return n in t.properties||(t.properties[n]={name:n,type:s.cT,evaluator:t=>(0,s.Ye)(t.getGeometry())}),(t.inFragmentShader?"v_prop_":"a_prop_")+n},[s.ZD.LineMetric]:()=>"currentLineMetric",[s.ZD.Var]:(t,e)=>{const i=e.args[0].value;return i in t.variables||(t.variables[i]={name:i,type:e.type}),f(i)},[s.ZD.Resolution]:()=>"u_resolution",[s.ZD.Zoom]:()=>"u_zoom",[s.ZD.Time]:()=>"u_time",[s.ZD.Any]:y((t=>`(${t.join(" || ")})`)),[s.ZD.All]:y((t=>`(${t.join(" && ")})`)),[s.ZD.Not]:y((([t])=>`(!${t})`)),[s.ZD.Equal]:y((([t,e])=>`(${t} == ${e})`)),[s.ZD.NotEqual]:y((([t,e])=>`(${t} != ${e})`)),[s.ZD.GreaterThan]:y((([t,e])=>`(${t} > ${e})`)),[s.ZD.GreaterThanOrEqualTo]:y((([t,e])=>`(${t} >= ${e})`)),[s.ZD.LessThan]:y((([t,e])=>`(${t} < ${e})`)),[s.ZD.LessThanOrEqualTo]:y((([t,e])=>`(${t} <= ${e})`)),[s.ZD.Multiply]:y((t=>`(${t.join(" * ")})`)),[s.ZD.Divide]:y((([t,e])=>`(${t} / ${e})`)),[s.ZD.Add]:y((t=>`(${t.join(" + ")})`)),[s.ZD.Subtract]:y((([t,e])=>`(${t} - ${e})`)),[s.ZD.Clamp]:y((([t,e,i])=>`clamp(${t}, ${e}, ${i})`)),[s.ZD.Mod]:y((([t,e])=>`mod(${t}, ${e})`)),[s.ZD.Pow]:y((([t,e])=>`pow(${t}, ${e})`)),[s.ZD.Abs]:y((([t])=>`abs(${t})`)),[s.ZD.Floor]:y((([t])=>`floor(${t})`)),[s.ZD.Ceil]:y((([t])=>`ceil(${t})`)),[s.ZD.Round]:y((([t])=>`floor(${t} + 0.5)`)),[s.ZD.Sin]:y((([t])=>`sin(${t})`)),[s.ZD.Cos]:y((([t])=>`cos(${t})`)),[s.ZD.Atan]:y((([t,e])=>void 0!==e?`atan(${t}, ${e})`:`atan(${t})`)),[s.ZD.Sqrt]:y((([t])=>`sqrt(${t})`)),[s.ZD.Match]:y((t=>{const e=t[0],i=t[t.length-1];let n=null;for(let s=t.length-3;s>=1;s-=2)n=`(${e} == ${t[s]} ? ${t[s+1]} : ${n||i})`;return n})),[s.ZD.Between]:y((([t,e,i])=>`(${t} >= ${e} && ${t} <= ${i})`)),[s.ZD.Interpolate]:y((([t,e,...i])=>{let n="";for(let s=0;s{const e=t[t.length-1];let i=null;for(let n=t.length-3;n>=0;n-=2)i=`(${t[n]} ? ${t[n+1]} : ${i||e})`;return i})),[s.ZD.In]:y((([t,...e],i)=>{const n=function(t,e){return`operator_in_${Object.keys(e.functions).length}`}(0,i),s=[];for(let t=0;t`vec${t.length}(${t.join(", ")})`)),[s.ZD.Color]:y((t=>{if(1===t.length)return`vec4(vec3(${t[0]} / 255.0), 1.0)`;if(2===t.length)return`vec4(vec3(${t[0]} / 255.0), ${t[1]})`;const e=t.slice(0,3).map((t=>`${t} / 255.0`));if(3===t.length)return`vec4(${e.join(", ")}, 1.0)`;const i=t[3];return`vec4(${e.join(", ")}, ${i})`})),[s.ZD.Band]:y((([t,e,i],n)=>{if(!(m in n.functions)){let t="";const e=n.bandCount||1;for(let i=0;i{const[i,...r]=e.args,a=r.length,l=new Uint8Array(4*a);for(let t=0;t0)return l(t.value);if((t.type&s.T8)>0)return t.value.toString();if((t.type&s.cT)>0)return _(t.value.toString());if((t.type&s.mE)>0)return c(t.value);if((t.type&s.Fq)>0)return h(t.value);if((t.type&s.qA)>0)return n=t.value,h((0,a.xq)(n));var n;throw new Error(`Unexpected expression ${t.value} (expected type ${(0,s.go)(e)})`)}},915:(t,e,i)=>{i.d(e,{$C:()=>y,$u:()=>N,Af:()=>G,Bg:()=>I,HY:()=>O,Im:()=>k,Ld:()=>a,Li:()=>B,Mx:()=>z,N:()=>g,NW:()=>j,Oq:()=>L,Py:()=>M,QJ:()=>U,R:()=>C,R8:()=>E,RG:()=>D,Rj:()=>c,S5:()=>d,Tr:()=>s,UG:()=>S,Vy:()=>p,WU:()=>F,X$:()=>v,Ym:()=>l,_N:()=>P,aI:()=>m,aZ:()=>_,bE:()=>x,dP:()=>f,k_:()=>R,ms:()=>h,o8:()=>o,q1:()=>w,qF:()=>b,r:()=>r,sB:()=>A,vz:()=>u});var n=i(1580);function s(t){const e=[1/0,1/0,-1/0,-1/0];for(let i=0,n=t.length;ir&&(h|=n.A.RIGHT),lo&&(h|=n.A.ABOVE),h===n.A.UNKNOWN&&(h=n.A.INTERSECTING),h}function d(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,i,n,s){return s?(s[0]=t,s[1]=e,s[2]=i,s[3]=n,s):[t,e,i,n]}function _(t){return g(1/0,1/0,-1/0,-1/0,t)}function f(t,e){const i=t[0],n=t[1];return g(i,n,i,n,e)}function p(t,e,i,n,s){return E(_(s),t,e,i,n)}function m(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function x(t,e,i){return Math.abs(t[0]-e[0])t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function y(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function E(t,e,i,n,s){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function k(t){return t[2]=a&&p<=h),s||!(o&n.A.RIGHT)||r&n.A.RIGHT||(m=_-(g-h)*f,s=m>=l&&m<=c),s||!(o&n.A.BELOW)||r&n.A.BELOW||(p=g-(_-l)/f,s=p>=a&&p<=h),s||!(o&n.A.LEFT)||r&n.A.LEFT||(m=_-(g-a)*f,s=m>=l&&m<=c)}return s}function j(t,e,i,n){if(k(t))return _(i);let s=[];if(n>1){const e=t[2]-t[0],i=t[3]-t[1];for(let r=0;r=i[2])){const e=D(i),s=Math.floor((n[0]-i[0])/e)*e;t[0]-=s,t[2]-=s}return t}function U(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];B(t,e);const s=D(n);if(D(t)>s&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-s,t[3]]]}return[t]}},1580:(t,e,i)=>{i.d(e,{A:()=>n});const n={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16}},1142:(t,e,i)=>{i.d(e,{m8:()=>r,nF:()=>o});var n=i(4238);let s=!1;function r(t,e,i,n,r,o,a){const l=new XMLHttpRequest;l.open("GET","function"==typeof t?t(i,n,r):t,!0),"arraybuffer"==e.getType()&&(l.responseType="arraybuffer"),l.withCredentials=s,l.onload=function(t){if(!l.status||l.status>=200&&l.status<300){const t=e.getType();try{let n;"text"==t||"json"==t?n=l.responseText:"xml"==t?n=l.responseXML||l.responseText:"arraybuffer"==t&&(n=l.response),n?o(e.readFeatures(n,{extent:i,featureProjection:r}),e.readProjection(n)):a()}catch{a()}}else a()},l.onerror=a,l.send()}function o(t,e){return function(i,s,o,a,l){const h=this;r(t,e,i,s,o,(function(t,e){h.addFeatures(t),void 0!==a&&a(t)}),l||n.tV)}}},6067:(t,e,i)=>{i.d(e,{A:()=>V});var n=i(4087);function s(t,e){return r(t,e,[]).join("")}function r(t,e,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{let n;for(n=t.firstChild;n;n=n.nextSibling)r(n,e,i)}return i}function o(t,e){return function(i,n){const s=t.call(e??this,i,n);void 0!==s&&n[n.length-1].push(s)}}function a(t,e,i){return function(n,s){const r=t.call(i??this,n,s);if(void 0!==r){const t=s[s.length-1],i=void 0!==e?e:n.localName;let o;i in t?o=t[i]:(o=[],t[i]=o),o.push(r)}}}function l(t,e,i){return function(n,s){const r=t.call(i??this,n,s);void 0!==r&&(s[s.length-1][void 0!==e?e:n.localName]=r)}}function h(t,e,i){let n,s;for(i=void 0!==i?i:{},n=0,s=t.length;n{i.d(e,{B4:()=>a,W8:()=>r,hq:()=>l,rT:()=>s,tV:()=>o});var n=i(6514);function s(){return!0}function r(){return!1}function o(){}function a(t){let e,i,s;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===s&&(0,n.aI)(r,i)||(s=this,i=r,e=t.apply(this,arguments)),e}}function l(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}},7430:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(4120),s=i(4087),r=i(9703),o=i(915),a=i(3407),l=i(4238),h=i(7622);const c=(0,r.vt)();class u extends n.A{constructor(){super(),this.extent_=(0,o.S5)(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=(0,l.B4)(((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return(0,s.b0)()}closestPointXY(t,e,i,n){return(0,s.b0)()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return(0,s.b0)()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&(0,o.aZ)(t),this.extentRevision_=this.getRevision()}return(0,o.$u)(this.extent_,t)}rotate(t,e){(0,s.b0)()}scale(t,e,i){(0,s.b0)()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return(0,s.b0)()}getType(){return(0,s.b0)()}applyTransform(t){(0,s.b0)()}intersectsExtent(t){return(0,s.b0)()}translate(t,e){(0,s.b0)()}transform(t,e){const i=(0,a.Jt)(t),n="tile-pixels"==i.getUnits()?function(t,n,s){const l=i.getExtent(),u=i.getWorldExtent(),d=(0,o.Oq)(u)/(0,o.Oq)(l);return(0,r.Zz)(c,u[0],u[3],d,-d,0,0,0),(0,h.Rc)(t,0,t.length,s,c,n),(0,a.RG)(i,e)(t,n,s)}:(0,a.RG)(i,e);return this.applyTransform(n),this}}const d=u},4338:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(7430),r=i(915),o=i(9438);class a extends s.A{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(o.JH),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;et.clone()))}const h=a},1217:(t,e,i)=>{i.d(e,{A:()=>f});var n=i(2096),s=i(3953),r=i(915),o=i(2497),a=i(3671),l=i(6514),h=i(1374),c=i(6361),u=i(9969),d=i(4350),g=i(904);class _ extends n.Ay{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){(0,l.X$)(this.flatCoordinates,t),this.changed()}clone(){const t=new _(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.MD)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.n)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return(0,h.j)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(e=void 0!==e&&e,(0,u.gr)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return(0,c.n2)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return(0,u.SH)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return(0,g.k)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=(0,a.P4)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new _(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return(0,d.gp)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,o.z2)(this.flatCoordinates,0,t,this.stride),this.changed()}}const f=_},6702:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(1217),s=i(2096),r=i(3953),o=i(915),a=i(2497),l=i(3671),h=i(6514),c=i(6361),u=i(9969),d=i(4350);class g extends s.Ay{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const e=t,i=[],n=[];for(let t=0,s=e.length;t{i.d(e,{A:()=>u});var n=i(4294),s=i(2096),r=i(915),o=i(2497),a=i(6514),l=i(6361),h=i(1597);class c extends s.Ay{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){(0,a.X$)(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new c(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<(0,r.Ld)(this.getExtent(),t,e))return n;const s=this.flatCoordinates,o=this.stride;for(let r=0,a=s.length;r{i.d(e,{A:()=>v});var n=i(503),s=i(1064),r=i(2096),o=i(3953),a=i(915),l=i(2497),h=i(6514),c=i(2616),u=i(6361),d=i(4350),g=i(3402),_=i(8609),f=i(4049),p=i(2845),m=i(3671);class x extends r.Ay{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const n=t,s=[],r=[];for(let t=0,e=n.length;t{i.d(e,{A:()=>l});var n=i(2096),s=i(915),r=i(2497),o=i(1597);class a extends n.Ay{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new a(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const s=this.flatCoordinates,r=(0,o.hG)(t,e,s[0],s[1]);if(r{i.d(e,{kj:()=>T,Ay:()=>E,nD:()=>S,VY:()=>A});var n=i(2096),s=i(3953),r=i(915),o=i(2497),a=i(3671),l=i(6361),h=i(8609);class c extends n.Ay{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new c(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.MD)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.n)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return(0,h.eN)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return(0,l.n2)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=(0,a.P4)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new c(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,o.z2)(this.flatCoordinates,0,t,this.stride),this.changed()}}const u=c;var d=i(4294),g=i(6514),_=i(2616),f=i(4350),p=i(3402),m=i(2845),x=i(1597),v=i(2490);class y extends n.Ay{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?(0,g.X$)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new y(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.HX)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.oW)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return(0,m.zb)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return(0,h.PK)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),(0,p.ug)(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,(0,l.cD)(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=(0,r.q1)(this.getExtent());this.flatInteriorPoint_=(0,_.J)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new d.A(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new u(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let s=0;for(let r=0,o=i.length;r{i.d(e,{Ay:()=>u,dn:()=>h,p0:()=>l,v7:()=>c});var n=i(7430),s=i(4087),r=i(915),o=i(7622);class a extends n.A{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return(0,r.Vy)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return(0,s.b0)()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length{function n(t,e,i,n){let s=0;const r=t[i-n],o=t[i-n+1];let a=0,l=0;for(;er,PK:()=>s,eN:()=>n})},4049:(t,e,i)=>{i.d(e,{C:()=>s});var n=i(915);function s(t,e,i,s){const r=[];let o=(0,n.S5)();for(let a=0,l=i.length;a{i.d(e,{HX:()=>o,MD:()=>r,c:()=>a,n:()=>l,oW:()=>h,te:()=>c});var n=i(1597);function s(t,e,i,s,r,o,a){const l=t[e],h=t[e+1],c=t[i]-l,u=t[i+1]-h;let d;if(0===c&&0===u)d=e;else{const g=((r-l)*c+(o-h)*u)/(c*c+u*u);if(g>1)d=i;else{if(g>0){for(let r=0;rr&&(r=l),o=i,a=s}return r}function o(t,e,i,n,s){for(let o=0,a=i.length;o{i.d(e,{Gd:()=>a,a_:()=>r,t7:()=>s,zb:()=>o});var n=i(915);function s(t,e,i,s,o){return!(0,n.sB)(o,(function(n){return!r(t,e,i,s,n[0],n[1])}))}function r(t,e,i,n,s,r){let o=0,a=t[i-n],l=t[i-n+1];for(;er&&(i-a)*(r-l)-(s-a)*(n-l)>0&&o++:n<=r&&(i-a)*(r-l)-(s-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function o(t,e,i,n,s,o){if(0===i.length)return!1;if(!r(t,e,i[0],n,s,o))return!1;for(let e=1,a=i.length;e{function n(t,e,i,n){for(let n=0,s=i.length;nr,_n:()=>n,d6:()=>o,z2:()=>s})},6361:(t,e,i)=>{function n(t,e,i,n,s){s=void 0!==s?s:[];let r=0;for(let o=e;or,cD:()=>s,n2:()=>n})},2616:(t,e,i)=>{i.d(e,{J:()=>r,p:()=>o});var n=i(6514),s=i(2845);function r(t,e,i,r,o,a,l){let h,c,u,d,g,_,f;const p=o[a+1],m=[];for(let n=0,s=i.length;nv&&(u=(d+g)/2,(0,s.zb)(t,e,i,r,u,p)&&(x=u,v=n)),d=g}return isNaN(x)&&(x=o[a]),l?(l.push(x,p,v),l):[x,p,v]}function o(t,e,i,n,s){let o=[];for(let a=0,l=i.length;a{i.d(e,{L8:()=>a,SH:()=>r,gr:()=>o});var n=i(6514),s=i(1597);function r(t,e,i,r,o,a,l){let h,c;const u=(i-e)/r;if(1===u)h=e;else if(2===u)h=e,c=o;else if(0!==u){let s=t[e],a=t[e+1],l=0;const u=[0];for(let n=e+r;n1?l:2,a=a||new Array(l);for(let e=0;e>1;r{i.d(e,{HT:()=>h,Wp:()=>c,fB:()=>a,gp:()=>o,sj:()=>l});var n=i(915),s=i(1374),r=i(2845);function o(t,e,i,r,o){const a=(0,n.R8)((0,n.S5)(),t,e,i,r);return!!(0,n.HY)(o,a)&&(!!(0,n.ms)(o,a)||a[0]>=o[0]&&a[2]<=o[2]||a[1]>=o[1]&&a[3]<=o[3]||(0,s.j)(t,e,i,r,(function(t,e){return(0,n.Mx)(o,t,e)})))}function a(t,e,i,n,s){for(let r=0,a=i.length;r{function n(t,e,i,n){let s=t[e],r=t[e+1],o=0;for(let a=e+n;an})},3402:(t,e,i)=>{function n(t,e,i,n){for(;e0}function r(t,e,i,n,r){r=void 0!==r&&r;for(let o=0,a=i.length;oh,PA:()=>r,mb:()=>o,ug:()=>a,NK:()=>l})},1374:(t,e,i)=>{function n(t,e,i,n,s){let r;for(e+=n;en})},3671:(t,e,i)=>{i.d(e,{AL:()=>r,Hg:()=>l,P4:()=>s,n$:()=>o,sx:()=>h});var n=i(1597);function s(t,e,i,s,r,o,a){const l=(i-e)/s;if(l<3){for(;e0;){const i=c.pop(),o=c.pop();let a=0;const l=t[o],d=t[o+1],g=t[i],_=t[i+1];for(let e=o+s;ea&&(u=e,a=r)}a>r&&(h[(u-e)/s]=1,o+s0&&f>g)&&(_<0&&p<_||_==p||_>0&&p>_)?(l=i,h=d):(r[a++]=l,r[a++]=h,c=l,u=h,l=i,h=d)}return r[a++]=l,r[a++]=h,a}function l(t,e,i,n,s,r,o,l){for(let h=0,c=i.length;h{function n(t,e,i,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=e;ln,Tl:()=>o,e$:()=>s,hs:()=>r})},7771:(t,e,i)=>{i.d(e,{DT:()=>c,FT:()=>d,Wl:()=>h,XM:()=>u,_p:()=>s,cr:()=>l,ew:()=>a,j:()=>o,oF:()=>r});const n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",s=n.includes("firefox"),r=n.includes("safari")&&!n.includes("chrom")&&(n.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(n)),o=n.includes("webkit")&&!n.includes("edge"),a=n.includes("macintosh"),l="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,h="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,c="undefined"!=typeof Image&&Image.prototype.decode,u="function"==typeof createImageBitmap,d=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}()},6068:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(6292),s=i(3445);class r extends n.Ay{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==s.A.DBLCLICK){const i=t.originalEvent,s=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();(0,n.D2)(a,o,r,this.duration_),i.preventDefault(),e=!0}return!e}}const o=r},422:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(1685),s=i(1409),r=i(25),o=i(1064);class a extends r.A{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new o.Ay([i])}getGeometry(){return this.geometry_}}const l=a;var h=i(8704);const c="boxcancel";class u extends n.Ay{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class d extends s.A{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new l(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??h.at,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],s=i[1]-e[1];return n*n+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new u("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new u(e?"boxend":c,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new u("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new u(c,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new u(c,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}const g=d},4473:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(1409),s=i(4238),r=i(8704),o=i(3474),a=i(6933);class l extends n.A{constructor(t){super({stopDown:s.W8}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:(0,r.Q7)(r.TS,r.fs);this.condition_=t.onFocusOnly?(0,r.Q7)(r.eL,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,s=e.getEventPixel((0,n.v)(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const e=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],i=t.map.getView();(0,a.hs)(e,i.getResolution()),(0,a.e$)(e,i.getRotation()),i.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const t=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),s=i.getCenterInternal(),r=e.getPixelFromCoordinateInternal(s),a=e.getCoordinateFromPixelInternal([r[0]-t*Math.cos(n),r[1]-t*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:o.vT})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const h=l},4051:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(1409),s=i(4238),r=i(8704),o=i(4498);class a extends n.A{constructor(t){t=t||{},super({stopDown:s.W8}),this.condition_=t.condition?t.condition:r.IO,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!(0,r.A4)(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===o.b8)return;const n=e.getSize(),s=t.pixel,a=Math.atan2(n[1]/2-s[1],s[0]-n[0]/2);if(void 0!==this.lastAngle_){const t=a-this.lastAngle_;i.adjustRotationInternal(-t)}this.lastAngle_=a}handleUpEvent(t){return!(0,r.A4)(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!!(0,r.A4)(t)&&(!(!(0,r.at)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))}}const l=a},4423:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(422),s=i(3474),r=i(8704);class o extends n.A{constructor(t){super({condition:(t=t||{}).condition?t.condition:r.Kg,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){const e=this.getMap().getView();let i=this.getGeometry();if(this.out_){const t=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(t),s=e.getResolution()/n;i=i.clone(),i.scale(s*s)}e.fitInternal(i,{duration:this.duration_,easing:s.vT})}}const a=o},9964:(t,e,i)=>{i.d(e,{Ay:()=>W});var n=i(2096),s=i(915),r=i(2497),o=i(7622);class a extends n.Ay{constructor(t,e,i){super(),void 0!==i&&void 0===e?this.setFlatCoordinates(i,t):(e=e||0,this.setCenterAndRadius(t,e,i))}clone(){const t=new a(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const s=this.flatCoordinates,r=t-s[0],o=e-s[1],a=r*r+o*o;if(a=e[0]||t[1]<=e[1]&&t[3]>=e[1]||(0,s.sB)(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){const e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let i=1;i=i?t[e-i]:t[e]}function O(t,e,i){let n,s;eo)return F(B(t,n),B(t,s));let a=0;n=i?n-=i:n<0&&(n+=i);let r=n+1;r>=i&&(r-=i);const o=t[n],a=o[0],l=o[1],h=t[r];return[a+(h[0]-a)*s,l+(h[1]-l)*s]}class U extends E.A{constructor(t){const e=t;e.stopDown||(e.stopDown=C.W8),super(e),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:"Polygon"===this.mode_?3:2,this.maxPoints_="Circle"===this.mode_?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:C.rT,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let i=t.geometryFunction;if(!i){const t=this.mode_;if("Circle"===t)i=(t,e,i)=>{const n=e||new l([NaN,NaN]),s=(0,L.Ad)(t[0],i),r=(0,I.hG)(s,(0,L.Ad)(t[t.length-1],i));n.setCenterAndRadius(s,Math.sqrt(r),this.geometryLayout_);const o=(0,L.Tf)();return o&&n.transform(i,o),n};else{let e;"Point"===t?e=y.A:"LineString"===t?e=_.A:"Polygon"===t&&(e=T.Ay),i=(i,n,s)=>(n?"Polygon"===t?i[0].length?n.setCoordinates([i[0].concat([i[0][0]])],this.geometryLayout_):n.setCoordinates([],this.geometryLayout_):n.setCoordinates(i,this.geometryLayout_):n=new e(i,this.geometryLayout_),n)}}this.geometryFunction_=i,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new A.A({source:new S.A({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:X(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:R.TS,this.freehandCondition_,t.freehand?this.freehandCondition_=R.Gk:this.freehandCondition_=t.freehandCondition?t.freehandCondition:R.Kg,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(g.A.ACTIVE,this.updateState_)}setTrace(t){let e;e=t?!0===t?R.Gk:t:R.Zm,this.traceCondition_=e}setMap(t){super.setMap(t),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(t){t.originalEvent.type===c.A.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_="Point"!==this.mode_&&this.freehandCondition_(t);let e=t.type===p.A.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&t.type===p.A.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===p.A.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===p.A.POINTERDOWN?i=!1:e&&this.getPointerCount()<2?(i=t.type===p.A.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):("mouse"===t.originalEvent.pointerType||t.type===p.A.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t)):t.type===p.A.DBLCLICK&&(i=!1),super.handleEvent(t)&&i}handleDownEvent(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((()=>{this.handlePointerMove_(new f.A(p.A.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active)return void this.deactivateTrace_();const e=this.getMap(),i=e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),n=e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),r=(0,s.Tr)([i,n]),o=this.traceSource_.getFeaturesInExtent(r);if(0===o.length)return;const a=function(t,e){const i=[];for(let n=0;nt.endIndex||!i&&et.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let i=0;if(t0&&this.removeLastPoints_(i)}addTracedCoordinates_(t,e,i){if(e===i)return;const n=[];if(e=r;--e)n.push(D(t.coordinates,e))}n.length&&this.appendCoordinates(n)}updateTrace_(t){const e=this.traceState_;if(!e.active)return;if(-1===e.targetIndex&&(0,I.Io)(e.startPx,t.pixel)i.startIndex?hi.startIndex&&(h-=n.length)),l=h,a=t)}const h=e.targets[a];let c=h.ring;if(e.targetIndex===a&&c){const t=B(h.coordinates,l),s=i.getPixelFromCoordinate(t);(0,I.Io)(s,e.startPx)>n&&(c=!1)}if(c){const t=h.coordinates,e=t.length,i=h.startIndex,n=l;if(ithis.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?(this.updateTrace_(t),this.modifyDrawing_(t.coordinate)):this.createOrUpdateSketchPoint_(t.coordinate.slice())}atFinish_(t,e){let i=!1;if(this.sketchFeature_){let n=!1,s=[this.finishCoordinate_];const r=this.mode_;if("Point"===r)i=!0;else if("Circle"===r)i=2===this.sketchCoords_.length;else if("LineString"===r)n=!e&&this.sketchCoords_.length>this.minPoints_;else if("Polygon"===r){const t=this.sketchCoords_;n=t[0].length>this.minPoints_,s=[t[0][0],t[0][t[0].length-2]],s=e?[t[0][0]]:[t[0][0],t[0][t[0].length-2]]}if(n){const e=this.getMap();for(let n=0,r=s.length;n=this.maxPoints_&&(this.freehand_?s.pop():n=!0),s.push(t.slice()),this.geometryFunction_(s,e,i)):"Polygon"===r&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():n=!0),s.push(t.slice()),n&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,e,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),n?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;for(let s=0;s=2){this.finishCoordinate_=t[t.length-2].slice();const e=this.finishCoordinate_.slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}this.geometryFunction_(t,e,i),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if("Polygon"===n){t=this.sketchCoords_[0],t.splice(-2,1);const n=this.sketchLine_.getGeometry();if(t.length>=2){const e=t[t.length-2].slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}n.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}if(1===t.length){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return null;let e=this.sketchCoords_;const i=t.getGeometry(),n=this.getMap().getView().getProjection();return"LineString"===this.mode_?(e.pop(),this.geometryFunction_(e,i,n)):"Polygon"===this.mode_&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new x.A([e])):"MultiLineString"===this.type_?t.setGeometry(new m.A([e])):"MultiPolygon"===this.type_&&t.setGeometry(new v.A([e])),this.dispatchEvent(new M("drawend",t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t),t}abortDrawing_(){this.finishCoordinate_=null;const t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){const t=this.abortDrawing_();t&&this.dispatchEvent(new M("drawabort",t))}appendCoordinates(t){const e=this.mode_,i=!this.sketchFeature_;let n;if(i&&this.startDrawing_(t[0]),"LineString"===e||"Circle"===e)n=this.sketchCoords_;else{if("Polygon"!==e)return;n=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}i&&n.shift(),n.pop();for(let e=0;e{i.d(e,{Ay:()=>h,D2:()=>l,e4:()=>a});var n=i(4120),s=i(2187),r=i(3474);class o extends n.A{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(s.A.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(s.A.ACTIVE,t)}setMap(t){this.map_=t}}function a(t,e,i){const n=t.getCenterInternal();if(n){const s=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:r.sn,center:t.getConstrainedCenter(s)})}}function l(t,e,i,n){const s=t.getZoom();if(void 0===s)return;const o=t.getConstrainedZoom(s+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==n?n:250,easing:r.vT})}const h=o},9888:(t,e,i)=>{i.d(e,{A:()=>u});var n=i(6837),s=i(6292);const r="ArrowLeft",o="ArrowRight",a="ArrowDown";var l=i(8704),h=i(6933);class c extends s.Ay{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return(0,l.TS)(t)&&(0,l.tE)(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==n.A.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==a||n==r||n==o||"ArrowUp"==n)){const l=t.map.getView(),c=l.getResolution()*this.pixelDelta_;let u=0,d=0;n==a?d=-c:n==r?u=-c:n==o?u=c:d=c;const g=[u,d];(0,h.e$)(g,l.getRotation()),(0,s.e4)(l,g,this.duration_),i.preventDefault(),e=!0}}return!e}}const u=c},6856:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(6837),s=i(6292),r=i(8704);class o extends s.Ay{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!(0,r.GB)(t)&&(0,r.tE)(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==n.A.KEYDOWN||t.type==n.A.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&("+"===n||"-"===n)){const r=t.map,o="+"===n?this.delta_:-this.delta_,a=r.getView();(0,s.D2)(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const a=o},9132:(t,e,i)=>{i.d(e,{A:()=>M});var n=i(71),s=i(2135),r=i(1685),o=i(6837),a=i(6717),l=i(3445),h=i(4294),c=i(1409),u=i(5902),d=i(8280),g=i(2757),_=i(4602),f=i(8704),p=i(915),m=i(6933),x=i(9276),v=i(6514),y=i(1064),E=i(3407),T=i(4087);const A=[0,0,0,0],S=[],C="modifyend";class R extends r.Ay{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}class w extends c.A{constructor(t){let e;if(super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:f.fs,this.defaultDeleteCondition_=function(t){return(0,f.Js)(t)&&(0,f.t5)(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:f.Gk,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new u.A,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new g.A({source:new _.A({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:P(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null,t.features?e=t.features:t.source&&(this.source_=t.source,e=new n.A(this.source_.getFeatures()),this.source_.addEventListener(d.A.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(d.A.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(s.A.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(s.A.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=void 0===t.snapToPointer?!this.hitDetection_:t.snapToPointer}addFeature_(t){const e=t.getGeometry();if(e){const i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(o.A.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new n.A;const i=this.featuresBeingModified_.getArray();for(let t=0,n=e.length;t=0;--t){const n=i[t];for(let t=this.dragSegments_.length-1;t>=0;--t)this.dragSegments_[t][0]===n&&this.dragSegments_.splice(t,1);e.remove(n)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)}writeMultiPointGeometry_(t,e){const i=e.getCoordinates();for(let n=0,s=i.length;n=0;--t)this.insertVertex_(s[t],r)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){const i=this.dragSegments_[e][0],n=i.geometry;if("Circle"===n.getType()){const e=n.getCenter(),s=i.featureSegments[0],r=i.featureSegments[1];s.segment[0]=e,s.segment[1]=e,r.segment[0]=e,r.segment[1]=e,this.rBush_.update((0,p.dP)(e),s);let o=n;const a=(0,E.Tf)();if(a){const e=t.map.getView().getProjection();o=o.clone().transform(a,e),o=(0,y.nD)(o).transform(e,a)}this.rBush_.update(o.getExtent(),r)}else this.rBush_.update((0,p.Tr)(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new R(C,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,i){const n=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection(),r=function(t,e){return I(n,t,s)-I(n,e,s)};let o,l;if(this.hitDetection_){const i="object"==typeof this.hitDetection_?t=>t===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,((t,e,i)=>{i&&"Point"===i.getType()&&(i=new h.A((0,E.te)(i.getCoordinates(),s)));const n=i||t.getGeometry();if(t instanceof a.A&&this.features_.getArray().includes(t)){l=n;const e=t.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:l,segment:[e,e]}]}return!0}),{layerFilter:i})}if(!o){const t=(0,E.SD)((0,p.dP)(n,A),s),i=e.getView().getResolution()*this.pixelTolerance_,r=(0,E.JR)((0,p.r)(t,i,A),s);o=this.rBush_.getInExtent(r)}if(o&&o.length>0){const i=o.sort(r)[0],a=i.segment;let h=L(n,i,s);const c=e.getPixelFromCoordinate(h);let u=(0,m.Io)(t,c);if(l||u<=this.pixelTolerance_){const t={};if(t[(0,T.v6)(a)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-n[0],this.delta_[1]=h[1]-n[1]),"Circle"===i.geometry.getType()&&1===i.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);else{const n=e.getPixelFromCoordinate(a[0]),s=e.getPixelFromCoordinate(a[1]),r=(0,m.hG)(c,n),l=(0,m.hG)(c,s);u=Math.sqrt(Math.min(r,l)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(h=r>l?a[1]:a[0]),this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);const d={};d[(0,T.v6)(i.geometry)]=!0;for(let e=1,i=o.length;e=0;--o)s=t[o],u=s[0],d=(0,T.v6)(u.feature),u.depth&&(d+="-"+u.depth.join("-")),d in e||(e[d]={}),0===s[1]?(e[d].right=u,e[d].index=u.index):1==s[1]&&(e[d].left=u,e[d].index=u.index+1);for(d in e){switch(c=e[d].right,l=e[d].left,a=e[d].index,h=a-1,u=void 0!==l?l:c,h<0&&(h=0),r=u.geometry,n=r.getCoordinates(),i=n,g=!1,r.getType()){case"MultiLineString":n[u.depth[0]].length>2&&(n[u.depth[0]].splice(a,1),g=!0);break;case"LineString":n.length>2&&(n.splice(a,1),g=!0);break;case"MultiPolygon":i=i[u.depth[1]];case"Polygon":i=i[u.depth[0]],i.length>4&&(a==i.length-1&&(a=0),i.splice(a,1),g=!0,0===a&&(i.pop(),i.push(i[0]),h=i.length-1))}if(g){this.setGeometryCoordinates_(r,n);const e=[];if(void 0!==l&&(this.rBush_.remove(l),e.push(l.segment[0])),void 0!==c&&(this.rBush_.remove(c),e.push(c.segment[1])),void 0!==l&&void 0!==c){const t={depth:u.depth,feature:u.feature,geometry:u.geometry,index:h,segment:e};this.rBush_.insert((0,p.Tr)(t.segment),t)}this.updateSegmentIndices_(r,a,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return g}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(s){s.geometry===t&&(void 0===i||void 0===s.depth||(0,v.aI)(s.depth,i))&&s.index>e&&(s.index+=n)}))}}function b(t,e){return t.index-e.index}function I(t,e,i){const n=e.geometry;if("Circle"===n.getType()){let s=n;if(1===e.index){const e=(0,E.Tf)();e&&(s=s.clone().transform(e,i));const n=(0,m.hG)(s.getCenter(),(0,E.Ad)(t,i)),r=Math.sqrt(n)-s.getRadius();return r*r}}const s=(0,E.Ad)(t,i);return S[0]=(0,E.Ad)(e.segment[0],i),S[1]=(0,E.Ad)(e.segment[1],i),(0,m.$x)(s,S)}function L(t,e,i){const n=e.geometry;if("Circle"===n.getType()&&1===e.index){let e=n;const s=(0,E.Tf)();return s&&(e=e.clone().transform(s,i)),(0,E.te)(e.getClosestPoint((0,E.Ad)(t,i)),i)}const s=(0,E.Ad)(t,i);return S[0]=(0,E.Ad)(e.segment[0],i),S[1]=(0,E.Ad)(e.segment[1],i),(0,E.te)((0,m.sG)(s,S),i)}function P(){const t=(0,x.mY)();return function(e,i){return t.Point}}const M=w},8751:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(6292),r=i(7771),o=i(8704),a=i(1597);class l extends s.Ay{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:o.Gk;this.condition_=t.onFocusOnly?(0,o.Q7)(o.eL,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t))return!0;if(t.type!==n.A.WHEEL)return!0;const e=t.map,i=t.originalEvent;let s;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel),t.type==n.A.WHEEL&&(s=i.deltaY,r._p&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=r.cr),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),0===s)return!1;this.lastDelta_=s;const o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=e.getView();if("trackpad"===this.mode_&&!a.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-(0,a.qE)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),(0,s.D2)(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}const h=l},3711:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(1409),s=i(4238),r=i(4498);class o extends n.A{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=s.W8),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],s=this.targetPointers[1],o=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(void 0!==this.lastAngle_){const t=o-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=o;const a=t.map,l=a.getView();l.getConstraints().rotation!==r.b8&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel((0,n.v)(this.targetPointers))),this.rotating_&&(a.render(),l.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const a=o},5243:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(1409),s=i(4238);class r extends n.A{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=s.W8),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel((0,n.v)(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const o=r},1409:(t,e,i)=>{i.d(e,{A:()=>a,v:()=>o});var n=i(6292),s=i(3445);class r extends n.Ay{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==s.A.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==s.A.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==s.A.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==s.A.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function o(t){const e=t.length;let i=0,n=0;for(let s=0;s{i.d(e,{A:()=>n});const n={ACTIVE:"active"}},4458:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(71),s=i(1685),r=i(6717),o=i(2187),a=i(1409),l=i(4238),h=i(8704),c=i(3407);class u extends s.Ay{constructor(t,e,i,n,s){super(t),this.features=e,this.coordinate=i,this.startCoordinate=n,this.mapBrowserEvent=s}}class d extends a.A{constructor(t){let e;if(super(t=t||{}),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=void 0!==t.features?t.features:null,t.layers&&!this.features_)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=l.rT;this.layerFilter_=e,this.filter_=t.filter&&!this.features_?t.filter:l.rT,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:h.Gk,this.lastFeature_=null,this.addChangeListener(o.A.ACTIVE,this.handleActiveChanged_)}handleDownEvent(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);const e=this.features_||new n.A([this.lastFeature_]);return this.dispatchEvent(new u("translatestart",e,t.coordinate,this.startCoordinate_,t)),!0}return!1}handleUpEvent(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);const e=this.features_||new n.A([this.lastFeature_]);return this.dispatchEvent(new u("translateend",e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1}handleDragEvent(t){if(this.lastCoordinate_){const e=t.coordinate,i=t.map.getView().getProjection(),s=(0,c.Ad)(e,i),r=(0,c.Ad)(this.lastCoordinate_,i),o=s[0]-r[0],a=s[1]-r[1],l=this.features_||new n.A([this.lastFeature_]),h=(0,c.Tf)();l.forEach((function(t){const e=t.getGeometry();h?(e.transform(h,i),e.translate(o,a),e.transform(i,h)):e.translate(o,a),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new u("translating",l,e,this.startCoordinate_,t))}}handleMoveEvent(t){const e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}featuresAtPixel_(t,e){return e.forEachFeatureAtPixel(t,((t,e)=>{if(t instanceof r.A&&this.filter_(t,e)&&(!this.features_||this.features_.getArray().includes(t)))return t}),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(t){this.hitTolerance_=t}setMap(t){const e=this.getMap();super.setMap(t),this.updateState_(e)}handleActiveChanged_(){this.updateState_(null)}updateState_(t){let e=this.getMap();const i=this.getActive();e&&i||(e=e||t,!e)||e.getViewport().classList.remove("ol-grab","ol-grabbing")}}const g=d},8620:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(4120),s=i(5332),r=i(4087),o=i(588),a=i(1597);class l extends n.A{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[s.A.OPACITY]=void 0!==t.opacity?t.opacity:1,(0,o.v)("number"==typeof e[s.A.OPACITY],"Layer opacity must be a number"),e[s.A.VISIBLE]=void 0===t.visible||t.visible,e[s.A.Z_INDEX]=t.zIndex,e[s.A.MAX_RESOLUTION]=void 0!==t.maxResolution?t.maxResolution:1/0,e[s.A.MIN_RESOLUTION]=void 0!==t.minResolution?t.minResolution:0,e[s.A.MIN_ZOOM]=void 0!==t.minZoom?t.minZoom:-1/0,e[s.A.MAX_ZOOM]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=(0,a.qE)(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return(0,r.b0)()}getLayerStatesArray(t){return(0,r.b0)()}getExtent(){return this.get(s.A.EXTENT)}getMaxResolution(){return this.get(s.A.MAX_RESOLUTION)}getMinResolution(){return this.get(s.A.MIN_RESOLUTION)}getMinZoom(){return this.get(s.A.MIN_ZOOM)}getMaxZoom(){return this.get(s.A.MAX_ZOOM)}getOpacity(){return this.get(s.A.OPACITY)}getSourceState(){return(0,r.b0)()}getVisible(){return this.get(s.A.VISIBLE)}getZIndex(){return this.get(s.A.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(s.A.EXTENT,t)}setMaxResolution(t){this.set(s.A.MAX_RESOLUTION,t)}setMinResolution(t){this.set(s.A.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(s.A.MAX_ZOOM,t)}setMinZoom(t){this.set(s.A.MIN_ZOOM,t)}setOpacity(t){(0,o.v)("number"==typeof t,"Layer opacity must be a number"),this.set(s.A.OPACITY,t)}setVisible(t){this.set(s.A.VISIBLE,t)}setZIndex(t){this.set(s.A.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const h=l},2808:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(764),s=i(5360);class r extends n.A{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(s.A.PRELOAD)}setPreload(t){this.set(s.A.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(s.A.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(s.A.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const o=r},2284:(t,e,i)=>{i.d(e,{A:()=>Y});var n=i(764),s=i(2375),r=i(9276),o=i(7733),a=i(3628),l=i(9700),h=i(6936),c=i(953),u=i(1426),d=i(9825),g=i(3730);function _(t,e,i){return f((0,d.qg)(t,e,i),i)}function f(t,e){if(t instanceof d._D){if(t.type===d.mE&&"string"==typeof t.value){const e=(0,g.sH)(t.value);return function(){return e}}return function(){return t.value}}const i=t.operator;switch(i){case d.ZD.Number:case d.ZD.String:case d.ZD.Coalesce:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{for(let e=0;e{for(let e=0;e{const n=t.args;let s=i.properties[e];for(let t=1,e=n.length;tt.variables[e];case d.ZD.Has:return i=>{const n=t.args;if(!(e in i.properties))return!1;let s=i.properties[e];for(let t=1,e=n.length;tt.featureId;case d.ZD.GeometryType:return t=>t.geometryType;case d.ZD.Concat:{const i=t.args.map((t=>f(t,e)));return t=>"".concat(...i.map((e=>e(t).toString())))}case d.ZD.Resolution:return t=>t.resolution;case d.ZD.Any:case d.ZD.All:case d.ZD.Between:case d.ZD.In:case d.ZD.Not:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{for(let e=0;e{for(let e=0;e{const e=s[0](t),i=s[1](t),n=s[2](t);return e>=i&&e<=n};case d.ZD.In:return t=>{const e=s[0](t);for(let i=1;i!s[0](t);default:throw new Error(`Unsupported logical operator ${i}`)}}(t,e);case d.ZD.Equal:case d.ZD.NotEqual:case d.ZD.LessThan:case d.ZD.LessThanOrEqualTo:case d.ZD.GreaterThan:case d.ZD.GreaterThanOrEqualTo:return function(t,e){const i=t.operator,n=f(t.args[0],e),s=f(t.args[1],e);switch(i){case d.ZD.Equal:return t=>n(t)===s(t);case d.ZD.NotEqual:return t=>n(t)!==s(t);case d.ZD.LessThan:return t=>n(t)n(t)<=s(t);case d.ZD.GreaterThan:return t=>n(t)>s(t);case d.ZD.GreaterThanOrEqualTo:return t=>n(t)>=s(t);default:throw new Error(`Unsupported comparison operator ${i}`)}}(t,e);case d.ZD.Multiply:case d.ZD.Divide:case d.ZD.Add:case d.ZD.Subtract:case d.ZD.Clamp:case d.ZD.Mod:case d.ZD.Pow:case d.ZD.Abs:case d.ZD.Floor:case d.ZD.Ceil:case d.ZD.Round:case d.ZD.Sin:case d.ZD.Cos:case d.ZD.Atan:case d.ZD.Sqrt:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{let e=1;for(let i=0;is[0](t)/s[1](t);case d.ZD.Add:return t=>{let e=0;for(let i=0;is[0](t)-s[1](t);case d.ZD.Clamp:return t=>{const e=s[0](t),i=s[1](t);if(en?n:e};case d.ZD.Mod:return t=>s[0](t)%s[1](t);case d.ZD.Pow:return t=>Math.pow(s[0](t),s[1](t));case d.ZD.Abs:return t=>Math.abs(s[0](t));case d.ZD.Floor:return t=>Math.floor(s[0](t));case d.ZD.Ceil:return t=>Math.ceil(s[0](t));case d.ZD.Round:return t=>Math.round(s[0](t));case d.ZD.Sin:return t=>Math.sin(s[0](t));case d.ZD.Cos:return t=>Math.cos(s[0](t));case d.ZD.Atan:return 2===n?t=>Math.atan2(s[0](t),s[1](t)):t=>Math.atan(s[0](t));case d.ZD.Sqrt:return t=>Math.sqrt(s[0](t));default:throw new Error(`Unsupported numeric operator ${i}`)}}(t,e);case d.ZD.Case:return function(t,e){const i=t.args.length,n=new Array(i);for(let s=0;s{for(let e=0;e{const e=n[0](t);for(let s=1;s{const e=n[0](t),s=n[1](t);let r,o;for(let a=2;a=s)return 2===a?l:h?m(e,s,r,o,i,l):p(e,s,r,o,i,l);r=i,o=l}return o}}(t,e);case d.ZD.ToString:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{const i=s[0](e);return t.args[0].type===d.mE?(0,g.dI)(i):i.toString()};throw new Error(`Unsupported convert operator ${i}`)}(t,e);default:throw new Error(`Unsupported operator ${i}`)}}function p(t,e,i,n,s,r){const o=s-i;if(0===o)return n;const a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(r-n)}function m(t,e,i,n,s,r){if(0==s-i)return n;const o=(0,g.eE)(n),a=(0,g.eE)(r);let l=a[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const h=[p(t,e,i,o[0],s,a[0]),p(t,e,i,o[1],s,a[1]),o[2]+p(t,e,i,0,s,l),p(t,e,i,n[3],s,r[3])];return(0,g.S8)((0,g.cD)(h))}var x=i(3530),v=i(4401);function y(t){return!0}function E(t){const e=(0,d.SR)(),i=t.length,n=new Array(i);for(let s=0;snull;n=b(t,e+"fill-color",i)}if(!n)return null;const s=new a.A;return function(t){const e=n(t);return e===g.qV?null:(s.setColor(e),s)}}function S(t,e,i){const n=C(t,e+"stroke-width",i),s=b(t,e+"stroke-color",i);if(!n&&!s)return null;const r=R(t,e+"stroke-line-cap",i),o=R(t,e+"stroke-line-join",i),a=I(t,e+"stroke-line-dash",i),l=C(t,e+"stroke-line-dash-offset",i),h=C(t,e+"stroke-miter-limit",i),u=new c.A;return function(t){if(s){const e=s(t);if(e===g.qV)return null;u.setColor(e)}if(n&&u.setWidth(n(t)),r){const e=r(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw new Error("Expected butt, round, or square line cap");u.setLineCap(e)}if(o){const e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw new Error("Expected bevel, round, or miter line join");u.setLineJoin(e)}return a&&u.setLineDash(a(t)),l&&u.setLineDashOffset(l(t)),h&&u.setMiterLimit(h(t)),u}}function C(t,e,i){if(!(e in t))return;const n=_(t[e],d.wl,i);return function(t){return j(n(t),e)}}function R(t,e,i){if(!(e in t))return null;const n=_(t[e],d.cT,i);return function(t){return z(n(t),e)}}function w(t,e,i){if(!(e in t))return null;const n=_(t[e],d.T8,i);return function(t){const i=n(t);if("boolean"!=typeof i)throw new Error(`Expected a boolean for ${e}`);return i}}function b(t,e,i){if(!(e in t))return null;const n=_(t[e],d.mE,i);return function(t){return B(n(t),e)}}function I(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){return G(n(t),e)}}function L(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){const i=G(n(t),e);if(2!==i.length)throw new Error(`Expected two numbers for ${e}`);return i}}function P(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){return U(n(t),e)}}function M(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq|d.wl,i);return function(t){return i=n(t),s=e,"number"==typeof i?i:U(i,s);var i,s}}function F(t,e){const i=t[e];if(void 0!==i){if("number"!=typeof i)throw new Error(`Expected a number for ${e}`);return i}}function D(t,e){const i=t[e];if(void 0!==i){if("number"==typeof i)return(0,v.xq)(i);if(!Array.isArray(i))throw new Error(`Expected a number or size array for ${e}`);if(2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])throw new Error(`Expected a number or size array for ${e}`);return i}}function O(t,e){const i=t[e];if(void 0!==i){if("bottom-left"!==i&&"bottom-right"!==i&&"top-left"!==i&&"top-right"!==i)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return i}}function k(t,e){const i=t[e];if(void 0!==i){if("pixels"!==i&&"fraction"!==i)throw new Error(`Expected pixels or fraction for ${e}`);return i}}function N(t,e){const i=t[e];if(void 0!==i){if("string"!=typeof i)throw new Error(`Expected a string for ${e}`);if("declutter"!==i&&"obstacle"!==i&&"none"!==i)throw new Error(`Expected declutter, obstacle, or none for ${e}`);return i}}function G(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const i=t.length;for(let n=0;n4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return i}function U(t,e){const i=G(t,e);if(2!==i.length)throw new Error(`Expected an array of two numbers for ${e}`);return i}const X="renderOrder";class W extends n.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(X)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter==0&&(t.declutter[i]=new s.A(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(X,t)}setStyle(t){this.style_=void 0===t?r.d1:t;const e=function(t){if(void 0===t)return r.d1;if(!t)return null;if("function"==typeof t)return t;if(t instanceof r.Ay)return t;if(!Array.isArray(t))return E([t]);if(0===t.length)return[];const e=t.length,i=t[0];if(i instanceof r.Ay){const i=new Array(e);for(let n=0;n{i.d(e,{A:()=>A});var n=i(71),s=i(3984),r=i(6717),o=i(3628),a=i(1217),l=i(4294),h=i(953),c=i(9276),u=i(1426),d=i(2757),g=i(4602),_=i(915),f=i(1597),p=i(6933),m=i(3407),x=i(7331);function v(t,e,i){const n=[];let s=t(0),r=t(1),o=e(s),a=e(r);const l=[r,s],h=[a,o],c=[1,0],u={};let d,g,_,p,m,x,v=1e5;for(;--v>0&&c.length>0;)_=c.pop(),s=l.pop(),o=h.pop(),x=_.toString(),x in u||(n.push(o[0],o[1]),u[x]=!0),p=c.pop(),r=l.pop(),a=h.pop(),m=(_+p)/2,d=t(m),g=e(d),(0,f.Q1)(g[0],g[1],o[0],o[1],a[0],a[1]){const e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_},this.latLabelStyleBase_=new c.Ay({text:void 0!==t.latLabelStyle?t.latLabelStyle.clone():new u.A({font:"12px Calibri,sans-serif",textAlign:"right",fill:new o.A({color:"rgba(0,0,0,1)"}),stroke:new h.A({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=t=>{const e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_},this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(s.A.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=void 0!==t.intervals?t.intervals:E,this.setSource(new g.A({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new n.A,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new c.Ay({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(t,e){let i=t.slice();return this.projection_&&this.getSource().getWrapX()&&(0,_.Li)(i,this.projection_),this.loadedExtent_&&((0,_.bE)(this.loadedExtent_,i,e)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]}loaderFunction(t,e,i){this.loadedExtent_=t;const n=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=(0,_._N)(s,t);if(this.renderedExtent_&&(0,_.aI)(this.renderedExtent_,o)&&this.renderedResolution_===e)return;if(this.renderedExtent_=o,this.renderedResolution_=e,(0,_.Im)(o))return;const a=(0,_.q1)(o),l=e*e/4;(!this.projection_||!(0,m.tI)(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(o,a,e,l);let h,c=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(c+=this.meridians_.length),this.parallelsLabels_&&(c+=this.parallels_.length);c>this.featurePool_.length;)h=new r.A,this.featurePool_.push(h);const u=n.getFeaturesCollection();u.clear();let d,g,f=0;for(d=0,g=this.meridians_.length;dMath.PI/2);const d=(0,x.r2)(t);for(let t=a;t<=l;++t){let i,n,c,g,_=this.meridians_.length+this.parallels_.length;if(this.meridiansLabels_)for(n=0,c=this.meridiansLabels_.length;n=a?(t[0]=o[0],t[2]=o[2]):r=!0);const l=[(0,f.qE)(e[0],this.minX_,this.maxX_),(0,f.qE)(e[1],this.minY_,this.maxY_)],h=this.toLonLatTransform_(l);isNaN(h[1])&&(h[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let c=(0,f.qE)(h[0],this.minLon_,this.maxLon_),u=(0,f.qE)(h[1],this.minLat_,this.maxLat_);const d=this.maxLines_;let g,p,m,x,v=t;r||(v=[(0,f.qE)(t[0],this.minX_,this.maxX_),(0,f.qE)(t[1],this.minY_,this.maxY_),(0,f.qE)(t[2],this.minX_,this.maxX_),(0,f.qE)(t[3],this.minY_,this.maxY_)]);const y=(0,_.NW)(v,this.toLonLatTransform_,void 0,8);let E=y[3],T=y[2],A=y[1],S=y[0];if(r||((0,_.Ym)(v,this.bottomLeft_)&&(S=this.minLon_,A=this.minLat_),(0,_.Ym)(v,this.bottomRight_)&&(T=this.maxLon_,A=this.minLat_),(0,_.Ym)(v,this.topLeft_)&&(S=this.minLon_,E=this.maxLat_),(0,_.Ym)(v,this.topRight_)&&(T=this.maxLon_,E=this.maxLat_),E=(0,f.qE)(E,u,this.maxLat_),T=(0,f.qE)(T,c,this.maxLon_),A=(0,f.qE)(A,this.minLat_,u),S=(0,f.qE)(S,this.minLon_,c)),c=Math.floor(c/s)*s,x=(0,f.qE)(c,this.minLon_,this.maxLon_),p=this.addMeridian_(x,A,E,n,t,0),g=0,r)for(;(x-=s)>=S&&g++n[r]&&(s=r,r=1);const o=Math.max(e[1],n[s]),a=Math.min(e[3],n[r]),l=(0,f.qE)(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,a),h=[n[s-1]+(n[r-1]-n[s-1])*(l-n[s])/(n[r]-n[s]),l],c=this.meridiansLabels_[i].geom;return c.setCoordinates(h),c}getMeridians(){return this.meridians_}getParallel_(t,e,i,n,s){const r=function(t,e,i,n,s){const r=(0,m.Jt)("EPSG:4326");return v((function(n){return[e+(i-e)*n,t]}),(0,m.RG)(r,n),s)}(t,e,i,this.projection_,n);let o=this.parallels_[s];return o?(o.setFlatCoordinates("XY",r),o.changed()):o=new a.A(r,"XY"),o}getParallelPoint_(t,e,i){const n=t.getFlatCoordinates();let s=0,r=n.length-2;n[s]>n[r]&&(s=r,r=0);const o=Math.max(e[0],n[s]),a=Math.min(e[2],n[r]),l=(0,f.qE)(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,a),h=[l,n[s+1]+(n[r+1]-n[s+1])*(l-n[s])/(n[r]-n[s])],c=this.parallelsLabels_[i].geom;return c.setCoordinates(h),c}getParallels(){return this.parallels_}updateProjectionInfo_(t){const e=(0,m.Jt)("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const n=(0,m.RG)(t,e);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}}const A=T},5598:(t,e,i)=>{i.d(e,{A:()=>m,i:()=>_});var n=i(8620),s=i(71),r=i(2135),o=i(1685),a=i(6837),l=i(8450),h=i(588),c=i(3530),u=i(915),d=i(4087),g=i(9438);class _ extends o.Ay{constructor(t,e){super(t),this.layer=e}}const f="layers";class p extends n.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(f,this.handleLayersChanged_),i?Array.isArray(i)?i=new s.A(i.slice(),{unique:!0}):(0,h.v)("function"==typeof i.getArray,"Expected `layers` to be an array or a `Collection`"):i=new s.A(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(g.JH),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push((0,g.KT)(t,r.A.ADD,this.handleLayersAdd_,this),(0,g.KT)(t,r.A.REMOVE,this.handleLayersRemove_,this));for(const t in this.listenerKeys_)this.listenerKeys_[t].forEach(g.JH);(0,c.I)(this.listenerKeys_);const e=t.getArray();for(let t=0,i=e.length;t{i.d(e,{A:()=>z});var n=i(2284),s=i(8280),r=i(2703),o=i(259),a=i(492),l=i(6514);const h=new Uint8Array(4),c=class{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){(0,l.aI)(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return h[0]=0,h[1]=0,h[2]=0,h[3]=0,h;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return h[0]=this.data_[4*i],h[1]=this.data_[4*i+1],h[2]=this.data_[4*i+2],h[3]=this.data_[4*i+3],h}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}};var u=i(130),d=i(9777);const g="GENERATE_POINT_BUFFERS";var _=i(9703),f=i(588),p=i(915);function m(t,e){const i=256,n=255;return(e=e||[])[0]=Math.floor(t/i/i/i)/n,e[1]=Math.floor(t/i/i)%i/n,e[2]=Math.floor(t/i)%i/n,e[3]=t%i/n,e}var x=i(3407),v=i(4087),y=i(9438);class E extends a.A{constructor(t,e){const i=e.uniforms||{},n=(0,_.vt)();i[d.M8.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new o.Ay(u.H7,u.Be),this.indicesBuffer_=new o.Ay(u.IP,u.Be),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const r=e.attributes?e.attributes.map((function(t){return{name:"a_prop_"+t.name,size:1,type:d.jQ.FLOAT}})):[];this.attributes=[{name:"a_position",size:2,type:d.jQ.FLOAT},{name:"a_index",size:1,type:d.jQ.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:d.jQ.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:d.jQ.FLOAT})),this.attributes.push(...r),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=(0,p.S5)(),this.currentTransform_=n,this.renderTransform_=(0,_.vt)(),this.invertRenderTransform_=(0,_.vt)(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=function(){const t='const t="GENERATE_POLYGON_BUFFERS",e="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function x(t,e){const n=(r=e)[0]*r[3]-r[1]*r[2];var r;!function(t,e){if(!t)throw new Error(e)}(0!==n,"Transformation matrix cannot be inverted");const x=e[0],o=e[1],u=e[2],i=e[3],f=e[4],s=e[5];return t[0]=i/n,t[1]=-o/n,t[2]=-u/n,t[3]=x/n,t[4]=(u*s-i*f)/n,t[5]=-(x*s-o*f)/n,t}function o(t,e,n=2){const r=e&&e.length,x=r?e[0]*n:t.length;let o=u(t,0,x,n,!0);const i=[];if(!o||o.next===o.prev)return i;let s,l,c;if(r&&(o=function(t,e,n,r){const x=[];for(let n=0,o=e.length;n80*n){s=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;oe&&(e=n),x>r&&(r=x)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return f(o,i,n,s,l,c,0),i}function u(t,e,n,r,x){let o;if(x===function(t,e,n,r){let x=0;for(let o=e,u=n-r;o0)for(let x=e;x=e;x-=r)o=z(x/r|0,t[x],t[x+1],o);return o&&M(o,o.next)&&(F(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(F(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function f(t,e,n,r,x,o,u){if(!t)return;!u&&o&&function(t,e,n,r){let x=t;do{0===x.z&&(x.z=v(x.x,x.y,e,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==t);x.prevZ.nextZ=null,x.prevZ=null,function(t){let e,n=1;do{let r,x=t;t=null;let o=null;for(e=0;x;){e++;let u=x,i=0;for(let t=0;t0||f>0&&u;)0!==i&&(0===f||!u||x.z<=u.z)?(r=x,x=x.nextZ,i--):(r=u,u=u.nextZ,f--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;x=u}o.nextZ=null,n*=2}while(e>1)}(x)}(t,r,x,o);let y=t;for(;t.prev!==t.next;){const h=t.prev,p=t.next;if(o?l(t,r,x,o):s(t))e.push(h.i,t.i,p.i),F(t),t=p.next,y=p.next;else if((t=p)===y){u?1===u?f(t=c(i(t),e),e,n,r,x,o,2):2===u&&a(t,e,n,r,x,o):f(i(t),e,n,r,x,o,1);break}}}function s(t){const e=t.prev,n=t,r=t.next;if(d(e,n,r)>=0)return!1;const x=e.x,o=n.x,u=r.x,i=e.y,f=n.y,s=r.y,l=xo?x>u?x:u:o>u?o:u,y=i>f?i>s?i:s:f>s?f:s;let h=r.next;for(;h!==e;){if(h.x>=l&&h.x<=a&&h.y>=c&&h.y<=y&&b(x,i,o,f,u,s,h.x,h.y)&&d(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function l(t,e,n,r){const x=t.prev,o=t,u=t.next;if(d(x,o,u)>=0)return!1;const i=x.x,f=o.x,s=u.x,l=x.y,c=o.y,a=u.y,y=if?i>s?i:s:f>s?f:s,g=l>c?l>a?l:a:c>a?c:a,Z=v(y,h,e,n,r),M=v(p,g,e,n,r);let w=t.prevZ,m=t.nextZ;for(;w&&w.z>=Z&&m&&m.z<=M;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=Z;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=M;){if(m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(t,e){let n=t;do{const r=n.prev,x=n.next.next;!M(r,x)&&w(r,n,n.next,x)&&E(r,x)&&E(x,r)&&(e.push(r.i,n.i,x.i),F(n),F(n.next),n=t=x),n=n.next}while(n!==t);return i(n)}function a(t,e,n,r,x,o){let u=t;do{let t=u.next.next;for(;t!==u.prev;){if(u.i!==t.i&&Z(u,t)){let s=I(u,t);return u=i(u,u.next),s=i(s,s.next),f(u,e,n,r,x,o,0),void f(s,e,n,r,x,o,0)}t=t.next}u=u.next}while(u!==t)}function y(t,e){return t.x-e.x}function h(t,e){const n=function(t,e){let n=e;const r=t.x,x=t.y;let o,u=-1/0;do{if(x<=n.y&&x>=n.next.y&&n.next.y!==n.y){const t=n.x+(x-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>u&&(u=t,o=n.x=n.x&&n.x>=f&&r!==n.x&&b(xo.x||n.x===o.x&&p(o,n)))&&(o=n,l=e)}n=n.next}while(n!==i);return o}(t,e);if(!n)return e;const r=I(n,t);return i(r,r.next),i(n,n.next)}function p(t,e){return d(t.prev,t,e.prev)<0&&d(e.next,t,t.next)<0}function v(t,e,n,r,x){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){let e=t,n=t;do{(e.x=(t-u)*(o-i)&&(t-u)*(r-i)>=(n-u)*(e-i)&&(n-u)*(o-i)>=(x-u)*(r-i)}function Z(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){let n=t,r=!1;const x=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&x<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(d(t.prev,t,e.prev)||d(t,e.prev,e))||M(t,e)&&d(t.prev,t,t.next)>0&&d(e.prev,e,e.next)>0)}function d(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function M(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,n,r){const x=A(d(t,e,n)),o=A(d(t,e,r)),u=A(d(n,r,t)),i=A(d(n,r,e));return x!==o&&u!==i||(!(0!==x||!m(t,n,e))||(!(0!==o||!m(t,r,e))||(!(0!==u||!m(n,t,r))||!(0!==i||!m(n,e,r)))))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function A(t){return t>0?1:t<0?-1:0}function E(t,e){return d(t.prev,t,t.next)<0?d(t,e,t.next)>=0&&d(t,t.prev,e)>=0:d(t,e,t.prev)<0||d(t,t.next,e)<0}function I(t,e){const n=P(t.i,t.x,t.y),r=P(e.i,e.x,e.y),x=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=x,x.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function z(t,e,n,r){const x=P(t,e,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function F(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function P(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}new Array(6);const B=[],N={vertexPosition:0,indexPosition:0};function R(t,e,n,r,x){t[e+0]=n,t[e+1]=r,t[e+2]=x}function S(t,e,n,r,x,o){const u=3+x,i=t[e+0],f=t[e+1],s=B;s.length=x;for(let n=0;n0?f:2*Math.PI-f}let M=-1,w=-1,m=c;const A=null!==o;if(null!==x){M=d(b,Z,r(s,[...[t[x],t[x+1]]])),Math.cos(M)<=.985&&(m+=Math.tan((M-Math.PI)/2))}if(A){w=d(Z,b,r(s,[...[t[o],t[o+1]]])),Math.cos(w)<=.985&&(m+=Math.tan((Math.PI-w)/2))}function E(t,e){return 0===e?1e4*t:Math.sign(e)*(1e4*t+Math.abs(e))}return u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(0,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(1,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(2,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(3,c)),u.push(...f),i.push(y,y+1,y+2,y+1,y+3,y+2),{length:l+Math.sqrt((Z[0]-b[0])*(Z[0]-b[0])+(Z[1]-b[1])*(Z[1]-b[1])),angle:m}}function _(t,e,n,r,x){const u=2+x;let i=e;const f=t.slice(i,i+x);i+=x;const s=t[i++];let l=0;const c=new Array(s-1);for(let e=0;e{const o=r.data;switch(o.type){case e:{const t=3,e=2,n=o.customAttributesSize,r=e+n,x=new Float32Array(o.renderInstructions),u=x.length/r,i=4*u*(n+t),f=new Uint32Array(6*u),s=new Float32Array(i);let l;for(let t=0;t0?h=i+(n-1)*r:c&&(h=o-r);let p=null;n{const e=t.data;if(e.type===g){const i=e.projectionTransform;this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,(0,_.T9)(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}})),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[(0,y.KT)(a,s.A.ADDFEATURE,this.handleSourceFeatureAdded_,this),(0,y.KT)(a,s.A.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),(0,y.KT)(a,s.A.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),(0,y.KT)(a,s.A.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature((t=>{this.featureCache_[(0,v.v6)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new c(this.helper)),this.verticesBuffer_.getArray()&&this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.getArray()&&this.helper.flushBufferData(this.indicesBuffer_)}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[(0,v.v6)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[(0,v.v6)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[(0,v.v6)(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,s]=function(t,e){const i=t.viewState.projection,n=e.getSource().getWrapX()&&i.canWrapX(),s=i.getExtent(),r=t.extent,o=n?(0,p.RG)(s):null,a=n?Math.ceil((r[2]-s[2])/o)+1:1;return[n?Math.floor((r[0]-s[0])/o):0,a,o]}(t,this.getLayer());return this.renderWorlds(t,!1,i,n,s),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),s=t.viewState,o=!t.viewHints[r.A.ANIMATING]&&!t.viewHints[r.A.INTERACTING],a=!(0,p.aI)(this.previousExtent_,t.extent),l=this.sourceRevision_ 0) {\n if (gl_FragColor.a < 0.05) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}getStrokeVertexShader(){return this.hasStroke_?`${S}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_segmentStart;\nattribute vec2 a_segmentEnd;\nattribute float a_measureStart;\nattribute float a_measureEnd;\nattribute float a_parameters;\nattribute float a_distance;\nattribute vec2 a_joinAngles;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\nvarying float v_measureStart;\nvarying float v_measureEnd;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvec2 worldToPx(vec2 worldPos) {\n vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvec4 pxToScreen(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return vec4(screenPos, u_depth, 1.0);\n}\n\nbool isCap(float joinAngle) {\n return joinAngle < -0.1;\n}\n\nvec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) {\n float halfAngle = joinAngle / 2.0;\n float c = cos(halfAngle);\n float s = sin(halfAngle);\n vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y);\n float length = 1.0 / s;\n return angleBisectorNormal * length;\n}\n\nvec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) {\n // if on a cap or the join angle is too high, offset the line along the segment normal\n if (cos(joinAngle) > 0.998 || isCap(joinAngle)) {\n return point - normal * offsetPx;\n }\n // offset is applied along the inverted normal (positive offset goes "right" relative to line direction)\n return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx;\n}\n\nvoid main(void) {\n v_angleStart = a_joinAngles.x;\n v_angleEnd = a_joinAngles.y;\n float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5);\n currentLineMetric = vertexNumber < 1.5 ? a_measureStart : a_measureEnd;\n // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45)\n float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters);\n\n float lineWidth = ${this.strokeWidthExpression_};\n float lineOffsetPx = ${this.strokeOffsetExpression_};\n\n // compute segment start/end in px with offset\n vec2 segmentStartPx = worldToPx(a_segmentStart);\n vec2 segmentEndPx = worldToPx(a_segmentEnd);\n vec2 tangentPx = normalize(segmentEndPx - segmentStartPx);\n vec2 normalPx = vec2(-tangentPx.y, tangentPx.x);\n segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx),\n segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx);\n \n // compute current vertex position\n float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0;\n float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0;\n float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd;\n vec2 joinDirection;\n vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx;\n // if angle is too high, do not make a proper join\n if (cos(angle) > 0.985 || isCap(angle)) {\n joinDirection = normalPx * normalDir - tangentPx * tangentDir;\n } else {\n joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle);\n }\n positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing\n gl_Position = pxToScreen(positionPx);\n\n v_segmentStart = segmentStartPx;\n v_segmentEnd = segmentEndPx;\n v_width = lineWidth;\n v_prop_hitColor = a_prop_hitColor;\n v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum);\n v_measureStart = a_measureStart;\n v_measureEnd = a_measureEnd;\n${this.varyings_.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${S}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\nvarying float v_measureStart;\nvarying float v_measureEnd;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\n\nvec2 pxToWorld(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nbool isCap(float joinAngle) {\n return joinAngle < -0.1;\n}\n\nfloat segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n vec2 tangent = normalize(end - start);\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 startToPoint = point - start;\n return abs(dot(startToPoint, normal)) - width * 0.5;\n}\n\nfloat buttCapDistanceField(vec2 point, vec2 start, vec2 end) {\n vec2 startToPoint = point - start;\n vec2 tangent = normalize(end - start);\n return dot(startToPoint, -tangent);\n}\n\nfloat squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n return buttCapDistanceField(point, start, end) - width * 0.5;\n}\n\nfloat roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment\n return length(point - start) - width * 0.5 - onSegment;\n}\n\nfloat roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n return roundCapDistanceField(point, start, end, width);\n}\n\nfloat bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n vec2 startToPoint = point - start;\n vec2 tangent = normalize(end - start);\n float c = cos(joinAngle * 0.5);\n float s = sin(joinAngle * 0.5);\n float direction = -sign(sin(joinAngle));\n vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y);\n float radius = width * 0.5 * s;\n return dot(startToPoint, bisector * direction) - radius;\n}\n\nfloat miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n if (cos(joinAngle) > 0.985) { // avoid risking a division by zero\n return bevelJoinField(point, start, end, width, joinAngle);\n }\n float miterLength = 1. / sin(joinAngle * 0.5);\n float miterLimit = ${this.strokeMiterLimitExpression_};\n if (miterLength > miterLimit) {\n return bevelJoinField(point, start, end, width, joinAngle);\n }\n return -1000.;\n}\n\nfloat capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {\n if (capType == ${(0,A.Tl)("butt")}) {\n return buttCapDistanceField(point, start, end);\n } else if (capType == ${(0,A.Tl)("square")}) {\n return squareCapDistanceField(point, start, end, width);\n }\n return roundCapDistanceField(point, start, end, width);\n}\n\nfloat joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {\n if (joinType == ${(0,A.Tl)("bevel")}) {\n return bevelJoinField(point, start, end, width, joinAngle);\n } else if (joinType == ${(0,A.Tl)("miter")}) {\n return miterJoinDistanceField(point, start, end, width, joinAngle);\n }\n return roundJoinDistanceField(point, start, end, width);\n}\n\nfloat computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) {\n if (isCap(joinAngle)) {\n return capDistanceField(point, start, end, width, capType);\n }\n return joinDistanceField(point, start, end, width, joinAngle, joinType);\n}\n\nvoid main(void) {\n vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio;\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n vec2 worldPos = pxToWorld(currentPoint);\n if (\n abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n worldPos[0] < u_renderExtent[0] ||\n worldPos[1] < u_renderExtent[1] ||\n worldPos[0] > u_renderExtent[2] ||\n worldPos[1] > u_renderExtent[3]\n )\n ) {\n discard;\n }\n #endif\n\n float segmentLength = length(v_segmentEnd - v_segmentStart);\n vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength;\n vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x);\n vec2 startToPoint = currentPoint - v_segmentStart;\n float lengthToPoint = max(0., min(dot(segmentTangent, startToPoint), segmentLength));\n float currentLengthPx = lengthToPoint + v_distanceOffsetPx; \n float currentRadiusPx = abs(dot(segmentNormal, startToPoint));\n float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width;\n currentLineMetric = mix(v_measureStart, v_measureEnd, lengthToPoint / segmentLength);\n\n if (${this.discardExpression_}) { discard; }\n\n vec4 color = ${this.strokeColorExpression_};\n float capType = ${this.strokeCapExpression_};\n float joinType = ${this.strokeJoinExpression_};\n float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType);\n float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType);\n float distance = max(\n segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width),\n max(segmentStartDistance, segmentEndDistance)\n );\n distance = max(distance, ${this.strokeDistanceFieldExpression_});\n color.a *= smoothstep(0.5, -0.5, distance);\n gl_FragColor = color;\n gl_FragColor.a *= u_globalAlpha;\n gl_FragColor.rgb *= gl_FragColor.a;\n if (u_hitDetection > 0) {\n if (gl_FragColor.a < 0.1) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}getFillVertexShader(){return this.hasFill_?`${S}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0);\n v_prop_hitColor = a_prop_hitColor;\n${this.varyings_.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getFillFragmentShader(){return this.hasFill_?`${S}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\nvec2 pxToWorld(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nvec2 worldToPx(vec2 worldPos) {\n vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvoid main(void) {\n vec2 pxPos = gl_FragCoord.xy / u_pixelRatio;\n vec2 pxOrigin = worldToPx(u_patternOrigin);\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n vec2 worldPos = pxToWorld(pxPos);\n if (\n abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n worldPos[0] < u_renderExtent[0] ||\n worldPos[1] < u_renderExtent[1] ||\n worldPos[0] > u_renderExtent[2] ||\n worldPos[1] > u_renderExtent[3]\n )\n ) {\n discard;\n }\n #endif\n if (${this.discardExpression_}) { discard; }\n gl_FragColor = ${this.fillColorExpression_};\n gl_FragColor.a *= u_globalAlpha;\n gl_FragColor.rgb *= gl_FragColor.a;\n if (u_hitDetection > 0) {\n if (gl_FragColor.a < 0.1) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}}var M=i(1597),F=i(8711);const D="blur",O="gradient",k="radius",N=["#00f","#0ff","#0f0","#ff0","#f00"];class G extends n.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(O,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:N),this.setBlur(void 0!==t.blur?t.blur:15),this.setRadius(void 0!==t.radius?t.radius:8);const i=t.weight?t.weight:"weight";this.weightFunction_="string"==typeof i?t=>t.get(i):i,this.setRenderOrder(null)}getBlur(){return this.get(D)}getGradient(){return this.get(O)}getRadius(){return this.get(k)}handleGradientChanged_(){this.gradient_=function(t){const e=(0,F.Y)(1,256),i=e.createLinearGradient(0,0,1,256),n=1/(t.length-1);for(let e=0,s=t.length;e{const e=this.weightFunction_(t);return void 0!==e?(0,M.qE)(e,0,1):1}}],uniforms:{u_size:()=>2*(this.get(k)+this.get(D)),u_blurSlope:()=>this.get(k)/Math.max(1,this.get(D))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}const z=G},8044:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(764);class s extends n.A{constructor(t){super(t=t||{})}}const r=s;var o=i(6769),a=i(6141),l=i(2703),h=i(9703),c=i(915),u=i(3407);class d extends o.A{constructor(t){super(t),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,n=t.viewState,s=n.resolution,r=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(void 0!==e.extent&&(h=(0,c._N)(h,(0,u.SD)(e.extent,n.projection))),!o[l.A.ANIMATING]&&!o[l.A.INTERACTING]&&!(0,c.Im)(h))if(r){const t=n.projection,e=r.getImage(h,s,i,t);e&&(this.loadImage(e)?this.image=e:e.getState()===a.A.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=(0,h.Bb)(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!(0,c.Ym)(s,n))return null;const r=this.image.getExtent(),o=this.image.getImage(),a=(0,c.RG)(r),l=Math.floor(o.width*((n[0]-r[0])/a));if(l<0||l>=o.width)return null;const u=(0,c.Oq)(r),d=Math.floor(o.height*((r[3]-n[1])/u));return d<0||d>=o.height?null:this.getImageData(o,l,d)}renderFrame(t,e){const i=this.image,n=i.getExtent(),s=i.getResolution(),[r,o]=Array.isArray(s)?s:[s,s],a=i.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],d=t.pixelRatio,g=t.viewState,_=g.center,f=g.resolution,p=d*r/(f*a),m=d*o/(f*a);this.prepareContainer(t,e);const x=this.context.canvas.width,v=this.context.canvas.height,y=this.getRenderContext(t);let E=!1,T=!0;if(l.extent){const e=(0,u.SD)(l.extent,g.projection);T=(0,c.HY)(e,t.extent),E=T&&!(0,c.ms)(e,t.extent),E&&this.clipUnrotated(y,t,e)}const A=i.getImage(),S=(0,h.Zz)(this.tempTransform,x/2,v/2,p,m,0,a*(n[0]-_[0])/r,a*(_[1]-n[3])/o);this.renderedResolution=o*d/a;const C=A.width*S[0],R=A.height*S[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,t),T&&C>=.5&&R>=.5){const t=S[4],e=S[5],i=l.opacity;1!==i&&(y.save(),y.globalAlpha=i),y.drawImage(A,0,0,+A.width,+A.height,t,e,C,R),1!==i&&y.restore()}return this.postRender(this.context,t),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}const g=d,_=class extends r{constructor(t){super(t)}createRenderer(){return new g(this)}getData(t){return super.getData(t)}}},764:(t,e,i)=>{i.d(e,{A:()=>g,l:()=>d});var n=i(8620),s=i(6837),r=i(5332),o=i(3984),a=i(3568),l=i(588),h=i(915),c=i(9438);class u extends n.A{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(r.A.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(r.A.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&((0,c.JH)(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=(0,c.KT)(t,s.A.CHANGE,this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout((()=>{this.dispatchEvent("sourceready")}),0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const i=this.getMapInternal();let n;!t&&i&&(t=i.getView()),e=t instanceof a.Ay?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray()),n=e.layerStatesArray?e.layerStatesArray.find((t=>t.layer===this)):this.getLayerState();const s=this.getExtent();return d(n,e.viewState)&&(!s||(0,h.HY)(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];let i=e(t instanceof a.Ay?t.getViewStateAndExtent():t);return Array.isArray(i)||(i=[i]),i}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(r.A.MAP,t)}getMapInternal(){return this.get(r.A.MAP)}setMap(t){this.mapPrecomposeKey_&&((0,c.JH)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&((0,c.JH)(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=(0,c.KT)(t,o.A.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=(0,c.KT)(this,s.A.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);(0,l.v)(!e.some((t=>t.layer===i.layer)),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(r.A.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function d(t,e){if(!t.visible)return!1;const i=e.resolution;if(i=t.maxResolution)return!1;const n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const g=u},5332:(t,e,i)=>{i.d(e,{A:()=>n});const n={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"}},945:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(2808),s=i(4029);class r extends n.A{constructor(t){super(t)}createRenderer(){return new s.A(this,{cacheSize:this.getCacheSize()})}}const o=r},5360:(t,e,i)=>{i.d(e,{A:()=>n});const n={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"}},2757:(t,e,i)=>{i.d(e,{A:()=>y});var n=i(2284),s=i(136),r=i(6769),o=i(7343),a=i(3984),l=i(2703),h=i(3663),c=i(915),u=i(8711),d=i(3608),g=i(6514),_=i(3407),f=i(4087),p=i(6933);class m extends r.A{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=(0,c.S5)(),this.wrappedRenderedExtent_=(0,c.S5)(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,s=e.viewState,r=s.center,a=s.resolution,h=s.projection,u=s.rotation,d=h.getExtent(),g=this.getLayer().getSource(),_=this.getLayer().getDeclutter(),f=e.pixelRatio,p=e.viewHints,m=!(p[l.A.ANIMATING]||p[l.A.INTERACTING]),x=this.context,v=Math.round((0,c.RG)(n)/a*f),y=Math.round((0,c.Oq)(n)/a*f),E=g.getWrapX()&&h.canWrapX(),T=E?(0,c.RG)(d):null,A=E?Math.ceil((n[2]-d[2])/T)+1:1;let S=E?Math.floor((n[0]-d[0])/T):0;do{let n=this.getRenderTransform(r,a,0,f,v,y,S*T);e.declutter&&(n=n.slice(0)),t.execute(x,[x.canvas.width,x.canvas.height],n,u,m,void 0===i?o.y2:i?o.$i:o.x$,i?_&&e.declutter[_]:void 0)}while(++S{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,s=this.renderedProjection_,r=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*h.tF,u=t[1]*h.tF;a.push(this.getRenderTransform(e,i,n,h.tF,l,u,0).slice());const g=o.getSource(),f=s.getExtent();if(g.getWrapX()&&s.canWrapX()&&!(0,c.ms)(f,r)){let t=r[0];const s=(0,c.RG)(f);let o,d=0;for(;tf[2];)++d,o=s*d,a.push(this.getRenderTransform(e,i,n,h.tF,l,u,o).slice()),t-=s}const p=(0,_.Tf)();this.hitDetectionImageData_=(0,h._7)(t,a,this.renderedFeatures_,o.getStyleFunction(),r,i,n,(0,d.j)(i,this.renderedPixelRatio_),p?s:null)}e((0,h.F8)(t,this.renderedFeatures_,this.hitDetectionImageData_))}))}forEachFeatureAtCoordinate(t,e,i,n,s){if(!this.replayGroup_)return;const r=e.viewState.resolution,o=e.viewState.rotation,a=this.getLayer(),l={},h=function(t,e,i){const r=(0,f.v6)(t),o=l[r];if(o){if(!0!==o&&ic=n.forEachFeatureAtCoordinate(t,r,o,i,h,d&&e.declutter[d]?e.declutter[d].all().map((t=>t.value)):null))),c}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[l.A.ANIMATING],r=t.viewHints[l.A.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const u=t.extent,f=t.viewState,m=f.projection,x=f.resolution,v=t.pixelRatio,y=e.getRevision(),E=e.getRenderBuffer();let T=e.getRenderOrder();void 0===T&&(T=d.Eo);const A=f.center.slice(),S=(0,c.r)(u,E*x),C=S.slice(),R=[S.slice()],w=m.getExtent();if(i.getWrapX()&&m.canWrapX()&&!(0,c.ms)(w,t.extent)){const t=(0,c.RG)(w),e=Math.max((0,c.RG)(S)/2,t);S[0]=w[0]-e,S[2]=w[2]+e,(0,p.Li)(A,m);const i=(0,c.Li)(R[0],m);i[0]w[0]&&i[2]>w[2]&&R.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==x&&this.renderedRevision_==y&&this.renderedRenderOrder_==T&&this.renderedFrameDeclutter_===!!t.declutter&&(0,c.ms)(this.wrappedRenderedExtent_,S))return(0,g.aI)(this.renderedExtent_,C)||(this.hitDetectionImageData_=null,this.renderedExtent_=C),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const b=new s.A((0,d.gY)(x,v),S,x,v),I=(0,_.Tf)();let L;if(I){for(let t=0,e=R.length;t{let n;const s=t.getStyleFunction()||e.getStyleFunction();if(s&&(n=s(t,x)),n){const e=this.renderFeature(t,P,n,b,L,this.getLayer().getDeclutter(),i);M=M&&!e}},D=(0,_.JR)(S,m),O=i.getFeaturesInExtent(D);T&&O.sort(T);for(let t=0,e=O.length;t{i.d(e,{A:()=>C});var n=i(2284),s=i(136),r=i(7343),o=i(4029),a=i(1078),l=i(2703),h=i(808),c=i(3663),u=i(9703),d=i(6514),g=i(915),_=i(3608),f=i(4087),p=i(4401),m=i(6933);const x={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},v={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class y extends o.A{constructor(t,e){super(t,e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=(0,u.vt)(),this.tileClipContexts_=null}drawTile(t,e,i,n,s,r,o,a){this.updateExecutorGroup_(t,e.pixelRatio,e.viewState.projection),this.tileImageNeedsRender_(t)&&this.renderTileImage_(t,e),super.drawTile(t,e,i,n,s,r,o,a)}getTile(t,e,i,n){const s=this.getOrCreateTile(t,e,i,n);if(!s)return null;const r=n.viewState.resolution,o=n.viewHints;return!(!o[l.A.ANIMATING]&&!o[l.A.INTERACTING])&&s.wantedResolution||(s.wantedResolution=r),s}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,i){const n=this.getLayer(),o=n.getRevision(),l=n.getRenderOrder()||null,h=t.wantedResolution,c=t.getReplayState(n);if(!c.dirty&&c.renderedResolution===h&&c.renderedRevision==o&&c.renderedRenderOrder==l)return;const u=n.getSource(),d=!!n.getDeclutter(),p=u.getTileGrid(),m=u.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),x=u.getSourceTiles(e,i,t),v=(0,f.v6)(n);delete t.hitDetectionImageData[v],t.executorGroups[v]=[],c.dirty=!1;for(let i=0,o=x.length;i{const s=x?e.declutter[x].all().map((t=>t.value)):null;for(let e=0,a=n.length;e{const n=this.getLayer(),s=(0,f.v6)(n),r=n.getSource(),o=this.renderedProjection,l=o.getExtent(),h=this.renderedResolution,d=r.getTileGridForProjection(o),_=(0,u.Bb)(this.renderedPixelToCoordinateTransform_,t.slice()),x=d.getTileCoordForCoordAndResolution(_,h);let v;for(let t=0,e=this.renderedTiles.length;t0)return void e([]);const y=d.getTileCoordExtent(v.wrappedTileCoord),E=(0,g.Py)(y),T=[(_[0]-E[0])/h,(E[1]-_[1])/h],A=v.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]);let S=v.hitDetectionImageData[s];if(!S){const t=(0,p.xq)(d.getTileSize(d.getZForResolution(h,r.zDirection))),e=this.renderedRotation_,i=[this.getRenderTransform(d.getTileCoordCenter(v.wrappedTileCoord),h,0,c.tF,t[0]*c.tF,t[1]*c.tF,0)];S=(0,c._7)(t,i,A,n.getStyleFunction(),d.getTileCoordExtent(v.wrappedTileCoord),v.getReplayState(n).renderedResolution,e),v.hitDetectionImageData[s]=S}e((0,c.F8)(T,A,S))}))}getFeaturesInExtent(t){const e=[],i=this.getTileCache();if(0===i.getCount())return e;const n=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),s=n.getZForResolution(this.renderedResolution),r={};return i.forEach((i=>{if(i.tileCoord[0]!==s||i.getState()!==a.A.LOADED)return;const o=i.getSourceTiles();for(let i=0,s=o.length;i=0;--e)n[e].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(i,t),t.viewState.rotation,o,r.$i,s?t.declutter[s]:void 0)}i.globalAlpha=n}renderDeferredInternal(t){const e=this.renderedTiles.reduce(((t,e,i)=>(e.executorGroups[(0,f.v6)(this.getLayer())].forEach((e=>t.push({executorGroup:e,index:i}))),t)),[]),i=e.map((({executorGroup:t})=>t.getDeferredZIndexContexts())),n={};for(let t=0,i=e.length;t{i.forEach(((i,n)=>{i[t]&&(i[t].forEach((t=>{const{executorGroup:i,index:s}=e[n],r=i.getRenderedContext(),o=r.globalAlpha;r.globalAlpha=this.renderedOpacity_;const a=this.tileClipContexts_[s];a&&a.draw(r),t.draw(r),a&&r.restore(),r.globalAlpha=o,t.clear()})),i[t].length=0)}))}))}getTileRenderTransform(t,e){const i=e.pixelRatio,n=e.viewState,s=n.center,r=n.resolution,o=n.rotation,a=e.size,l=Math.round(a[0]*i),h=Math.round(a[1]*i),c=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,g=c.getTileCoordExtent(t.wrappedTileCoord),_=c.getTileCoordExtent(d,this.tempExtent)[0]-g[0];return(0,u.lw)((0,u.hs)(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,r,o,i,l,h,_))}postRender(t,e){const i=e.viewHints,n=!(i[l.A.ANIMATING]||i[l.A.INTERACTING]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const c=s.getDeclutter(),u=c?v[o].filter((t=>!r.$i.includes(t))):v[o],d=e.viewState,_=d.rotation,p=s.getSource(),m=p.getTileGridForProjection(d.projection).getZForResolution(d.resolution,p.zDirection),x=this.renderedTiles,y=[],E=[],T=[];let A=!0;for(let i=x.length-1;i>=0;--i){const r=x[i];A=A&&!r.getReplayState(s).dirty;const o=r.executorGroups[(0,f.v6)(s)].filter((t=>t.hasExecutors(u)));if(0===o.length)continue;const a=this.getTileRenderTransform(r,e),l=r.tileCoord[0];let d=!1;const p=o[0].getClipCoords(a);let v,S=t;if(p){v=new h.A,S=v.getContext();for(let t=0,e=y.length;t{i.d(e,{A:()=>u});var n=i(2808),s=i(5332),r=i(2323),o=i(9825),a=i(5516);function l(t,e,i){const n=(0,o.SR)();return(0,a.nR)(e,i,n,t)}function h(t,e){const i=`\n attribute vec2 ${r.eS.TEXTURE_COORD};\n uniform mat4 ${r.gF.TILE_TRANSFORM};\n uniform float ${r.gF.TEXTURE_PIXEL_WIDTH};\n uniform float ${r.gF.TEXTURE_PIXEL_HEIGHT};\n uniform float ${r.gF.TEXTURE_RESOLUTION};\n uniform float ${r.gF.TEXTURE_ORIGIN_X};\n uniform float ${r.gF.TEXTURE_ORIGIN_Y};\n uniform float ${r.gF.DEPTH};\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ${r.eS.TEXTURE_COORD};\n v_mapCoord = vec2(\n ${r.gF.TEXTURE_ORIGIN_X} + ${r.gF.TEXTURE_RESOLUTION} * ${r.gF.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],\n ${r.gF.TEXTURE_ORIGIN_Y} - ${r.gF.TEXTURE_RESOLUTION} * ${r.gF.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]\n );\n gl_Position = ${r.gF.TILE_TRANSFORM} * vec4(${r.eS.TEXTURE_COORD}, ${r.gF.DEPTH}, 1.0);\n }\n `,n={...(0,a.z0)(),inFragmentShader:!0,bandCount:e,style:t},s=[];if(void 0!==t.color){const e=l(n,t.color,o.mE);s.push(`color = ${e};`)}if(void 0!==t.contrast){const e=l(n,t.contrast,o.wl);s.push(`color.rgb = clamp((${e} + 1.0) * color.rgb - (${e} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.exposure){const e=l(n,t.exposure,o.wl);s.push(`color.rgb = clamp((${e} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.saturation){const e=l(n,t.saturation,o.wl);s.push(`\n float saturation = ${e} + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n `)}if(void 0!==t.gamma){const e=l(n,t.gamma,o.wl);s.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${e}));`)}if(void 0!==t.brightness){const e=l(n,t.brightness,o.wl);s.push(`color.rgb = clamp(color.rgb + ${e}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const h={},c=Object.keys(n.variables).length;if(c>1&&!t.variables)throw new Error(`Missing variables in style (expected ${n.variables})`);for(let e=0;e ${r.gF.RENDER_EXTENT}[2] ||\n v_mapCoord[1] > ${r.gF.RENDER_EXTENT}[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(${r.gF.TILE_TEXTURE_ARRAY}[0], v_textureCoord);\n\n ${s.join("\n")}\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ${r.gF.TRANSITION_ALPHA};\n }`,uniforms:h,paletteTextures:n.paletteTextures}}class c extends n.A{constructor(t){const e=(t=t?Object.assign({},t):{}).style||{};delete t.style,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.styleVariables_=this.style_.variables||{},this.addChangeListener(s.A.SOURCE,this.handleSourceUpdate_)}getSources(t,e){const i=this.getSource();return this.sources_?"function"==typeof this.sources_?this.sources_(t,e):this.sources_:i?[i]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const t=this.getRenderSource();return t?t.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache();const t=this.getSource();if(t)if("loading"===t.getState()){const e=()=>{"ready"===t.getState()&&(t.removeEventListener("change",e),this.setStyle(this.style_))};t.addEventListener("change",e)}else this.setStyle(this.style_)}getSourceBandCount_(){const t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4}createRenderer(){const t=h(this.style_,this.getSourceBandCount_());return new r.Ay(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(t,e){const i=this.getRenderer();let n;for(let s=0,r=e.length;s{"ready"==e.getState()&&(e.removeEventListener("change",t),this.changed())};e.addEventListener("change",t)}s=s&&"ready"==i}const r=this.renderSources(t,n);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=i.resolution,r;if(this.renderedResolution_>.5*i.resolution){const e=this.getSources(t.extent,this.renderedResolution_).filter((t=>!n.includes(t)));if(e.length>0)return this.renderSources(t,e)}return r}setStyle(t){if(this.styleVariables_=t.variables||{},this.style_=t,this.hasRenderer()){const t=h(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures}),this.changed()}}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}c.prototype.dispose;const u=c},942:(t,e,i)=>{function n(t,e){return[[-1/0,-1/0,1/0,1/0]]}function s(t,e){return[t]}i.d(e,{Q7:()=>n,Qk:()=>s}),i(3407)},1597:(t,e,i)=>{function n(t,e,i){return Math.min(Math.max(t,e),i)}function s(t,e,i,n,s,o){const a=s-i,l=o-n;if(0!==a||0!==l){const r=((t-i)*a+(e-n)*l)/(a*a+l*l);r>1?(i=s,n=o):r>0&&(i+=a*r,n+=l*r)}return r(t,e,i,n)}function r(t,e,i,n){const s=i-t,r=n-e;return s*s+r*r}function o(t){const e=t.length;for(let i=0;is&&(s=e,n=r)}if(0===s)return null;const r=t[n];t[n]=t[i],t[i]=r;for(let n=i+1;n=0;n--){i[n]=t[n][e]/t[n][n];for(let s=n-1;s>=0;s--)t[s][e]-=t[s][n]*i[n]}return i}function a(t){return 180*t/Math.PI}function l(t){return t*Math.PI/180}function h(t,e){const i=t%e;return i*e<0?i+e:i}function c(t,e,i){return t+i*(e-t)}function u(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function d(t,e){return Math.round(u(t,e))}function g(t,e){return Math.floor(u(t,e))}function _(t,e){return Math.ceil(u(t,e))}i.d(e,{Cc:()=>c,KU:()=>o,LI:()=>d,Mg:()=>u,Q1:()=>s,RI:()=>g,eh:()=>l,hG:()=>r,mk:()=>_,qE:()=>n,xP:()=>h,xW:()=>a})},3530:(t,e,i)=>{function n(t){for(const e in t)delete t[e]}function s(t){let e;for(e in t)return!1;return!e}i.d(e,{I:()=>n,p:()=>s})},613:(t,e,i)=>{i.d(e,{A:()=>n});const n={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},3407:(t,e,i)=>{i.d(e,{Ig:()=>f.I,MF:()=>n.A,hB:()=>F,O3:()=>L,bF:()=>w,Av:()=>P,wU:()=>H,RJ:()=>S,tI:()=>k,Rb:()=>D,Ad:()=>W,SD:()=>Z,Jt:()=>b,hO:()=>I,RG:()=>G,FO:()=>N,Tf:()=>U,R6:()=>R,WP:()=>O,te:()=>X,JR:()=>Y,vN:()=>V,pd:()=>z,DI:()=>j});var n=i(5286);const s=6378137,r=Math.PI*s,o=[-r,-r,r,r],a=[-180,-85,180,85],l=s*Math.log(Math.tan(Math.PI/2));class h extends n.A{constructor(t){super({code:t,units:"m",extent:o,global:!0,worldExtent:a,getPointResolution:function(t,e){return t/Math.cosh(e[1]/s)}})}}const c=[new h("EPSG:3857"),new h("EPSG:102100"),new h("EPSG:102113"),new h("EPSG:900913"),new h("http://www.opengis.net/def/crs/EPSG/0/3857"),new h("http://www.opengis.net/gml/srs/epsg.xml#3857")];const u=[-180,-90,180,90],d=6378137*Math.PI/180;class g extends n.A{constructor(t,e){super({code:t,units:"degrees",extent:u,axisOrientation:e,global:!0,metersPerUnit:d,worldExtent:u})}}const _=[new g("CRS:84"),new g("EPSG:4326","neu"),new g("urn:ogc:def:crs:OGC:1.3:CRS84"),new g("urn:ogc:def:crs:OGC:2:84"),new g("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new g("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new g("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var f=i(8100);let p={};var m=i(3158),x=i(915),v=i(1597),y=i(6933),E=i(2490),T=i(4422);let A=!0;function S(t){A=!(void 0===t||t)}function C(t,e){if(void 0!==e)for(let i=0,n=t.length;i=a?e[o+t]:r[t]}return i}}function F(t,e,i,n){const s=b(t),r=b(e);(0,m.WQ)(s,r,M(i)),(0,m.WQ)(r,s,M(n))}function D(t,e){return S(),z(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function O(t,e){const i=z(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=(0,v.xP)(n+180,360)-180),i}function k(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||N(t,e)===C)&&i}function N(t,e){const i=t.getCode(),n=e.getCode();let s=(0,m.Jt)(i,n);return s||(s=R),s}function G(t,e){return N(b(t),b(e))}function z(t,e,i){return G(e,i)(t,void 0,t.length)}function j(t,e,i,n){const s=G(e,i);return(0,x.NW)(t,s,void 0,n)}let B=null;function U(){return B}function X(t,e){return B?z(t,e,B):t}function W(t,e){return B?z(t,B,e):(A&&!(0,y.aI)(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(A=!1,(0,T.R8)("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Y(t,e){return B?j(t,e,B):t}function Z(t,e){return B?j(t,B,e):t}function V(t,e){if(!B)return t;const i=b(e).getMetersPerUnit(),n=B.getMetersPerUnit();return i&&n?t*i/n:t}function H(t,e,i){return function(n){let s,r;if(t.canWrapX()){const e=t.getExtent(),o=(0,x.RG)(e);n=n.slice(0),r=(0,y.U$)(n,t,o),r&&(n[0]=n[0]-r*o),n[0]=(0,v.qE)(n[0],e[0],e[2]),n[1]=(0,v.qE)(n[1],e[1],e[3]),s=i(n)}else s=i(n);return r&&e.canWrapX()&&(s[0]+=r*(0,x.RG)(e.getExtent())),s}}var K,q,$;L(c),L(_),K=c,q=function(t,e,i,n){const o=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(o));for(let i=0;il?n=l:n<-l&&(n=-l),e[i+1]=n}return e},$=function(t,e,i,n){const o=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(o));for(let i=0;i{i.d(e,{A:()=>s});var n=i(8100);const s=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||n.I[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}},8100:(t,e,i)=>{i.d(e,{I:()=>r,q:()=>s});const n={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function s(t){return n[t]}const r={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937}},3158:(t,e,i)=>{i.d(e,{Jt:()=>r,WQ:()=>s});let n={};function s(t,e,i){const s=t.getCode(),r=e.getCode();s in n||(n[s]={}),n[s][r]=i}function r(t,e){let i;return t in n&&e in n[t]&&(i=n[t][e]),i}},7331:(t,e,i)=>{i.d(e,{r2:()=>a});var n=i(2236),s=i(9703),r=i(3608),o=i(3407);function a(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const e=t.inversePixelTransform[0],i=t.inversePixelTransform[1],a=Math.sqrt(e*e+i*i),l=t.frameState,h=(0,s.lw)(t.inversePixelTransform.slice(),l.coordinateToPixelTransform),c=(0,r.j)(l.viewState.resolution,a);let u;const d=(0,o.Tf)();return d&&(u=(0,o.FO)(d,l.viewState.projection)),new n.A(t.context,a,l.extent,h,l.viewState.rotation,c,u)}},9960:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(1685);class s extends n.Ay{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const r=s},3984:(t,e,i)=>{i.d(e,{A:()=>n});const n={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}},4778:(t,e,i)=>{i.d(e,{Ay:()=>p});var n=i(9703),s=i(915),r=i(3671),o=i(6514),a=i(2616),l=i(3407),h=i(3402),c=i(9969),u=i(4049),d=i(4238),g=i(7622);const _=(0,n.vt)();class f{constructor(t,e,i,n,s,r){this.styleFunction,this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?(0,s.dP)(this.flatCoordinates_):(0,s.Vy)(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=(0,s.q1)(this.getExtent());this.flatInteriorPoints_=(0,a.J)(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=(0,h.yJ)(this.flatCoordinates_,this.ends_),e=(0,u.C)(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=(0,a.p)(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=(0,c.SH)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let n=0,s=i.length;n{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=(0,r.P4)(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=(0,r.AL)(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=(0,r.Hg)(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n)}return n&&(this.simplifiedGeometry_=new f(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_})),this}}f.prototype.getFlatCoordinates=f.prototype.getOrientedFlatCoordinates;const p=f},2826:(t,e,i)=>{i.d(e,{A:()=>n});const n=class{drawCustom(t,e,i,n,s){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}},8774:(t,e,i)=>{i.d(e,{Jw:()=>L,M8:()=>m,MY:()=>p,NT:()=>f,Oq:()=>u,TA:()=>b,Tq:()=>x,ZV:()=>l,_K:()=>g,_m:()=>c,aq:()=>v,eL:()=>_,fZ:()=>S,jT:()=>I,qY:()=>h,vk:()=>d,yY:()=>y});var n=i(4120),s=i(7771),r=i(3530),o=i(8711),a=i(5176);const l="10px sans-serif",h="#000",c="round",u=[],d=0,g="round",_=10,f="#000",p="center",m="middle",x=[0,0,0,0],v=1,y=new n.A;let E,T=null;const A={},S=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let s,o;function l(s,r,a){let l=!0;for(let h=0;hMath.max(e,w(t,i))),0);return i[e]=n,n}function I(t,e){const i=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=e.length;h<=c;h+=2){const u=e[h];if("\n"===u||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=e[h+1]||t.font,g=w(d,u);i.push(g),o+=g;const _=C(d);n.push(_),l=Math.max(l,_)}return{width:r,height:a,widths:i,heights:n,lineWidths:s}}function L(t,e,i,n,s,r,o,a,l,h,c){t.save(),1!==i&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=i:t.globalAlpha*=i),e&&t.transform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(c[0],c[1]),function(t,e){const i=t.contextInstructions;for(let t=0,n=i.length;t{i.d(e,{A:()=>d});var n=i(6429),s=i(1580),r=i(2826),o=i(7295),a=i(915),l=i(8774),h=i(6514),c=i(6361);class u extends r.A{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,s=this.coordinates;let r=s.length;for(let o=0,l=t.length;ol&&(this.instructions.push([n.Ay.CUSTOM,l,u,t,i,c.n2,r]),this.hitDetectionInstructions.push([n.Ay.CUSTOM,l,u,t,s||i,c.n2,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),u=this.coordinates.length,this.instructions.push([n.Ay.CUSTOM,l,u,t,i,void 0,r]),this.hitDetectionInstructions.push([n.Ay.CUSTOM,l,u,t,s||i,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[n.Ay.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[n.Ay.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const i=t.length;let s,r,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[n.Ay.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[n.Ay.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,r=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!(0,h.aI)(t.currentLineDash,s)||t.currentLineDashOffset!=r||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=r,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[n.Ay.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(0,a.o8)(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;(0,a.r)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const d=u},136:(t,e,i)=>{i.d(e,{A:()=>p});var n=i(8130),s=i(6429),r=i(915);class o extends n.A{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!(0,r.Ym)(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,l=this.appendFlatPointCoordinates(n,o);this.instructions.push([s.Ay.DRAW_IMAGE,a,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([s.Ay.DRAW_IMAGE,a,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),o=[];for(let e=0,i=n.length;e{i.d(e,{y2:()=>R,$i:()=>w,x$:()=>b,Ay:()=>L});var n=i(6429),s=i(808),r=i(3624),o=i(9703),a=i(915),l=i(8774),h=i(1597),c=i(7622);function u(t,e,i,n,s,r,o,a,l,u,d,g){let _=t[e],f=t[e+1],p=0,m=0,x=0,v=0;function y(){p=_,m=f,_=t[e+=n],f=t[e+1],v+=x,x=Math.sqrt((_-p)*(_-p)+(f-m)*(f-m))}do{y()}while(et[2]}else I=T>w;const L=Math.PI,P=[],M=S+n===e;let F;if(x=0,v=C,_=t[e=S],f=t[e+1],M){y(),F=Math.atan2(f-m,_-p),I&&(F+=F>0?-L:L);const t=(w+T)/2,e=(b+A)/2;return P[0]=[t,e,(R-r)/2,F,s],P}for(let t=0,c=(s=s.replace(/\n/g," ")).length;t0?-L:L),void 0!==F){let t=g-F;if(t+=t>L?-2*L:t<-L?2*L:0,Math.abs(t)>o)return null}F=g;const T=t;let A=0;for(;t0&&t.push("\n",""),t.push(e,""),t}const A=class{constructor(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=(0,o.vt)(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new s.A:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const o=n?this.strokeStates[n]:null,a=i?this.fillStates[i]:null,h=this.textStates[e],c=this.pixelRatio,u=[h.scale[0]*c,h.scale[1]*c],d=h.justify?r.E[h.justify]:E(Array.isArray(t)?t[0]:t,h.textAlign||l.MY),g=n&&o.lineWidth?o.lineWidth:0,_=Array.isArray(t)?t:String(t).split("\n").reduce(T,[]),{width:f,height:p,widths:m,heights:x,lineWidths:v}=(0,l.jT)(h,_),y=f+g,A=[],S=(y+2)*u[0],C=(p+g)*u[1],R={width:S<0?Math.floor(S):Math.ceil(S),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:A};1==u[0]&&1==u[1]||A.push("scale",u),n&&(A.push("strokeStyle",o.strokeStyle),A.push("lineWidth",g),A.push("lineCap",o.lineCap),A.push("lineJoin",o.lineJoin),A.push("miterLimit",o.miterLimit),A.push("setLineDash",[o.lineDash]),A.push("lineDashOffset",o.lineDashOffset)),i&&A.push("fillStyle",a.fillStyle),A.push("textBaseline","middle"),A.push("textAlign","center");const w=.5-d;let b=d*y+w*g;const I=[],L=[];let P,M=0,F=0,D=0,O=0;for(let t=0,e=_.length;tt?t-c:s,R=r+u>e?e-u:r,w=y[3]+C*g[0]+y[1],b=y[0]+R*g[1]+y[2],I=A-y[3],L=S-y[0];let P;return(E||0!==d)&&(f[0]=I,x[0]=I,f[1]=L,p[1]=L,p[0]=I+w,m[0]=p[0],m[1]=L+b,x[1]=m[1]),0!==d?(P=(0,o.Zz)((0,o.vt)(),i,n,1,1,d,-i,-n),(0,o.Bb)(P,f),(0,o.Bb)(P,p),(0,o.Bb)(P,m),(0,o.Bb)(P,x),(0,a.N)(Math.min(f[0],p[0],m[0],x[0]),Math.min(f[1],p[1],m[1],x[1]),Math.max(f[0],p[0],m[0],x[0]),Math.max(f[1],p[1],m[1],x[1]),_)):(0,a.N)(Math.min(I,I+w),Math.min(L,L+b),Math.max(I,I+w),Math.max(L,L+b),_),v&&(A=Math.round(A),S=Math.round(S)),{drawImageX:A,drawImageY:S,drawImageW:C,drawImageH:R,originX:c,originY:u,declutterBox:{minX:_[0],minY:_[1],maxX:_[2],maxY:_[3],value:T},canvasTransform:P,scale:g}}replayImageOrLabel_(t,e,i,n,s,r,o){const a=!(!r&&!o),h=n.declutterBox,c=o?o[2]*n.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(a&&this.replayTextBackground_(t,f,p,m,x,r,o),(0,l.Jw)(t,n.canvasTransform,s,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=(0,o.Bb)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const s=this.textStates[e],o=this.createLabel(t,e,n,i),a=this.strokeStates[i],h=this.pixelRatio,c=E(Array.isArray(t)?t[0]:t,s.textAlign||l.MY),u=r.E[s.textBaseline||l.M8],d=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:c*(o.width/h-2*s.scale[0])+2*(.5-c)*d,anchorY:u*o.height/h+2*(.5-u)*d}}execute_(t,e,i,s,r,h,_,f){const p=this.zIndexContext_;let m;this.pixelCoordinates_&&(0,d.aI)(i,this.renderedTransform_)?m=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),m=(0,c.Rc)(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),(0,o.k3)(this.renderedTransform_,i));let x=0;const y=s.length;let T,A,S,C,R,w,b,I,L,P,M,F,D,O=0,k=0,N=0,G=null,z=null;const j=this.coordinateCache_,B=this.viewRotation_,U=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,X={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},W=this.instructions!=s||this.overlaps?0:200;let Y,Z,V,H;for(;xW&&(this.fill_(t),k=0),N>W&&(t.stroke(),N=0),k||N||(t.beginPath(),R=NaN,w=NaN),++x;break;case n.Ay.CIRCLE:O=i[1];const s=m[O],o=m[O+1],c=m[O+2]-s,d=m[O+3]-o,y=Math.sqrt(c*c+d*d);t.moveTo(s+y,o),t.arc(s,o,y,0,2*Math.PI,!0),++x;break;case n.Ay.CLOSE_PATH:t.closePath(),++x;break;case n.Ay.CUSTOM:O=i[1],T=i[2];const K=i[3],q=i[4],$=i[5];X.geometry=K,X.feature=Y,x in j||(j[x]=[]);const J=j[x];$?$(m,O,T,2,J):(J[0]=m[O],J[1]=m[O+1],J.length=2),p&&(p.zIndex=i[6]),q(J,X),++x;break;case n.Ay.DRAW_IMAGE:O=i[1],T=i[2],L=i[3],A=i[4],S=i[5];let Q=i[6];const tt=i[7],et=i[8],it=i[9],nt=i[10];let st=i[11];const rt=i[12];let ot=i[13];C=i[14]||"declutter";const at=i[15];if(!L&&i.length>=20){P=i[19],M=i[20],F=i[21],D=i[22];const t=this.drawLabelWithPointPlacement_(P,M,F,D);L=t.label,i[3]=L;const e=i[23];A=(t.anchorX-e)*this.pixelRatio,i[4]=A;const n=i[24];S=(t.anchorY-n)*this.pixelRatio,i[5]=S,Q=L.height,i[6]=Q,ot=L.width,i[13]=ot}let lt,ht,ct,ut;i.length>25&&(lt=i[25]),i.length>17?(ht=i[16],ct=i[17],ut=i[18]):(ht=l.Tq,ct=!1,ut=!1),nt&&U?st+=B:nt||U||(st-=B);let dt=0;for(;O!w.includes(t))),I={},L=class{constructor(t,e,i,n,s,r,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=(0,o.vt)(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);const s=t[i];for(const t in s){const i=s[t];n[t]=new A(this.resolution_,this.pixelRatio_,this.overlaps_,i,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let e=0,n=t.length;ei)break;let a=n[o];a||(a=[],n[o]=a),a.push(4*((t+s)*e+(t+r))+3),s>0&&a.push(4*((t-s)*e+(t+r))+3),r>0&&(a.push(4*((t+s)*e+(t-r))+3),s>0&&a.push(4*((t-s)*e+(t-r))+3))}const s=[];for(let t=0,e=n.length;t0){if(!r||"none"===i||"Image"!==f&&"Text"!==f||r.includes(t)){const i=(_[a]-3)/4,r=n-i%l,o=n-(i/l|0),h=s(t,e,r*r+o*o);if(h)return h}u.clearRect(0,0,l,l);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);let x,v,y,E,T;for(m.sort(d.V_),x=m.length-1;x>=0;--x){const t=m[x].toString();for(y=this.executorsByZIndex_[t],v=R.length-1;v>=0;--v)if(f=R[v],E=y[f],void 0!==E&&(T=E.executeHitDetection(u,h,i,p,g),T))return T}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],r=e[3],o=[i,n,i,r,s,r,s,n];return(0,c.Rc)(o,0,8,2,t,o),o}isEmpty(){return(0,C.p)(this.executorsByZIndex_)}execute(t,e,i,n,s,r,o){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(d.V_),r=r||R;const l=R.length;let h,c,u,g,_;for(o&&a.reverse(),h=0,c=a.length;hd.execute(t,e,i,n,s,o))):d.execute(g,e,i,n,s,o),_&&g.restore(),r){r.offset();const t=a[h]*l+u;this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(r)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(d.V_);for(let i=0,n=e.length;i{t.draw(this.renderedContext_),t.clear()})),t[e[i]].length=0}}},2236:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(2826),s=i(7295),r=i(9703),o=i(8774),a=i(6514),l=i(915),h=i(1597),c=i(7622),u=i(2096);class d extends n.A{constructor(t,e,i,n,s,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?(0,h.Mg)(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=(0,r.vt)()}drawImages_(t,e,i,n){if(!this.image_)return;const s=(0,c.Rc)(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;0===this.transformRotation_&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let t=0,e=s.length;tt*this.pixelRatio_)),lineDashOffset:(r||o.vk)*this.pixelRatio_,lineJoin:void 0!==a?a:o._K,lineWidth:(void 0!==l?l:o.aq)*this.pixelRatio_,miterLimit:void 0!==h?h:o.eL,strokeStyle:(0,s.F)(t||o.NT)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const r=t.getScaleArray();this.imageScale_=[r[0]*this.pixelRatio_/i,r[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:(0,s.F)(t||o.qY)}}else this.textFillState_=null;const i=t.getStroke();if(i){const t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),r=i.getLineDashOffset(),a=i.getLineJoin(),l=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:o._m,lineDash:n||o.Oq,lineDashOffset:r||o.vk,lineJoin:void 0!==a?a:o._K,lineWidth:void 0!==l?l:o.aq,miterLimit:void 0!==h?h:o.eL,strokeStyle:(0,s.F)(t||o.NT)}}else this.textStrokeState_=null;const n=t.getFont(),r=t.getOffsetX(),a=t.getOffsetY(),l=t.getRotateWithView(),h=t.getRotation(),c=t.getScaleArray(),u=t.getText(),d=t.getTextAlign(),g=t.getTextBaseline();this.textState_={font:void 0!==n?n:o.ZV,textAlign:void 0!==d?d:o.MY,textBaseline:void 0!==g?g:o.M8},this.text_=void 0!==u?Array.isArray(u)?u.reduce(((t,e,i)=>t+(i%2?" ":e)),""):u:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==a?this.pixelRatio_*a:0,this.textRotateWithView_=void 0!==l&&l,this.textRotation_=void 0!==h?h:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}else this.text_=""}}const g=d},6429:(t,e,i)=>{i.d(e,{Ay:()=>l,I5:()=>s,VD:()=>r,kx:()=>a,th:()=>o});const n={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},s=[n.FILL],r=[n.STROKE],o=[n.BEGIN_PATH],a=[n.CLOSE_PATH],l=n},3624:(t,e,i)=>{i.d(e,{E:()=>d,A:()=>_});var n=i(8130),s=i(6429),r=i(7295),o=i(8774),a=i(4087),l=i(915),h=i(1597);function c(t,e,i,n,s){const r=[];let o=i,a=0,l=e.slice(i,2);for(;a=t){const e=(t-a+d)/d,g=(0,h.Cc)(i,c,e),_=(0,h.Cc)(n,u,e);l.push(g,_),r.push(l),l=[g,_],a==t&&(o+=s),a=0}else if(a0&&r.push(l),r}function u(t,e,i,n,s){let r,o,a,l,h,c,u,d,g,_,f=i,p=i,m=0,x=0,v=i;for(o=i;ot&&(x>m&&(m=x,f=v,p=o),x=0,v=o-s)),a=l,u=g,d=_),h=i,c=n}return x+=l,x>m?[v,o]:[f,p]}const d={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class g extends n.A{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[o.qY]={fillStyle:o.qY},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const n=this.textFillState_,r=this.textStrokeState_,a=this.textState_;if(""===this.text_||!a||!n&&!r)return;const h=this.coordinates;let d=h.length;const g=t.getType();let _=null,f=t.getStride();if("line"!==a.placement||"LineString"!=g&&"MultiLineString"!=g&&"Polygon"!=g&&"MultiPolygon"!=g){let n=a.overflow?null:[];switch(g){case"Point":case"MultiPoint":_=t.getFlatCoordinates();break;case"LineString":_=t.getFlatMidpoint();break;case"Circle":_=t.getCenter();break;case"MultiLineString":_=t.getFlatMidpoints(),f=2;break;case"Polygon":_=t.getFlatInteriorPoint(),a.overflow||n.push(_[2]/this.resolution),f=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();_=[];for(let t=0,i=e.length;t{const n=h[2*(t+i)]===_[i*f]&&h[2*(t+i)+1]===_[i*f+1];return n||--t,n}))}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&this.updateFillStyle(this.state,this.createFill),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let l=a.padding;if(l!=o.Tq&&(a.scale[0]<0||a.scale[1]<0)){let t=a.padding[0],e=a.padding[1],i=a.padding[2],n=a.padding[3];a.scale[0]<0&&(e=-e,n=-n),a.scale[1]<0&&(t=-t,i=-i),l=[t,e,i,n]}const c=this.pixelRatio;this.instructions.push([s.Ay.DRAW_IMAGE,d,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,l==o.Tq?o.Tq:l.map((function(t){return t*c})),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);const u=1/c,p=this.state.fillStyle;a.backgroundFill&&(this.state.fillStyle=o.qY,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([s.Ay.DRAW_IMAGE,d,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[u,u],NaN,this.declutterMode_,this.declutterImageWithText_,l,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?o.qY:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),a.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}else{if(!(0,l.HY)(this.maxExtent,t.getExtent()))return;let n;if(_=t.getFlatCoordinates(),"LineString"==g)n=[_.length];else if("MultiLineString"==g)n=t.getEnds();else if("Polygon"==g)n=t.getEnds().slice(0,1);else if("MultiPolygon"==g){const e=t.getEndss();n=[];for(let t=0,i=e.length;t{i.d(e,{A:()=>s});var n=i(8711);const s=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy((0,n.lr)(),{get:(t,e)=>{if("function"==typeof(0,n.lr)()[e])return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach((e=>{for(let i=0,n=e.length;i{i.d(e,{F8:()=>d,_7:()=>u,tF:()=>c});var n=i(2236),s=i(9700),r=i(6514),o=i(1597),a=i(8711),l=i(3407),h=i(915);const c=.5;function u(t,e,i,o,u,d,g,_,f){const p=f?(0,l.JR)(u,f):u,m=t[0]*c,x=t[1]*c,v=(0,a.Y)(m,x);v.imageSmoothingEnabled=!1;const y=v.canvas,E=new n.A(v,c,u,null,g,_,f?(0,l.FO)((0,l.Tf)(),f):null),T=i.length,A=Math.floor(16777215/T),S={};for(let t=1;t<=T;++t){const e=i[t-1],n=e.getStyleFunction()||o;if(!n)continue;let r=n(e,d);if(!r)continue;Array.isArray(r)||(r=[r]);const l=(t*A).toString(16).padStart(7,"#00000");for(let t=0,i=r.length;t{i.d(e,{A:()=>l});var n=i(6837),s=i(6141),r=i(1854),o=i(4087);class a extends r.A{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return(0,o.b0)()}getData(t){return null}prepareFrame(t){return(0,o.b0)()}renderFrame(t,e){return(0,o.b0)()}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;e.getState()!==s.A.LOADED&&e.getState()!==s.A.ERROR||this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=s.A.LOADED&&e!=s.A.ERROR&&t.addEventListener(n.A.CHANGE,this.boundHandleImageChange_),e==s.A.IDLE&&(t.load(),e=t.getState()),e==s.A.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const l=a},6769:(t,e,i)=>{i.d(e,{A:()=>f,B:()=>d});var n=i(5986),s=i(9960),r=i(3984),o=i(808),a=i(9703),l=i(3730),h=i(8711),c=i(6514),u=i(915);const d=[];let g=null;class _ extends n.A{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=(0,a.vt)(),this.pixelTransform=(0,a.vt)(),this.inversePixelTransform=(0,a.vt)(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,i){let n;g||(g=(0,h.Y)(1,1,void 0,{willReadFrequently:!0})),g.clearRect(0,0,1,1);try{g.drawImage(t,e,i,1,1,0,0,1,1),n=g.getImageData(0,0,1,1).data}catch(t){return g=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let s,r;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&(0,c.aI)((0,l._j)(t.style.backgroundColor),(0,l._j)(i)))){const e=t.firstElementChild;e instanceof HTMLCanvasElement&&(r=e.getContext("2d"))}if(r&&r.canvas.style.transform===e?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=n;let t=s.style;t.position="absolute",t.width="100%",t.height="100%",r=(0,h.Y)();const e=r.canvas;s.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=s,this.context=r}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=(0,u.Py)(i),s=(0,u.WU)(i),r=(0,u.k_)(i),o=(0,u.R)(i);(0,a.Bb)(e.coordinateToPixelTransform,n),(0,a.Bb)(e.coordinateToPixelTransform,s),(0,a.Bb)(e.coordinateToPixelTransform,r),(0,a.Bb)(e.coordinateToPixelTransform,o);const l=this.inversePixelTransform;(0,a.Bb)(l,n),(0,a.Bb)(l,s),(0,a.Bb)(l,r),(0,a.Bb)(l,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const i=t.extent,n=t.viewState.resolution,s=t.viewState.rotation,r=t.pixelRatio,o=Math.round((0,u.RG)(i)/n*r),l=Math.round((0,u.Oq)(i)/n*r);(0,a.Zz)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/r,1/r,s,-o/2,-l/2),(0,a.T9)(this.inversePixelTransform,this.pixelTransform);const h=(0,a.dI)(this.pixelTransform);if(this.useContainer(e,h,this.getBackground(t)),!this.containerReused){const t=this.context.canvas;t.width!=o||t.height!=l?(t.width=o,t.height=l):this.context.clearRect(0,0,o,l),h!==t.style.transform&&(t.style.transform=h)}}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const r=new s.A(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(r.A.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(r.A.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new o.A),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(r.A.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(r.A.POSTRENDER,this.context,t))}getRenderTransform(t,e,i,n,s,r,o){const l=s/2,h=r/2,c=n/e,u=-c,d=-t[0]+o,g=-t[1];return(0,a.Zz)(this.tempTransform,l,h,c,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const f=_},4029:(t,e,i)=>{i.d(e,{A:()=>A});var n=i(6769),s=i(7607),r=i(190),o=i(4969),a=i(8596),l=i(7404),h=i(1110),c=i(1078),u=i(9703),d=i(6514),g=i(915),_=i(186),f=i(3407),p=i(4087),m=i(4401);function x(t,e,i,n){return`${t},${(0,_.dp)(e,i,n)}`}function v(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;const n=t[i],s=n.has(e);return s||n.add(e),!s}function y(t,e,i){const n=t[i];return!!n&&n.delete(e)}function E(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=(0,g._N)(e,(0,f.SD)(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=(0,g._N)(e,i))}return e}class T extends n.A{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=(0,g.S5)(),this.tempTileRange_=new h.A(0,0,0,0),this.tempTileCoord_=(0,_.N)(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new o.A(i),this.renderedProjection_=void 0,this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){const s=this.tileCache_,r=this.getLayer().getSource(),o=x(r.getKey(),t,e,i);let a;if(s.containsKey(o))a=s.get(o);else{if(a=r.getTile(t,e,i,n.pixelRatio,n.viewState.projection),!a)return null;s.set(o,a)}return a}getTile(t,e,i,n){return this.getOrCreateTile(t,e,i,n)||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=(0,u.Bb)(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!(0,g.Ym)(o,n))return null;const a=e.viewState,h=i.getRenderSource(),d=h.getTileGridForProjection(a.projection),_=h.getTilePixelRatio(e.pixelRatio);for(let t=d.getZForResolution(a.resolution);t>=d.getMinZoom();--t){const i=d.getTileCoordForCoordAndZ(n,t),o=this.getTile(t,i[1],i[2],e);if(!o||o.getState()!==c.A.LOADED)continue;const u=d.getOrigin(t),g=(0,m.xq)(d.getTileSize(t)),f=d.getResolution(t);let p;if(o instanceof r.A||o instanceof l.A)p=o.getImage();else{if(!(o instanceof s.Ay))continue;if(p=(0,s.xo)(o.getData()),!p)continue}const x=Math.floor(_*((n[0]-u[0])/f-i[1]*g[0])),v=Math.floor(_*((u[1]-n[1])/f-i[2]*g[1])),y=Math.round(_*h.getGutterForProjection(a.projection));return this.getImageData(p,x+y,v+y)}return null}prepareFrame(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(t,e,i,n,s){const r=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(r.projection),h=(0,p.v6)(a);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],d=o.getMapInternal(),g=Math.max(i-s,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection));for(let s=i;s>=g;--s){const i=l.getTileRangeForExtentAndZ(e,s,this.tempTileRange_),r=l.getResolution(s);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){const i=this.getTile(s,e,o,t);if(!i)continue;if(!v(n,i,s))continue;const a=i.getKey();if(u[a]=!0,i.getState()===c.A.IDLE&&!t.tileQueue.isKeyQueued(a)){const n=(0,_.N)(s,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,h,l.getTileCoordCenter(n),r])}}}}findStaleTile_(t,e){const i=this.tileCache_,n=t[0],s=t[1],r=t[2],o=this.getStaleKeys();for(let t=0;t0&&setTimeout((()=>{this.enqueueTiles(t,O,T-1,F,D-1)}),0),!(T in F))return this.container;const k=(0,p.v6)(this),N=t.time;for(const e of F[T]){const i=e.getState();if((e instanceof l.A||e instanceof a.A)&&i===c.A.EMPTY)continue;const n=e.tileCoord;if(i===c.A.LOADED&&1===e.getAlpha(k,N)){e.endTransition(k);continue}if(this.renderComplete=!1,this.findStaleTile_(n,F)){y(F,e,T),t.animate=!0;continue}if(this.findAltTiles_(v,n,T+1,F))continue;const s=v.getMinZoom();for(let t=T-1;t>=s&&!this.findAltTiles_(v,n,t,F);--t);}const G=A/r*h/R,z=this.getRenderContext(t);(0,u.Zz)(this.tempTransform,w/2,b/2,G,G,0,-w/2,-b/2),i.extent&&this.clipUnrotated(z,t,I),m.getInterpolate()||(z.imageSmoothingEnabled=!1),this.preRender(z,t);const j=Object.keys(F).map(Number);let B;j.sort(d.V_);const U=[],X=[];for(let e=j.length-1;e>=0;--e){const i=j[e],n=m.getTilePixelSize(i,h,s),r=v.getResolution(i)/A,o=n[0]*r*G,a=n[1]*r*G,l=v.getTileCoordForCoordAndZ((0,g.Py)(M),i),d=v.getTileCoordExtent(l),_=(0,u.Bb)(this.tempTransform,[R*(d[0]-M[0])/A,R*(M[3]-d[3])/A]),f=R*m.getGutterForProjection(s);for(const e of F[i]){if(e.getState()!==c.A.LOADED)continue;const n=e.tileCoord,s=l[1]-n[1],r=Math.round(_[0]-(s-1)*o),h=l[2]-n[2],u=Math.round(_[1]-(h-1)*a),d=Math.round(_[0]-s*o),p=Math.round(_[1]-h*a),x=r-d,v=u-p,y=1===j.length;let E=!1;B=[d,p,d+x,p,d+x,p+v,d,p+v];for(let t=0,e=U.length;t{const i=(0,p.v6)(m),n=e.wantedTiles[i],s=n?Object.keys(n).length:0;this.updateCacheSize(s),this.tileCache_.expireCache()})),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,r,o,a,l){let h;if(t instanceof s.Ay){if(h=(0,s.xo)(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(e),u=(0,p.v6)(this),d=e.layerStatesArray[e.layerIndex],g=d.opacity*(l?t.getAlpha(u,e.time):1),_=g!==c.globalAlpha;_&&(c.save(),c.globalAlpha=g),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,i,n,r,o),_&&c.restore(),g!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const n=(0,p.v6)(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}}const A=T},3608:(t,e,i)=>{i.d(e,{Eo:()=>a,gY:()=>h,j:()=>l,nl:()=>c});var n=i(6141),s=i(4087);const r=.5,o={Point:function(t,e,i,s,r,o){const a=i.getImage(),l=i.getText(),h=l&&l.getText(),c=o&&a&&h?{}:void 0;if(a){if(a.getImageState()!=n.A.LOADED)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,c),o.drawPoint(e,s,r)}if(h){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(l,c),n.drawText(e,s,r)}},LineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},Polygon:function(t,e,i,n,s){const r=i.getFill(),o=i.getStroke();if(r||o){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,o),a.drawPolygon(e,n,s)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n,s)}},MultiPoint:function(t,e,i,s,r,o){const a=i.getImage(),l=a&&0!==a.getOpacity(),h=i.getText(),c=h&&h.getText(),u=o&&l&&c?{}:void 0;if(l){if(a.getImageState()!=n.A.LOADED)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,u),o.drawMultiPoint(e,s,r)}if(c){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(h,u),n.drawText(e,s,r)}},MultiLineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},MultiPolygon:function(t,e,i,n,s){const r=i.getFill(),o=i.getStroke();if(o||r){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,o),a.drawMultiPolygon(e,n,s)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n,s)}},GeometryCollection:function(t,e,i,n,s,r){const a=e.getGeometriesArray();let l,h;for(l=0,h=a.length;l0;return _&&Promise.all(c).then((()=>r(null))),function(t,e,i,n,s,r,a){const l=i.getGeometryFunction()(e);if(!l)return;const h=l.simplifyTransformed(n,s);i.getRenderer()?u(t,h,i,e,a):(0,o[h.getType()])(t,h,i,e,a,r)}(t,e,i,s,a,l,h),_}function u(t,e,i,n,s){if("GeometryCollection"!=e.getType())t.getBuilder(i.getZIndex(),"Default").drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer(),s);else{const r=e.getGeometries();for(let e=0,o=r.length;e{i.d(e,{A:()=>c});var n=i(5332),s=i(5986),r=i(9960),o=i(3984),a=i(9777),l=i(9703);class h extends s.A{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=(0,l.vt)(),this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,this.onMapChanged_=()=>{this.clearCache(),this.removeHelper()},t.addChangeListener(n.A.MAP,this.onMapChanged_),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(o.A.PRECOMPOSE)){const n=new r.A(o.A.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(o.A.POSTCOMPOSE)){const n=new r.A(o.A.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e,i=!0,n=-1;for(let s=0,r=t.layerStatesArray.length;s{i.d(e,{eS:()=>j,gF:()=>z,Ay:()=>U});var n=i(8596),s=i(7404),r=i(1078),o=i(9332),a=i(6837),l=i(190),h=i(4087);class c extends o.A{constructor(t){super(),this.tile,this.handleTileChange_=this.handleTileChange_.bind(this),this.gutter=t.gutter||0,this.helper=t.helper,this.loaded=!1,this.ready=!1}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(a.A.CHANGE,this.handleTileChange_),this.tile=t,this.loaded=t.getState()===r.A.LOADED,this.loaded)this.uploadTile();else{if(t instanceof l.A){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(a.A.CHANGE,this.handleTileChange_)}}uploadTile(){(0,h.b0)()}setReady(){this.ready=!0,this.dispatchEvent(a.A.CHANGE)}handleTileChange_(){this.tile.getState()===r.A.LOADED&&(this.loaded=!0,this.uploadTile())}setHelper(t){this.helper=t,this.helper&&this.loaded&&this.uploadTile()}disposeInternal(){this.setHelper(null),this.tile.removeEventListener(a.A.CHANGE,this.handleTileChange_)}}const u=c;var d=i(7607),g=i(259),_=i(130),f=i(8711),p=i(4401);function m(t,e,i){const n=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function x(t,e,i,n,s,r){const o=t.getGL();let a,l;i instanceof Float32Array?(a=o.FLOAT,t.getExtension("OES_texture_float"),l=null!==t.getExtension("OES_texture_float_linear")):(a=o.UNSIGNED_BYTE,l=!0),m(o,e,r&&l);const h=i.byteLength/n[1];let c,u=1;switch(h%8==0?u=8:h%4==0?u=4:h%2==0&&(u=2),s){case 1:c=o.LUMINANCE;break;case 2:c=o.LUMINANCE_ALPHA;break;case 3:c=o.RGB;break;case 4:c=o.RGBA;break;default:throw new Error(`Unsupported number of bands: ${s}`)}const d=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,u),o.texImage2D(o.TEXTURE_2D,0,c,n[0],n[1],0,c,a,i),o.pixelStorei(o.UNPACK_ALIGNMENT,d)}let v=null;const y=class extends u{constructor(t){super(t),this.textures=[],this.renderSize_=(0,p.xq)(t.grid.getTileSize(t.tile.tileCoord[0])),this.bandCount=NaN;const e=new g.Ay(_.H7,_.Ek);e.fromArray([0,1,1,1,1,0,0,0]),this.helper.flushBufferData(e),this.coords=e,this.setTile(t.tile)}setHelper(t){const e=this.helper?.getGL();if(e){this.helper.deleteBuffer(this.coords);for(let t=0;t=p;--s){const i=c.getTileRangeForExtentAndZ(e,s,this.tempTileRange_),a=c.getResolution(s);for(let e=i.minX;e<=i.maxX;++e)for(let h=i.minY;h<=i.maxY;++h){const i=(0,C.N)(s,e,h,this.tempTileCoord_),f=O(l,i);let p,m;if(_.containsKey(f)&&(p=_.get(f),m=p.tile),!(p&&p.tile.key===l.getKey()||(m=l.getTile(s,e,h,t.pixelRatio,o.projection),m)))continue;if(M(n,m))continue;p?p.setTile(m):(p=this.createTileRepresentation({tile:m,grid:c,helper:this.helper,gutter:u}),_.set(f,p)),F(n,p,s);const x=m.getKey();g[x]=!0,m.getState()===r.A.IDLE&&(t.tileQueue.isKeyQueued(x)||t.tileQueue.enqueue([m,d,c.getTileCoordCenter(i),a]))}}}beforeTilesRender(t,e){this.helper.prepareDraw(this.frameState,!e,!0)}beforeTilesMaskRender(t){return!1}renderTile(t,e,i,n,s,r,o,a,l,h,c){}renderTileMask(t,e,i,n){}drawTile_(t,e,i,n,s,r,o){if(!e.ready)return;const a=e.tile.tileCoord,l=(0,C.i7)(a),h=l in r?r[l]:1,c=o.getResolution(i),u=(0,p.xq)(o.getTileSize(i),this.tempSize_),d=o.getOrigin(i),g=o.getTileCoordExtent(a),_=h<1?-1:P(i);h<1&&(t.animate=!0);const f=t.viewState,m=f.center[0],x=f.center[1],v=u[0]+2*n,y=u[1]+2*n,E=v/y,T=(m-d[0])/(u[0]*c),A=(d[1]-x)/(u[1]*c),S=f.resolution/c,w=a[1],b=a[2];(0,R.cL)(this.tileTransform_),(0,R.hs)(this.tileTransform_,2/(t.size[0]*S/v),-2/(t.size[1]*S/v)),(0,R.e$)(this.tileTransform_,f.rotation),(0,R.hs)(this.tileTransform_,1,1/E),(0,R.Tl)(this.tileTransform_,(u[0]*(w-T)-n)/v,(u[1]*(b-A)-n)/y),this.renderTile(e,this.tileTransform_,t,s,c,u,d,g,_,n,h)}renderFrame(t){this.frameState=t,this.renderComplete=!0;const e=this.helper.getGL();this.preRender(e,t);const i=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(i.projection),c=a.getGutterForProjection(i.projection),u=D(t,t.extent),d=l.getZForResolution(i.resolution,a.zDirection),g={tileIds:new Set,representationsByZ:{}},_=o.getPreload();if(t.nextExtent){const e=l.getZForResolution(i.nextResolution,a.zDirection),n=D(t,t.nextExtent);this.enqueueTiles(t,n,e,g,_)}this.enqueueTiles(t,u,d,g,0),_>0&&setTimeout((()=>{this.enqueueTiles(t,u,d-1,g,_-1)}),0);const f={},p=(0,h.v6)(this),m=t.time;let x=!1;const v=g.representationsByZ;if(d in v)for(const t of v[d]){const e=t.tile;if((e instanceof s.A||e instanceof n.A)&&e.getState()===r.A.EMPTY)continue;const i=e.tileCoord;if(t.ready){const t=e.getAlpha(p,m);if(1===t){e.endTransition(p);continue}x=!0,f[(0,C.i7)(i)]=t}if(this.renderComplete=!1,this.findAltTiles_(l,i,d+1,g))continue;const o=l.getMinZoom();for(let t=d-1;t>=o&&!this.findAltTiles_(l,i,t,g);--t);}const y=Object.keys(v).map(Number).sort(w.rG);if(this.beforeTilesMaskRender(t))for(let t=0,e=y.length;tt.dispose())),t.clear()}afterHelperCreated(){super.afterHelperCreated(),this.tileRepresentationCache.forEach((t=>t.setHelper(this.helper)))}disposeInternal(){super.disposeInternal(),delete this.frameState}}const N=k;var G=i(9777);const z={TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",RESOLUTION:"u_resolution",ZOOM:"u_zoom",GLOBAL_ALPHA:"u_globalAlpha",PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},j={TEXTURE_COORD:"a_textureCoord"},B=[{name:j.TEXTURE_COORD,size:2,type:G.jQ.FLOAT}],U=class extends N{constructor(t,e){super(t,e),this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new g.Ay(_.IP,_.Ek),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=e.paletteTextures||[]}reset(t){if(super.reset(t),this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}if(this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_);const t=this.helper.getGL();for(const e of this.paletteTextures_)e.getTexture(t)}}afterHelperCreated(){super.afterHelperCreated();const t=this.helper.getGL();for(const e of this.paletteTextures_)e.getTexture(t);this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}removeHelper(){if(this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}super.removeHelper()}createTileRepresentation(t){return new y(t)}beforeTilesRender(t,e){super.beforeTilesRender(t,e),this.helper.useProgram(this.program_,t)}renderTile(t,e,i,n,s,r,o,a,l,h,c){const u=this.helper.getGL();this.helper.bindBuffer(t.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(B);let d=0;for(;d0&&(v=a,(0,I._N)(v,n,v)),this.helper.setUniformFloatVec4(z.RENDER_EXTENT,v),this.helper.setUniformFloatValue(z.RESOLUTION,g.resolution),this.helper.setUniformFloatValue(z.ZOOM,g.zoom),this.helper.setUniformFloatValue(z.TEXTURE_PIXEL_WIDTH,_),this.helper.setUniformFloatValue(z.TEXTURE_PIXEL_HEIGHT,f),this.helper.setUniformFloatValue(z.TEXTURE_RESOLUTION,s),this.helper.setUniformFloatValue(z.TEXTURE_ORIGIN_X,o[0]+m*r[0]*s-h*s),this.helper.setUniformFloatValue(z.TEXTURE_ORIGIN_Y,o[1]-x*r[1]*s+h*s),this.helper.drawElements(0,this.indices_.getSize())}getData(t){if(!this.helper.getGL())return null;const e=this.frameState;if(!e)return null;const i=this.getLayer(),o=(0,R.Bb)(e.pixelToCoordinateTransform,t.slice()),a=e.viewState,l=i.getExtent();if(l&&!(0,I.Ym)((0,b.SD)(l,a.projection),o))return null;const h=i.getSources((0,I.Tr)([o]),a.resolution);let c,u,d;for(c=h.length-1;c>=0;--c)if(u=h[c],"ready"===u.getState()){if(d=u.getTileGridForProjection(a.projection),u.getWrapX())break;const t=d.getExtent();if(!t||(0,I.Ym)(t,o))break}if(c<0)return null;const g=this.tileRepresentationCache;for(let t=d.getZForResolution(a.resolution);t>=d.getMinZoom();--t){const e=d.getTileCoordForCoordAndZ(o,t),i=O(u,e);if(!g.containsKey(i))continue;const a=g.get(i),l=a.tile;if((l instanceof s.A||l instanceof n.A)&&l.getState()===r.A.EMPTY)return null;if(!a.loaded)continue;const h=d.getOrigin(t),c=(0,p.xq)(d.getTileSize(t)),_=d.getResolution(t),f=(o[0]-h[0])/_-e[1]*c[0],m=(h[1]-o[1])/_-e[2]*c[1];return a.getPixelData(f,m)}return null}disposeInternal(){const t=this.helper;if(t){const e=t.getGL();for(const t of this.paletteTextures_)t.delete(e);this.paletteTextures_.length=0,e.deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)}super.disposeInternal(),delete this.indices_}}},3513:(t,e,i)=>{i.d(e,{BV:()=>l,KQ:()=>u,XX:()=>g,aY:()=>d});var n=i(915),s=i(8711),r=i(3407),o=i(1597);let a;const l=[];function h(t,e,i,n,s){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,s),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,s)),t.restore()}function c(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function u(t,e,i,s){const o=(0,r.pd)(i,e,t);let a=(0,r.hO)(e,s,i);const l=e.getMetersPerUnit();void 0!==l&&(a*=l);const h=t.getMetersPerUnit();void 0!==h&&(a/=h);const c=t.getExtent();if(!c||(0,n.Ym)(c,o)){const e=(0,r.hO)(t,a,o)/a;isFinite(e)&&e>0&&(a/=e)}return a}function d(t,e,i,s){const r=(0,n.q1)(i);let o=u(t,e,r,s);return(!isFinite(o)||o<=0)&&(0,n.sB)(i,(function(i){return o=u(t,e,i,s),isFinite(o)&&o>0})),o}function g(t,e,i,r,u,d,g,_,f,p,m,x,v,y){const E=(0,s.Y)(Math.round(i*t),Math.round(i*e),l);if(x||(E.imageSmoothingEnabled=!1),0===f.length)return E.canvas;function T(t){return Math.round(t*i)/i}E.scale(i,i),E.globalCompositeOperation="lighter";const A=(0,n.S5)();let S;f.forEach((function(t,e,i){(0,n.X$)(A,t.extent)}));const C=i/r,R=(x?1:1+Math.pow(2,-24))/C;if(!v||1!==f.length||0!==p){if(S=(0,s.Y)(Math.round((0,n.RG)(A)*C),Math.round((0,n.Oq)(A)*C),l),x||(S.imageSmoothingEnabled=!1),u&&y){const t=(u[0]-A[0])*C,e=-(u[3]-A[3])*C,i=(0,n.RG)(u)*C,s=(0,n.Oq)(u)*C;S.rect(t,e,i,s),S.clip()}f.forEach((function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){S.save();const e=(t.clipExtent[0]-A[0])*C,i=-(t.clipExtent[3]-A[3])*C,s=(0,n.RG)(t.clipExtent)*C,r=(0,n.Oq)(t.clipExtent)*C;S.rect(x?e:Math.round(e),x?i:Math.round(i),x?s:Math.round(e+s)-Math.round(e),x?r:Math.round(i+r)-Math.round(i)),S.clip()}const e=(t.extent[0]-A[0])*C,i=-(t.extent[3]-A[3])*C,s=(0,n.RG)(t.extent)*C,r=(0,n.Oq)(t.extent)*C;S.drawImage(t.image,p,p,t.image.width-2*p,t.image.height-2*p,x?e:Math.round(e),x?i:Math.round(i),x?s:Math.round(e+s)-Math.round(e),x?r:Math.round(i+r)-Math.round(i)),t.clipExtent&&S.restore()}}))}const w=(0,n.Py)(g);return _.getTriangles().forEach((function(t,e,i){const r=t.source,u=t.target;let g=r[0][0],_=r[0][1],p=r[1][0],m=r[1][1],v=r[2][0],y=r[2][1];const C=T((u[0][0]-w[0])/d),b=T(-(u[0][1]-w[1])/d),I=T((u[1][0]-w[0])/d),L=T(-(u[1][1]-w[1])/d),P=T((u[2][0]-w[0])/d),M=T(-(u[2][1]-w[1])/d),F=g,D=_;g=0,_=0,p-=F,m-=D,v-=F,y-=D;const O=[[p,m,0,0,I-C],[v,y,0,0,P-C],[0,0,p,m,L-b],[0,0,v,y,M-b]],k=(0,o.KU)(O);if(!k)return;if(E.save(),E.beginPath(),function(){if(void 0===a){const t=(0,s.Y)(6,6,l);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",h(t,4,5,4,0),h(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;a=c(e,0)||c(e,4)||c(e,8),(0,s.Yg)(t),l.push(t.canvas)}return a}()||!x){E.moveTo(I,L);const t=4,e=C-I,i=b-L;for(let n=0;n{i.d(e,{A:()=>_});var n=i(3101),s=i(7607),r=i(6837),o=i(1078),a=i(2913),l=i(3513),h=i(1597),c=i(8711),u=i(915),d=i(9438);class g extends s.Ay{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,i=e.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?s?(0,u._N)(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),c=this.targetTileGrid_.getExtent();let d=this.sourceTileGrid_.getExtent();const g=c?(0,u._N)(r,c):r;if(0===(0,u.UG)(g))return void(this.state=o.A.EMPTY);i&&(d=d?(0,u._N)(d,i):i);const _=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),f=t.targetProj,p=(0,l.aY)(e,f,g,_);if(!isFinite(p)||p<=0)return void(this.state=o.A.EMPTY);const m=void 0!==t.errorThreshold?t.errorThreshold:n.l;if(this.triangulation_=new a.A(e,f,g,d,p*m,_),0===this.triangulation_.getTriangles().length)return void(this.state=o.A.EMPTY);this.sourceZ_=this.sourceTileGrid_.getZForResolution(p);let x=this.triangulation_.calculateSourceExtent();if(d&&(e.canWrapX()?(x[1]=(0,h.qE)(x[1],d[1],d[3]),x[3]=(0,h.qE)(x[3],d[1],d[3])):x=(0,u._N)(x,d)),(0,u.UG)(x)){let n=0,s=0;e.canWrapX()&&(n=(0,u.RG)(i),s=Math.floor((x[0]-i[0])/n)),(0,u.QJ)(x.slice(),e,!0).forEach((e=>{const i=this.sourceTileGrid_.getTileRangeForExtentAndZ(e,this.sourceZ_),r=t.getTileFunction;for(let t=i.minX;t<=i.maxX;t++)for(let e=i.minY;e<=i.maxY;e++){const i=r(this.sourceZ_,t,e,this.pixelRatio_);if(i){const t=s*n;this.sourceTiles_.push({tile:i,offset:t})}}++s})),0===this.sourceTiles_.length&&(this.state=o.A.EMPTY)}else this.state=o.A.EMPTY}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach((i=>{const n=i.tile;if(!n||n.getState()!==o.A.LOADED)return;const r=n.getSize(),a=this.gutter_;let l;const h=(0,s.bL)(n.getData());h?l=h:(e=!0,l=(0,s.$r)((0,s.xo)(n.getData())));const c=[r[0]+2*a,r[1]+2*a],u=l instanceof Float32Array,d=c[0]*c[1],g=u?Float32Array:Uint8ClampedArray,_=new g(l.buffer),f=g.BYTES_PER_ELEMENT,p=f*_.length/d,m=_.byteLength/c[1],x=Math.floor(m/f/c[0]),v=d*x;let y=_;if(_.length!==v){y=new g(v);let t=0,e=0;const i=c[0]*x;for(let n=0;n=0;--e){const i=[];for(let n=0,s=t.length;n{const i=e.getState();if(i!==o.A.IDLE&&i!==o.A.LOADING)return;t++;const n=(0,d.KT)(e,r.A.CHANGE,(()=>{const i=e.getState();i!=o.A.LOADED&&i!=o.A.ERROR&&i!=o.A.EMPTY||((0,d.JH)(n),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(n)})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t}){t.getState()==o.A.IDLE&&t.load()}))}unlistenSources_(){this.sourcesListenerKeys_.forEach(d.JH),this.sourcesListenerKeys_=null}}const _=g},7404:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(3101),s=i(6837),r=i(8143),o=i(1078),a=i(2913),l=i(3513),h=i(1597),c=i(915),u=i(9438),d=i(8711);class g extends r.A{constructor(t,e,i,s,r,u,d,g,_,f,p,m){super(r,o.A.IDLE,m),this.renderEdges_=void 0!==p&&p,this.pixelRatio_=d,this.gutter_=g,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=u||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const x=s.getTileCoordExtent(this.wrappedTileCoord_),v=this.targetTileGrid_.getExtent();let y=this.sourceTileGrid_.getExtent();const E=v?(0,c._N)(x,v):x;if(0===(0,c.UG)(E))return void(this.state=o.A.EMPTY);const T=t.getExtent();T&&(y=y?(0,c._N)(y,T):T);const A=s.getResolution(this.wrappedTileCoord_[0]),S=(0,l.aY)(t,i,E,A);if(!isFinite(S)||S<=0)return void(this.state=o.A.EMPTY);const C=void 0!==f?f:n.l;if(this.triangulation_=new a.A(t,i,E,y,S*C,A),0===this.triangulation_.getTriangles().length)return void(this.state=o.A.EMPTY);this.sourceZ_=e.getZForResolution(S);let R=this.triangulation_.calculateSourceExtent();if(y&&(t.canWrapX()?(R[1]=(0,h.qE)(R[1],y[1],y[3]),R[3]=(0,h.qE)(R[3],y[1],y[3])):R=(0,c._N)(R,y)),(0,c.UG)(R)){let i=0,n=0;t.canWrapX()&&(i=(0,c.RG)(T),n=Math.floor((R[0]-T[0])/i)),(0,c.QJ)(R.slice(),t,!0).forEach((t=>{const s=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=s.minX;t<=s.maxX;t++)for(let e=s.minY;e<=s.maxY;e++){const s=_(this.sourceZ_,t,e,d);if(s){const t=n*i;this.sourceTiles_.push({tile:s,offset:t})}}++n})),0===this.sourceTiles_.length&&(this.state=o.A.EMPTY)}else this.state=o.A.EMPTY}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach((e=>{const i=e.tile;if(i&&i.getState()==o.A.LOADED){const n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=e.offset,s[2]+=e.offset),t.push({extent:n,clipExtent:s,image:i.getImage()})}})),this.sourceTiles_.length=0,0===t.length)this.state=o.A.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],s="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),h=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=(0,l.XX)(n,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,h,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=o.A.LOADED}this.changed()}load(){if(this.state==o.A.IDLE){this.state=o.A.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((({tile:e})=>{const i=e.getState();if(i==o.A.IDLE||i==o.A.LOADING){t++;const i=(0,u.KT)(e,s.A.CHANGE,(n=>{const s=e.getState();s!=o.A.LOADED&&s!=o.A.ERROR&&s!=o.A.EMPTY||((0,u.JH)(i),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(i)}})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t},e,i){t.getState()==o.A.IDLE&&t.load()}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(u.JH),this.sourcesListenerKeys_=null}release(){this.canvas_&&((0,d.Yg)(this.canvas_.getContext("2d")),l.BV.push(this.canvas_),this.canvas_=null),super.release()}}const _=g},2913:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(915),s=i(3407),r=i(1597);const o=class{constructor(t,e,i,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const h=(0,s.RG)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){const e=t[0]+"/"+t[1];return l[e]||(l[e]=h(t)),l[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&(0,n.RG)(r)>=(0,n.RG)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,n.RG)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,n.RG)(this.targetProj_.getExtent()):null;const c=(0,n.Py)(i),u=(0,n.WU)(i),d=(0,n.k_)(i),g=(0,n.R)(i),_=this.transformInv_(c),f=this.transformInv_(u),p=this.transformInv_(d),m=this.transformInv_(g),x=10+(a?Math.max(0,Math.ceil(Math.log2((0,n.UG)(i)/(a*a*256*256)))):0);if(this.addQuad_(c,u,d,g,_,f,p,m,x),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach((function(e,i,n){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])})),this.triangles_.forEach((e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);const n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n.5&&d<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const r=(0,n.Tr)([t,e,i,s]);f=(0,n.RG)(r)/this.targetWorldWidth_>.25||f}!_&&this.sourceProj_.isGlobal()&&d&&(f=d>.25||f)}if(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!(0,n.HY)(u,this.maxSourceExtent_))return;let p=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(l[0])&&isFinite(l[1])&&isFinite(h[0])&&isFinite(h[1])))if(c>0)f=!0;else if(p=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(a[0])&&isFinite(a[1])?0:4)+(isFinite(l[0])&&isFinite(l[1])?0:2)+(isFinite(h[0])&&isFinite(h[1])?0:1),1!=p&&2!=p&&4!=p&&8!=p)return;if(c>0){if(!f){const e=[(t[0]+i[0])/2,(t[1]+i[1])/2],n=this.transformInv_(e);let s;s=_?((0,r.xP)(o[0],g)+(0,r.xP)(l[0],g))/2-(0,r.xP)(n[0],g):(o[0]+l[0])/2-n[0];const a=(o[1]+l[1])/2-n[1];f=s*s+a*a>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const n=[(e[0]+i[0])/2,(e[1]+i[1])/2],r=this.transformInv_(n),u=[(s[0]+t[0])/2,(s[1]+t[1])/2],d=this.transformInv_(u);this.addQuad_(t,e,n,u,o,a,r,d,c-1),this.addQuad_(u,n,i,s,d,r,l,h,c-1)}else{const n=[(t[0]+e[0])/2,(t[1]+e[1])/2],r=this.transformInv_(n),u=[(i[0]+s[0])/2,(i[1]+s[1])/2],d=this.transformInv_(u);this.addQuad_(t,n,u,s,o,r,d,h,c-1),this.addQuad_(n,e,i,u,r,a,l,d,c-1)}return}}if(_){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&p||this.addTriangle_(t,i,s,o,l,h),14&p||this.addTriangle_(t,i,e,o,l,a),p&&(13&p||this.addTriangle_(e,s,t,a,h,o),7&p||this.addTriangle_(e,s,i,a,h,l))}calculateSourceExtent(){const t=(0,n.S5)();return this.triangles_.forEach((function(e,i,s){const r=e.source;(0,n.$C)(t,r[0]),(0,n.$C)(t,r[1]),(0,n.$C)(t,r[2])})),t}getTriangles(){return this.triangles_}}},3101:(t,e,i)=>{i.d(e,{l:()=>n});const n=.5},4498:(t,e,i)=>{i.d(e,{a$:()=>o,b8:()=>s,cq:()=>a,dv:()=>r});var n=i(1597);function s(t){if(void 0!==t)return 0}function r(t){if(void 0!==t)return t}function o(t){const e=2*Math.PI/t;return function(t,i){return i?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function a(t){const e=void 0===t?(0,n.eh)(5):t;return function(t,i){return i||void 0===t?t:Math.abs(t)<=e?0:t}}},4401:(t,e,i)=>{function n(t){return t[0]>0&&t[1]>0}function s(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function r(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}i.d(e,{Ie:()=>n,hs:()=>s,xq:()=>r})},6203:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(6837),s=i(6717),r=i(4294),o=i(4602),a=i(6933),l=i(588),h=i(915),c=i(4087);class u extends o.A{constructor(t){super({attributions:(t=t||{}).attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(t){const e=t.getGeometry();return(0,l.v)(!e||"Point"===e.getType(),"The default `geometryFunction` can only handle `Point` or null geometries"),e},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,i){this.source?.loadFeatures(t,e,i),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(n.A.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(n.A.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const i=0===t?0:Math.min(e,t)/t,n=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=e,this.interpolationRatio=i,n&&this.refresh()}cluster(){if(void 0===this.resolution||!this.source)return;const t=(0,h.S5)(),e=this.distance*this.resolution,i=this.source.getFeatures(),n={};for(let s=0,r=i.length;s=0;--e){const n=this.geometryFunction(t[e]);n?(0,a.WQ)(i,n.getCoordinates()):t.splice(e,1)}(0,a.hs)(i,1/t.length);const n=(0,h.q1)(e),o=this.interpolationRatio,l=new r.A([i[0]*(1-o)+n[0]*o,i[1]*(1-o)+n[1]*o]);return this.createCustomCluster_?this.createCustomCluster_(l,t):new s.A({geometry:l,features:t})}}const d=u},4977:(t,e,i)=>{i.d(e,{A:()=>m});var n=i(7607),s=i(6837),r=i(8596),o=i(61),a=i(8469),l=i(6017),h=i(1078),c=i(4863),u=i(3407),d=i(186),g=i(4087),_=i(4238),f=i(4401);class p extends l.A{constructor(t){const e=void 0===t.projection?"EPSG:3857":t.projection;let i=t.tileGrid;void 0===i&&e&&(i=(0,c.EN)({extent:(0,c.kZ)(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize})),super({cacheSize:.1,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:e,tileGrid:i,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.tileSize_=t.tileSize?(0,f.xq)(t.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=t.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=void 0===t.bandCount?4:t.bandCount,this.tileGridForProjection_={},this.tileCacheForProjection_={},this.crossOrigin_=t.crossOrigin||"anonymous"}setTileSizes(t){this.tileSizes_=t}getTileSize(t){if(this.tileSizes_)return this.tileSizes_[t];if(this.tileSize_)return this.tileSize_;const e=this.getTileGrid();return e?(0,f.xq)(e.getTileSize(t)):[256,256]}getGutterForProjection(t){const e=this.getProjection();return!e||(0,u.tI)(e,t)?this.gutter_:0}setLoader(t){this.loader_=t}getReprojTile_(t,e,i,n,s){const o=this.getTileCacheForProjection(n),a=(0,d.dp)(t,e,i);if(o.containsKey(a)){const t=o.get(a);if(t&&t.key==this.getKey())return t}const l=this.getTileGrid(),h=Math.max.apply(null,l.getResolutions().map(((t,e)=>{const i=(0,f.xq)(l.getTileSize(e)),n=this.getTileSize(e);return Math.max(n[0]/i[0],n[1]/i[1])}))),c=this.getTileGridForProjection(s),u=this.getTileGridForProjection(n),g=[t,e,i],_=this.getTileCoordForTileUrlFunction(g,n),p=Object.assign({sourceProj:s,sourceTileGrid:c,targetProj:n,targetTileGrid:u,tileCoord:g,wrappedTileCoord:_,pixelRatio:h,gutter:this.getGutterForProjection(s),getTileFunction:(t,e,i,n)=>this.getTile(t,e,i,n,s)},this.tileOptions),m=new r.A(p);return m.key=this.getKey(),m}getTile(t,e,i,r,o){const a=this.getProjection();if(a&&o&&!(0,u.tI)(a,o))return this.getReprojTile_(t,e,i,o,a);const l=this.getTileSize(t),h=this.loader_,c=new AbortController,d={signal:c.signal,crossOrigin:this.crossOrigin_},g=this.getTileCoordForTileUrlFunction([t,e,i]);if(!g)return null;const f=g[0],p=g[1],m=g[2],x=Object.assign({tileCoord:[t,e,i],loader:function(){return(0,_.hq)((function(){return h(f,p,m,d)}))},size:l,controller:c},this.tileOptions),v=new n.Ay(x);return v.key=this.getKey(),v.addEventListener(s.A.CHANGE,this.handleTileChange_),v}handleTileChange_(t){const e=t.target,i=(0,g.v6)(e),n=e.getState();let s;n==h.A.LOADING?(this.tileLoadingKeys_[i]=!0,s=a.A.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=n==h.A.ERROR?a.A.TILELOADERROR:n==h.A.LOADED?a.A.TILELOADEND:void 0),s&&this.dispatchEvent(new l.c(s,e))}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||(0,u.tI)(e,t)))return this.tileGrid;const i=(0,g.v6)(t);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=(0,c.pr)(t)),this.tileGridForProjection_[i]}setTileGridForProjection(t,e){const i=(0,u.Jt)(t);if(i){const t=(0,g.v6)(i);t in this.tileGridForProjection_||(this.tileGridForProjection_[t]=e)}}getTileCacheForProjection(t){const e=this.getProjection();if(!e||(0,u.tI)(e,t))return super.getTileCacheForProjection(t);const i=(0,g.v6)(t);return i in this.tileCacheForProjection_||(this.tileCacheForProjection_[i]=new o.A(.1)),this.tileCacheForProjection_[i]}expireCache(t,e){const i=this.getTileCacheForProjection(t);for(const t in this.tileCacheForProjection_){const n=this.tileCacheForProjection_[t];n.expireCache(n==i?e:{})}}clear(){super.clear();for(const t in this.tileCacheForProjection_)this.tileCacheForProjection_[t].clear()}}const m=p},9925:(t,e,i)=>{i.d(e,{Ay:()=>S,VV:()=>T,QD:()=>A});var n=i(1685),s=i(6837),r=i(6141),o=i(3938),a=i(3101),l=i(2913),h=i(3513);function c(t){return Array.isArray(t)?Math.min(...t):t}var u=i(915),d=i(9438);class g extends o.Ay{constructor(t,e,i,n,s,o,c){let d=t.getExtent();d&&t.canWrapX()&&(d=d.slice(),d[0]=-1/0,d[2]=1/0);let g=e.getExtent();g&&e.canWrapX()&&(g=g.slice(),g[0]=-1/0,g[2]=1/0);const _=g?(0,u._N)(i,g):i,f=(0,u.q1)(_),p=(0,h.KQ)(t,e,f,n),m=a.l,x=new l.A(t,e,_,d,p*m,n),v=x.calculateSourceExtent(),y=(0,u.Im)(v)?null:o(v,p,s),E=y?r.A.IDLE:r.A.EMPTY,T=y?y.getPixelRatio():1;super(i,n,T,E),this.targetProj_=e,this.maxSourceExtent_=d,this.triangulation_=x,this.targetResolution_=n,this.targetExtent_=i,this.sourceImage_=y,this.sourcePixelRatio_=T,this.interpolate_=c,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==r.A.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==r.A.LOADED){const t=(0,u.RG)(this.targetExtent_)/this.targetResolution_,e=(0,u.Oq)(this.targetExtent_)/this.targetResolution_;this.canvas_=(0,h.XX)(t,e,this.sourcePixelRatio_,c(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(this.state==r.A.IDLE){this.state=r.A.LOADING,this.changed();const t=this.sourceImage_.getState();t==r.A.LOADED||t==r.A.ERROR?this.reproject_():(this.sourceListenerKey_=(0,d.KT)(this.sourceImage_,s.A.CHANGE,(t=>{const e=this.sourceImage_.getState();e!=r.A.LOADED&&e!=r.A.ERROR||(this.unlistenSource_(),this.reproject_())})),this.sourceImage_.load())}}unlistenSource_(){(0,d.JH)(this.sourceListenerKey_),this.sourceListenerKey_=null}}const _=g;var f=i(6444),p=i(2192),m=i(1597),x=i(3407),v=i(6514);class y extends n.Ay{constructor(t,e){super(t),this.image=e}}class E extends f.A{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:void 0===t.interpolate||t.interpolate}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=!!t.loader&&0===t.loader.length,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();return e&&(t=e[(0,v.FT)(e,t,0)]),t}getImage(t,e,i,n){const s=this.getProjection();if(!s||!n||(0,x.tI)(s,n))return s&&(n=s),this.getImageInternal(t,e,i,n);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&(0,x.tI)(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&(0,u.aI)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new _(s,n,t,e,i,((t,e,i)=>this.getImageInternal(t,e,i,s)),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,i,n){if(this.loader){const r=A(t,e,i,1),a=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===n&&(this.wantedExtent_&&(0,u.ms)(this.wantedExtent_,r)||(0,u.ms)(this.image.getExtent(),r))&&(this.wantedResolution_&&c(this.wantedResolution_)===a||c(this.image.getResolution())===a)))return this.image;this.wantedProjection_=n,this.wantedExtent_=r,this.wantedResolution_=a,this.image=new o.Ay(r,a,i,this.loader),this.image.addEventListener(s.A.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let i;switch(e.getState()){case r.A.LOADING:this.loading=!0,i="imageloadstart";break;case r.A.LOADED:this.loading=!1,i="imageloadend";break;case r.A.ERROR:this.loading=!1,i="imageloaderror";break;default:return}this.hasListener(i)&&this.dispatchEvent(new y(i,e))}}function T(t,e){t.getImage().src=e}function A(t,e,i,n){const s=e/i,r=(0,u.q1)(t),o=(0,m.mk)((0,u.RG)(t)/s,p.B),a=(0,m.mk)((0,u.Oq)(t)/s,p.B),l=o+2*(0,m.mk)((n-1)*o/2,p.B),h=a+2*(0,m.mk)((n-1)*a/2,p.B);return(0,u.Bg)(r,s,0,[l,h])}const S=E},8270:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(9925),r=i(3938),o=i(915),a=i(3407);class l extends s.Ay{constructor(t){const e=void 0!==t.crossOrigin?t.crossOrigin:null,i=void 0!==t.imageLoadFunction?t.imageLoadFunction:s.VV;super({attributions:t.attributions,interpolate:t.interpolate,projection:(0,a.Jt)(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image=null,this.image=new r.Ay(this.imageExtent_,void 0,1,function(t){const e=t.load||r.D4,i=t.imageExtent,n=t.crossOrigin??null;return()=>{const s=new Image;return s.crossOrigin=n,e(s,t.url).then((t=>{const e=(0,o.RG)(i)/t.width,n=(0,o.Oq)(i)/t.height;return{image:t,extent:i,resolution:e!==n?[e,n]:n,pixelRatio:1}}))}}({url:t.url,imageExtent:t.imageExtent,crossOrigin:e,load:(t,e)=>(this.image.setImage(t),i(this.image,e),(0,r.D4)(t))})),this.image.addEventListener(n.A.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,i,n){return(0,o.HY)(t,this.image.getExtent())?this.image:null}getUrl(){return this.url_}}const h=l},3080:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(4977),s=i(4465);const r=new Error("Image failed to load");function o(t,e,i,n,o){return new Promise(((a,l)=>{const h=new Image;h.crossOrigin=o.crossOrigin??null,h.addEventListener("load",(()=>a(h))),h.addEventListener("error",(()=>l(r))),h.src=(0,s.M)(t,e,i,n,o.maxY)}))}function a(t){return function(e,i,n,r){return o((0,s.de)(t,e,i,n),e,i,n,r)}}function l(t){let e;if(Array.isArray(t))e=a(t);else if("string"==typeof t)e=a((0,s.Uu)(t));else{if("function"!=typeof t)throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");i=t,e=function(t,e,n,s){return o(i(t,e,n,s),t,e,n,s)}}var i;return e}let h=0;function c(t){return Array.isArray(t)?t.join("\n"):"string"==typeof t?t:(++h,"url-function-key-"+h)}class u extends n.A{constructor(t){let e,i=(t=t||{}).loader;t.url&&(i=l(t.url),e=c(t.url));const n=i?t.state:"loading",s=void 0===t.wrapX||t.wrapX;super({loader:i,key:e,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize,gutter:t.gutter,maxResolution:t.maxResolution,projection:t.projection,tileGrid:t.tileGrid,state:n,wrapX:s,transition:t.transition,interpolate:!1!==t.interpolate,crossOrigin:t.crossOrigin})}setUrl(t){const e=l(t);this.setLoader(e),this.setKey(c(t)),"ready"!==this.getState()&&this.setState("ready")}}const d=u},1011:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(9925),s=i(3513),r=i(7500),o=i(3938),a=i(3407);class l extends n.Ay{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:n.VV,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,i,n){const o=(0,a.Jt)(i),l=this.getProjection();l&&l!==o&&(e=(0,s.KQ)(l,o,t,e),t=(0,a.pd)(t,o,l));const h={url:this.url_,params:{...this.params_,...n},projection:l||o};return(0,r.y4)(h,t,e)}getLegendUrl(t,e){return(0,r.$q)({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,i,n){return void 0===this.url_?null:(this.loader&&this.loaderProjection_===n||(this.loaderProjection_=n,this.loader=(0,r.Eq)({crossOrigin:this.crossOrigin_,params:this.params_,projection:n,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(t,e)=>(this.image.setImage(t),this.imageLoadFunction_(this.image,e),(0,o.D4)(t))})),super.getImageInternal(t,e,i,n))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const h=l},7896:(t,e,i)=>{i.d(e,{A:()=>o,o:()=>s});var n=i(702);const s='© OpenStreetMap contributors.';class r extends n.A{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:[s];const i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const o=r},6444:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(4120),s=i(3407);class r extends n.A{constructor(t){super(),this.projection=(0,s.Jt)(t.projection),this.attributions_=o(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise((function(t,i){e.viewResolver=t,e.viewRejector=i}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=o(t),this.changed()}setState(t){this.state_=t,this.changed()}}function o(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),e=>t):null}const a=r},6017:(t,e,i)=>{i.d(e,{A:()=>g,c:()=>d});var n=i(1685),s=i(6444),r=i(4087),o=i(588),a=i(3407),l=i(4863),h=i(4401),c=i(186);class u extends s.A{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;this.tileGrid&&(0,h.xq)(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=t.key||(0,r.v6)(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,s){return(0,r.b0)()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:(0,l.pr)(t)}getTileCacheForProjection(t){const e=this.getProjection();return(0,o.v)(null===e||(0,a.tI)(e,t),"Use the renderer's tile cache when not reprojecting."),null}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),r=(0,h.xq)(n.getTileSize(t),this.tmpSize);return 1==s?r:(0,h.hs)(r,s,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=void 0!==e?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=(0,l.Li)(i,t,e)),(0,c.N5)(t,i)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class d extends n.Ay{constructor(t,e){super(t),this.tile=e}}const g=u},8469:(t,e,i)=>{i.d(e,{A:()=>n});const n={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"}},8512:(t,e,i)=>{i.d(e,{A:()=>f});var n=i(6837),s=i(190),r=i(7404),o=i(61),a=i(1078),l=i(6164),h=i(3407),c=i(186),u=i(4863),d=i(4087);class g extends l.A{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:_,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:s.A,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);for(const t in this.tileCacheForProjection){const n=this.tileCacheForProjection[t];n.expireCache(n==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!(0,h.tI)(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||(0,h.tI)(e,t)))return this.tileGrid;const i=(0,d.v6)(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=(0,u.pr)(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||(0,h.tI)(e,t))return super.getTileCacheForProjection(t);const i=(0,d.v6)(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new o.A(512)),this.tileCacheForProjection[i]}createTile_(t,e,i,s,r,o){const l=[t,e,i],h=this.getTileCoordForTileUrlFunction(l,r),c=h?this.tileUrlFunction(h,s,r):void 0,u=new this.tileClass(l,void 0!==c?a.A.IDLE:a.A.EMPTY,void 0!==c?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(n.A.CHANGE,this.handleTileChange.bind(this)),u}getTile(t,e,i,n,s){const o=this.getProjection();if(!o||!s||(0,h.tI)(o,s))return this.getTileInternal(t,e,i,n,o||s);const a=this.getTileCacheForProjection(s),l=[t,e,i];let u;const d=(0,c.i7)(l);a.containsKey(d)&&(u=a.get(d));const g=this.getKey();if(u&&u.key==g)return u;const _=this.getTileGridForProjection(o),f=this.getTileGridForProjection(s),p=this.getTileCoordForTileUrlFunction(l,s),m=new r.A(o,_,s,f,l,p,this.getTilePixelRatio(n),this.getGutter(),((t,e,i,n)=>this.getTileInternal(t,e,i,n,o)),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=g,u?a.replace(d,m):a.set(d,m),m}getTileInternal(t,e,i,n,s){const r=this.getKey();return this.createTile_(t,e,i,n,s,r)}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(t,e){const i=(0,h.Jt)(t);if(i){const t=(0,d.v6)(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function _(t,e){t.getImage().src=e}const f=g},4218:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(8512),s=i(915),r=i(2654),o=i(4863),a=i(3407),l=i(4087);Error,Error;class h extends n.A{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:(0,a.Jt)("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)!function(t,e,i){const n=document.createElement("script"),s="olc_"+(0,l.v6)(e);function r(){delete window[s],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(t.includes("?")?"&":"?")+"callback="+s;const o=setTimeout((function(){r(),i&&i()}),1e4);window[s]=function(t){clearTimeout(o),r(),e(t)},document.head.appendChild(n)}(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=(0,a.Jt)("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=(0,a.FO)(e,i);n=(0,s.NW)(t.bounds,r)}const l=(0,o.kZ)(i),h=t.minzoom||0,c=t.maxzoom||22,u=(0,o.EN)({extent:l,maxZoom:c,minZoom:h,tileSize:this.tileSize_});if(this.tileGrid=u,this.tileUrlFunction=(0,r.Qz)(t.tiles,u),t.attribution&&!this.getAttributions()){const e=void 0!==n?n:l;this.setAttributions((function(i){return(0,s.HY)(e,i.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}}const c=h},2728:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(8512),s=i(7500),r=i(4465),o=i(915),a=i(3513),l=i(2806),h=i(3407),c=i(1597),u=i(186);class d extends n.A{constructor(t){t=t||{};const e=Object.assign({},t.params);super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=(0,o.S5)(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,i,n){const r=(0,h.Jt)(i),l=this.getProjection()||r;let c=this.getTileGrid();c||(c=this.getTileGridForProjection(l));const u=(0,h.pd)(t,r,l),d=(0,a.KQ)(l,r,t,e),g=c.getZForResolution(d,this.zDirection),_=c.getResolution(g),f=c.getTileCoordForCoordAndZ(u,g);if(c.getResolutions().length<=f[0])return;let p=c.getTileCoordExtent(f,this.tmpExtent_);const m=this.gutter_;0!==m&&(p=(0,o.r)(p,_*m,p));const x={QUERY_LAYERS:this.params_.LAYERS};Object.assign(x,(0,s.W3)(this.params_,"GetFeatureInfo"),n);const v=Math.floor((u[0]-p[0])/_),y=Math.floor((p[3]-u[1])/_);return x[this.v13_?"I":"X"]=v,x[this.v13_?"J":"Y"]=y,this.getRequestUrl_(f,p,1,l||r,x)}getLegendUrl(t,e){if(void 0===this.urls[0])return;const i={SERVICE:"WMS",VERSION:s.jD,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){const t=this.params_.LAYERS;if(Array.isArray(t)&&1!==t.length)return;i.LAYER=t}if(void 0!==t){const e=this.getProjection()?this.getProjection().getMetersPerUnit():1,n=28e-5;i.SCALE=t*e/n}return Object.assign(i,e),(0,r.LW)(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r){const o=this.urls;if(!o)return;let a;return a=1==o.length?o[0]:o[(0,c.xP)((0,u.tW)(t),o.length)],(0,s.AE)(e,(this.tileGrid||this.getTileGridForProjection(n)).getResolution(t[0]),i,n,a,r,this.serverType_)}getTilePixelRatio(t){return this.hidpi_&&void 0!==this.serverType_?t:1}getKeyForParams_(){let t=0;const e=[];for(const i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||s.jD;this.v13_=(0,l.Z)(t,"1.3")>=0}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);const r=n.getResolution(t[0]);let a=n.getTileCoordExtent(t,this.tmpExtent_);const l=this.gutter_;0!==l&&(a=(0,o.r)(a,r*l,a));const h=Object.assign({},(0,s.W3)(this.params_,"GetMap"));return this.getRequestUrl_(t,a,e,i,h)}}const g=d},6164:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(8469),s=i(6017),r=i(1078),o=i(2654),a=i(4465),l=i(4087);class h extends s.A{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===h.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=(0,l.v6)(e),o=e.getState();let a;o==r.A.LOADING?(this.tileLoadingKeys_[i]=!0,a=n.A.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],a=o==r.A.ERROR?n.A.TILELOADERROR:o==r.A.LOADED?n.A.TILELOADEND:void 0),null!=a&&this.dispatchEvent(new s.c(a,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=(0,a.Uu)(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction((0,o.Qz)(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}}const c=h},4602:(t,e,i)=>{i.d(e,{A:()=>A});var n=i(71),s=i(2135),r=i(1685),o=i(6837),a=i(8450),l=i(5902),h=i(4778),c=i(6444),u=i(8280),d=i(4238),g=i(942),_=i(588),f=i(915),p=i(6514),m=i(4087),x=i(3530),v=i(9438),y=i(1142);class E extends r.Ay{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class T extends c.A{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=d.tV,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&((0,_.v)(this.format_,"`format` must be set when `url` is set"),this.loader_=(0,y.nF)(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:g.Q7;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let i,s;this.featuresRtree_=e?new l.A:null,this.loadedExtentsRtree_=new l.A,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),e||void 0!==i||(i=new n.A(s)),void 0!==s&&this.addFeaturesInternal(s),void 0!==i&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=(0,m.v6)(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const e=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new E(u.A.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof h.Ay||(this.featureChangeKeys_[t]=[(0,v.KT)(e,o.A.CHANGE,this.handleFeatureChange_,this),(0,v.KT)(e,a.A.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(void 0!==e.getId()){const t=String(e.getId());if(t in this.idIndex_)if(e instanceof h.Ay){const n=this.idIndex_[t];n instanceof h.Ay?Array.isArray(n)?n.push(e):this.idIndex_[t]=[n,e]:i=!1}else i=!1;else this.idIndex_[t]=e}return i&&((0,_.v)(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let e=0,n=t.length;e{e||(e=!0,this.addFeature(t.element),e=!1)})),t.addEventListener(s.A.REMOVE,(t=>{e||(e=!0,this.removeFeature(t.element),e=!1)})),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(v.JH);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const t=t=>{this.removeFeatureInternal(t)};this.featuresRtree_.forEach(t);for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new E(u.A.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){const n=i.getGeometry();if(n instanceof h.Ay||n.intersectsCoordinate(t))return e(i)}))}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,(function(i){const n=i.getGeometry();if(n instanceof h.Ay||n.intersectsExtent(t)){const t=e(i);if(t)return t}}))}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),(0,x.p)(this.nullGeometryFeatures_)||(0,p.X$)(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=(0,f.QJ)(t,e);return[].concat(...i.map((t=>this.featuresRtree_.getInExtent(t))))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const r=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||d.rT,this.featuresRtree_.forEachInExtent(a,(function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e instanceof h.Ay?0:e.closestPointXY(i,n,r,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new E(u.A.FEATURESLOADEND,void 0,t))}),(()=>{--this.loadingExtentsCount_,this.dispatchEvent(new E(u.A.FEATURESLOADERROR))})),n.insert(r,{extent:r.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,(function(e){if((0,f.aI)(e.extent,t))return i=e,!0})),i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;i{i.d(e,{A:()=>n});const n={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"}},5923:(t,e,i)=>{i.d(e,{A:()=>E,Y:()=>T});var n=i(6837),s=i(8756),r=i(6758),o=i(1078),a=i(6164),l=i(8143),h=i(8711),c=i(4087);const u=[];class d extends l.A{constructor(t,e,i,n,s){super(t,e,{transition:0}),this.context_=null,this.executorGroups=[],this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=n.bind(void 0,this),this.removeSourceTiles_=s,this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=(0,h.Y)(1,1,u)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(t){const e=(0,c.v6)(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){this.context_&&((0,h.Yg)(this.context_),u.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}const g=d;var _=i(9496),f=i(915),p=i(4863),m=i(3530),x=i(1142),v=i(4401);class y extends a.A{constructor(t){const e=t.projection||"EPSG:3857",i=t.extent||(0,p.kZ)(e),n=t.tileGrid||(0,p.EN)({extent:i,maxResolution:t.maxResolution,maxZoom:void 0!==t.maxZoom?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,projection:e,state:t.state,tileGrid:n,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:T,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:void 0===t.zDirection?1:t.zDirection}),this.format_=t.format?t.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:s.A,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(t,e,i){if(i.getState()===o.A.IDLE){i.setState(o.A.LOADING);const s=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(s),l=s[0],h=r.getResolution(l);(0,f.r)(a,-h,a);const c=this.tileGrid,u=c.getExtent();u&&(0,f._N)(a,u,a);const d=c.getZForResolution(h,this.zDirection);c.forEachTileCoord(a,d,(s=>{const r=this.tileUrlFunction(s,t,e);this.sourceTiles_[r]||(this.sourceTiles_[r]=new this.tileClass(s,r?o.A.IDLE:o.A.EMPTY,r,this.format_,this.tileLoadFunction));const a=this.sourceTiles_[r];i.sourceTiles.push(a),this.tileKeysBySourceTileUrl_[r]||(this.tileKeysBySourceTileUrl_[r]=[]),this.tileKeysBySourceTileUrl_[r].push(i.getKey());const l=a.getState();if(l{this.handleTileChange(e);const s=a.getState();if(s===o.A.LOADED||s===o.A.ERROR){const e=a.getKey();e in i.errorTileKeys?a.getState()===o.A.LOADED&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,s===o.A.ERROR?i.errorTileKeys[e]=!0:a.removeEventListener(n.A.CHANGE,t),0===i.loadingSourceTiles&&i.setState((0,m.p)(i.errorTileKeys)?o.A.LOADED:o.A.ERROR)}};a.addEventListener(n.A.CHANGE,t),i.loadingSourceTiles++}l===o.A.IDLE&&(a.extent=c.getTileCoordExtent(s),a.projection=e,a.resolution=c.getResolution(s[0]),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((t=>t.getState()===o.A.ERROR))?o.A.ERROR:o.A.LOADED)}return i.sourceTiles}removeSourceTiles(t){const e=t.sourceTiles;for(let t=0,i=e.length;t{c=c&&!this.tileUrlFunction(t,n,s)}))}const u=new g(r,c?o.A.EMPTY:o.A.IDLE,a,this.getSourceTiles.bind(this,n,s),this.removeSourceTiles.bind(this));return u.key=this.getKey(),u}getTileGridForProjection(t){const e=t.getCode();let i=this.tileGrids_[e];if(!i){const t=this.tileGrid,n=t.getResolutions().slice(),s=n.map((function(e,i){return t.getOrigin(i)})),o=n.map((function(e,i){return t.getTileSize(i)})),a=_.L+1;for(let t=n.length;t{i.d(e,{A:()=>u,t:()=>d});var n=i(8512),s=i(4465),r=i(915),o=i(6758),a=i(3407);class l extends o.A{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}var h=i(2654);class c extends n.A{constructor(t){const e=void 0!==t.requestEncoding?t.requestEncoding:"KVP",i=t.tileGrid;let n=t.urls;void 0===n&&void 0!==t.url&&(n=(0,s.Uu)(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:n,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),n&&n.length>0&&(this.tileUrlFunction=(0,h.FD)(n.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join("\n");this.setTileUrlFunction((0,h.FD)(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};"KVP"==e&&Object.assign(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t="KVP"==e?(0,s.LW)(t,i):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t}));const n=this.tileGrid,r=this.dimensions_;return function(i,o,a){if(!i)return;const l={TileMatrix:n.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};Object.assign(l,r);let h=t;return h="KVP"==e?(0,s.LW)(h,l):h.replace(/\{(\w+?)\}/g,(function(t,e){return l[e]})),h}}}const u=c;function d(t,e){const i=t.Contents.Layer,n=i?.find((function(t){return t.Identifier==e.layer}));if(!n)return null;const s=t.Contents.TileMatrixSet;let o;o=n.TileMatrixSetLink.length>1?"projection"in e?n.TileMatrixSetLink.findIndex((function(t){const i=s.find((function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,n=(0,a.Jt)(i),r=(0,a.Jt)(e.projection);return n&&r?(0,a.tI)(n,r):i==e.projection})):n.TileMatrixSetLink.findIndex((function(t){return t.TileMatrixSet==e.matrixSet})):0,o<0&&(o=0);const h=n.TileMatrixSetLink[o].TileMatrixSet,c=n.TileMatrixSetLink[o].TileMatrixSetLimits;let u=n.Format[0];"format"in e&&(u=e.format),o=n.Style.findIndex((function(t){return"style"in e?t.Title==e.style:t.isDefault})),o<0&&(o=0);const d=n.Style[o].Identifier,g={};"Dimension"in n&&n.Dimension.forEach((function(t,e,i){const n=t.Identifier;let s=t.Default;void 0===s&&(s=t.Value[0]),g[n]=s}));const _=t.Contents.TileMatrixSet.find((function(t){return t.Identifier==h}));let f;const p=_.SupportedCRS;if(p&&(f=(0,a.Jt)(p)),"projection"in e){const t=(0,a.Jt)(e.projection);t&&(f&&!(0,a.tI)(t,f)||(f=t))}let m=!1;const x=f.getAxisOrientation().startsWith("ne");let v=_.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:v.MatrixWidth-1,MaxTileRow:v.MatrixHeight-1};if(c){y=c[c.length-1];const t=_.TileMatrix.find((t=>t.Identifier===y.TileMatrix||_.Identifier+":"+t.Identifier===y.TileMatrix));t&&(v=t)}const E=28e-5*v.ScaleDenominator/f.getMetersPerUnit(),T=x?[v.TopLeftCorner[1],v.TopLeftCorner[0]]:v.TopLeftCorner,A=v.TileWidth*E,S=v.TileHeight*E;let C=_.BoundingBox;C&&x&&(C=[C[1],C[0],C[3],C[2]]);let R=[T[0]+A*y.MinTileCol,T[1]-S*(1+y.MaxTileRow),T[0]+A*(1+y.MaxTileCol),T[1]-S*y.MinTileRow];if(void 0!==C&&!(0,r.ms)(C,R)){const t=n.WGS84BoundingBox,e=(0,a.Jt)("EPSG:4326").getExtent();if(R=C,t)m=t[0]===e[0]&&t[2]===e[2];else{const t=(0,a.DI)(C,_.SupportedCRS,"EPSG:4326");m=t[0]-1e-10<=e[0]&&t[2]+1e-10>=e[2]}}const w=function(t,e,i){const n=[],s=[],r=[],o=[],h=[];i=void 0!==i?i:[];const c="TileMatrix",u="Identifier",d="ScaleDenominator",g="TopLeftCorner",_=t.SupportedCRS,f=(0,a.Jt)(_),p=f.getMetersPerUnit(),m=f.getAxisOrientation().startsWith("ne");return t[c].sort((function(t,e){return e[d]-t[d]})),t[c].forEach((function(e){let a;if(a=!(i.length>0)||i.find((function(i){return e[u]==i[c]||!e[u].includes(":")&&t[u]+":"+e[u]===i[c]})),a){s.push(e[u]);const t=28e-5*e[d]/p,i=e.TileWidth,a=e.TileHeight;m?r.push([e[g][1],e[g][0]]):r.push(e[g]),n.push(t),o.push(i==a?i:[i,a]),h.push([e.MatrixWidth,e.MatrixHeight])}})),new l({extent:e,origins:r,resolutions:n,matrixIds:s,tileSizes:o,sizes:h})}(_,R,c),b=[];let I=e.requestEncoding;if(I=void 0!==I?I:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata){const e=t.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let t=0,i=e.length;t{i.d(e,{A:()=>o});var n=i(8512),s=i(4863);class r extends n.A{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:(0,s.EN)({extent:(0,s.kZ)(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}}const o=r},2192:(t,e,i)=>{i.d(e,{B:()=>n});const n=4},7500:(t,e,i)=>{i.d(e,{$q:()=>x,AE:()=>_,Eq:()=>p,W3:()=>f,jD:()=>u,y4:()=>m});var n=i(2192),s=i(4465),r=i(2806),o=i(3938),a=i(1597),l=i(915),h=i(3407),c=i(9925);const u="1.3.0",d=[101,101];function g(t,e,i,n,o){o.WIDTH=i[0],o.HEIGHT=i[1];const a=n.getAxisOrientation(),l=(0,r.Z)(o.VERSION,"1.3")>=0;o[l?"CRS":"SRS"]=n.getCode();const h=l&&a.startsWith("ne")?[e[1],e[0],e[3],e[2]]:e;return o.BBOX=h.join(","),(0,s.LW)(t,o)}function _(t,e,i,s,r,o,h){o=Object.assign({REQUEST:"GetMap"},o);const c=e/i,u=[(0,a.LI)((0,l.RG)(t)/c,n.B),(0,a.LI)((0,l.Oq)(t)/c,n.B)];if(1!=i)switch(h){case"geoserver":const t=90*i+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+t:o.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":o.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":o.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return g(r,t,u,s,o)}function f(t,e){return Object.assign({REQUEST:e,SERVICE:"WMS",VERSION:u,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},t)}function p(t){const e=void 0===t.hidpi||t.hidpi,i=(0,h.Jt)(t.projection||"EPSG:3857"),n=t.ratio||1.5,s=t.load||o.D4,r=t.crossOrigin??null;return(o,a,l)=>{o=(0,c.QD)(o,a,l,n),1==l||e&&void 0!==t.serverType||(l=1);const h=_(o,a,l,i,t.url,f(t.params,"GetMap"),t.serverType),u=new Image;return u.crossOrigin=r,s(u,h).then((t=>({image:t,extent:o,pixelRatio:l})))}}function m(t,e,i){if(void 0===t.url)return;const s=(0,h.Jt)(t.projection||"EPSG:3857"),o=(0,l.Bg)(e,i,0,d),c={QUERY_LAYERS:t.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(c,f(t.params,"GetFeatureInfo"),t.params);const u=(0,a.RI)((e[0]-o[0])/i,n.B),_=(0,a.RI)((o[3]-e[1])/i,n.B),p=(0,r.Z)(c.VERSION,"1.3")>=0;return c[p?"I":"X"]=u,c[p?"J":"Y"]=_,g(t.url,o,d,s,c)}function x(t,e){if(void 0===t.url)return;const i={SERVICE:"WMS",VERSION:u,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0!==e){const n=(0,h.Jt)(t.projection||"EPSG:3857").getMetersPerUnit()||1,s=28e-5;i.SCALE=e*n/s}if(Object.assign(i,t.params),void 0!==t.params&&void 0===i.LAYER){const t=i.LAYERS;if(Array.isArray(t)&&1===t.length)return;i.LAYER=t}return(0,s.LW)(t.url,i)}},2490:(t,e,i)=>{i.d(e,{Yf:()=>r,cY:()=>o});var n=i(1597);const s=6371008.8;function r(t,e,i){i=i||s;const r=(0,n.eh)(t[1]),o=(0,n.eh)(e[1]),a=(o-r)/2,l=(0,n.eh)(e[0]-t[0])/2,h=Math.sin(a)*Math.sin(a)+Math.sin(l)*Math.sin(l)*Math.cos(r)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}function o(t,e,i,r){r=r||s;const o=(0,n.eh)(t[1]),a=(0,n.eh)(t[0]),l=e/r,h=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(i)),c=a+Math.atan2(Math.sin(i)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(h));return[(0,n.xW)(c),(0,n.xW)(h)]}},2806:(t,e,i)=>{function n(t,e,i){const n=void 0!==i?t.toFixed(i):""+t;let s=n.indexOf(".");return s=-1===s?n.length:s,s>e?n:new Array(1+e-s).join("0")+n}function s(t,e){const i=(""+t).split("."),n=(""+e).split(".");for(let t=0;ts)return 1;if(s>e)return-1}return 0}i.d(e,{H:()=>n,Z:()=>s})},4969:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(25),s=i(588);const r=class{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();){const t=this.pop();t instanceof n.A&&t.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return(0,s.v)(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return(0,s.v)(void 0!==e,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t}getValues(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){(0,s.v)(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}},5902:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(2375),s=i(915),r=i(4087),o=i(3530);const a=class{constructor(t){this.rbush_=new n.A(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[(0,r.v6)(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,s=e.length;n{i.d(e,{A:()=>r});var n=i(6936);class s extends n.A{constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new s({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}const r=s},3628:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(6141),s=i(7907);class r{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){const t=this.getColor();return new r({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){const e=(0,s.J)(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then((()=>{this.patternImage_=null})),e.getImageState()===n.A.IDLE&&e.load(),e.getImageState()===n.A.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const o=r},9700:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(6837),s=i(6141),r=i(940),o=i(3730),a=i(588),l=i(7907),h=i(4087);function c(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}class u extends r.A{constructor(t){const e=void 0!==(t=t||{}).opacity?t.opacity:1,i=void 0!==t.rotation?t.rotation:0,n=void 0!==t.scale?t.scale:1,r=void 0!==t.rotateWithView&&t.rotateWithView;super({opacity:e,rotation:i,scale:n,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const u=void 0!==t.img?t.img:null;let d,g=t.src;if((0,a.v)(!(void 0!==g&&u),"`image` and `src` cannot be provided at the same time"),void 0!==g&&0!==g.length||!u||(g=u.src||(0,h.v6)(u)),(0,a.v)(void 0!==g&&g.length>0,"A defined and non-empty `src` or `image` must be provided"),(0,a.v)(!((void 0!==t.width||void 0!==t.height)&&void 0!==t.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?d=s.A.IDLE:void 0!==u&&(d="complete"in u?u.complete?u.src?s.A.LOADED:s.A.IDLE:s.A.LOADING:s.A.LOADED),this.color_=void 0!==t.color?(0,o._j)(t.color):null,this.iconImage_=(0,l.J)(u,g,this.crossOrigin_,d,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,i;if(t.size)[e,i]=t.size;else{const n=this.getImage(1);if(n.width&&n.height)e=n.width,i=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;const i=this.iconImage_.getSize();this.setScale(c(i[0],i[1],t.width,t.height))};return void this.listenImageChange(e)}}void 0!==e&&this.setScale(c(e,i,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new u({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),"top-right"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[0]=-t[0]+e[0]),"bottom-left"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),"top-right"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[0]=i[0]-e[0]-t[0]),"bottom-left"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:this.iconImage_.getImageState()==s.A.LOADED?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:this.iconImage_.getImageState()==s.A.LOADED?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(n.A.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(n.A.CHANGE,t)}ready(){return this.iconImage_.ready()}}const d=u},7907:(t,e,i)=>{i.d(e,{J:()=>d});var n=i(9332),s=i(6837),r=i(6141),o=i(3730),a=i(8711),l=i(3938),h=i(2241);let c=null;class u extends n.A{constructor(t,e,i,n,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=void 0===n?r.A.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===r.A.LOADED){c||(c=(0,a.Y)(1,1,void 0,{willReadFrequently:!0})),c.drawImage(this.image_,0,0);try{c.getImageData(0,0,1,1),this.tainted_=!1}catch(t){c=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(s.A.CHANGE)}handleImageError_(){this.imageState_=r.A.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=r.A.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=(0,a.Y)(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===r.A.IDLE){this.image_||this.initializeImage_(),this.imageState_=r.A.LOADING;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch(t){this.handleImageError_()}this.image_ instanceof HTMLImageElement&&(0,l.RA)(this.image_,this.src_).then((t=>{this.image_=t,this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==r.A.LOADED)return;const e=this.image_,i=(0,a.Y)(Math.ceil(e.width*t),Math.ceil(e.height*t)),n=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=(0,o.oJ)(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise((t=>{if(this.imageState_===r.A.LOADED||this.imageState_===r.A.ERROR)t();else{const e=()=>{this.imageState_!==r.A.LOADED&&this.imageState_!==r.A.ERROR||(this.removeEventListener(s.A.CHANGE,e),t())};this.addEventListener(s.A.CHANGE,e)}}))),this.ready_}}function d(t,e,i,n,s,r){let o=void 0===e?void 0:h.ue.get(e,i,s);return o||(o=new u(t,t&&"src"in t?t.src||void 0:e,i,n,s),h.ue.set(e,i,s,o,r)),r&&o&&!h.ue.getPattern(e,i,s)&&h.ue.set(e,i,s,o,r),o}},2241:(t,e,i)=>{i.d(e,{ue:()=>a});var n=i(6141),s=i(3730),r=i(8711);function o(t,e,i){return e+":"+t+":"+(i?(0,s._j)(i):"null")}const a=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];3&t++||i.hasListener()||(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const n=o(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){const n=o(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,s,a){const l=o(t,e,i),h=l in this.cache_;this.cache_[l]=s,a&&(s.getImageState()===n.A.IDLE&&s.load(),s.getImageState()===n.A.LOADING?s.ready().then((()=>{this.patternCache_[l]=(0,r.lr)().createPattern(s.getImage(1),"repeat")})):this.patternCache_[l]=(0,r.lr)().createPattern(s.getImage(1),"repeat")),h||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}},940:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(4087),s=i(4401);class r{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=(0,s.xq)(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new r({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return(0,n.b0)()}getImage(t){return(0,n.b0)()}getHitDetectionImage(){return(0,n.b0)()}getPixelRatio(t){return 1}getImageState(){return(0,n.b0)()}getImageSize(){return(0,n.b0)()}getOrigin(){return(0,n.b0)()}getSize(){return(0,n.b0)()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=(0,s.xq)(t)}listenImageChange(t){(0,n.b0)()}load(){(0,n.b0)()}unlistenImageChange(t){(0,n.b0)()}ready(){return Promise.resolve()}}const o=r},6936:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(6141),s=i(940),r=i(3730),o=i(7295),a=i(8711),l=i(8774);class h extends s.A{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?n.A.LOADING:n.A.LOADED,this.imageState_===n.A.LOADING&&this.ready().then((()=>this.imageState_=n.A.LOADED)),this.render()}clone(){const t=this.getScale(),e=new h({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,n=(0,a.Y)(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius,s=void 0===this.radius2_?n:this.radius2_;if(n{i.d(e,{A:()=>s});class n{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const s=n},9276:(t,e,i)=>{i.d(e,{Ay:()=>g,d1:()=>c,mC:()=>l,mY:()=>u});var n=i(7733),s=i(3628),r=i(953),o=i(588);class a{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=d,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new a({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=d,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function l(t){let e;if("function"==typeof t)e=t;else{let i;Array.isArray(t)?i=t:((0,o.v)("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`"),i=[t]),e=function(){return i}}return e}let h=null;function c(t,e){if(!h){const t=new s.A({color:"rgba(255,255,255,0.4)"}),e=new r.A({color:"#3399CC",width:1.25});h=[new a({image:new n.A({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return h}function u(){const t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new a({fill:new s.A({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new a({stroke:new r.A({color:e,width:5})}),new a({stroke:new r.A({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new a({image:new n.A({radius:6,fill:new s.A({color:i}),stroke:new r.A({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function d(t){return t.getGeometry()}const g=a},1426:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(3628),s=i(4401);class r{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=(0,s.xq)(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new n.A({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new r({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=(0,s.xq)(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const o=r},186:(t,e,i)=>{function n(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function s(t,e,i){return t+"/"+e+"/"+i}function r(t){return s(t[0],t[1],t[2])}function o(t){return t.split("/").map(Number)}function a(t){return l(t[0],t[1],t[2])}function l(t,e,i){return(e<i||i>e.getMaxZoom())return!1;const r=e.getFullTileRange(i);return!r||r.containsXY(n,s)}i.d(e,{K:()=>o,N:()=>n,N5:()=>h,_T:()=>l,dp:()=>s,i7:()=>r,tW:()=>a})},4863:(t,e,i)=>{i.d(e,{EN:()=>c,Li:()=>h,kZ:()=>d,pr:()=>l});var n=i(6758),s=i(9496),r=i(3407),o=i(915),a=i(4401);function l(t){let e=t.getDefaultTileGrid();return e||(e=function(t){return function(t,e,i,s){s=void 0!==s?s:"top-left";const r=u(t,e,i);return new n.A({extent:t,origin:(0,o.qF)(t,s),resolutions:r,tileSize:i})}(d(t),void 0,void 0,void 0)}(t),t.setDefaultTileGrid(e)),e}function h(t,e,i){const n=e[0],s=t.getTileCoordCenter(e),r=d(i);if(!(0,o.Ym)(r,s)){const e=(0,o.RG)(r),i=Math.ceil((r[0]-s[0])/e);return s[0]+=e*i,t.getTileCoordForCoordAndZ(s,n)}return e}function c(t){const e=t||{},i=e.extent||(0,r.Jt)("EPSG:3857").getExtent(),s={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:u(i,e.maxZoom,e.tileSize,e.maxResolution)};return new n.A(s)}function u(t,e,i,n){e=void 0!==e?e:s.L,i=(0,a.xq)(void 0!==i?i:s.R);const r=(0,o.Oq)(t),l=(0,o.RG)(t);n=n>0?n:Math.max(l/i[0],r/i[1]);const h=e+1,c=new Array(h);for(let t=0;t{i.d(e,{A:()=>g});var n=i(1110),s=i(9496),r=i(588),o=i(1597),a=i(915),l=i(186),h=i(4350),c=i(6514),u=i(4401);const d=[0,0,0],g=class{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,(0,r.v)((0,c.WC)(this.resolutions_,((t,e)=>e-t),!0),"`resolutions` must be sorted in descending order"),!t.origins)for(let t=0,i=this.resolutions_.length-1;t{const s=new n.A(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){const t=this.getTileRangeForExtentAndZ(i,e);s.minX=Math.max(t.minX,s.minX),s.maxX=Math.min(t.maxX,s.maxX),s.minY=Math.max(t.minY,s.minY),s.maxY=Math.min(t.maxY,s.maxY)}return s})):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,s=n.maxX;t<=s;++t)for(let s=n.minY,r=n.maxY;s<=r;++s)i([e,t,s])}forEachTileCoordParentTileRange(t,e,i,s){let r,o,a,l=null,h=t[0]-1;for(2===this.zoomFactor_?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);h>=this.minZoom;){if(void 0!==o&&void 0!==a?(o=Math.floor(o/2),a=Math.floor(a/2),r=(0,n.N)(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,h,i),e(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e{i.d(e,{L:()=>n,R:()=>s});const n=42,s=256},2654:(t,e,i)=>{i.d(e,{FD:()=>l,Qz:()=>a});var n=i(1597),s=i(4465),r=i(186);function o(t,e){return function(i,n,r){if(!i)return;let o;const a=i[0];if(e){const t=e.getFullTileRange(a);t&&(o=t.getHeight()-1)}return(0,s.M)(t,a,i[1],i[2],o)}}function a(t,e){const i=t.length,n=new Array(i);for(let s=0;s{i.d(e,{Bb:()=>c,T9:()=>f,Tl:()=>g,Zz:()=>_,cL:()=>o,dI:()=>m,e$:()=>u,hs:()=>d,k3:()=>h,lw:()=>a,vt:()=>r});var n=i(588);const s=new Array(6);function r(){return[1,0,0,1,0,0]}function o(t){return l(t,1,0,0,1,0,0)}function a(t,e){const i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],d=e[4],g=e[5];return t[0]=i*l+s*h,t[1]=n*l+r*h,t[2]=i*c+s*u,t[3]=n*c+r*u,t[4]=i*d+s*g+o,t[5]=n*d+r*g+a,t}function l(t,e,i,n,s,r,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=s,t[4]=r,t[5]=o,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function c(t,e){const i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function u(t,e){const i=Math.cos(e),n=Math.sin(e);return a(t,l(s,i,n,-n,i,0,0))}function d(t,e,i){return a(t,l(s,e,0,0,i,0,0))}function g(t,e,i){return a(t,l(s,1,0,0,1,e,i))}function _(t,e,i,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return t[0]=n*h,t[1]=s*l,t[2]=-n*l,t[3]=s*h,t[4]=o*n*h-a*n*l+e,t[5]=o*s*l+a*s*h+i,t}function f(t,e){const i=(s=e)[0]*s[3]-s[1]*s[2];var s;(0,n.v)(0!==i,"Transformation matrix cannot be inverted");const r=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5];return t[0]=l/i,t[1]=-o/i,t[2]=-a/i,t[3]=r/i,t[4]=(a*c-l*h)/i,t[5]=-(r*c-o*h)/i,t}const p=[1e6,1e6,1e6,1e6,2,2];function m(t){return"matrix("+t.map(((t,e)=>Math.round(t*p[e])/p[e])).join(", ")+")"}},4465:(t,e,i)=>{i.d(e,{LW:()=>r,M:()=>c,Uu:()=>d,de:()=>u});var n=i(186),s=i(1597);function r(t,e){const i=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))}));const n=i.join("&");return t=t.replace(/[?&]$/,""),(t+=t.includes("?")?"&":"?")+n}const o=/\{z\}/g,a=/\{x\}/g,l=/\{y\}/g,h=/\{-y\}/g;function c(t,e,i,n,s){return t.replace(o,e.toString()).replace(a,i.toString()).replace(l,n.toString()).replace(h,(function(){if(void 0===s)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()}))}function u(t,e,i,r){const o=(0,n._T)(e,i,r);return t[(0,s.xP)(o,t.length)]}function d(t){const e=[];let i=/\{([a-z])-([a-z])\}/.exec(t);if(i){const n=i[1].charCodeAt(0),s=i[2].charCodeAt(0);let r;for(r=n;r<=s;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t),i){const n=parseInt(i[2],10);for(let s=parseInt(i[1],10);s<=n;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}},3954:(t,e,i)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}i.d(e,{Z:()=>s,v:()=>n})},130:(t,e,i)=>{i.d(e,{Be:()=>l,Ek:()=>a,H7:()=>s,IP:()=>r,JL:()=>c,SD:()=>_,Ss:()=>o,UD:()=>u,l4:()=>h,zH:()=>d});var n=i(7771);const s=34962,r=34963,o=35040,a=35044,l=35048,h=5121,c=5123,u=5125,d=5126,g=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function _(t,e){e=Object.assign({preserveDrawingBuffer:!0,antialias:!n.oF},e);const i=g.length;for(let n=0;n{i.d(e,{Ay:()=>a});var n=i(130),s=i(588);const r={STATIC_DRAW:n.Ek,STREAM_DRAW:n.Ss,DYNAMIC_DRAW:n.Be};function o(t){switch(t){case n.H7:return Float32Array;case n.IP:return Uint32Array;default:return Float32Array}}const a=class{constructor(t,e){this.array_=null,this.type_=t,(0,s.v)(t===n.H7||t===n.IP,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage_=void 0!==e?e:r.STATIC_DRAW}ofSize(t){return this.array_=new(o(this.type_))(t),this}fromArray(t){return this.array_=o(this.type_).from(t),this}fromArrayBuffer(t){return this.array_=new(o(this.type_))(t),this}getType(){return this.type_}getArray(){return this.array_}setArray(t){const e=o(this.type_);if(!(t instanceof e))throw new Error(`Expected ${e}`);this.array_=t}getUsage(){return this.usage_}getSize(){return this.array_?this.array_.length:0}}},9777:(t,e,i)=>{i.d(e,{jQ:()=>g,M8:()=>d,Ay:()=>v});const n="webglcontextlost",s="webglcontextrestored";var r=i(25),o=i(4087);const a=class{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n precision mediump float;\n\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n\n uniform vec2 u_screenSize;\n\n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach((i=>{this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}))}getRenderTargetTexture(){return this.renderTargetTexture_}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const t=0,n=e.RGBA,s=0,r=e.RGBA,o=e.UNSIGNED_BYTE,a=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,t,n,i[0],i[1],s,r,o,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const s=this.getGL(),r=t.size;if(s.bindFramebuffer(s.FRAMEBUFFER,e?e.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!e){const e=(0,o.v6)(s.canvas);if(!t.renderTargets[e]){const i=s.getContextAttributes();i&&i.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT)),t.renderTargets[e]=!0}}s.disable(s.DEPTH_TEST),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=t.layerStatesArray[t.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(t),i&&i(s,t),s.drawArrays(s.TRIANGLES,0,6),n&&n(s,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach((function(s){if(i="function"==typeof s.value?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof ImageData)s.texture||(s.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,s.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(s.location,n++);else if(Array.isArray(i))switch(i.length){case 2:return void e.uniform2f(s.location,i[0],i[1]);case 3:return void e.uniform3f(s.location,i[0],i[1],i[2]);case 4:return void e.uniform4f(s.location,i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(s.location,i)}))}};var l=i(130),h=i(3530),c=i(9703),u=i(3954);const d={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},g={UNSIGNED_BYTE:l.l4,UNSIGNED_SHORT:l.JL,UNSIGNED_INT:l.UD,FLOAT:l.zH},_={};function f(t){return"shared/"+t}let p=0;class m extends r.A{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?f(t.canvasCacheKey):function(){const t="unique/"+p;return p+=1,t}(),this.gl_=function(t){let e=_[t];if(!e){const i=document.createElement("canvas");i.width=1,i.height=1,i.style.position="absolute",i.style.left="0",e={users:0,context:(0,l.SD)(i)},_[t]=e}return e.users+=1,e.context}(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(n,this.boundHandleWebGLContextLost_),e.addEventListener(s,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=(0,c.vt)(),this.offsetScaleMatrix_=(0,c.vt)(),this.tmpMat4_=(0,u.v)(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map((t=>new a({webGlContext:this.gl_,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms}))):[new a({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===f(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=(0,o.v6)(t);let n=this.bufferCache_[i];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=n),e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=(0,o.v6)(t);delete this.bufferCache_[e]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(n,this.boundHandleWebGLContextLost_),t.removeEventListener(s,this.boundHandleWebGLContextRestored_),function(t){const e=_[t];if(!e)return;if(e.users-=1,e.users>0)return;const i=e.context,n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();const s=i.canvas;s.width=1,s.height=1,delete _[t]}(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,s=this.getCanvas(),r=t.size,o=t.pixelRatio;s.width===r[0]*o&&s.height===r[1]*o||(s.width=r[0]*o,s.height=r[1]*o,s.style.width=r[0]+"px",s.style.height=r[1]+"px");for(let e=this.postProcessPasses_.length-1;e>=0;e--)this.postProcessPasses_[e].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindFrameBuffer(t,e){const i=this.getGL();i.bindFramebuffer(i.FRAMEBUFFER,t),e&&i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0)}bindInitialFrameBuffer(){const t=this.getGL(),e=this.postProcessPasses_[0].getFrameBuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);const i=this.postProcessPasses_[0].getRenderTargetTexture();t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}bindAttribute(t,e,i){const n=this.getGL();this.bindBuffer(t);const s=this.getAttributeLocation(e);n.enableVertexAttribArray(s),n.vertexAttribPointer(s,i,n.FLOAT,!1,0,0)}prepareDrawToRenderTarget(t,e,i,n){const s=this.gl_,r=e.getSize();s.bindFramebuffer(s.FRAMEBUFFER,e.getFramebuffer()),s.bindRenderbuffer(s.RENDERBUFFER,e.getDepthbuffer()),s.viewport(0,0,r[0],r[1]),s.bindTexture(s.TEXTURE_2D,e.getTexture()),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,i?s.ZERO:s.ONE_MINUS_SRC_ALPHA),n?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,s=e-t,r=4*t;i.drawElements(i.TRIANGLES,s,n,r)}finalizeDraw(t,e,i){for(let n=0,s=this.postProcessPasses_.length;n{if(i="function"==typeof s.value?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData||i instanceof WebGLTexture){i instanceof WebGLTexture&&!s.texture?(s.prevValue=void 0,s.texture=i):s.texture||(s.prevValue=void 0,s.texture=e.createTexture()),this.bindTexture(s.texture,n,s.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const t=!(i instanceof HTMLImageElement)||i.complete;i instanceof WebGLTexture||!t||s.prevValue===i||(s.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++}else if(Array.isArray(i)&&6===i.length)this.setUniformMatrixValue(s.name,(0,u.Z)(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:return void e.uniform2f(this.getUniformLocation(s.name),i[0],i[1]);case 3:return void e.uniform3f(this.getUniformLocation(s.name),i[0],i[1],i[2]);case 4:return void e.uniform4f(this.getUniformLocation(s.name),i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(this.getUniformLocation(s.name),i)}))}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,e&&(this.applyFrameState(e),this.applyUniforms(e))}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),s=this.compileShader(e,i.VERTEX_SHADER),r=i.createProgram();if(i.attachShader(r,n),i.attachShader(r,s),i.linkProgram(r),!i.getShaderParameter(n,i.COMPILE_STATUS)){const t=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(t)}if(i.deleteShader(n),!i.getShaderParameter(s,i.COMPILE_STATUS)){const t=`Vertex shader compilation failed: ${i.getShaderInfoLog(s)}`;throw new Error(t)}if(i.deleteShader(s),!i.getProgramParameter(r,i.LINK_STATUS)){const t=`GL program linking failed: ${i.getProgramInfoLog(r)}`;throw new Error(t)}return r}getUniformLocation(t){const e=(0,o.v6)(this.currentProgram_);return void 0===this.uniformLocationsByProgram_[e]&&(this.uniformLocationsByProgram_[e]={}),void 0===this.uniformLocationsByProgram_[e][t]&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=(0,o.v6)(this.currentProgram_);return void 0===this.attribLocationsByProgram_[e]&&(this.attribLocationsByProgram_[e]={}),void 0===this.attribLocationsByProgram_[e][t]&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,s=t.viewState.resolution,r=t.viewState.center;return(0,c.Zz)(e,0,0,2/(s*i[0]),2/(s*i[1]),-n,-r[0],-r[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,s){const r=this.getAttributeLocation(t);r<0||(this.gl_.enableVertexAttribArray(r),this.gl_.vertexAttribPointer(r,e,i,!1,n,s))}enableAttributes(t){const e=function(t){let e=0;for(let i=0;i{function n(t,e,i=0,o=t.length-1,a=r){for(;o>i;){if(o-i>600){const s=o-i+1,r=e-i+1,l=Math.log(s),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(s-h)/s)*(r-s/2<0?-1:1);n(t,e,Math.max(i,Math.floor(e-r*h/s+c)),Math.min(o,Math.floor(e+(s-r)*h/s+c)),a)}const r=t[e];let l=i,h=o;for(s(t,i,e),a(t[o],r)>0&&s(t,i,o);l0;)h--}0===a(t[i],r)?s(t,i,h):(h++,s(t,h,o)),h<=e&&(i=h+1),e<=h&&(o=h-1)}}function s(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function r(t,e){return te?1:0}i.d(e,{A:()=>o});class o{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!m(t,e))return i;const n=this.toBBox,s=[];for(;e;){for(let r=0;r=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)}_split(t,e){const i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);const r=this._chooseSplitIndex(i,s,n),o=x(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,l(i,this.toBBox),l(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=x([t,e]),this.data.height=t.height+1,this.data.leaf=!1,l(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,s=1/0,r=1/0;for(let o=e;o<=i-e;o++){const e=h(t,0,o,this.toBBox),a=h(t,o,i,this.toBBox),l=f(e,a),c=g(e)+g(a);l=e;n--){const e=t.children[n];c(o,t.leaf?s(e):e),a+=_(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)c(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():l(t[i],this.toBBox)}}function a(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n=t.minX&&e.maxY>=t.minY}function x(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=s)continue;const a=e+Math.ceil((i-e)/s/2)*s;n(t,a,e,i,r),o.push(e,a,a,i)}}}}]); \ No newline at end of file diff --git a/7240.bundle.js b/7240.bundle.js index 5a810cda..93089ed6 100644 --- a/7240.bundle.js +++ b/7240.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7240],{7248:(e,t,s)=>{s.d(t,{E:()=>n,o:()=>l});var r=s(6540),o=s(2627),i=s(1443);const n="_rlayers_handlers";class l extends r.PureComponent{static getOLObject(e,t){let s=t.get(e);return void 0===s&&(s={},t.set(e,s)),s}get handlers(){return l.getOLObject(n,this.ol)}getCurrentEvents(){return Object.keys(this.props).filter((e=>e.startsWith("on"))).map((e=>({event:e.toLowerCase().slice(2),prop:e}))).reduce(((e,t)=>({...e,[t.event]:this.props[t.prop]})),{})}getHandlerProp(e){for(const t of Object.keys(this.props))if(t.toLowerCase()==="on"+e)return t}incrementHandlers(e){}decrementHandlers(e){}attachEventHandlers(){var e;const t=this.handlers,s=Object.keys(null!=t?t:{}),r=null!==(e=this.eventSources)&&void 0!==e?e:[this.ol],o=this.getCurrentEvents(),n=Object.keys(o),l=n.concat(s.filter((e=>!n.includes(e))));for(const e of l){if(void 0!==t[e]&&void 0===o[e]){(0,i.A)("removing previously installed handler",this,e,t[e]);for(const s of r)s.un(e,t[e]);t[e]=void 0,this.decrementHandlers(e)}if(void 0===t[e]&&void 0!==o[e]){(0,i.A)("installing handler",this,e,o[e]);const s=this.getHandlerProp(e);if(!s)throw new Error("Internal error");t[e]=e=>this.props[s].call(this,e);for(const s of r)s.on(e,t[e]);this.incrementHandlers(e)}}}attachOldEventHandlers(e){const t=this.handlers,s=this.getCurrentEvents();for(const r of Object.keys(s))s[r]&&((0,i.A)("reinstalling existing handler",this,r,s[r]),e.on(r,t[r]))}refresh(e){this.attachEventHandlers()}on(e,t){this.ol.on(e,t),this.incrementHandlers(e)}un(e,t){this.decrementHandlers(e),this.ol.un(e,t)}componentDidMount(){(0,i.A)("didMount",this),this.refresh()}propsDiff(e){if(null===this.props||null===e)return this.props!==e&&((0,i.A)("null props differ",this.props,e),!0);for(const t of Object.keys(this.props))if(this.props[t]!==e[t])return(0,i.A)("because of",t,this.props[t],e[t]),!0;return!1}componentDidUpdate(e,t,s){this.props!==e&&((0,i.A)("willRefresh",this,e,this.props),this.refresh(e))}componentWillUnmount(){var e;const t=this.handlers;(0,i.A)("willUnmount",this,t);const s=null!==(e=this.eventSources)&&void 0!==e?e:[this.ol];for(const e of Object.keys(null!=t?t:{}))if((0,i.A)("cleaning up handler",this,e,t[e]),t[e]){for(const r of s)r.un(e,t[e]);t[e]=void 0,this.decrementHandlers(e)}}render(){return null}}l.contextType=o.aU},4114:(e,t,s)=>{s.d(t,{Ay:()=>v});var r=s(6540),o=s(277),i=s(6717),n=s(915),l=s(2627),a=s(7248),c=s(1895),h=s(1169),p=s(1443);class u extends o.A{}class d extends a.o{constructor(e,t){var s,r;if(super(e,t),!(null===(s=null==this?void 0:this.context)||void 0===s?void 0:s.vectorlayer))throw new Error("An RFeature must be part of a vector layer");e.feature?this.ol=e.feature:this.ol=new i.A({...null!==(r=e.properties)&&void 0!==r?r:{},geometry:e.geometry,style:h.Ay.getStyle(e.style)}),d.initEventRelay(this.context.map),this.onchange=()=>this.forceUpdate()}static initEventRelay(e){for(const t of d.pointerEvents)e.on(t,d.eventRelay)}incrementHandlers(e){var t;const s=a.o.getOLObject(c.Y,this.context.vectorlayer);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){a.o.getOLObject(c.Y,this.context.vectorlayer)[e]--}static dispatchEvent(e,t){var s;if(!e.feature)return!0;if(e.feature.dispatchEvent&&!1===e.feature.dispatchEvent(t))return!1;t.target||(t.target=e.feature);const r=null===(s=e.layer)||void 0===s?void 0:s.get(a.E)[t.type];return!r||r.call(null,t)}static eventRelay(e){const t=[];if(e.map.forEachFeatureAtPixel(e.pixel,((e,s)=>t.push({feature:e,layer:s})&&!1),{hitTolerance:d.hitTolerance,layerFilter:t=>{var s,r,o,i,n;const l=a.o.getOLObject(c.Y,t);switch(e.type){case"click":return l.click>0;case"dblclick":return l.dblclick>0;case"singleclick":return l.singleclick>0;case"pointermove":return(null!==(s=l.pointermove)&&void 0!==s?s:0)+(null!==(r=l.pointerenter)&&void 0!==r?r:0)+(null!==(o=l.pointerleave)&&void 0!==o?o:0)>0;case"pointerdrag":return(null!==(i=l.pointerdrag)&&void 0!==i?i:0)+(null!==(n=l.pointerdragend)&&void 0!==n?n:0)>0}return Object.keys(l).reduce(((e,t)=>e+l[t]),0)>0}}),e.dragging){d.lastFeaturesDragged.length||(d.lastFeaturesDragged=[...t]);for(const e of d.lastFeaturesDragged)t.find((t=>t.feature===e.feature))||t.push(e)}else{for(const t of d.lastFeaturesDragged)if(!1===d.dispatchEvent(t,new u("pointerdragend",e.map,e.originalEvent)))return d.lastFeaturesDragged=[],!1;d.lastFeaturesDragged=[]}if("pointermove"===e.type){for(const s of d.lastFeaturesEntered)if(!t.find((e=>e.feature===s.feature))){const t=d.dispatchEvent(s,new u("pointerleave",e.map,e.originalEvent));if(s.feature=null,s.layer=null,!1===t)return d.lastFeaturesEntered=d.lastFeaturesEntered.filter((e=>e.feature)),!1}d.lastFeaturesEntered=d.lastFeaturesEntered.filter((e=>e.feature));for(const s of t)if(!d.lastFeaturesEntered.find((e=>e.feature===s.feature))){const t=d.dispatchEvent(s,new u("pointerenter",e.map,e.originalEvent));if(d.lastFeaturesEntered.push(s),!1===t)return!1}}for(const s of t)if(!1===d.dispatchEvent(s,new u(e.type,e.map,e.originalEvent)))return!1;return!0}refresh(e){super.refresh(e),void 0!==this.props.feature&&this.props.feature!==this.ol&&((0,p.A)("replacing bound feature",this.ol),this.componentWillUnmount(),this.ol=this.props.feature,this.componentDidMount()),this.props.properties!==(null==e?void 0:e.properties)&&this.ol.setProperties(this.props.properties),this.props.geometry!==(null==e?void 0:e.geometry)&&this.ol.setGeometry(this.props.geometry),this.props.style!==(null==e?void 0:e.style)&&this.ol.setStyle(h.Ay.getStyle(this.props.style))}componentDidMount(){(0,p.A)("didMount",this.ol),super.componentDidMount(),this.ol.on("change",this.onchange),this.context.vectorsource.addFeature(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.ol.un("change",this.onchange),this.context.vectorsource.removeFeature(this.ol)}render(){var e,t;const s=null===(t=null===(e=this.ol)||void 0===e?void 0:e.getGeometry())||void 0===t?void 0:t.getExtent(),o=s&&(0,n.q1)(s);return r.createElement("div",{className:"_rlayers_RFeature"},r.createElement(l.aU.Provider,{value:{...this.context,feature:this.ol,rFeature:this,location:o}},this.props.children))}}d.pointerEvents=["click","pointerdrag","pointermove","singleclick","dblclick"],d.lastFeaturesEntered=[],d.lastFeaturesDragged=[],d.hitTolerance=3;const v=d},2627:(e,t,s)=>{s.d(t,{Xo:()=>i,aU:()=>o});var r=s(6540);const o=r.createContext({});function i(){const e=r.useContext(o);return{map:e.map,layer:e.layer,source:e.source,vectorlayer:e.vectorlayer,vectorsource:e.vectorsource,vectortilelayer:e.vectortilelayer,feature:e.feature,location:e.location,style:e.style,styleArray:e.styleArray}}},1443:(e,t,s)=>{s.d(t,{A:()=>r});const r=()=>{}},7240:(e,t,s)=>{s.d(t,{E6:()=>r,Dp:()=>B.Ay,NI:()=>Qe,vk:()=>o,Am:()=>p.A,od:()=>W,y1:()=>D,KL:()=>N,Xy:()=>U,HS:()=>f,QN:()=>M,Ff:()=>T,dx:()=>J,j9:()=>w,Ji:()=>G,Tw:()=>k,Fd:()=>O,f9:()=>h,ej:()=>A,$g:()=>$,Rv:()=>Je,bz:()=>$e,cq:()=>F,Xo:()=>n.Xo});var r={};s.r(r),s.d(r,{ON:()=>se,Es:()=>ae,yO:()=>de,bc:()=>ce,Ip:()=>pe,H4:()=>ee,WP:()=>oe,ni:()=>ne});var o={};s.r(o),s.d(o,{M5:()=>we,Hm:()=>Oe,Nl:()=>ke,dI:()=>Se});var i=s(7248),n=s(2627),l=s(6540),a=s(2961),c=s(3568);class h extends i.o{constructor(e){super(e),this.updateView=e=>{var t;const s=this.ol.getView();"function"==typeof(null===(t=this.props)||void 0===t?void 0:t.view[1])&&this.props.view[1]({center:s.getCenter(),zoom:s.getZoom(),resolution:s.getResolution()})},this.target=l.createRef(),this.ol=new a.A({controls:e.noDefaultControls?[]:void 0,interactions:e.noDefaultInteractions?[]:void 0,view:new c.Ay({projection:e.projection,center:e.initial.center,zoom:void 0===e.initial.resolution?e.initial.zoom:void 0,resolution:e.initial.resolution,extent:e.extent,minResolution:e.minResolution,maxResolution:e.maxResolution,constrainResolution:e.constrainResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,enableRotation:e.enableRotation,constrainRotation:e.constrainRotation})}),this.props.view&&this.ol.on("moveend",this.updateView)}componentDidMount(){super.componentDidMount(),this.ol.setTarget(this.target.current)}refresh(e){super.refresh(e);const t=this.ol.getView();for(const s of["minZoom","maxZoom","constrainResolution"]){const r=s.charAt(0).toUpperCase()+s.substring(1);e&&this.props[s]===e[s]||t["set"+r](this.props[s])}this.props.view&&(t.setCenter(this.props.view[0].center),void 0===this.props.view[0].resolution?t.setZoom(this.props.view[0].zoom):t.setResolution(this.props.view[0].resolution)),this.props.properties&&this.ol.setProperties(this.props.properties),this.props.view?this.ol.on("moveend",this.updateView):this.ol.un("moveend",this.updateView)}render(){return l.createElement("div",{className:this.props.className,style:{width:this.props.width,height:this.props.height},ref:this.target},l.createElement(n.aU.Provider,{value:{map:this.ol,rMap:this}},this.props.children))}}var p=s(5553),u=s(945),d=s(702),v=s(2662);class f extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new d.A({url:this.props.url,interpolate:!this.props.noIterpolation,projection:this.props.projection,tileGrid:this.props.tileGrid,crossOrigin:this.props.crossOrigin}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.tileGrid)===this.props.tileGrid&&(null==e?void 0:e.url)===this.props.url||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}var m=s(1895),y=s(2757),g=s(731),x=s(1169);class w extends m.A{createSource(e){return this.source=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.ol=new y.A({...e,style:x.Ay.getStyle(this.props.style),source:this.source}),[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}}var P=s(7896);class A extends v.A{constructor(e,t){super(e,t),this.source=new P.A,this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.ol.setProperties({label:"OpenStreetMap"})}}var S=s(2794),b=s(6067),E=s(1443);class O extends v.A{constructor(e,t){super(e,t),this.ol=new u.A({source:this.source}),this.parser=new b.A}createSource(){return(0,E.A)("createSource",this),fetch(this.props.url).then((e=>e.text())).then((e=>{const t=this.parser.read(e);return this.options=(0,S.t)(t,{layer:this.props.layer}),this.props.attributions&&(this.options.attributions=this.props.attributions),this.options.crossOrigin="",this.props.projection&&(this.options.projection=this.props.projection),this.options.wrapX=!1,this.source=new S.A(this.options),this.ol.setSource(this.source),this.eventSources=[this.ol,this.source],this.props.onCapabilities&&this.props.onCapabilities.call(this,this.options),this.source})).catch((e=>(console.error("failed loading WMTS",this.props.url,this.props.layer,e),this.source=void 0,null)))}refresh(e){super.refresh(),(null==e?void 0:e.url)!==this.props.url||(null==e?void 0:e.layer)!==this.props.layer?this.createSource().then((()=>{this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)})):this.props.onCapabilities&&this.props.onCapabilities.call(this,this.options)}}var R=s(8044),L=s(1011);class k extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new R.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const{params:e,url:t,crossOrigin:s}=this.props,r={params:e,url:t,crossOrigin:s};this.source=new L.A(r),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)}}var j=s(8270);class U extends p.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new R.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const e={url:this.props.url,projection:this.props.projection,imageExtent:this.props.extent,imageSize:this.props.size};this.source=new j.A(e),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.props.url&&(null==e?void 0:e.url)!==this.props.url&&(this.createSource(),this.ol.setSource(this.source),this.eventSources=[this.ol,this.source],this.attachOldEventHandlers(this.source))}}var C=s(517),F=s(5111);class D extends p.A{constructor(e,t){super(e,t),this.createSource()}createSource(){var e,t,s,r,o,i;const n=null===(t=null===(e=F.RStyle.getStyleStatic(this.props.strokeStyle))||void 0===e?void 0:e.getStroke)||void 0===t?void 0:t.call(e),l=null===(r=null===(s=F.RStyle.getStyleStatic(this.props.lonLabelStyle))||void 0===s?void 0:s.getText)||void 0===r?void 0:r.call(s),a=null===(i=null===(o=F.RStyle.getStyleStatic(this.props.latLabelStyle))||void 0===o?void 0:o.getText)||void 0===i?void 0:i.call(o);this.ol=new C.A({...this.props,strokeStyle:n,lonLabelStyle:l,latLabelStyle:a}),this.eventSources=[this.ol]}refresh(e){super.refresh(e);const t=this.context.map.removeLayer(this.ol);this.createSource(),this.attachOldEventHandlers(this.ol),t&&this.context.map.addLayer(this.ol)}}var z=s(4218);class M extends v.A{constructor(e,t){super(e,t),this.source=new z.A({url:this.props.url,tileSize:this.props.tileSize}),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.props.url&&(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}}var I=s(2728);class T extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const{params:e,url:t,projection:s}=this.props,r={params:e,url:t,projection:s};this.source=new I.A(r),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)}}var _=s(1905);class N extends m.A{createSource(e){return this.source=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.ol=new _.A({...e,source:this.source}),[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.blur)!==this.props.blur&&this.ol.setBlur(this.props.blur),(null==e?void 0:e.radius)!==this.props.radius&&this.ol.setRadius(this.props.radius)}}var H=s(6203);class W extends m.A{createSource(e){return this.cluster=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.source=new H.A({source:this.cluster,distance:this.props.distance}),this.ol=new y.A({...e,source:this.source,style:x.Ay.getStyle(e.style)}),[this.ol,this.source,this.cluster]}refresh(e){super.refresh(e),(null==e?void 0:e.distance)!==this.props.distance&&this.source.setDistance(this.props.distance),(null==e?void 0:e.url)!==this.props.url&&(this.cluster.setUrl(this.props.url),this.cluster.refresh())}render(){return l.createElement("div",{className:"_rlayers_RLayerCluster"},l.createElement(n.aU.Provider,{value:{...this.context,layer:this.ol,source:this.cluster,vectorlayer:this.ol,vectorsource:this.cluster,rLayer:this,rLayerVector:this}},this.props.children))}}var V=s(8063),X=s(5620),B=s(4114);class G extends p.A{constructor(e,t){super(e,t),this.source=new X.A({url:this.props.url,format:this.props.format,projection:this.props.projection,cacheSize:this.props.cacheSize,extent:this.props.extent,overlaps:this.props.overlaps,state:this.props.state,tileClass:this.props.tileClass,tileSize:this.props.tileSize,tileGrid:this.props.tileGrid,tileLoadFunction:this.props.tileLoadFunction,tileUrlFunction:this.props.tileUrlFunction,transition:this.props.transition,wrapX:this.props.wrapX,zDirection:this.props.zDirection}),this.ol=new V.A({style:x.Ay.getStyle(this.props.style),source:this.source,renderBuffer:this.props.renderBuffer}),this.eventSources=[this.ol,this.source],B.Ay.initEventRelay(this.context.map)}incrementHandlers(e){var t;const s=i.o.getOLObject(m.Y,this.ol);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){i.o.getOLObject(m.Y,this.ol)[e]--}refresh(e){super.refresh(e);const t=Object.keys(this.props).filter((e=>e.startsWith("on"))).reduce(((e,t)=>({...e,["_"+t.toLowerCase()]:this.props[t]})),{});this.ol.setProperties(t),(null==e?void 0:e.style)!==this.props.style&&this.ol.setStyle(x.Ay.getStyle(this.props.style)),(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}render(){return l.createElement("div",{className:"_rlayers_RLayerVectorTile"},l.createElement(n.aU.Provider,{value:{...this.context,layer:this.ol,vectortilelayer:this.ol,rLayer:this,rLayerVectorTile:this}},this.props.children))}}var Z=s(114),Y=s(3080);class q extends v.A{}class J extends q{constructor(e,t){super(e,t),this.createSource(),this.ol=new Z.A({opacity:.9,source:this.source,cacheSize:e.cacheSize}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new Y.A({url:this.props.url,interpolate:!this.props.noIterpolation,projection:this.props.projection,tileGrid:this.props.tileGrid,crossOrigin:"anonymous"}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.tileGrid)===this.props.tileGrid&&(null==e?void 0:e.url)===this.props.url||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}class $ extends q{constructor(e,t){super(e,t),this.source=new P.A,this.ol=new Z.A({source:this.source,cacheSize:e.cacheSize}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.ol.setProperties({label:"OpenStreetMap"})}}var K=s(3965);class Q extends i.o{constructor(e,t){var s;if(super(e,t),!(null===(s=this.context)||void 0===s?void 0:s.map))throw new Error("A control must be part of a map")}toOLProps(e){var t;return{className:e.className,target:null===(t=e.target)||void 0===t?void 0:t.current}}refresh(e){super.refresh(e),this.ol.setProperties(this.toOLProps(this.props))}componentDidMount(){super.componentDidMount(),this.context.map.addControl(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeControl(this.ol)}}class ee extends Q{constructor(e,t){super(e,t),this.ol=new K.A(this.toOLProps(e))}toOLProps(e){var t;return{...super.toOLProps(e),minWidth:e.minWidth,bar:e.bar,text:e.text,units:null!==(t=e.units)&&void 0!==t?t:"metric"}}}var te=s(7456);class se extends Q{constructor(e,t){super(e,t),this.ol=new te.A(this.toOLProps(e))}refresh(e){super.refresh(e),(null==e?void 0:e.collapsed)!==this.props.collapsed&&this.ol.setCollapsed(this.props.collapsed)}toOLProps(e){var t;return{...super.toOLProps(e),collapsible:null===(t=e.collapsible)||void 0===t||t,collapsed:e.collapsed}}}var re=s(9186);class oe extends Q{constructor(e,t){super(e,t),this.ol=new re.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),duration:e.duration,zoomInLabel:e.zoomInLabel,zoomOutLabel:e.zoomOutLabel,zoomInTipLabel:e.zoomInTipLabel,zoomOutTipLabel:e.zoomOutTipLabel,delta:e.delta}}}var ie=s(9439);class ne extends Q{constructor(e,t){super(e,t),this.ol=new ie.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),duration:e.duration}}}s(2898);var le=s(972);class ae extends Q{constructor(e,t){super(e,t),this.targetRef=l.createRef()}componentDidMount(){this.ol=new le.A(this.toOLProps(this.props)),super.componentDidMount()}toOLProps(e){var t;return{...super.toOLProps(e),element:null===(t=this.targetRef)||void 0===t?void 0:t.current}}render(){return l.createElement("div",{className:["ol-control",this.props.className].join(" "),ref:this.targetRef},this.props.children)}}class ce extends Q{constructor(e,t){super(e,t),this.onchange=()=>this.forceUpdate(),this.clickCollapse=()=>{this.setState({collapsed:!this.state.collapsed})},this.targetRef=l.createRef(),this.state={collapsed:!0,visible:[!0]}}componentDidMount(){this.ol=new le.A(this.toOLProps(this.props)),super.componentDidMount(),this.context.map.on("change",this.onchange),this.forceUpdate()}componentWillUnmount(){super.componentWillUnmount(),this.context.map.un("change",this.onchange)}toOLProps(e){var t;return{...super.toOLProps(e),element:null===(t=this.targetRef)||void 0===t?void 0:t.current}}render(){var e,t;const s=l.Children.map(this.props.children,((e,t)=>{var s;if(l.isValidElement(e))return null!==(s=this.state.visible[t])&&void 0!==s&&s})),r=l.Children.map(this.props.children,(e=>{var t,s;if(l.isValidElement(e))return null!==(s=null===(t=e.props.properties)||void 0===t?void 0:t.label)&&void 0!==s?s:"no label"}));return l.createElement(l.Fragment,null,l.createElement("div",{className:["ol-control",null!==(e=this.props.className)&&void 0!==e?e:"ol-layers-control"].join(" "),ref:this.targetRef},l.createElement("span",{onClick:this.clickCollapse},null!==(t=this.props.element)&&void 0!==t?t:l.createElement("button",null,"=")),this.state.collapsed?null:l.createElement("div",null,r.map(((e,t)=>l.createElement("div",{key:t},l.createElement("input",{type:"radio",id:t.toString(),name:e,value:t.toString(),checked:s[t],onChange:()=>{for(const e in s)s[e]=!1;s[t]=!0,this.setState({visible:[...s],collapsed:!0})}}),l.createElement("label",{htmlFor:t.toString()},e)))))),l.Children.map(this.props.children,((e,t)=>l.isValidElement(e)?l.cloneElement(e,{visible:s[t]}):e)))}}var he=s(6950);class pe extends Q{constructor(e,t){super(e,t),this.ol=new he.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),collapsible:e.collapsible,collapsed:e.collapsed,label:e.label,collapseLabel:e.collapseLabel}}refresh(e){super.refresh(e),(null==e?void 0:e.collapsed)!==this.props.collapsed&&this.ol.setCollapsed(this.props.collapsed)}render(){return l.createElement("div",{className:this.props.className,style:{width:this.props.width,height:this.props.height}},l.createElement(n.aU.Provider,{value:{map:this.ol.getOverviewMap()}},this.props.children))}}var ue=s(7364);class de extends Q{constructor(e,t){super(e,t),this.ol=new ue.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),source:e.source,label:e.label,labelActive:e.labelActive,tipLabel:e.tipLabel}}}s(2977),s(1727);class ve extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(r=null===(s=this.context)||void 0===s?void 0:s.map)||void 0===r?void 0:r.addInteraction))throw new Error("An interaction must be part of a map");this.ol=this.createOL(e)}createOL(e){throw new Error("RBaseInteraction should not be directly instantiated")}refresh(e){for(const t of this.classProps)if(e&&e[t]!==this.props[t]){(0,E.A)("Replacing interaction",this,e),this.componentWillUnmount(),this.ol=this.createOL(this.props),this.componentDidMount();break}super.refresh(e)}componentDidMount(){super.componentDidMount(),this.context.map.addInteraction(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeInteraction(this.ol)}}ve.classProps=[];const fe=ve;class me extends fe{}me.classProps=["handleDownEvent","handleDragEvent","handleMoveEvent","handleUpEvent"];const ye=me;var ge=s(422);class xe extends ye{createOL(e){return this.classProps=xe.classProps,new ge.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}xe.classProps=["className","condition","minArea","boxEndCondition"];const we=xe;var Pe=s(4458);class Ae extends ye{createOL(e){return this.classProps=Ae.classProps,new Pe.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ae.classProps=["features","layers","filter","hitTolerance"];const Se=Ae;var be=s(9964);class Ee extends ye{createOL(e){var t;if(!(null===(t=null==this?void 0:this.context)||void 0===t?void 0:t.vectorsource))throw new Error("A Draw interaction must be part of a vector layer");return this.classProps=Ee.classProps,new be.Ay({type:e.type,source:this.context.vectorsource,...Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{})})}}Ee.classProps=["condition","finishCondition","freehandCondition","style","stopClick","maxPoints","minPoints","snapTolerance"];const Oe=Ee;var Re=s(9132);class Le extends ye{createOL(e){var t;if(!(null===(t=null==this?void 0:this.context)||void 0===t?void 0:t.vectorsource))throw new Error("A Modify interaction must be part of a vector layer");return this.classProps=Le.classProps,new Re.A({source:this.context.vectorsource,...Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{})})}}Le.classProps=["condition","deleteCondition","insertVertexCondition","style","pixelTolerance","hitDetection"];const ke=Le;var je=s(6068);class Ue extends fe{createOL(e){return this.classProps=Ue.classProps,new je.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ue.classProps=["duration","delta"];var Ce=s(4473);class Fe extends fe{createOL(e){return this.classProps=Fe.classProps,new Ce.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Fe.classProps=["condition","kinetic"];var De=s(4051);class ze extends fe{createOL(e){return this.classProps=ze.classProps,new De.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}ze.classProps=["condition","duration"];var Me=s(4423);class Ie extends fe{createOL(e){return this.classProps=Ie.classProps,new Me.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ie.classProps=["className","condition","duration","out","minArea"];var Te=s(8751);class _e extends fe{createOL(e){return this.classProps=_e.classProps,new Te.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}_e.classProps=["condition","maxDelta","duration","useAnchor","constrainResolution"];var Ne=s(3711);class He extends fe{createOL(e){return this.classProps=He.classProps,new Ne.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}He.classProps=["threshold","duration"];var We=s(5243);class Ve extends fe{createOL(e){return this.classProps=Ve.classProps,new We.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ve.classProps=["duration"];var Xe=s(9888);class Be extends fe{createOL(e){return this.classProps=Be.classProps,new Xe.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Be.classProps=["condition","duration","pixelDelta"];var Ge=s(6856);class Ze extends fe{createOL(e){return this.classProps=Ze.classProps,new Ge.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ze.classProps=["condition","duration","delta"];var Ye=s(1795);class qe extends i.o{constructor(e,t){var s;if(super(e,t),!(null===(s=this.context)||void 0===s?void 0:s.location))throw new Error("An overlay must be part of a location provider (ie RFeature)");this.ol=new Ye.A({autoPan:e.autoPan,offset:e.offset,positioning:e.positioning}),this.containerRef=l.createRef()}setPosition(){var e;if(this.ol.setPosition(this.context.location),this.props.autoPosition&&(null===(e=this.containerRef)||void 0===e?void 0:e.current)){this.containerRef.current.style.position="absolute";const e=this.context.map.getPixelFromCoordinate(this.context.location),t=this.context.map.getSize();e[0]>t[0]/2?(this.containerRef.current.style.left=null,this.containerRef.current.style.right="0px"):(this.containerRef.current.style.left="0px",this.containerRef.current.style.right=null),e[1]>t[1]/2?(this.containerRef.current.style.top=null,this.containerRef.current.style.bottom="0px"):(this.containerRef.current.style.top="0px",this.containerRef.current.style.bottom=null)}}refresh(e){super.refresh(e),this.ol.setElement(this.containerRef.current),this.setPosition(),this.props.offset!==(null==e?void 0:e.offset)&&this.ol.setOffset(this.props.offset),this.props.positioning!==(null==e?void 0:e.positioning)&&this.ol.setPositioning(this.props.positioning)}componentDidMount(){super.componentDidMount(),this.context.map.addOverlay(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeOverlay(this.ol)}render(){return this.setPosition(),l.createElement("div",{className:"_rlayers_ROverlay"},l.createElement("div",{ref:this.containerRef,className:this.props.className,onClick:this.props.onClick},this.props.children))}}class Je extends qe{}class $e extends qe{constructor(e,t){super(e,t),this.toggle=()=>{this.visible=!this.visible,this.setPosition()},this.show=()=>{var e,t;this.showing||(this.hiding&&window.clearTimeout(this.hiding),this.showing=window.setTimeout((()=>{this.visible=!0,this.setPosition(),this.hiding=this.showing=void 0}),null!==(t=null===(e=this.props.delay)||void 0===e?void 0:e.show)&&void 0!==t?t:250))},this.hide=()=>{var e,t;this.hiding||(this.showing&&window.clearTimeout(this.showing),this.hiding=window.setTimeout((()=>{this.visible=!1,this.setPosition(),this.hiding=this.showing=void 0}),null!==(t=null===(e=this.props.delay)||void 0===e?void 0:e.hide)&&void 0!==t?t:50))},this.visible=!1}componentWillUnmount(){super.componentWillUnmount(),this.unregister()}setPosition(){this.ol.setPosition(this.visible?this.context.location:void 0)}unregister(e){if(e)switch(e.trigger){default:case"click":this.context.rFeature.un("click",this.toggle);break;case"hover":this.context.rFeature.un("pointerenter",this.show),this.context.rFeature.un("pointerhide",this.hide)}}refresh(e){if(this.ol.setElement(this.containerRef.current),(null==e?void 0:e.trigger)!==this.props.trigger)switch(this.unregister(e),this.props.trigger){default:case"click":"hover"===(null==e?void 0:e.trigger)&&(this.context.rFeature.un("pointerenter",this.show),this.context.rFeature.un("pointerhide",this.hide)),this.context.rFeature.on("click",this.toggle);break;case"hover":"click"===(null==e?void 0:e.trigger)&&this.context.rFeature.un("click",this.toggle),this.context.rFeature.on("pointerenter",this.show),this.context.rFeature.on("pointerleave",this.hide)}this.setPosition()}}var Ke=s(5213);class Qe extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(s=null==this?void 0:this.context)||void 0===s?void 0:s.map))throw new Error("A Geolocation must be part of a map");const o=null!==(r=e.projection)&&void 0!==r?r:this.context.map.getView().getProjection();this.ol=new Ke.A({...e,projection:o})}}},5553:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(6540),o=s(2627),i=s(7248);class n extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(r=null===(s=this.context)||void 0===s?void 0:s.map)||void 0===r?void 0:r.addLayer))throw new Error("A layer must be part of a map")}refresh(e){super.refresh(e);for(const t of["visible","opacity","zIndex","minResolution","maxResolution","minZoom","maxZoom"]){const s=t.charAt(0).toUpperCase()+t.substring(1);this.props[t]!==(e&&e[t])&&this.ol["set"+s](this.props[t])}this.source&&this.props.attributions&&this.source.setAttributions(this.props.attributions),this.props.properties&&this.ol.setProperties(this.props.properties)}componentDidMount(){super.componentDidMount(),this.context.map.addLayer(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeLayer(this.ol)}render(){return r.createElement("div",{className:"_rlayers_RLayer"},r.createElement(o.aU.Provider,{value:{...this.context,layer:this.ol,source:this.source,rLayer:this}},this.props.children))}}},1895:(e,t,s)=>{s.d(t,{A:()=>h,Y:()=>c});var r=s(6540),o=s(2627),i=s(5553),n=s(4114),l=s(1169),a=s(7248);const c="_rlayers_feature_handlers";class h extends i.A{constructor(e,t){super(e,t),n.Ay.initEventRelay(this.context.map),this.eventSources=this.createSource(e),super.refresh()}createSource(e){throw new Error("RLayerBaseVector is an abstract class")}refresh(e){super.refresh(e),(null==e?void 0:e.style)!==this.props.style&&this.ol.setStyle(l.Ay.getStyle(this.props.style))}incrementHandlers(e){var t;const s=a.o.getOLObject(c,this.ol);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){a.o.getOLObject(c,this.ol)[e]--}render(){return r.createElement("div",{className:"_rlayers_RLayerVector"},r.createElement(o.aU.Provider,{value:{...this.context,layer:this.ol,source:this.source,vectorlayer:this.ol,vectorsource:this.source,rLayer:this,rLayerVector:this}},this.props.children))}}},2662:(e,t,s)=>{s.d(t,{A:()=>o});var r=s(5553);class o extends r.A{}},1169:(e,t,s)=>{s.d(t,{Ay:()=>d,M2:()=>p,VX:()=>h});var r=s(6540),o=s(5338),i=s(9303),n=s(9276),l=s(2627),a=s(1443),c=s(961);const h=()=>r.useRef(),p=()=>r.createRef();class u extends r.PureComponent{constructor(e,t){super(e,t),this.style=(e,t)=>{if(this.ol!==this.style)return this.ol;let s;if(this.cache){s=this.props.cacheId(e,t);const r=this.cache.get(s);if(r)return r}const i=new n.Ay({zIndex:this.props.zIndex}),a=r.createElement(l.aU.Provider,{value:{...this.context,style:i}},this.props.render(e,t)),h=(0,o.createRoot)(document.createElement("div"));return(0,c.flushSync)((()=>{h.render(a)})),this.cache&&this.cache.set(s,i),i},e.render?this.ol=this.style:this.ol=new n.Ay({zIndex:e.zIndex}),e.render&&e.cacheSize&&e.cacheId&&(this.cache=new i.q({max:e.cacheSize}))}componentDidMount(){this.refresh()}componentDidUpdate(e,t,s){this.props!==e&&((0,a.A)("willRefresh",this,e,this.props),this.refresh(e))}refresh(e){var t,s,r,o,i,l,a;if(!e||(null==e?void 0:e.render)!==this.props.render){if(null===(t=this.context)||void 0===t?void 0:t.styleArray){if(this.ol===this.style)throw new Error("An RStyleArray must contain only static RStyles");this.context.styleArray.includes(this.ol)||this.context.styleArray.push(this.ol)}else(null===(r=null===(s=this.context)||void 0===s?void 0:s.feature)||void 0===r?void 0:r.setStyle)?this.context.feature.setStyle(this.ol):(null===(i=null===(o=this.context)||void 0===o?void 0:o.vectorlayer)||void 0===i?void 0:i.setStyle)?this.context.vectorlayer.setStyle(this.ol):(null===(a=null===(l=this.context)||void 0===l?void 0:l.vectortilelayer)||void 0===a?void 0:a.setStyle)&&this.context.vectortilelayer.setStyle(this.ol);this.cache&&this.cache.clear()}this.ol instanceof n.Ay&&(!e||e.zIndex!==this.props.zIndex)&&this.ol.setZIndex(this.props.zIndex)}render(){return this.props.render?null:r.createElement("div",{className:"_rlayers_RStyle"},r.createElement(l.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}static getStyle(e){return null==e?e:"function"==typeof e.style?(t,s)=>e.style(t,s):Object.keys(e).includes("current")?(t,s)=>e.current.style(t,s):e}static getStyleStatic(e){if(null==e)return e;let t;if("function"==typeof e.style&&(t=e),!Object.keys(e).includes("current")||(t=e.current,null!=t)){if(t){if(void 0!==t.ol&&"function"!=typeof t.ol)return t.ol;throw new TypeError("RStyle is dynamic and cannot be converted to Style")}if("function"==typeof e)throw new TypeError("StyleLike is dynamic and cannot be converted to Style");return e}}}u.contextType=l.aU;const d=u},5111:(e,t,s)=>{s.r(t),s.d(t,{RBackground:()=>C,RBaseStyle:()=>a,RBaseStyleProps:()=>r.RBaseStyleProps,RCircle:()=>b,RFill:()=>y,RIcon:()=>z,RRegularShape:()=>R,RStroke:()=>v,RStyle:()=>c.Ay,RStyleArray:()=>p,RStyleLike:()=>c.RStyleLike,RStyleRef:()=>c.RStyleRef,RText:()=>j,createRStyle:()=>c.M2,useRStyle:()=>c.VX});var r={};s.r(r),s.d(r,{A:()=>a});var o=s(6540),i=s(2627),n=s(1443);class l extends o.PureComponent{constructor(e,t){if(super(e,t),!this.context)throw new Error("A style property must be part of a style");this.ol=this.create(e)}create(e){throw new Error("RBaseStyle is an abstract class")}refresh(e){if((0,n.A)("refreshStyle",this),e)for(const t of this.classProps){const s=t.charAt(0).toUpperCase()+t.substring(1);(e&&e[t])!==this.props[t]&&(this.ol["set"+s]?this.ol["set"+s](this.props[t]):console.error(`Underlying OpenLayers object does not support updating of ${t} after object creation. If you are using an anonymous constant array or object, consider assigning its value to a constant and then passing the constant or use React.useMemo() to avoid this warning and improve performance.`))}}set(e){}componentDidMount(){this.set(this.ol)}componentDidUpdate(e,t,s){e!==this.props&&this.refresh(e)}componentWillUnmount(){this.set(null)}render(){return null}}l.contextType=i.aU,l.classProps=[];const a=l;var c=s(1169),h=s(5338);class p extends c.Ay{constructor(e,t){super(e,t),this.style=(e,t)=>{if(this.props.render){const s=this.props.render(e,t);o.Children.map(s.props.children,(e=>{if(o.isValidElement(e)&&e.type!==c.Ay)throw new TypeError("An RStyleArray should contain only RStyle elements")}));const r=[],n=o.createElement(i.aU.Provider,{value:{...this.context,styleArray:r}},s.props.children);return(0,h.createRoot)(document.createElement("div")).render(n),r}return this.ol},this.childRefs=[],e.render?this.ol=this.style:this.ol=[]}refresh(e){super.refresh(e)}render(){return o.Children.map(this.props.children,(e=>{if(o.isValidElement(e)&&e.type!==c.Ay)throw new TypeError("An RStyleArray should contain only RStyle elements")})),this.props.render?o.createElement(o.Fragment,null):o.createElement("div",{className:"_rlayers_RStyleArray"},o.createElement(i.aU.Provider,{value:{...this.context,styleArray:this.ol}},this.props.children))}}var u=s(953);class d extends a{create(e){return this.classProps=d.classProps,new u.A(e)}set(e){if(this.context.style.setStroke)return this.context.style.setStroke(e);throw new Error("Parent element does not support a stroke")}}d.classProps=["color","width","lineCap","lineJoin","lineDash"];const v=d;var f=s(3628);class m extends a{create(e){return this.classProps=m.classProps,new f.A(e)}set(e){if(this.context.style.setFill)return this.context.style.setFill(e);throw new Error("Parent element does not support a fill")}}m.classProps=["color"];const y=m;var g=s(7733);class x extends a{create(e){throw new Error("RImage is an abstract class")}set(e){if(!this.context.style.setImage)throw new Error("Parent element does not support an image");this.context.style.setImage(e)}}x.classProps=["opacity","rotateWithView","rotation","scale","displacement"];const w=x;class P extends w{create(e){throw new Error("RImage is an abstract class")}setStroke(e){this.stroke=e,this.ol=this.create(this.props),super.set(this.ol)}setFill(e){this.fill=e,this.ol=this.create(this.props),super.set(this.ol)}render(){return o.createElement("div",{className:"_rlayers_RStyle"},o.createElement(i.aU.Provider,{value:{...this.context,style:this}},this.props.children))}}P.classProps=w.classProps.concat(["radius"]);const A=P;class S extends A{create(e){return this.classProps=S.classProps,new g.A({...e,stroke:this.stroke,fill:this.fill})}}S.classProps=A.classProps.concat(["radius"]);const b=S;var E=s(6936);class O extends A{create(e){return this.classProps=O.classProps,new E.A({...e,stroke:this.stroke,fill:this.fill})}}O.classProps=A.classProps.concat(["radius1","radius2","points","angle"]);const R=O;var L=s(1426);class k extends a{create(e){return this.classProps=k.classProps,new L.A(e)}set(e){if(!this.context.style.setText)throw new Error("Parent element does not support a text");this.context.style.setText(e)}render(){return o.createElement("div",{className:"_rlayers_RStyle_RText"},o.createElement(i.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}}k.classProps=["text","font","offsetY","offsetX","overflow","scale","rotation","textAlign","padding","placement","textBaseline"];const j=k;class U extends a{create(e){this.classProps=U.classProps;const t=this.context.style;if(!t.setBackgroundFill||!t.setBackgroundStroke)throw new Error("Parent element does not support a background");return{setFill:t.setBackgroundFill.bind(t),setStroke:t.setBackgroundStroke.bind(t)}}render(){return o.createElement("div",{className:"_rlayers_RStyle_RBackground"},o.createElement(i.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}}U.classProps=[];const C=U;var F=s(9700);class D extends w{create(e){return this.classProps=D.classProps,new F.A(e)}}D.classProps=w.classProps.concat(["anchor","anchorXUnits","anchorYUnits","color","crossOrigin","img","offset","offsetOrigin","size","imgSize","src"]);const z=D}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7240],{7248:(e,t,s)=>{s.d(t,{E:()=>n,o:()=>l});var r=s(6540),o=s(2627),i=s(1443);const n="_rlayers_handlers";class l extends r.PureComponent{static getOLObject(e,t){let s=t.get(e);return void 0===s&&(s={},t.set(e,s)),s}get handlers(){return l.getOLObject(n,this.ol)}getCurrentEvents(){return Object.keys(this.props).filter((e=>e.startsWith("on"))).map((e=>({event:e.toLowerCase().slice(2),prop:e}))).reduce(((e,t)=>({...e,[t.event]:this.props[t.prop]})),{})}getHandlerProp(e){for(const t of Object.keys(this.props))if(t.toLowerCase()==="on"+e)return t}incrementHandlers(e){}decrementHandlers(e){}attachEventHandlers(){var e;const t=this.handlers,s=Object.keys(null!=t?t:{}),r=null!==(e=this.eventSources)&&void 0!==e?e:[this.ol],o=this.getCurrentEvents(),n=Object.keys(o),l=n.concat(s.filter((e=>!n.includes(e))));for(const e of l){if(void 0!==t[e]&&void 0===o[e]){(0,i.A)("removing previously installed handler",this,e,t[e]);for(const s of r)s.un(e,t[e]);t[e]=void 0,this.decrementHandlers(e)}if(void 0===t[e]&&void 0!==o[e]){(0,i.A)("installing handler",this,e,o[e]);const s=this.getHandlerProp(e);if(!s)throw new Error("Internal error");t[e]=e=>this.props[s].call(this,e);for(const s of r)s.on(e,t[e]);this.incrementHandlers(e)}}}attachOldEventHandlers(e){const t=this.handlers,s=this.getCurrentEvents();for(const r of Object.keys(s))s[r]&&((0,i.A)("reinstalling existing handler",this,r,s[r]),e.on(r,t[r]))}refresh(e){this.attachEventHandlers()}on(e,t){this.ol.on(e,t),this.incrementHandlers(e)}un(e,t){this.decrementHandlers(e),this.ol.un(e,t)}componentDidMount(){(0,i.A)("didMount",this),this.refresh()}propsDiff(e){if(null===this.props||null===e)return this.props!==e&&((0,i.A)("null props differ",this.props,e),!0);for(const t of Object.keys(this.props))if(this.props[t]!==e[t])return(0,i.A)("because of",t,this.props[t],e[t]),!0;return!1}componentDidUpdate(e,t,s){this.props!==e&&((0,i.A)("willRefresh",this,e,this.props),this.refresh(e))}componentWillUnmount(){var e;const t=this.handlers;(0,i.A)("willUnmount",this,t);const s=null!==(e=this.eventSources)&&void 0!==e?e:[this.ol];for(const e of Object.keys(null!=t?t:{}))if((0,i.A)("cleaning up handler",this,e,t[e]),t[e]){for(const r of s)r.un(e,t[e]);t[e]=void 0,this.decrementHandlers(e)}}render(){return null}}l.contextType=o.aU},4114:(e,t,s)=>{s.d(t,{Ay:()=>v});var r=s(6540),o=s(277),i=s(6717),n=s(915),l=s(2627),a=s(7248),c=s(1895),h=s(1169),p=s(1443);class u extends o.A{}class d extends a.o{constructor(e,t){var s,r;if(super(e,t),!(null===(s=null==this?void 0:this.context)||void 0===s?void 0:s.vectorlayer))throw new Error("An RFeature must be part of a vector layer");e.feature?this.ol=e.feature:this.ol=new i.A({...null!==(r=e.properties)&&void 0!==r?r:{},geometry:e.geometry,style:h.Ay.getStyle(e.style)}),d.initEventRelay(this.context.map),this.onchange=()=>this.forceUpdate()}static initEventRelay(e){for(const t of d.pointerEvents)e.on(t,d.eventRelay)}incrementHandlers(e){var t;const s=a.o.getOLObject(c.Y,this.context.vectorlayer);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){a.o.getOLObject(c.Y,this.context.vectorlayer)[e]--}static dispatchEvent(e,t){var s;if(!e.feature)return!0;if(e.feature.dispatchEvent&&!1===e.feature.dispatchEvent(t))return!1;t.target||(t.target=e.feature);const r=null===(s=e.layer)||void 0===s?void 0:s.get(a.E)[t.type];return!r||r.call(null,t)}static eventRelay(e){const t=[];if(e.map.forEachFeatureAtPixel(e.pixel,((e,s)=>t.push({feature:e,layer:s})&&!1),{hitTolerance:d.hitTolerance,layerFilter:t=>{var s,r,o,i,n;const l=a.o.getOLObject(c.Y,t);switch(e.type){case"click":return l.click>0;case"dblclick":return l.dblclick>0;case"singleclick":return l.singleclick>0;case"pointermove":return(null!==(s=l.pointermove)&&void 0!==s?s:0)+(null!==(r=l.pointerenter)&&void 0!==r?r:0)+(null!==(o=l.pointerleave)&&void 0!==o?o:0)>0;case"pointerdrag":return(null!==(i=l.pointerdrag)&&void 0!==i?i:0)+(null!==(n=l.pointerdragend)&&void 0!==n?n:0)>0}return Object.keys(l).reduce(((e,t)=>e+l[t]),0)>0}}),e.dragging){d.lastFeaturesDragged.length||(d.lastFeaturesDragged=[...t]);for(const e of d.lastFeaturesDragged)t.find((t=>t.feature===e.feature))||t.push(e)}else{for(const t of d.lastFeaturesDragged)if(!1===d.dispatchEvent(t,new u("pointerdragend",e.map,e.originalEvent)))return d.lastFeaturesDragged=[],!1;d.lastFeaturesDragged=[]}if("pointermove"===e.type){for(const s of d.lastFeaturesEntered)if(!t.find((e=>e.feature===s.feature))){const t=d.dispatchEvent(s,new u("pointerleave",e.map,e.originalEvent));if(s.feature=null,s.layer=null,!1===t)return d.lastFeaturesEntered=d.lastFeaturesEntered.filter((e=>e.feature)),!1}d.lastFeaturesEntered=d.lastFeaturesEntered.filter((e=>e.feature));for(const s of t)if(!d.lastFeaturesEntered.find((e=>e.feature===s.feature))){const t=d.dispatchEvent(s,new u("pointerenter",e.map,e.originalEvent));if(d.lastFeaturesEntered.push(s),!1===t)return!1}}for(const s of t)if(!1===d.dispatchEvent(s,new u(e.type,e.map,e.originalEvent)))return!1;return!0}refresh(e){super.refresh(e),void 0!==this.props.feature&&this.props.feature!==this.ol&&((0,p.A)("replacing bound feature",this.ol),this.componentWillUnmount(),this.ol=this.props.feature,this.componentDidMount()),this.props.properties!==(null==e?void 0:e.properties)&&this.ol.setProperties(this.props.properties),this.props.geometry!==(null==e?void 0:e.geometry)&&this.ol.setGeometry(this.props.geometry),this.props.style!==(null==e?void 0:e.style)&&this.ol.setStyle(h.Ay.getStyle(this.props.style))}componentDidMount(){(0,p.A)("didMount",this.ol),super.componentDidMount(),this.ol.on("change",this.onchange),this.context.vectorsource.addFeature(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.ol.un("change",this.onchange),this.context.vectorsource.removeFeature(this.ol)}render(){var e,t;const s=null===(t=null===(e=this.ol)||void 0===e?void 0:e.getGeometry())||void 0===t?void 0:t.getExtent(),o=s&&(0,n.q1)(s);return r.createElement("div",{className:"_rlayers_RFeature"},r.createElement(l.aU.Provider,{value:{...this.context,feature:this.ol,rFeature:this,location:o}},this.props.children))}}d.pointerEvents=["click","pointerdrag","pointermove","singleclick","dblclick"],d.lastFeaturesEntered=[],d.lastFeaturesDragged=[],d.hitTolerance=3;const v=d},2627:(e,t,s)=>{s.d(t,{Xo:()=>i,aU:()=>o});var r=s(6540);const o=r.createContext({});function i(){const e=r.useContext(o);return{map:e.map,layer:e.layer,source:e.source,vectorlayer:e.vectorlayer,vectorsource:e.vectorsource,vectortilelayer:e.vectortilelayer,feature:e.feature,location:e.location,style:e.style,styleArray:e.styleArray}}},1443:(e,t,s)=>{s.d(t,{A:()=>r});const r=()=>{}},7240:(e,t,s)=>{s.d(t,{E6:()=>r,Dp:()=>B.Ay,NI:()=>Qe,vk:()=>o,Am:()=>p.A,od:()=>W,y1:()=>D,KL:()=>N,Xy:()=>U,HS:()=>f,QN:()=>M,Ff:()=>T,dx:()=>J,j9:()=>w,Ji:()=>G,Tw:()=>k,Fd:()=>O,f9:()=>h,ej:()=>A,$g:()=>$,Rv:()=>Je,bz:()=>$e,cq:()=>F,Xo:()=>n.Xo});var r={};s.r(r),s.d(r,{ON:()=>se,Es:()=>ae,yO:()=>de,bc:()=>ce,Ip:()=>pe,H4:()=>ee,WP:()=>oe,ni:()=>ne});var o={};s.r(o),s.d(o,{M5:()=>we,Hm:()=>Oe,Nl:()=>ke,dI:()=>Se});var i=s(7248),n=s(2627),l=s(6540),a=s(6679),c=s(3568);class h extends i.o{constructor(e){super(e),this.updateView=e=>{var t;const s=this.ol.getView();"function"==typeof(null===(t=this.props)||void 0===t?void 0:t.view[1])&&this.props.view[1]({center:s.getCenter(),zoom:s.getZoom(),resolution:s.getResolution()})},this.target=l.createRef(),this.ol=new a.A({controls:e.noDefaultControls?[]:void 0,interactions:e.noDefaultInteractions?[]:void 0,view:new c.Ay({projection:e.projection,center:e.initial.center,zoom:void 0===e.initial.resolution?e.initial.zoom:void 0,resolution:e.initial.resolution,extent:e.extent,minResolution:e.minResolution,maxResolution:e.maxResolution,constrainResolution:e.constrainResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,enableRotation:e.enableRotation,constrainRotation:e.constrainRotation})}),this.props.view&&this.ol.on("moveend",this.updateView)}componentDidMount(){super.componentDidMount(),this.ol.setTarget(this.target.current)}refresh(e){super.refresh(e);const t=this.ol.getView();for(const s of["minZoom","maxZoom","constrainResolution"]){const r=s.charAt(0).toUpperCase()+s.substring(1);e&&this.props[s]===e[s]||t["set"+r](this.props[s])}this.props.view&&(t.setCenter(this.props.view[0].center),void 0===this.props.view[0].resolution?t.setZoom(this.props.view[0].zoom):t.setResolution(this.props.view[0].resolution)),this.props.properties&&this.ol.setProperties(this.props.properties),this.props.view?this.ol.on("moveend",this.updateView):this.ol.un("moveend",this.updateView)}render(){return l.createElement("div",{className:this.props.className,style:{width:this.props.width,height:this.props.height},ref:this.target},l.createElement(n.aU.Provider,{value:{map:this.ol,rMap:this}},this.props.children))}}var p=s(5553),u=s(945),d=s(702),v=s(2662);class f extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new d.A({url:this.props.url,interpolate:!this.props.noIterpolation,projection:this.props.projection,tileGrid:this.props.tileGrid,crossOrigin:this.props.crossOrigin}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.tileGrid)===this.props.tileGrid&&(null==e?void 0:e.url)===this.props.url||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}var m=s(1895),y=s(2757),g=s(4602),x=s(1169);class w extends m.A{createSource(e){return this.source=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.ol=new y.A({...e,style:x.Ay.getStyle(this.props.style),source:this.source}),[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}}var P=s(7896);class A extends v.A{constructor(e,t){super(e,t),this.source=new P.A,this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.ol.setProperties({label:"OpenStreetMap"})}}var S=s(2794),b=s(6067),E=s(1443);class O extends v.A{constructor(e,t){super(e,t),this.ol=new u.A({source:this.source}),this.parser=new b.A}createSource(){return(0,E.A)("createSource",this),fetch(this.props.url).then((e=>e.text())).then((e=>{const t=this.parser.read(e);return this.options=(0,S.t)(t,{layer:this.props.layer}),this.props.attributions&&(this.options.attributions=this.props.attributions),this.options.crossOrigin="",this.props.projection&&(this.options.projection=this.props.projection),this.options.wrapX=!1,this.source=new S.A(this.options),this.ol.setSource(this.source),this.eventSources=[this.ol,this.source],this.props.onCapabilities&&this.props.onCapabilities.call(this,this.options),this.source})).catch((e=>(console.error("failed loading WMTS",this.props.url,this.props.layer,e),this.source=void 0,null)))}refresh(e){super.refresh(),(null==e?void 0:e.url)!==this.props.url||(null==e?void 0:e.layer)!==this.props.layer?this.createSource().then((()=>{this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)})):this.props.onCapabilities&&this.props.onCapabilities.call(this,this.options)}}var R=s(8044),L=s(1011);class k extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new R.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const{params:e,url:t,crossOrigin:s}=this.props,r={params:e,url:t,crossOrigin:s};this.source=new L.A(r),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)}}var j=s(8270);class U extends p.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new R.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const e={url:this.props.url,projection:this.props.projection,imageExtent:this.props.extent,imageSize:this.props.size};this.source=new j.A(e),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.props.url&&(null==e?void 0:e.url)!==this.props.url&&(this.createSource(),this.ol.setSource(this.source),this.eventSources=[this.ol,this.source],this.attachOldEventHandlers(this.source))}}var C=s(517),F=s(5111);class D extends p.A{constructor(e,t){super(e,t),this.createSource()}createSource(){var e,t,s,r,o,i;const n=null===(t=null===(e=F.RStyle.getStyleStatic(this.props.strokeStyle))||void 0===e?void 0:e.getStroke)||void 0===t?void 0:t.call(e),l=null===(r=null===(s=F.RStyle.getStyleStatic(this.props.lonLabelStyle))||void 0===s?void 0:s.getText)||void 0===r?void 0:r.call(s),a=null===(i=null===(o=F.RStyle.getStyleStatic(this.props.latLabelStyle))||void 0===o?void 0:o.getText)||void 0===i?void 0:i.call(o);this.ol=new C.A({...this.props,strokeStyle:n,lonLabelStyle:l,latLabelStyle:a}),this.eventSources=[this.ol]}refresh(e){super.refresh(e);const t=this.context.map.removeLayer(this.ol);this.createSource(),this.attachOldEventHandlers(this.ol),t&&this.context.map.addLayer(this.ol)}}var z=s(4218);class M extends v.A{constructor(e,t){super(e,t),this.source=new z.A({url:this.props.url,tileSize:this.props.tileSize}),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.props.url&&(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}}var I=s(2728);class T extends v.A{constructor(e,t){super(e,t),this.createSource(),this.ol=new u.A({source:this.source}),this.eventSources=[this.ol,this.source]}createSource(){const{params:e,url:t,projection:s}=this.props,r={params:e,url:t,projection:s};this.source=new I.A(r),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source)}}var _=s(1905);class N extends m.A{createSource(e){return this.source=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.ol=new _.A({...e,source:this.source}),[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.blur)!==this.props.blur&&this.ol.setBlur(this.props.blur),(null==e?void 0:e.radius)!==this.props.radius&&this.ol.setRadius(this.props.radius)}}var H=s(6203);class W extends m.A{createSource(e){return this.cluster=new g.A({features:this.props.features,url:this.props.url,format:this.props.format,loader:this.props.loader,wrapX:this.props.wrapX,strategy:this.props.strategy}),this.source=new H.A({source:this.cluster,distance:this.props.distance}),this.ol=new y.A({...e,source:this.source,style:x.Ay.getStyle(e.style)}),[this.ol,this.source,this.cluster]}refresh(e){super.refresh(e),(null==e?void 0:e.distance)!==this.props.distance&&this.source.setDistance(this.props.distance),(null==e?void 0:e.url)!==this.props.url&&(this.cluster.setUrl(this.props.url),this.cluster.refresh())}render(){return l.createElement("div",{className:"_rlayers_RLayerCluster"},l.createElement(n.aU.Provider,{value:{...this.context,layer:this.ol,source:this.cluster,vectorlayer:this.ol,vectorsource:this.cluster,rLayer:this,rLayerVector:this}},this.props.children))}}var V=s(8063),X=s(5923),B=s(4114);class G extends p.A{constructor(e,t){super(e,t),this.source=new X.A({url:this.props.url,format:this.props.format,projection:this.props.projection,cacheSize:this.props.cacheSize,extent:this.props.extent,overlaps:this.props.overlaps,state:this.props.state,tileClass:this.props.tileClass,tileSize:this.props.tileSize,tileGrid:this.props.tileGrid,tileLoadFunction:this.props.tileLoadFunction,tileUrlFunction:this.props.tileUrlFunction,transition:this.props.transition,wrapX:this.props.wrapX,zDirection:this.props.zDirection}),this.ol=new V.A({style:x.Ay.getStyle(this.props.style),source:this.source,renderBuffer:this.props.renderBuffer}),this.eventSources=[this.ol,this.source],B.Ay.initEventRelay(this.context.map)}incrementHandlers(e){var t;const s=i.o.getOLObject(m.Y,this.ol);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){i.o.getOLObject(m.Y,this.ol)[e]--}refresh(e){super.refresh(e);const t=Object.keys(this.props).filter((e=>e.startsWith("on"))).reduce(((e,t)=>({...e,["_"+t.toLowerCase()]:this.props[t]})),{});this.ol.setProperties(t),(null==e?void 0:e.style)!==this.props.style&&this.ol.setStyle(x.Ay.getStyle(this.props.style)),(null==e?void 0:e.url)!==this.props.url&&(this.source.setUrl(this.props.url),this.source.refresh())}render(){return l.createElement("div",{className:"_rlayers_RLayerVectorTile"},l.createElement(n.aU.Provider,{value:{...this.context,layer:this.ol,vectortilelayer:this.ol,rLayer:this,rLayerVectorTile:this}},this.props.children))}}var Z=s(114),Y=s(3080);class q extends v.A{}class J extends q{constructor(e,t){super(e,t),this.createSource(),this.ol=new Z.A({opacity:.9,source:this.source,cacheSize:e.cacheSize}),this.eventSources=[this.ol,this.source]}createSource(){this.source=new Y.A({url:this.props.url,interpolate:!this.props.noIterpolation,projection:this.props.projection,tileGrid:this.props.tileGrid,crossOrigin:"anonymous"}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),(null==e?void 0:e.tileGrid)===this.props.tileGrid&&(null==e?void 0:e.url)===this.props.url||(this.createSource(),this.ol.setSource(this.source),this.attachOldEventHandlers(this.source))}}class $ extends q{constructor(e,t){super(e,t),this.source=new P.A,this.ol=new Z.A({source:this.source,cacheSize:e.cacheSize}),this.eventSources=[this.ol,this.source]}refresh(e){super.refresh(e),this.ol.setProperties({label:"OpenStreetMap"})}}var K=s(3965);class Q extends i.o{constructor(e,t){var s;if(super(e,t),!(null===(s=this.context)||void 0===s?void 0:s.map))throw new Error("A control must be part of a map")}toOLProps(e){var t;return{className:e.className,target:null===(t=e.target)||void 0===t?void 0:t.current}}refresh(e){super.refresh(e),this.ol.setProperties(this.toOLProps(this.props))}componentDidMount(){super.componentDidMount(),this.context.map.addControl(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeControl(this.ol)}}class ee extends Q{constructor(e,t){super(e,t),this.ol=new K.A(this.toOLProps(e))}toOLProps(e){var t;return{...super.toOLProps(e),minWidth:e.minWidth,bar:e.bar,text:e.text,units:null!==(t=e.units)&&void 0!==t?t:"metric"}}}var te=s(7456);class se extends Q{constructor(e,t){super(e,t),this.ol=new te.A(this.toOLProps(e))}refresh(e){super.refresh(e),(null==e?void 0:e.collapsed)!==this.props.collapsed&&this.ol.setCollapsed(this.props.collapsed)}toOLProps(e){var t;return{...super.toOLProps(e),collapsible:null===(t=e.collapsible)||void 0===t||t,collapsed:e.collapsed}}}var re=s(9186);class oe extends Q{constructor(e,t){super(e,t),this.ol=new re.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),duration:e.duration,zoomInLabel:e.zoomInLabel,zoomOutLabel:e.zoomOutLabel,zoomInTipLabel:e.zoomInTipLabel,zoomOutTipLabel:e.zoomOutTipLabel,delta:e.delta}}}var ie=s(9439);class ne extends Q{constructor(e,t){super(e,t),this.ol=new ie.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),duration:e.duration}}}s(2898);var le=s(972);class ae extends Q{constructor(e,t){super(e,t),this.targetRef=l.createRef()}componentDidMount(){this.ol=new le.A(this.toOLProps(this.props)),super.componentDidMount()}toOLProps(e){var t;return{...super.toOLProps(e),element:null===(t=this.targetRef)||void 0===t?void 0:t.current}}render(){return l.createElement("div",{className:["ol-control",this.props.className].join(" "),ref:this.targetRef},this.props.children)}}class ce extends Q{constructor(e,t){super(e,t),this.onchange=()=>this.forceUpdate(),this.clickCollapse=()=>{this.setState({collapsed:!this.state.collapsed})},this.targetRef=l.createRef(),this.state={collapsed:!0,visible:[!0]}}componentDidMount(){this.ol=new le.A(this.toOLProps(this.props)),super.componentDidMount(),this.context.map.on("change",this.onchange),this.forceUpdate()}componentWillUnmount(){super.componentWillUnmount(),this.context.map.un("change",this.onchange)}toOLProps(e){var t;return{...super.toOLProps(e),element:null===(t=this.targetRef)||void 0===t?void 0:t.current}}render(){var e,t;const s=l.Children.map(this.props.children,((e,t)=>{var s;if(l.isValidElement(e))return null!==(s=this.state.visible[t])&&void 0!==s&&s})),r=l.Children.map(this.props.children,(e=>{var t,s;if(l.isValidElement(e))return null!==(s=null===(t=e.props.properties)||void 0===t?void 0:t.label)&&void 0!==s?s:"no label"}));return l.createElement(l.Fragment,null,l.createElement("div",{className:["ol-control",null!==(e=this.props.className)&&void 0!==e?e:"ol-layers-control"].join(" "),ref:this.targetRef},l.createElement("span",{onClick:this.clickCollapse},null!==(t=this.props.element)&&void 0!==t?t:l.createElement("button",null,"=")),this.state.collapsed?null:l.createElement("div",null,r.map(((e,t)=>l.createElement("div",{key:t},l.createElement("input",{type:"radio",id:t.toString(),name:e,value:t.toString(),checked:s[t],onChange:()=>{for(const e in s)s[e]=!1;s[t]=!0,this.setState({visible:[...s],collapsed:!0})}}),l.createElement("label",{htmlFor:t.toString()},e)))))),l.Children.map(this.props.children,((e,t)=>l.isValidElement(e)?l.cloneElement(e,{visible:s[t]}):e)))}}var he=s(6950);class pe extends Q{constructor(e,t){super(e,t),this.ol=new he.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),collapsible:e.collapsible,collapsed:e.collapsed,label:e.label,collapseLabel:e.collapseLabel}}refresh(e){super.refresh(e),(null==e?void 0:e.collapsed)!==this.props.collapsed&&this.ol.setCollapsed(this.props.collapsed)}render(){return l.createElement("div",{className:this.props.className,style:{width:this.props.width,height:this.props.height}},l.createElement(n.aU.Provider,{value:{map:this.ol.getOverviewMap()}},this.props.children))}}var ue=s(7364);class de extends Q{constructor(e,t){super(e,t),this.ol=new ue.A(this.toOLProps(e))}toOLProps(e){return{...super.toOLProps(e),source:e.source,label:e.label,labelActive:e.labelActive,tipLabel:e.tipLabel}}}s(2977),s(1727);class ve extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(r=null===(s=this.context)||void 0===s?void 0:s.map)||void 0===r?void 0:r.addInteraction))throw new Error("An interaction must be part of a map");this.ol=this.createOL(e)}createOL(e){throw new Error("RBaseInteraction should not be directly instantiated")}refresh(e){for(const t of this.classProps)if(e&&e[t]!==this.props[t]){(0,E.A)("Replacing interaction",this,e),this.componentWillUnmount(),this.ol=this.createOL(this.props),this.componentDidMount();break}super.refresh(e)}componentDidMount(){super.componentDidMount(),this.context.map.addInteraction(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeInteraction(this.ol)}}ve.classProps=[];const fe=ve;class me extends fe{}me.classProps=["handleDownEvent","handleDragEvent","handleMoveEvent","handleUpEvent"];const ye=me;var ge=s(422);class xe extends ye{createOL(e){return this.classProps=xe.classProps,new ge.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}xe.classProps=["className","condition","minArea","boxEndCondition"];const we=xe;var Pe=s(4458);class Ae extends ye{createOL(e){return this.classProps=Ae.classProps,new Pe.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ae.classProps=["features","layers","filter","hitTolerance"];const Se=Ae;var be=s(9964);class Ee extends ye{createOL(e){var t;if(!(null===(t=null==this?void 0:this.context)||void 0===t?void 0:t.vectorsource))throw new Error("A Draw interaction must be part of a vector layer");return this.classProps=Ee.classProps,new be.Ay({type:e.type,source:this.context.vectorsource,...Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{})})}}Ee.classProps=["condition","finishCondition","freehandCondition","style","stopClick","maxPoints","minPoints","snapTolerance"];const Oe=Ee;var Re=s(9132);class Le extends ye{createOL(e){var t;if(!(null===(t=null==this?void 0:this.context)||void 0===t?void 0:t.vectorsource))throw new Error("A Modify interaction must be part of a vector layer");return this.classProps=Le.classProps,new Re.A({source:this.context.vectorsource,...Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{})})}}Le.classProps=["condition","deleteCondition","insertVertexCondition","style","pixelTolerance","hitDetection"];const ke=Le;var je=s(6068);class Ue extends fe{createOL(e){return this.classProps=Ue.classProps,new je.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ue.classProps=["duration","delta"];var Ce=s(4473);class Fe extends fe{createOL(e){return this.classProps=Fe.classProps,new Ce.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Fe.classProps=["condition","kinetic"];var De=s(4051);class ze extends fe{createOL(e){return this.classProps=ze.classProps,new De.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}ze.classProps=["condition","duration"];var Me=s(4423);class Ie extends fe{createOL(e){return this.classProps=Ie.classProps,new Me.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ie.classProps=["className","condition","duration","out","minArea"];var Te=s(8751);class _e extends fe{createOL(e){return this.classProps=_e.classProps,new Te.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}_e.classProps=["condition","maxDelta","duration","useAnchor","constrainResolution"];var Ne=s(3711);class He extends fe{createOL(e){return this.classProps=He.classProps,new Ne.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}He.classProps=["threshold","duration"];var We=s(5243);class Ve extends fe{createOL(e){return this.classProps=Ve.classProps,new We.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ve.classProps=["duration"];var Xe=s(9888);class Be extends fe{createOL(e){return this.classProps=Be.classProps,new Xe.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Be.classProps=["condition","duration","pixelDelta"];var Ge=s(6856);class Ze extends fe{createOL(e){return this.classProps=Ze.classProps,new Ge.A(Object.keys(e).filter((e=>this.classProps.includes(e))).reduce(((t,s)=>({...t,[s]:e[s]})),{}))}}Ze.classProps=["condition","duration","delta"];var Ye=s(1795);class qe extends i.o{constructor(e,t){var s;if(super(e,t),!(null===(s=this.context)||void 0===s?void 0:s.location))throw new Error("An overlay must be part of a location provider (ie RFeature)");this.ol=new Ye.A({autoPan:e.autoPan,offset:e.offset,positioning:e.positioning}),this.containerRef=l.createRef()}setPosition(){var e;if(this.ol.setPosition(this.context.location),this.props.autoPosition&&(null===(e=this.containerRef)||void 0===e?void 0:e.current)){this.containerRef.current.style.position="absolute";const e=this.context.map.getPixelFromCoordinate(this.context.location),t=this.context.map.getSize();e[0]>t[0]/2?(this.containerRef.current.style.left=null,this.containerRef.current.style.right="0px"):(this.containerRef.current.style.left="0px",this.containerRef.current.style.right=null),e[1]>t[1]/2?(this.containerRef.current.style.top=null,this.containerRef.current.style.bottom="0px"):(this.containerRef.current.style.top="0px",this.containerRef.current.style.bottom=null)}}refresh(e){super.refresh(e),this.ol.setElement(this.containerRef.current),this.setPosition(),this.props.offset!==(null==e?void 0:e.offset)&&this.ol.setOffset(this.props.offset),this.props.positioning!==(null==e?void 0:e.positioning)&&this.ol.setPositioning(this.props.positioning)}componentDidMount(){super.componentDidMount(),this.context.map.addOverlay(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeOverlay(this.ol)}render(){return this.setPosition(),l.createElement("div",{className:"_rlayers_ROverlay"},l.createElement("div",{ref:this.containerRef,className:this.props.className,onClick:this.props.onClick},this.props.children))}}class Je extends qe{}class $e extends qe{constructor(e,t){super(e,t),this.toggle=()=>{this.visible=!this.visible,this.setPosition()},this.show=()=>{var e,t;this.showing||(this.hiding&&window.clearTimeout(this.hiding),this.showing=window.setTimeout((()=>{this.visible=!0,this.setPosition(),this.hiding=this.showing=void 0}),null!==(t=null===(e=this.props.delay)||void 0===e?void 0:e.show)&&void 0!==t?t:250))},this.hide=()=>{var e,t;this.hiding||(this.showing&&window.clearTimeout(this.showing),this.hiding=window.setTimeout((()=>{this.visible=!1,this.setPosition(),this.hiding=this.showing=void 0}),null!==(t=null===(e=this.props.delay)||void 0===e?void 0:e.hide)&&void 0!==t?t:50))},this.visible=!1}componentWillUnmount(){super.componentWillUnmount(),this.unregister()}setPosition(){this.ol.setPosition(this.visible?this.context.location:void 0)}unregister(e){if(e)switch(e.trigger){default:case"click":this.context.rFeature.un("click",this.toggle);break;case"hover":this.context.rFeature.un("pointerenter",this.show),this.context.rFeature.un("pointerhide",this.hide)}}refresh(e){if(this.ol.setElement(this.containerRef.current),(null==e?void 0:e.trigger)!==this.props.trigger)switch(this.unregister(e),this.props.trigger){default:case"click":"hover"===(null==e?void 0:e.trigger)&&(this.context.rFeature.un("pointerenter",this.show),this.context.rFeature.un("pointerhide",this.hide)),this.context.rFeature.on("click",this.toggle);break;case"hover":"click"===(null==e?void 0:e.trigger)&&this.context.rFeature.un("click",this.toggle),this.context.rFeature.on("pointerenter",this.show),this.context.rFeature.on("pointerleave",this.hide)}this.setPosition()}}var Ke=s(5213);class Qe extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(s=null==this?void 0:this.context)||void 0===s?void 0:s.map))throw new Error("A Geolocation must be part of a map");const o=null!==(r=e.projection)&&void 0!==r?r:this.context.map.getView().getProjection();this.ol=new Ke.A({...e,projection:o})}}},5553:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(6540),o=s(2627),i=s(7248);class n extends i.o{constructor(e,t){var s,r;if(super(e,t),!(null===(r=null===(s=this.context)||void 0===s?void 0:s.map)||void 0===r?void 0:r.addLayer))throw new Error("A layer must be part of a map")}refresh(e){super.refresh(e);for(const t of["visible","opacity","zIndex","minResolution","maxResolution","minZoom","maxZoom"]){const s=t.charAt(0).toUpperCase()+t.substring(1);this.props[t]!==(e&&e[t])&&this.ol["set"+s](this.props[t])}this.source&&this.props.attributions&&this.source.setAttributions(this.props.attributions),this.props.properties&&this.ol.setProperties(this.props.properties)}componentDidMount(){super.componentDidMount(),this.context.map.addLayer(this.ol)}componentWillUnmount(){super.componentWillUnmount(),this.context.map.removeLayer(this.ol)}render(){return r.createElement("div",{className:"_rlayers_RLayer"},r.createElement(o.aU.Provider,{value:{...this.context,layer:this.ol,source:this.source,rLayer:this}},this.props.children))}}},1895:(e,t,s)=>{s.d(t,{A:()=>h,Y:()=>c});var r=s(6540),o=s(2627),i=s(5553),n=s(4114),l=s(1169),a=s(7248);const c="_rlayers_feature_handlers";class h extends i.A{constructor(e,t){super(e,t),n.Ay.initEventRelay(this.context.map),this.eventSources=this.createSource(e),super.refresh()}createSource(e){throw new Error("RLayerBaseVector is an abstract class")}refresh(e){super.refresh(e),(null==e?void 0:e.style)!==this.props.style&&this.ol.setStyle(l.Ay.getStyle(this.props.style))}incrementHandlers(e){var t;const s=a.o.getOLObject(c,this.ol);s[e]=(null!==(t=s[e])&&void 0!==t?t:0)+1}decrementHandlers(e){a.o.getOLObject(c,this.ol)[e]--}render(){return r.createElement("div",{className:"_rlayers_RLayerVector"},r.createElement(o.aU.Provider,{value:{...this.context,layer:this.ol,source:this.source,vectorlayer:this.ol,vectorsource:this.source,rLayer:this,rLayerVector:this}},this.props.children))}}},2662:(e,t,s)=>{s.d(t,{A:()=>o});var r=s(5553);class o extends r.A{}},1169:(e,t,s)=>{s.d(t,{Ay:()=>d,M2:()=>p,VX:()=>h});var r=s(6540),o=s(5338),i=s(9303),n=s(9276),l=s(2627),a=s(1443),c=s(961);const h=()=>r.useRef(),p=()=>r.createRef();class u extends r.PureComponent{constructor(e,t){super(e,t),this.style=(e,t)=>{if(this.ol!==this.style)return this.ol;let s;if(this.cache){s=this.props.cacheId(e,t);const r=this.cache.get(s);if(r)return r}const i=new n.Ay({zIndex:this.props.zIndex}),a=r.createElement(l.aU.Provider,{value:{...this.context,style:i}},this.props.render(e,t)),h=(0,o.createRoot)(document.createElement("div"));return(0,c.flushSync)((()=>{h.render(a)})),this.cache&&this.cache.set(s,i),i},e.render?this.ol=this.style:this.ol=new n.Ay({zIndex:e.zIndex}),e.render&&e.cacheSize&&e.cacheId&&(this.cache=new i.q({max:e.cacheSize}))}componentDidMount(){this.refresh()}componentDidUpdate(e,t,s){this.props!==e&&((0,a.A)("willRefresh",this,e,this.props),this.refresh(e))}refresh(e){var t,s,r,o,i,l,a;if(!e||(null==e?void 0:e.render)!==this.props.render){if(null===(t=this.context)||void 0===t?void 0:t.styleArray){if(this.ol===this.style)throw new Error("An RStyleArray must contain only static RStyles");this.context.styleArray.includes(this.ol)||this.context.styleArray.push(this.ol)}else(null===(r=null===(s=this.context)||void 0===s?void 0:s.feature)||void 0===r?void 0:r.setStyle)?this.context.feature.setStyle(this.ol):(null===(i=null===(o=this.context)||void 0===o?void 0:o.vectorlayer)||void 0===i?void 0:i.setStyle)?this.context.vectorlayer.setStyle(this.ol):(null===(a=null===(l=this.context)||void 0===l?void 0:l.vectortilelayer)||void 0===a?void 0:a.setStyle)&&this.context.vectortilelayer.setStyle(this.ol);this.cache&&this.cache.clear()}this.ol instanceof n.Ay&&(!e||e.zIndex!==this.props.zIndex)&&this.ol.setZIndex(this.props.zIndex)}render(){return this.props.render?null:r.createElement("div",{className:"_rlayers_RStyle"},r.createElement(l.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}static getStyle(e){return null==e?e:"function"==typeof e.style?(t,s)=>e.style(t,s):Object.keys(e).includes("current")?(t,s)=>e.current.style(t,s):e}static getStyleStatic(e){if(null==e)return e;let t;if("function"==typeof e.style&&(t=e),!Object.keys(e).includes("current")||(t=e.current,null!=t)){if(t){if(void 0!==t.ol&&"function"!=typeof t.ol)return t.ol;throw new TypeError("RStyle is dynamic and cannot be converted to Style")}if("function"==typeof e)throw new TypeError("StyleLike is dynamic and cannot be converted to Style");return e}}}u.contextType=l.aU;const d=u},5111:(e,t,s)=>{s.r(t),s.d(t,{RBackground:()=>C,RBaseStyle:()=>a,RBaseStyleProps:()=>r.RBaseStyleProps,RCircle:()=>b,RFill:()=>y,RIcon:()=>z,RRegularShape:()=>R,RStroke:()=>v,RStyle:()=>c.Ay,RStyleArray:()=>p,RStyleLike:()=>c.RStyleLike,RStyleRef:()=>c.RStyleRef,RText:()=>j,createRStyle:()=>c.M2,useRStyle:()=>c.VX});var r={};s.r(r),s.d(r,{A:()=>a});var o=s(6540),i=s(2627),n=s(1443);class l extends o.PureComponent{constructor(e,t){if(super(e,t),!this.context)throw new Error("A style property must be part of a style");this.ol=this.create(e)}create(e){throw new Error("RBaseStyle is an abstract class")}refresh(e){if((0,n.A)("refreshStyle",this),e)for(const t of this.classProps){const s=t.charAt(0).toUpperCase()+t.substring(1);(e&&e[t])!==this.props[t]&&(this.ol["set"+s]?this.ol["set"+s](this.props[t]):console.error(`Underlying OpenLayers object does not support updating of ${t} after object creation. If you are using an anonymous constant array or object, consider assigning its value to a constant and then passing the constant or use React.useMemo() to avoid this warning and improve performance.`))}}set(e){}componentDidMount(){this.set(this.ol)}componentDidUpdate(e,t,s){e!==this.props&&this.refresh(e)}componentWillUnmount(){this.set(null)}render(){return null}}l.contextType=i.aU,l.classProps=[];const a=l;var c=s(1169),h=s(5338);class p extends c.Ay{constructor(e,t){super(e,t),this.style=(e,t)=>{if(this.props.render){const s=this.props.render(e,t);o.Children.map(s.props.children,(e=>{if(o.isValidElement(e)&&e.type!==c.Ay)throw new TypeError("An RStyleArray should contain only RStyle elements")}));const r=[],n=o.createElement(i.aU.Provider,{value:{...this.context,styleArray:r}},s.props.children);return(0,h.createRoot)(document.createElement("div")).render(n),r}return this.ol},this.childRefs=[],e.render?this.ol=this.style:this.ol=[]}refresh(e){super.refresh(e)}render(){return o.Children.map(this.props.children,(e=>{if(o.isValidElement(e)&&e.type!==c.Ay)throw new TypeError("An RStyleArray should contain only RStyle elements")})),this.props.render?o.createElement(o.Fragment,null):o.createElement("div",{className:"_rlayers_RStyleArray"},o.createElement(i.aU.Provider,{value:{...this.context,styleArray:this.ol}},this.props.children))}}var u=s(953);class d extends a{create(e){return this.classProps=d.classProps,new u.A(e)}set(e){if(this.context.style.setStroke)return this.context.style.setStroke(e);throw new Error("Parent element does not support a stroke")}}d.classProps=["color","width","lineCap","lineJoin","lineDash"];const v=d;var f=s(3628);class m extends a{create(e){return this.classProps=m.classProps,new f.A(e)}set(e){if(this.context.style.setFill)return this.context.style.setFill(e);throw new Error("Parent element does not support a fill")}}m.classProps=["color"];const y=m;var g=s(7733);class x extends a{create(e){throw new Error("RImage is an abstract class")}set(e){if(!this.context.style.setImage)throw new Error("Parent element does not support an image");this.context.style.setImage(e)}}x.classProps=["opacity","rotateWithView","rotation","scale","displacement"];const w=x;class P extends w{create(e){throw new Error("RImage is an abstract class")}setStroke(e){this.stroke=e,this.ol=this.create(this.props),super.set(this.ol)}setFill(e){this.fill=e,this.ol=this.create(this.props),super.set(this.ol)}render(){return o.createElement("div",{className:"_rlayers_RStyle"},o.createElement(i.aU.Provider,{value:{...this.context,style:this}},this.props.children))}}P.classProps=w.classProps.concat(["radius"]);const A=P;class S extends A{create(e){return this.classProps=S.classProps,new g.A({...e,stroke:this.stroke,fill:this.fill})}}S.classProps=A.classProps.concat(["radius"]);const b=S;var E=s(6936);class O extends A{create(e){return this.classProps=O.classProps,new E.A({...e,stroke:this.stroke,fill:this.fill})}}O.classProps=A.classProps.concat(["radius1","radius2","points","angle"]);const R=O;var L=s(1426);class k extends a{create(e){return this.classProps=k.classProps,new L.A(e)}set(e){if(!this.context.style.setText)throw new Error("Parent element does not support a text");this.context.style.setText(e)}render(){return o.createElement("div",{className:"_rlayers_RStyle_RText"},o.createElement(i.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}}k.classProps=["text","font","offsetY","offsetX","overflow","scale","rotation","textAlign","padding","placement","textBaseline"];const j=k;class U extends a{create(e){this.classProps=U.classProps;const t=this.context.style;if(!t.setBackgroundFill||!t.setBackgroundStroke)throw new Error("Parent element does not support a background");return{setFill:t.setBackgroundFill.bind(t),setStroke:t.setBackgroundStroke.bind(t)}}render(){return o.createElement("div",{className:"_rlayers_RStyle_RBackground"},o.createElement(i.aU.Provider,{value:{...this.context,style:this.ol}},this.props.children))}}U.classProps=[];const C=U;var F=s(9700);class D extends w{create(e){return this.classProps=D.classProps,new F.A(e)}}D.classProps=w.classProps.concat(["anchor","anchorXUnits","anchorYUnits","color","crossOrigin","img","offset","offsetOrigin","size","imgSize","src"]);const z=D}}]); \ No newline at end of file diff --git a/7379.bundle.js b/7379.bundle.js index dec1d27f..c5b095b4 100644 --- a/7379.bundle.js +++ b/7379.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7379],{4096:(n,o,e)=>{e.d(o,{A:()=>a});var t=e(1601),r=e.n(t),l=e(6314),i=e.n(l)()(r());i.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=i},5045:(n,o,e)=>{var t=e(5072),r=e.n(t),l=e(7825),i=e.n(l),a=e(7659),s=e.n(a),c=e(5056),u=e.n(c),d=e(540),p=e.n(d),b=e(1113),h=e.n(b),m=e(4096),g={};g.styleTagTransform=h(),g.setAttributes=u(),g.insert=s().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=p(),r()(m.A,g),m.A&&m.A.locals&&m.A.locals},9760:(n,o,e)=>{e.r(o),e.d(o,{default:()=>B});var t=e(6540),r=e(3407),l=(e(5045),e(7240)),i=e(8063),a=e(2627),s=e(2662),c=e(4114),u=e(1169),d=e(1443);class p extends s.A{constructor(n,o){super(n,o),this.addon=Promise.all([e.e(3075),e.e(1060)]).then(e.bind(e,1060)),this.ol=new i.A({style:u.Ay.getStyle(this.props.style),renderBuffer:this.props.renderBuffer}),this.eventSources=[this.ol],c.Ay.initEventRelay(this.context.map)}createSource(){(0,d.A)("createSource start",this),this.metadata=this.addon.then((n=>{var o,e,t,r;return n.importMBTiles({url:this.props.url,sqlWorkers:null!==(o=this.props.workers)&&void 0!==o?o:4,sqlCacheSize:null!==(e=this.props.sqlCacheSize)&&void 0!==e?e:4096,maxSqlPageSize:null!==(t=this.props.maxSqlPageSize)&&void 0!==t?t:4096,backendType:null!==(r=this.props.backend)&&void 0!==r?r:"sync"})}));const n=new AbortController;this.abort=n,Promise.all([this.addon,this.metadata]).then((([o,e])=>n.signal.aborted?((0,d.A)("createSource aborted",this),void e.pool.then((n=>n.close()))):(this.source=new o.MBTilesVectorSource(e),this.eventSources=[this.ol,this.source],this.ol.setSource(this.source),this.attachOldEventHandlers(this.source),this.props.onMetadataReady&&this.props.onMetadataReady.call(this,e),this.source)))}destroySource(){(0,d.A)("destroySource",this,this.abort),this.source&&(this.source.dispose(),this.source=null,this.ol&&this.ol.setSource(null)),this.abort&&(this.abort.abort(),this.abort=null)}componentWillUnmount(){super.componentWillUnmount(),this.destroySource()}refresh(n){super.refresh(n);const o=Object.keys(this.props).filter((n=>n.startsWith("on"))).reduce(((n,o)=>({...n,["_"+o.toLowerCase()]:this.props[o]})),{});this.ol.setProperties(o),(null==n?void 0:n.style)!==this.props.style&&this.ol.setStyle(u.Ay.getStyle(this.props.style)),(null==n?void 0:n.url)!==this.props.url&&(this.destroySource(),this.createSource())}render(){return t.createElement("div",{className:"_rlayers_RLayerVectorMBTiles"},t.createElement(a.aU.Provider,{value:{...this.context,layer:this.ol,vectortilelayer:this.ol,rLayer:this}},this.props.children))}}var b=e(9276),h=e(953),m=e(3628),g=e(7733),v=e(1426);new b.Ay({stroke:new h.A({color:"blue",width:2})});const x={},w={motorway:"#776",trunk:"#ccb",highway:"#f39"},f=new b.Ay({fill:new m.A({color:"#666"}),stroke:new h.A({color:"#444",width:1})}),y=new b.Ay({fill:new m.A({color:"#9db9e8"})}),k=new b.Ay({stroke:new h.A({color:"#8B008B",width:2})}),A=function(n){const o=n.get("class"),e=n.get("railway"),t=n.get("sort_key"),r=o+"/"+e+"/"+t;let l=x[r];if(!l){let n,i;e?(n="#7de",i=1):(n=w[o],i="highway"==o?1.5:1),l=new b.Ay({stroke:new h.A({color:n,width:i}),zIndex:t}),x[r]=l}return l},z=new b.Ay({image:new g.A({radius:5,fill:new m.A({color:"#000080"})})}),S=new h.A({color:"white",width:2}),E=function(n){if("country"==n.get("class"))return null;if(n.get("name")){const o=z.clone();return o.setText(new v.A({text:n.get("name"),offsetY:-5,font:"bold 16px sans-serif",stroke:S})),o}return null};function B(){return t.createElement("div",null,t.createElement(l.f9,{width:"100%",height:"60vh",initial:{center:(0,r.Rb)([2.364,48.82]),zoom:9}},t.createElement(p,{url:"https://velivole.b-cdn.net/maptiler-osm-2017-07-03-v3.6.1-europe.mbtiles",layers:["transportation","water","waterway","landuse","place","boundary"],style:function(n){switch(n.get("layer")){case"water":case"waterway":return y;case"transportation":return A(n);case"landuse":return f;case"boundary":return k;case"place":return E(n);default:return null}}})),t.createElement("p",null,"The data comes from a huge 30GB ",t.createElement("code",null,".mbtiles")," file and initial loading times may be slow due to the CDN provider not keeping it in its cache"))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7379],{4096:(n,o,e)=>{e.d(o,{A:()=>a});var t=e(1601),r=e.n(t),l=e(6314),i=e.n(l)()(r());i.push([n.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=i},5045:(n,o,e)=>{var t=e(5072),r=e.n(t),l=e(7825),i=e.n(l),a=e(7659),s=e.n(a),c=e(5056),u=e.n(c),d=e(540),p=e.n(d),b=e(1113),h=e.n(b),m=e(4096),g={};g.styleTagTransform=h(),g.setAttributes=u(),g.insert=s().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=p(),r()(m.A,g),m.A&&m.A.locals&&m.A.locals},9760:(n,o,e)=>{e.r(o),e.d(o,{default:()=>B});var t=e(6540),r=e(3407),l=(e(5045),e(7240)),i=e(8063),a=e(2627),s=e(2662),c=e(4114),u=e(1169),d=e(1443);class p extends s.A{constructor(n,o){super(n,o),this.addon=Promise.all([e.e(3075),e.e(8112),e.e(1060)]).then(e.bind(e,1060)),this.ol=new i.A({style:u.Ay.getStyle(this.props.style),renderBuffer:this.props.renderBuffer}),this.eventSources=[this.ol],c.Ay.initEventRelay(this.context.map)}createSource(){(0,d.A)("createSource start",this),this.metadata=this.addon.then((n=>{var o,e,t,r;return n.importMBTiles({url:this.props.url,sqlWorkers:null!==(o=this.props.workers)&&void 0!==o?o:4,sqlCacheSize:null!==(e=this.props.sqlCacheSize)&&void 0!==e?e:4096,maxSqlPageSize:null!==(t=this.props.maxSqlPageSize)&&void 0!==t?t:4096,backendType:null!==(r=this.props.backend)&&void 0!==r?r:"sync"})}));const n=new AbortController;this.abort=n,Promise.all([this.addon,this.metadata]).then((([o,e])=>n.signal.aborted?((0,d.A)("createSource aborted",this),void e.pool.then((n=>n.close()))):(this.source=new o.MBTilesVectorSource(e),this.eventSources=[this.ol,this.source],this.ol.setSource(this.source),this.attachOldEventHandlers(this.source),this.props.onMetadataReady&&this.props.onMetadataReady.call(this,e),this.source)))}destroySource(){(0,d.A)("destroySource",this,this.abort),this.source&&(this.source.dispose(),this.source=null,this.ol&&this.ol.setSource(null)),this.abort&&(this.abort.abort(),this.abort=null)}componentWillUnmount(){super.componentWillUnmount(),this.destroySource()}refresh(n){super.refresh(n);const o=Object.keys(this.props).filter((n=>n.startsWith("on"))).reduce(((n,o)=>({...n,["_"+o.toLowerCase()]:this.props[o]})),{});this.ol.setProperties(o),(null==n?void 0:n.style)!==this.props.style&&this.ol.setStyle(u.Ay.getStyle(this.props.style)),(null==n?void 0:n.url)!==this.props.url&&(this.destroySource(),this.createSource())}render(){return t.createElement("div",{className:"_rlayers_RLayerVectorMBTiles"},t.createElement(a.aU.Provider,{value:{...this.context,layer:this.ol,vectortilelayer:this.ol,rLayer:this}},this.props.children))}}var b=e(9276),h=e(953),m=e(3628),g=e(7733),v=e(1426);new b.Ay({stroke:new h.A({color:"blue",width:2})});const x={},w={motorway:"#776",trunk:"#ccb",highway:"#f39"},f=new b.Ay({fill:new m.A({color:"#666"}),stroke:new h.A({color:"#444",width:1})}),y=new b.Ay({fill:new m.A({color:"#9db9e8"})}),k=new b.Ay({stroke:new h.A({color:"#8B008B",width:2})}),A=function(n){const o=n.get("class"),e=n.get("railway"),t=n.get("sort_key"),r=o+"/"+e+"/"+t;let l=x[r];if(!l){let n,i;e?(n="#7de",i=1):(n=w[o],i="highway"==o?1.5:1),l=new b.Ay({stroke:new h.A({color:n,width:i}),zIndex:t}),x[r]=l}return l},z=new b.Ay({image:new g.A({radius:5,fill:new m.A({color:"#000080"})})}),S=new h.A({color:"white",width:2}),E=function(n){if("country"==n.get("class"))return null;if(n.get("name")){const o=z.clone();return o.setText(new v.A({text:n.get("name"),offsetY:-5,font:"bold 16px sans-serif",stroke:S})),o}return null};function B(){return t.createElement("div",null,t.createElement(l.f9,{width:"100%",height:"60vh",initial:{center:(0,r.Rb)([2.364,48.82]),zoom:9}},t.createElement(p,{url:"https://velivole.b-cdn.net/maptiler-osm-2017-07-03-v3.6.1-europe.mbtiles",layers:["transportation","water","waterway","landuse","place","boundary"],style:function(n){switch(n.get("layer")){case"water":case"waterway":return y;case"transportation":return A(n);case"landuse":return f;case"boundary":return k;case"place":return E(n);default:return null}}})),t.createElement("p",null,"The data comes from a huge 30GB ",t.createElement("code",null,".mbtiles")," file and initial loading times may be slow due to the CDN provider not keeping it in its cache"))}}}]); \ No newline at end of file diff --git a/7729.bundle.js b/7729.bundle.js deleted file mode 100644 index 7da78e11..00000000 --- a/7729.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7729],{7729:(e,s,t)=>{t.r(s),t.d(s,{default:()=>o});var a={};t.r(a);var r=t(6540),l=t(3407),c=t(7240);class n extends c.Am{constructor(e,s){super(e,s),this.ol=new a.MapboxVector({...e}),this.eventSources=[this.ol],this.attachEventHandlers()}}function o(){return r.createElement(c.f9,{className:"example-map",initial:{center:(0,l.Rb)([2.364,48.82]),zoom:11}},r.createElement(n,{styleUrl:"mapbox://styles/mapbox/bright-v9",accessToken:"pk.eyJ1IjoibW1vbXRjaGV2IiwiYSI6ImNrejZ5eGRlejB1dWQydHBrenF4a2o4ZjMifQ.sEJ43dNJgBkKJI_zTFcV3Q"}))}}}]); \ No newline at end of file diff --git a/7743.bundle.js b/7743.bundle.js index a5c980bc..31ef384e 100644 --- a/7743.bundle.js +++ b/7743.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7743],{7743:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var a=r(6540),s=r(8110),n=r(3407),l=r(4078),i=(r(5045),r(7240));function c(){return a.createElement(i.f9,{className:"example-map",initial:{center:(0,n.Rb)([0,50]),zoom:5}},a.createElement(i.ej,null),a.createElement(i.Fd,{zIndex:5,projection:"EPSG:27700",attributions:"Contains OS data © Crown Copyright and database right",url:"https://tiles.arcgis.com/tiles/qHLhLQrcvEnxjtPr/arcgis/rest/services/OS_Open_Raster/MapServer/WMTS",layer:"OS_Open_Raster"}))}s.A.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),(0,l.kz)(s.A)}}]); \ No newline at end of file +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[7743],{7743:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var a=r(6540),s=r(8721),n=r(3407),l=r(4078),i=(r(5045),r(7240));function c(){return a.createElement(i.f9,{className:"example-map",initial:{center:(0,n.Rb)([0,50]),zoom:5}},a.createElement(i.ej,null),a.createElement(i.Fd,{zIndex:5,projection:"EPSG:27700",attributions:"Contains OS data © Crown Copyright and database right",url:"https://tiles.arcgis.com/tiles/qHLhLQrcvEnxjtPr/arcgis/rest/services/OS_Open_Raster/MapServer/WMTS",layer:"OS_Open_Raster"}))}s.A.defs("EPSG:27700","+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),(0,l.kz)(s.A)}}]); \ No newline at end of file diff --git a/7985.bundle.js b/7985.bundle.js index 0e76fed3..271ebe8d 100644 --- a/7985.bundle.js +++ b/7985.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r={7985:(e,t,r)=>{var n=r(9523);const o={};var s=r(9663),i=r(8595);const a={};n.Yz.threads("SQLite worker started"),globalThis.onmessage=({data:e})=>{n.Yz.threads("SQLite received green light",e);const t=e;r.e(4025).then(r.bind(r,4025)).then((e=>e.default())).then((e=>{n.Yz.threads("SQLite init"),e.initWorker1API(),"object"==typeof t.httpChannel?function(e,t,r){if("undefined"==typeof SharedArrayBuffer)throw new Error('SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers.');if(!(t&&t.port instanceof MessagePort&&t.shm instanceof SharedArrayBuffer))throw new Error("No backend message channel in options");const s=new Int32Array(t.shm,t.shm.byteLength-Int32Array.BYTES_PER_ELEMENT),i=new Uint8Array(t.shm,0,t.shm.byteLength-Int32Array.BYTES_PER_ELEMENT),a=e.capi,c=e.wasm,u=a.sqlite3_vfs,l=a.sqlite3_file,f=a.sqlite3_io_methods,p=new u,d=new f;p.$iVersion=1,p.$szOsFile=a.sqlite3_file.structInfo.sizeof,p.$mxPathname=1024,p.$zName=c.allocCString("http"),p.$xDlOpen=p.$xDlError=p.$xDlSym=p.$xDlClose=null;const h=e=>{var o;let i,a;Atomics.store(s,0,n.a9.WORKMSG),t.port.postMessage(e);do{i=Atomics.wait(s,0,n.a9.WORKMSG,null!==(o=null==r?void 0:r.timeout)&&void 0!==o?o:n.KQ.timeout),a=Atomics.load(s,0)}while("ok"===i&&a===n.a9.WORKMSG);return"timed-out"===i?(console.error("Backend timeout",i,s,e),-1):a},v={xCheckReservedLock:function(e,t){return n.Yz.vfs("xCheckReservedLock",e,t),c.poke(t,0,"i32"),0},xClose:function(e){return n.Yz.vfs("xClose",e),o[e]?(delete o[e],0):a.SQLITE_NOTFOUND},xDeviceCharacteristics:function(e){return n.Yz.vfs("xDeviceCharacteristics",e),a.SQLITE_IOCAP_IMMUTABLE},xFileControl:function(e,t,r){return n.Yz.vfs("xFileControl",e,t,r),t===a.SQLITE_FCNTL_SYNC?a.SQLITE_OK:a.SQLITE_NOTFOUND},xFileSize:function(e,r){if(n.Yz.vfs("xFileSize",e,r),!o[e])return a.SQLITE_NOTFOUND;if(0!==h({msg:"xFilesize",url:o[e].url}))return a.SQLITE_IOERR;const s=new BigUint64Array(t.shm,0,1)[0];return n.Yz.vfs("file size is ",s),c.poke(r,s,"i64"),0},xLock:function(e,t){return n.Yz.vfs("xLock",e,t),0},xRead:function(e,t,r,s){if(n.Yz.vfs("xRead",e,t,r,s),Number(s)>Number.MAX_SAFE_INTEGER)return a.SQLITE_TOOBIG;if(!o[e])return a.SQLITE_NOTFOUND;const u=h({msg:"xRead",url:o[e].url,n:r,offset:s});return 0!==u?(console.error("xRead",u),a.SQLITE_IOERR):(c.heap8u().set(i.subarray(0,r),t),a.SQLITE_OK)},xSync:function(e,t){return n.Yz.vfs("xSync",e,t),0},xTruncate:function(e,t){return n.Yz.vfs("xTruncate",e,t),0},xUnlock:function(e,t){return n.Yz.vfs("xUnlock",e,t),0},xWrite:function(e,t,r,o){return n.Yz.vfs("xWrite",e,t,r,o),a.SQLITE_READONLY}},E={xAccess:function(e,r,o,s){if(n.Yz.vfs("xAccess",e,r,o,s),!(o&a.SQLITE_OPEN_READONLY))return c.poke(s,0,"i32"),a.SQLITE_OK;const i=c.cstrToJs(r),u=h({msg:"xAccess",url:i});if(0!==u)return console.error("xAccess",u),a.SQLITE_IOERR;const l=new Uint32Array(t.shm,0,1)[0];return c.poke(s,l,"i32"),a.SQLITE_OK},xCurrentTime:function(e,t){return n.Yz.vfs("xCurrentTime",e,t),c.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return n.Yz.vfs("xCurrentTimeInt64",e,t),c.poke(t,BigInt(2440587.5)*BigInt(864e5)+BigInt((new Date).getTime()),"i64"),0},xDelete:function(e,t,r){return n.Yz.vfs("xDelete",e,t,r),a.SQLITE_READONLY},xFullPathname:function(e,t,r,o){return n.Yz.vfs("xFullPathname",e,t,r,o),c.cstrncpy(o,t,r)e.charCodeAt(0)))).buffer}}),function(e,t){const r=e.capi,o=e.wasm,c=r.sqlite3_vfs,u=r.sqlite3_file,l=r.sqlite3_io_methods,f=new c,p=new l;f.$iVersion=1,f.$szOsFile=r.sqlite3_file.structInfo.sizeof,f.$mxPathname=1024,f.$zName=o.allocCString("http"),f.$xDlOpen=f.$xDlError=f.$xDlSym=f.$xDlClose=null;const d={xCheckReservedLock:function(e,t){return n.Yz.vfs("xCheckReservedLock",e,t),o.poke(t,0,"i32"),0},xClose:function(e){return n.Yz.vfs("xClose",e),a[e]?(delete a[e],0):r.SQLITE_NOTFOUND},xDeviceCharacteristics:function(e){return n.Yz.vfs("xDeviceCharacteristics",e),r.SQLITE_IOCAP_IMMUTABLE},xFileControl:function(e,t,o){return n.Yz.vfs("xFileControl",e,t,o),t===r.SQLITE_FCNTL_SYNC?r.SQLITE_OK:r.SQLITE_NOTFOUND},xFileSize:function(e,t){return n.Yz.vfs("xFileSize",e,t),a[e]?(n.Yz.vfs("file size is ",a[e].size),o.poke(t,a[e].size,"i64"),0):r.SQLITE_NOTFOUND},xLock:function(e,t){return n.Yz.vfs("xLock",e,t),0},xRead:function(e,s,c,u){var l,f,p,h;if(n.Yz.vfs("xRead (sync)",e,s,c,u),Number(u)>Number.MAX_SAFE_INTEGER)return r.SQLITE_TOOBIG;if(!a[e])return r.SQLITE_NOTFOUND;const v=a[e];if(!v.pageSize){v.pageSize=1024;const o=new Uint8Array(2),s=d.xRead(e,o,2,BigInt(16)),a=new Uint16Array(o.buffer);if(0!==s)return r.SQLITE_IOERR;if((0,i.l)(a),v.pageSize=a[0],n.Yz.vfs(`page size is ${v.pageSize}`),1024!=v.pageSize&&(console.warn(`Page size for ${v.url} is ${v.pageSize}, recommended size is 1024`),v.pageCache.delete(0)),v.pageSize>(null!==(l=null==t?void 0:t.maxPageSize)&&void 0!==l?l:n.KQ.maxPageSize))throw new Error(`${v.pageSize} is over the maximum configured ${null!==(f=null==t?void 0:t.maxPageSize)&&void 0!==f?f:n.KQ.maxPageSize}`)}try{const e=BigInt(v.pageSize),i=BigInt(c),a=u/e;a*e!==u&&n.Yz.vfs(`Read chunk ${u} is not page-aligned`);let l=a*e;if(l+e0&&v.pageCache.get(Number(a)-1);o&&("number"==typeof o&&(o=v.pageCache.get(o)),o instanceof Uint8Array&&(e=2*o.byteLength,n.Yz.cache(`[sync] downloading super page of size ${e}`)));const s=e/v.pageSize;n.Yz.http(`downloading page ${a} of size ${e} starting at ${l}`);const i=new XMLHttpRequest;i.open("GET",v.url,!1);for(const e of Object.keys(null!==(p=null==t?void 0:t.headers)&&void 0!==p?p:n.KQ.headers))i.setRequestHeader(e,(null!==(h=null==t?void 0:t.headers)&&void 0!==h?h:n.KQ.headers)[e]);if(i.setRequestHeader("Range",`bytes=${l}-${l+BigInt(e-1)}`),i.responseType="arraybuffer",i.onload=()=>{i.response instanceof ArrayBuffer&&(f=new Uint8Array(i.response))},i.send(),!f)return r.SQLITE_IOERR;if(!(f instanceof Uint8Array)||0===f.length)throw new Error(`Invalid HTTP response received: ${JSON.stringify(i.response)}`);v.pageCache.set(Number(a),f);for(let e=Number(a)+1;e{var r,o;const i=Object.create(null);i.fid=c,i.url=v,i.sq3File=new u(c),i.sq3File.$pMethods=p.pointer,i.size=BigInt(null!==(r=e.getResponseHeader("Content-Length"))&&void 0!==r?r:0),i.pageCache=new s.A({maxSize:1024*(null!==(o=null==t?void 0:t.cacheSize)&&void 0!==o?o:n.KQ.cacheSize),sizeCalculation:e=>{var t;return null!==(t=e.byteLength)&&void 0!==t?t:4}}),"bytes"!==e.getResponseHeader("Accept-Ranges")&&console.warn(`Server for ${v} does not advertise 'Accept-Ranges'. If the server supports it, in order to remove this message, add "Accept-Ranges: bytes". Additionally, if using CORS, add "Access-Control-Expose-Headers: *".`),a[c]=i,E=!0},e.send()}catch(e){console.error("xOpen",e)}return E?(o.poke(f,r.SQLITE_OPEN_READONLY,"i32"),r.SQLITE_OK):(console.error("xOpen"),r.SQLITE_CANTOPEN)}};e.vfs.installVfs({io:{struct:p,methods:d},vfs:{struct:f,methods:h}}),e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(f.pointer,(function(e,r){var o;r.capi.sqlite3_busy_timeout(e,null!==(o=null==t?void 0:t.timeout)&&void 0!==o?o:n.KQ.timeout),r.capi.sqlite3_exec(e,["PRAGMA journal_mode=DELETE;","PRAGMA cache_size=0;"],0,0,0)}))}(e,t.httpOptions))}))}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,o.x=()=>{var e=o.O(void 0,[1917],(()=>o(7985)));return o.O(e)},e=[],o.O=(t,r,n,s)=>{if(!r){var i=1/0;for(l=0;l=s)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(a=!1,s0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[r,n,s]},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+".bundle.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=self.location+"";var e={7985:1};o.f.i=(t,r)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkrlayers=self.webpackChunkrlayers||[],r=t.push.bind(t);t.push=t=>{var[n,s,i]=t;for(var a in s)o.o(s,a)&&(o.m[a]=s[a]);for(i&&i(o);n.length;)e[n.pop()]=1;r(t)}})(),t=o.x,o.x=()=>o.e(1917).then(t),o.x()})(); \ No newline at end of file +(()=>{"use strict";var e,t,r={7985:(e,t,r)=>{var n=r(9523);const o={};var s=r(9663),i=r(8595);const a={};n.Yz.threads("SQLite worker started"),globalThis.onmessage=({data:e})=>{n.Yz.threads("SQLite received green light",e);const t=e;r.e(4025).then(r.bind(r,4025)).then((e=>e.default())).then((e=>{n.Yz.threads("SQLite init"),e.initWorker1API(),"object"==typeof t.httpChannel?function(e,t,r){if("undefined"==typeof SharedArrayBuffer)throw new Error('SharedArrayBuffer is not available. If your browser supports it, the webserver must send "Cross-Origin-Opener-Policy: same-origin "and "Cross-Origin-Embedder-Policy: require-corp" headers.');if(!(t&&t.port instanceof MessagePort&&t.shm instanceof SharedArrayBuffer))throw new Error("No backend message channel in options");const s=new Int32Array(t.shm,t.shm.byteLength-Int32Array.BYTES_PER_ELEMENT),i=new Uint8Array(t.shm,0,t.shm.byteLength-Int32Array.BYTES_PER_ELEMENT),a=e.capi,c=e.wasm,u=a.sqlite3_vfs,l=a.sqlite3_file,f=a.sqlite3_io_methods,p=new u,d=new f;p.$iVersion=1,p.$szOsFile=a.sqlite3_file.structInfo.sizeof,p.$mxPathname=1024,p.$zName=c.allocCString("http"),p.$xDlOpen=p.$xDlError=p.$xDlSym=p.$xDlClose=null;const h=e=>{var o;let i,a;Atomics.store(s,0,n.a9.WORKMSG),t.port.postMessage(e);do{i=Atomics.wait(s,0,n.a9.WORKMSG,null!==(o=null==r?void 0:r.timeout)&&void 0!==o?o:n.KQ.timeout),a=Atomics.load(s,0)}while("ok"===i&&a===n.a9.WORKMSG);return"timed-out"===i?(console.error("Backend timeout",i,s,e),-1):a},v={xCheckReservedLock:function(e,t){return n.Yz.vfs("xCheckReservedLock",e,t),c.poke(t,0,"i32"),0},xClose:function(e){return n.Yz.vfs("xClose",e),o[e]?(delete o[e],0):a.SQLITE_NOTFOUND},xDeviceCharacteristics:function(e){return n.Yz.vfs("xDeviceCharacteristics",e),a.SQLITE_IOCAP_IMMUTABLE},xFileControl:function(e,t,r){return n.Yz.vfs("xFileControl",e,t,r),t===a.SQLITE_FCNTL_SYNC?a.SQLITE_OK:a.SQLITE_NOTFOUND},xFileSize:function(e,r){if(n.Yz.vfs("xFileSize",e,r),!o[e])return a.SQLITE_NOTFOUND;if(0!==h({msg:"xFilesize",url:o[e].url}))return a.SQLITE_IOERR;const s=new BigUint64Array(t.shm,0,1)[0];return n.Yz.vfs("file size is ",s),c.poke(r,s,"i64"),0},xLock:function(e,t){return n.Yz.vfs("xLock",e,t),0},xRead:function(e,t,r,s){if(n.Yz.vfs("xRead",e,t,r,s),Number(s)>Number.MAX_SAFE_INTEGER)return a.SQLITE_TOOBIG;if(!o[e])return a.SQLITE_NOTFOUND;const u=h({msg:"xRead",url:o[e].url,n:r,offset:s});return 0!==u?(console.error("xRead",u),a.SQLITE_IOERR):(c.heap8u().set(i.subarray(0,r),t),a.SQLITE_OK)},xSync:function(e,t){return n.Yz.vfs("xSync",e,t),0},xTruncate:function(e,t){return n.Yz.vfs("xTruncate",e,t),0},xUnlock:function(e,t){return n.Yz.vfs("xUnlock",e,t),0},xWrite:function(e,t,r,o){return n.Yz.vfs("xWrite",e,t,r,o),a.SQLITE_READONLY}},E={xAccess:function(e,r,o,s){if(n.Yz.vfs("xAccess",e,r,o,s),!(o&a.SQLITE_OPEN_READONLY))return c.poke(s,0,"i32"),a.SQLITE_OK;const i=c.cstrToJs(r),u=h({msg:"xAccess",url:i});if(0!==u)return console.error("xAccess",u),a.SQLITE_IOERR;const l=new Uint32Array(t.shm,0,1)[0];return c.poke(s,l,"i32"),a.SQLITE_OK},xCurrentTime:function(e,t){return n.Yz.vfs("xCurrentTime",e,t),c.poke(t,2440587.5+(new Date).getTime()/864e5,"double"),0},xCurrentTimeInt64:function(e,t){return n.Yz.vfs("xCurrentTimeInt64",e,t),c.poke(t,BigInt(2440587.5)*BigInt(864e5)+BigInt((new Date).getTime()),"i64"),0},xDelete:function(e,t,r){return n.Yz.vfs("xDelete",e,t,r),a.SQLITE_READONLY},xFullPathname:function(e,t,r,o){return n.Yz.vfs("xFullPathname",e,t,r,o),c.cstrncpy(o,t,r)e.charCodeAt(0)))).buffer}}),function(e,t){const r=e.capi,o=e.wasm,c=r.sqlite3_vfs,u=r.sqlite3_file,l=r.sqlite3_io_methods,f=new c,p=new l;f.$iVersion=1,f.$szOsFile=r.sqlite3_file.structInfo.sizeof,f.$mxPathname=1024,f.$zName=o.allocCString("http"),f.$xDlOpen=f.$xDlError=f.$xDlSym=f.$xDlClose=null;const d={xCheckReservedLock:function(e,t){return n.Yz.vfs("xCheckReservedLock",e,t),o.poke(t,0,"i32"),0},xClose:function(e){return n.Yz.vfs("xClose",e),a[e]?(delete a[e],0):r.SQLITE_NOTFOUND},xDeviceCharacteristics:function(e){return n.Yz.vfs("xDeviceCharacteristics",e),r.SQLITE_IOCAP_IMMUTABLE},xFileControl:function(e,t,o){return n.Yz.vfs("xFileControl",e,t,o),t===r.SQLITE_FCNTL_SYNC?r.SQLITE_OK:r.SQLITE_NOTFOUND},xFileSize:function(e,t){return n.Yz.vfs("xFileSize",e,t),a[e]?(n.Yz.vfs("file size is ",a[e].size),o.poke(t,a[e].size,"i64"),0):r.SQLITE_NOTFOUND},xLock:function(e,t){return n.Yz.vfs("xLock",e,t),0},xRead:function(e,s,c,u){var l,f,p,h;if(n.Yz.vfs("xRead (sync)",e,s,c,u),Number(u)>Number.MAX_SAFE_INTEGER)return r.SQLITE_TOOBIG;if(!a[e])return r.SQLITE_NOTFOUND;const v=a[e];if(!v.pageSize){v.pageSize=1024;const o=new Uint8Array(2),s=d.xRead(e,o,2,BigInt(16)),a=new Uint16Array(o.buffer);if(0!==s)return r.SQLITE_IOERR;if((0,i.l)(a),v.pageSize=a[0],n.Yz.vfs(`page size is ${v.pageSize}`),1024!=v.pageSize&&(console.warn(`Page size for ${v.url} is ${v.pageSize}, recommended size is 1024`),v.pageCache.delete(0)),v.pageSize>(null!==(l=null==t?void 0:t.maxPageSize)&&void 0!==l?l:n.KQ.maxPageSize))throw new Error(`${v.pageSize} is over the maximum configured ${null!==(f=null==t?void 0:t.maxPageSize)&&void 0!==f?f:n.KQ.maxPageSize}`)}try{const e=BigInt(v.pageSize),i=BigInt(c),a=u/e;a*e!==u&&n.Yz.vfs(`Read chunk ${u} is not page-aligned`);let l=a*e;if(l+e0&&v.pageCache.get(Number(a)-1);o&&("number"==typeof o&&(o=v.pageCache.get(o)),o instanceof Uint8Array&&(e=2*o.byteLength,n.Yz.cache(`[sync] downloading super page of size ${e}`)));const s=e/v.pageSize;n.Yz.http(`downloading page ${a} of size ${e} starting at ${l}`);const i=new XMLHttpRequest;i.open("GET",v.url,!1);for(const e of Object.keys(null!==(p=null==t?void 0:t.headers)&&void 0!==p?p:n.KQ.headers))i.setRequestHeader(e,(null!==(h=null==t?void 0:t.headers)&&void 0!==h?h:n.KQ.headers)[e]);if(i.setRequestHeader("Range",`bytes=${l}-${l+BigInt(e-1)}`),i.responseType="arraybuffer",i.onload=()=>{i.response instanceof ArrayBuffer&&(f=new Uint8Array(i.response))},i.send(),!f)return r.SQLITE_IOERR;if(!(f instanceof Uint8Array)||0===f.length)throw new Error(`Invalid HTTP response received: ${JSON.stringify(i.response)}`);v.pageCache.set(Number(a),f);for(let e=Number(a)+1;e{var r,o;const i=Object.create(null);i.fid=c,i.url=v,i.sq3File=new u(c),i.sq3File.$pMethods=p.pointer,i.size=BigInt(null!==(r=e.getResponseHeader("Content-Length"))&&void 0!==r?r:0),i.pageCache=new s.A({maxSize:1024*(null!==(o=null==t?void 0:t.cacheSize)&&void 0!==o?o:n.KQ.cacheSize),sizeCalculation:e=>{var t;return null!==(t=e.byteLength)&&void 0!==t?t:4}}),"bytes"!==e.getResponseHeader("Accept-Ranges")&&console.warn(`Server for ${v} does not advertise 'Accept-Ranges'. If the server supports it, in order to remove this message, add "Accept-Ranges: bytes". Additionally, if using CORS, add "Access-Control-Expose-Headers: *".`),a[c]=i,E=!0},e.send()}catch(e){console.error("xOpen",e)}return E?(o.poke(f,r.SQLITE_OPEN_READONLY,"i32"),r.SQLITE_OK):(console.error("xOpen"),r.SQLITE_CANTOPEN)}};e.vfs.installVfs({io:{struct:p,methods:d},vfs:{struct:f,methods:h}}),e.oo1.DB.dbCtorHelper.setVfsPostOpenSql(f.pointer,(function(e,r){var o;r.capi.sqlite3_busy_timeout(e,null!==(o=null==t?void 0:t.timeout)&&void 0!==o?o:n.KQ.timeout),r.capi.sqlite3_exec(e,["PRAGMA journal_mode=DELETE;","PRAGMA cache_size=0;"],0,0,0)}))}(e,t.httpOptions))}))}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,o.x=()=>{var e=o.O(void 0,[1917],(()=>o(7985)));return o.O(e)},e=[],o.O=(t,r,n,s)=>{if(!r){var i=1/0;for(l=0;l=s)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(a=!1,s0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[r,n,s]},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+".bundle.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=self.location+"";var e={7985:1};o.f.i=(t,r)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkrlayers=self.webpackChunkrlayers||[],r=t.push.bind(t);t.push=t=>{var[n,s,i]=t;for(var a in s)o.o(s,a)&&(o.m[a]=s[a]);for(i&&i(o);n.length;)e[n.pop()]=1;r(t)}})(),t=o.x,o.x=()=>o.e(1917).then(t),o.x()})(); \ No newline at end of file diff --git a/8112.bundle.js b/8112.bundle.js new file mode 100644 index 00000000..d0ec37de --- /dev/null +++ b/8112.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[8112],{8112:(t,i,e)=>{e.d(i,{A:()=>o});const s=4294967296,r=1/s,h="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class o{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,i,e=this.length){for(;this.pos>3,r=this.pos;this.type=7&e,t(s,i,this),this.pos===r&&this.skip(e)}return i}readMessage(t,i){return this.readFields(t,i,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*s;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*s;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const i=this.buf;let e,s;return s=i[this.pos++],e=127&s,s<128?e:(s=i[this.pos++],e|=(127&s)<<7,s<128?e:(s=i[this.pos++],e|=(127&s)<<14,s<128?e:(s=i[this.pos++],e|=(127&s)<<21,s<128?e:(s=i[this.pos],e|=(15&s)<<28,function(t,i,e){const s=e.buf;let r,h;if(h=s[e.pos++],r=(112&h)>>4,h<128)return a(t,r,i);if(h=s[e.pos++],r|=(127&h)<<3,h<128)return a(t,r,i);if(h=s[e.pos++],r|=(127&h)<<10,h<128)return a(t,r,i);if(h=s[e.pos++],r|=(127&h)<<17,h<128)return a(t,r,i);if(h=s[e.pos++],r|=(127&h)<<24,h<128)return a(t,r,i);if(h=s[e.pos++],r|=(1&h)<<31,h<128)return a(t,r,i);throw new Error("Expected varint not more than 10 bytes")}(e,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,i=this.pos;return this.pos=t,t-i>=12&&h?h.decode(this.buf.subarray(i,t)):function(t,i,e){let s="",r=i;for(;r239?4:i>223?3:i>191?2:1;if(r+d>e)break;1===d?i<128&&(n=i):2===d?(h=t[r+1],128==(192&h)&&(n=(31&i)<<6|63&h,n<=127&&(n=null))):3===d?(h=t[r+1],o=t[r+2],128==(192&h)&&128==(192&o)&&(n=(15&i)<<12|(63&h)<<6|63&o,(n<=2047||n>=55296&&n<=57343)&&(n=null))):4===d&&(h=t[r+1],o=t[r+2],a=t[r+3],128==(192&h)&&128==(192&o)&&128==(192&a)&&(n=(15&i)<<18|(63&h)<<12|(63&o)<<6|63&a,(n<=65535||n>=1114112)&&(n=null))),null===n?(n=65533,d=1):n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|1023&n),s+=String.fromCharCode(n),r+=d}return s}(this.buf,i,t)}readBytes(){const t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i}readPackedVarint(t=[],i){const e=this.readPackedEnd();for(;this.pos127;);else if(2===i)this.pos=this.readVarint()+this.pos;else if(5===i)this.pos+=4;else{if(1!==i)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}writeTag(t,i){this.writeVarint(t<<3|i)}realloc(t){let i=this.length||16;for(;i268435455||t<0?function(t,i){let e,s;if(t>=0?(e=t%4294967296|0,s=t/4294967296|0):(e=~(-t%4294967296),s=~(-t/4294967296),4294967295^e?e=e+1|0:(e=0,s=s+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(t,i,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(e,0,i),function(t,i){const e=(7&t)<<4;i.buf[i.pos++]|=e|((t>>>=3)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t)))))}(s,i)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const i=this.pos;this.pos=function(t,i,e){for(let s,r,h=0;h55295&&s<57344){if(!r){s>56319||h+1===i.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=s;continue}if(s<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=s;continue}s=r-55296<<10|s-56320|65536,r=null}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);s<128?t[e++]=s:(s<2048?t[e++]=s>>6|192:(s<65536?t[e++]=s>>12|224:(t[e++]=s>>18|240,t[e++]=s>>12&63|128),t[e++]=s>>6&63|128),t[e++]=63&s|128)}return e}(this.buf,t,this.pos);const e=this.pos-i;e>=128&&n(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const i=t.length;this.writeVarint(i),this.realloc(i);for(let e=0;e=128&&n(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s}writeMessage(t,i,e){this.writeTag(t,2),this.writeRawMessage(i,e)}writePackedVarint(t,i){i.length&&this.writeMessage(t,d,i)}writePackedSVarint(t,i){i.length&&this.writeMessage(t,l,i)}writePackedBoolean(t,i){i.length&&this.writeMessage(t,w,i)}writePackedFloat(t,i){i.length&&this.writeMessage(t,u,i)}writePackedDouble(t,i){i.length&&this.writeMessage(t,p,i)}writePackedFixed32(t,i){i.length&&this.writeMessage(t,f,i)}writePackedSFixed32(t,i){i.length&&this.writeMessage(t,c,i)}writePackedFixed64(t,i){i.length&&this.writeMessage(t,g,i)}writePackedSFixed64(t,i){i.length&&this.writeMessage(t,F,i)}writeBytesField(t,i){this.writeTag(t,2),this.writeBytes(i)}writeFixed32Field(t,i){this.writeTag(t,5),this.writeFixed32(i)}writeSFixed32Field(t,i){this.writeTag(t,5),this.writeSFixed32(i)}writeFixed64Field(t,i){this.writeTag(t,1),this.writeFixed64(i)}writeSFixed64Field(t,i){this.writeTag(t,1),this.writeSFixed64(i)}writeVarintField(t,i){this.writeTag(t,0),this.writeVarint(i)}writeSVarintField(t,i){this.writeTag(t,0),this.writeSVarint(i)}writeStringField(t,i){this.writeTag(t,2),this.writeString(i)}writeFloatField(t,i){this.writeTag(t,5),this.writeFloat(i)}writeDoubleField(t,i){this.writeTag(t,1),this.writeDouble(i)}writeBooleanField(t,i){this.writeVarintField(t,+i)}}function a(t,i,e){return e?4294967296*i+(t>>>0):4294967296*(i>>>0)+(t>>>0)}function n(t,i,e){const s=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));e.realloc(s);for(let i=e.pos-1;i>=t;i--)e.buf[i+s]=e.buf[i]}function d(t,i){for(let e=0;e{i.d(e,{q:()=>g});const n="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=new Set,r={env:{RLAYERS_DEBUG:void 0}},o=(t,e,i,n)=>{"function"==typeof r.emitWarning?r.emitWarning(t,e,i,n):console.error(`[${i}] ${e}: ${t}`)};let a=globalThis.AbortController,l=globalThis.AbortSignal;if(void 0===a){l=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},a=class{constructor(){e()}signal=new l;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==r.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,o("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const h=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),c=t=>h(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?u:null:null;class u extends Array{constructor(t){super(t),this.fill(0)}}class d{heap;length;static#t=!1;static create(t){const e=c(t);if(!e)return[];d.#t=!0;const i=new d(t,e);return d.#t=!1,i}constructor(t,e){if(!d.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class g{#e;#i;#n;#s;#r;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#h;#c;#u;#d;#g;#_;#f;#p;#m;#x;#v;#y;#E;#T;#A;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#y,sizes:t.#x,keyMap:t.#h,keyList:t.#c,valList:t.#u,next:t.#d,prev:t.#g,get head(){return t.#_},get tail(){return t.#f},free:t.#p,isBackgroundFetch:e=>t.#C(e),backgroundFetch:(e,i,n,s)=>t.#S(e,i,n,s),moveToTail:e=>t.#R(e),indexes:e=>t.#w(e),rindexes:e=>t.#b(e),isStale:e=>t.#I(e)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#r}get memoMethod(){return this.#o}get dispose(){return this.#n}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:u,dispose:_,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:x=0,maxEntrySize:v=0,sizeCalculation:y,fetchMethod:E,memoMethod:T,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:R,ignoreFetchAbort:w}=t;if(0!==e&&!h(e))throw new TypeError("max option must be a nonnegative integer");const b=e?c(e):Array;if(!b)throw new Error("invalid max value: "+e);if(this.#e=e,this.#i=x,this.maxEntrySize=v||this.#i,this.sizeCalculation=y,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==T&&"function"!=typeof T)throw new TypeError("memoMethod must be a function if defined");if(this.#o=T,void 0!==E&&"function"!=typeof E)throw new TypeError("fetchMethod must be a function if specified");if(this.#r=E,this.#T=!!E,this.#h=new Map,this.#c=new Array(e).fill(void 0),this.#u=new Array(e).fill(void 0),this.#d=new b(e),this.#g=new b(e),this.#_=0,this.#f=0,this.#p=d.create(e),this.#a=0,this.#l=0,"function"==typeof _&&(this.#n=_),"function"==typeof f?(this.#s=f,this.#m=[]):(this.#s=void 0,this.#m=void 0),this.#E=!!this.#n,this.#A=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!h(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!h(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=h(n)||0===n?n:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!h(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(0===this.#e&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!s.has(t))(t)&&(s.add(t),o("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,g))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#P(){const t=new u(this.#e),e=new u(this.#e);this.#y=t,this.#v=e,this.#M=(i,s,r=n.now())=>{if(e[i]=0!==s?r:0,t[i]=s,0!==s&&this.ttlAutopurge){const t=setTimeout((()=>{this.#I(i)&&this.#F(this.#c[i],"expire")}),s+1);t.unref&&t.unref()}},this.#D=i=>{e[i]=0!==t[i]?n.now():0},this.#O=(n,r)=>{if(t[r]){const o=t[r],a=e[r];if(!o||!a)return;n.ttl=o,n.start=a,n.now=i||s();const l=n.now-a;n.remainingTTL=o-l}};let i=0;const s=()=>{const t=n.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=n=>{const r=this.#h.get(n);if(void 0===r)return 0;const o=t[r],a=e[r];return o&&a?o-((i||s())-a):1/0},this.#I=n=>{const r=e[n],o=t[n];return!!o&&!!r&&(i||s())-r>o}}#D=()=>{};#O=()=>{};#M=()=>{};#I=()=>!1;#L(){const t=new u(this.#e);this.#l=0,this.#x=t,this.#k=e=>{this.#l-=t[e],t[e]=0},this.#N=(t,e,i,n)=>{if(this.#C(e))return 0;if(!h(i)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(i=n(e,t),!h(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.#G=(e,i,n)=>{if(t[e]=i,this.#i){const i=this.#i-t[e];for(;this.#l>i;)this.#z(!0)}this.#l+=t[e],n&&(n.entrySize=i,n.totalCalculatedSize=this.#l)}}#k=t=>{};#G=(t,e,i)=>{};#N=(t,e,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#f;this.#j(e)&&(!t&&this.#I(e)||(yield e),e!==this.#_);)e=this.#g[e]}*#b({allowStale:t=this.allowStale}={}){if(this.#a)for(let e=this.#_;this.#j(e)&&(!t&&this.#I(e)||(yield e),e!==this.#f);)e=this.#d[e]}#j(t){return void 0!==t&&this.#h.get(this.#c[t])===t}*entries(){for(const t of this.#w())void 0===this.#u[t]||void 0===this.#c[t]||this.#C(this.#u[t])||(yield[this.#c[t],this.#u[t]])}*rentries(){for(const t of this.#b())void 0===this.#u[t]||void 0===this.#c[t]||this.#C(this.#u[t])||(yield[this.#c[t],this.#u[t]])}*keys(){for(const t of this.#w()){const e=this.#c[t];void 0===e||this.#C(this.#u[t])||(yield e)}}*rkeys(){for(const t of this.#b()){const e=this.#c[t];void 0===e||this.#C(this.#u[t])||(yield e)}}*values(){for(const t of this.#w())void 0===this.#u[t]||this.#C(this.#u[t])||(yield this.#u[t])}*rvalues(){for(const t of this.#b())void 0===this.#u[t]||this.#C(this.#u[t])||(yield this.#u[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#w()){const n=this.#u[i],s=this.#C(n)?n.__staleWhileFetching:n;if(void 0!==s&&t(s,this.#c[i],this))return this.get(this.#c[i],e)}}forEach(t,e=this){for(const i of this.#w()){const n=this.#u[i],s=this.#C(n)?n.__staleWhileFetching:n;void 0!==s&&t.call(e,s,this.#c[i],this)}}rforEach(t,e=this){for(const i of this.#b()){const n=this.#u[i],s=this.#C(n)?n.__staleWhileFetching:n;void 0!==s&&t.call(e,s,this.#c[i],this)}}purgeStale(){let t=!1;for(const e of this.#b({allowStale:!0}))this.#I(e)&&(this.#F(this.#c[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const i=this.#u[e],s=this.#C(i)?i.__staleWhileFetching:i;if(void 0===s)return;const r={value:s};if(this.#y&&this.#v){const t=this.#y[e],i=this.#v[e];if(t&&i){const e=t-(n.now()-i);r.ttl=e,r.start=Date.now()}}return this.#x&&(r.size=this.#x[e]),r}dump(){const t=[];for(const e of this.#w({allowStale:!0})){const i=this.#c[e],s=this.#u[e],r=this.#C(s)?s.__staleWhileFetching:s;if(void 0===r||void 0===i)continue;const o={value:r};if(this.#y&&this.#v){o.ttl=this.#y[e];const t=n.now()-this.#v[e];o.start=Math.floor(Date.now()-t)}this.#x&&(o.size=this.#x[e]),t.unshift([i,o])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=n.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:s,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:l=this.noUpdateTTL}=i;const h=this.#N(t,e,i.size||0,o);if(this.maxEntrySize&&h>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#F(t,"set"),this;let c=0===this.#a?void 0:this.#h.get(t);if(void 0===c)c=0===this.#a?this.#f:0!==this.#p.length?this.#p.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#c[c]=t,this.#u[c]=e,this.#h.set(t,c),this.#d[this.#f]=c,this.#g[c]=this.#f,this.#f=c,this.#a++,this.#G(c,h,a),a&&(a.set="add"),l=!1;else{this.#R(c);const i=this.#u[c];if(e!==i){if(this.#T&&this.#C(i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;void 0===e||r||(this.#E&&this.#n?.(e,t,"set"),this.#A&&this.#m?.push([e,t,"set"]))}else r||(this.#E&&this.#n?.(i,t,"set"),this.#A&&this.#m?.push([i,t,"set"]));if(this.#k(c),this.#G(c,h,a),this.#u[c]=e,a){a.set="replace";const t=i&&this.#C(i)?i.__staleWhileFetching:i;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#y||this.#P(),this.#y&&(l||this.#M(c,n,s),a&&this.#O(a,c)),!r&&this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#a;){const t=this.#u[this.#_];if(this.#z(!0),this.#C(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#z(t){const e=this.#_,i=this.#c[e],n=this.#u[e];return this.#T&&this.#C(n)?n.__abortController.abort(new Error("evicted")):(this.#E||this.#A)&&(this.#E&&this.#n?.(n,i,"evict"),this.#A&&this.#m?.push([n,i,"evict"])),this.#k(e),t&&(this.#c[e]=void 0,this.#u[e]=void 0,this.#p.push(e)),1===this.#a?(this.#_=this.#f=0,this.#p.length=0):this.#_=this.#d[e],this.#h.delete(i),this.#a--,e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=e,s=this.#h.get(t);if(void 0!==s){const t=this.#u[s];if(this.#C(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#I(s))return i&&this.#D(s),n&&(n.has="hit",this.#O(n,s)),!0;n&&(n.has="stale",this.#O(n,s))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!i&&this.#I(n))return;const s=this.#u[n];return this.#C(s)?s.__staleWhileFetching:s}#S(t,e,i,n){const s=void 0===e?void 0:this.#u[e];if(this.#C(s))return s;const r=new a,{signal:o}=i;o?.addEventListener("abort",(()=>r.abort(o.reason)),{signal:r.signal});const l={signal:r.signal,options:i,context:n},h=(n,s=!1)=>{const{aborted:o}=r.signal,a=i.ignoreFetchAbort&&void 0!==n;if(i.status&&(o&&!s?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,a&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),o&&!a&&!s)return c(r.signal.reason);const h=u;return this.#u[e]===u&&(void 0===n?h.__staleWhileFetching?this.#u[e]=h.__staleWhileFetching:this.#F(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,n,l.options))),n},c=n=>{const{aborted:s}=r.signal,o=s&&i.allowStaleOnFetchAbort,a=o||i.allowStaleOnFetchRejection,l=a||i.noDeleteOnFetchRejection,h=u;if(this.#u[e]===u&&(l&&void 0!==h.__staleWhileFetching?o||(this.#u[e]=h.__staleWhileFetching):this.#F(t,"fetch")),a)return i.status&&void 0!==h.__staleWhileFetching&&(i.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw n};i.status&&(i.status.fetchDispatched=!0);const u=new Promise(((e,n)=>{const o=this.#r?.(t,s,l);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),n),r.signal.addEventListener("abort",(()=>{i.ignoreFetchAbort&&!i.allowStaleOnFetchAbort||(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>h(t,!0)))}))})).then(h,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),c(t)))),d=Object.assign(u,{__abortController:r,__staleWhileFetching:s,__returned:void 0});return void 0===e?(this.set(t,d,{...l.options,status:void 0}),e=this.#h.get(t)):this.#u[e]=d,d}#C(t){if(!this.#T)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof a}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:_,forceRefresh:f=!1,status:p,signal:m}=e;if(!this.#T)return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:p});const x={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:r,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:p,signal:m};let v=this.#h.get(t);if(void 0===v){p&&(p.fetch="miss");const e=this.#S(t,v,x,_);return e.__returned=e}{const e=this.#u[v];if(this.#C(e)){const t=i&&void 0!==e.__staleWhileFetching;return p&&(p.fetch="inflight",t&&(p.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const s=this.#I(v);if(!f&&!s)return p&&(p.fetch="hit"),this.#R(v),n&&this.#D(v),p&&this.#O(p,v),e;const r=this.#S(t,v,x,_),o=void 0!==r.__staleWhileFetching&&i;return p&&(p.fetch=s?"stale":"refresh",o&&s&&(p.returnedStale=!0)),o?r.__staleWhileFetching:r.__returned=r}}async forceFetch(t,e={}){const i=await this.fetch(t,e);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(t,e={}){const i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:s,...r}=e,o=this.get(t,r);if(!s&&void 0!==o)return o;const a=i(t,o,{options:r,context:n});return this.set(t,a,r),a}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:r}=e,o=this.#h.get(t);if(void 0!==o){const e=this.#u[o],a=this.#C(e);return r&&this.#O(r,o),this.#I(o)?(r&&(r.get="stale"),a?(r&&i&&void 0!==e.__staleWhileFetching&&(r.returnedStale=!0),i?e.__staleWhileFetching:void 0):(s||this.#F(t,"expire"),r&&i&&(r.returnedStale=!0),i?e:void 0)):(r&&(r.get="hit"),a?e.__staleWhileFetching:(this.#R(o),n&&this.#D(o),e))}r&&(r.get="miss")}#B(t,e){this.#g[e]=t,this.#d[t]=e}#R(t){t!==this.#f&&(t===this.#_?this.#_=this.#d[t]:this.#B(this.#g[t],this.#d[t]),this.#B(this.#f,t),this.#f=t)}delete(t){return this.#F(t,"delete")}#F(t,e){let i=!1;if(0!==this.#a){const n=this.#h.get(t);if(void 0!==n)if(i=!0,1===this.#a)this.#U(e);else{this.#k(n);const i=this.#u[n];if(this.#C(i)?i.__abortController.abort(new Error("deleted")):(this.#E||this.#A)&&(this.#E&&this.#n?.(i,t,e),this.#A&&this.#m?.push([i,t,e])),this.#h.delete(t),this.#c[n]=void 0,this.#u[n]=void 0,n===this.#f)this.#f=this.#g[n];else if(n===this.#_)this.#_=this.#d[n];else{const t=this.#g[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#g[e]=this.#g[n]}this.#a--,this.#p.push(n)}}if(this.#A&&this.#m?.length){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}return i}clear(){return this.#U("delete")}#U(t){for(const e of this.#b({allowStale:!0})){const i=this.#u[e];if(this.#C(i))i.__abortController.abort(new Error("deleted"));else{const n=this.#c[e];this.#E&&this.#n?.(i,n,t),this.#A&&this.#m?.push([i,n,t])}}if(this.#h.clear(),this.#u.fill(void 0),this.#c.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#x&&this.#x.fill(0),this.#_=0,this.#f=0,this.#p.length=0,this.#l=0,this.#a=0,this.#A&&this.#m){const t=this.#m;let e;for(;e=t?.shift();)this.#s?.(...e)}}}},71:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(4120),s=i(2135),r=i(1685);const o="length";class a extends r.Ay{constructor(t,e,i){super(t),this.element=e,this.index=i}}class l extends n.A{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let t=0,e=this.array_.length;t0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new a(s.A.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new a(s.A.REMOVE,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new a(s.A.REMOVE,i,t)),this.dispatchEvent(new a(s.A.ADD,e,t))}updateLength_(){this.set(o,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i{i.d(e,{A:()=>n});const n={ADD:"add",REMOVE:"remove"}},7607:(t,e,i)=>{i.d(e,{$r:()=>c,Ay:()=>g,bL:()=>a,xo:()=>o});var n=i(8143),s=i(1078),r=i(8711);function o(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function a(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const l=new Error("disposed");let h=null;function c(t){h||(h=(0,r.Y)(t.width,t.height,void 0,{willReadFrequently:!0}));const e=h.canvas,i=t.width;e.width!==i&&(e.width=i);const n=t.height;return e.height!==n&&(e.height=n),h.clearRect(0,0,i,n),h.drawImage(t,0,0),h.getImageData(0,0,i,n).data}const u=[256,256];class d extends n.A{constructor(t){const e=s.A.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=o(this.data_);return t?[t.width,t.height]:u}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==s.A.IDLE&&this.state!==s.A.ERROR)return;this.state=s.A.LOADING,this.changed();const t=this;this.loader_().then((function(e){t.data_=e,t.state=s.A.LOADED,t.changed()})).catch((function(e){t.error_=e,t.state=s.A.ERROR,t.changed()}))}disposeInternal(){this.controller_&&(this.controller_.abort(l),this.controller_=null),super.disposeInternal()}}const g=d},25:(t,e,i)=>{i.d(e,{A:()=>n});const n=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}},6717:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(4120),s=i(6837),r=i(588),o=i(9438);class a extends n.A{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new a(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&((0,o.JH)(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=(0,o.KT)(t,s.A.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;let e;return Array.isArray(t)?e=t:((0,r.v)("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}const l=a},5213:(t,e,i)=>{i.d(e,{A:()=>y});var n=i(1685),s=i(4120),r=i(1064),o=i(3407),a=i(1597);const l="accuracy",h="accuracyGeometry",c="altitude",u="altitudeAccuracy",d="heading",g="position",_="projection",f="speed",p="tracking",m="trackingOptions";class x extends n.Ay{constructor(t){super("error"),this.code=t.code,this.message=t.message}}class v extends s.A{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.position_=null,this.transform_=o.R6,this.watchId_=void 0,this.addChangeListener(_,this.handleProjectionChanged_),this.addChangeListener(p,this.handleTrackingChanged_),void 0!==t.projection&&this.setProjection(t.projection),void 0!==t.trackingOptions&&this.setTrackingOptions(t.trackingOptions),this.setTracking(void 0!==t.tracking&&t.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const t=this.getProjection();t&&(this.transform_=(0,o.FO)((0,o.Jt)("EPSG:4326"),t),this.position_&&this.set(g,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(t){const e=t.coords;this.set(l,e.accuracy),this.set(c,null===e.altitude?void 0:e.altitude),this.set(u,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(d,null===e.heading?void 0:(0,a.eh)(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];const i=this.transform_(this.position_);this.set(g,i.slice()),this.set(f,null===e.speed?void 0:e.speed);const n=(0,r.kj)(this.position_,e.accuracy);n.applyTransform(this.transform_),this.set(h,n),this.changed()}positionError_(t){this.dispatchEvent(new x(t))}getAccuracy(){return this.get(l)}getAccuracyGeometry(){return this.get(h)||null}getAltitude(){return this.get(c)}getAltitudeAccuracy(){return this.get(u)}getHeading(){return this.get(d)}getPosition(){return this.get(g)}getProjection(){return this.get(_)}getSpeed(){return this.get(f)}getTracking(){return this.get(p)}getTrackingOptions(){return this.get(m)}setProjection(t){this.set(_,(0,o.Jt)(t))}setTracking(t){this.set(p,t)}setTrackingOptions(t){this.set(m,t)}}const y=v},3938:(t,e,i)=>{i.d(e,{Ay:()=>g,D4:()=>d,RA:()=>u,f6:()=>c});var n=i(9332),s=i(6837),r=i(6141),o=i(7771),a=i(9438),l=i(4238);class h extends n.A{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state="function"==typeof n?r.A.IDLE:n,this.image_=null,this.loader="function"==typeof n?n:null}changed(){this.dispatchEvent(s.A.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==r.A.IDLE&&this.loader){this.state=r.A.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;(0,l.hq)((()=>this.loader(this.getExtent(),e,this.getPixelRatio()))).then((t=>{"image"in t&&(this.image_=t.image),"extent"in t&&(this.extent=t.extent),"resolution"in t&&(this.resolution=t.resolution),"pixelRatio"in t&&(this.pixelRatio_=t.pixelRatio),(t instanceof HTMLImageElement||t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement)&&(this.image_=t),this.state=r.A.LOADED})).catch((t=>{this.state=r.A.ERROR,console.error(t)})).finally((()=>this.changed()))}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function c(t,e,i){const n=t;let r=!0,l=!1,h=!1;const c=[(0,a.Jz)(n,s.A.LOAD,(function(){h=!0,l||e()}))];return n.src&&o.DT?(l=!0,n.decode().then((function(){r&&e()})).catch((function(t){r&&(h?e():i())}))):c.push((0,a.Jz)(n,s.A.ERROR,i)),function(){r=!1,c.forEach(a.JH)}}function u(t,e){return e&&(t.src=e),t.src&&o.DT?new Promise(((e,i)=>t.decode().then((()=>e(t))).catch((n=>t.complete&&t.width?e(t):i(n))))):function(t){return new Promise(((e,i)=>{function n(){r(),e(t)}function s(){r(),i(new Error("Image load error"))}function r(){t.removeEventListener("load",n),t.removeEventListener("error",s)}t.addEventListener("load",n),t.addEventListener("error",s)}))}(t)}function d(t,e){return e&&(t.src=e),t.src&&o.DT&&o.XM?t.decode().then((()=>createImageBitmap(t))).catch((e=>{if(t.complete&&t.width)return t;throw e})):u(t)}const g=h},6141:(t,e,i)=>{i.d(e,{A:()=>n});const n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},190:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(8143),s=i(1078),r=i(8711),o=i(3938);class a extends n.A{constructor(t,e,i,n,s,r){super(t,e,r),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=s.A.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=s.A.ERROR,this.unlistenImage_(),this.image_=function(){const t=(0,r.Y)(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=s.A.LOADED:this.state=s.A.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==s.A.ERROR&&(this.state=s.A.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==s.A.IDLE&&(this.state=s.A.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=(0,o.f6)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}const l=a},2961:(t,e,i)=>{i.d(e,{A:()=>mt});var n=i(4120),s=i(71),r=i(2135),o=i(2284),a=i(25),l=i(4238),h=i(4087),c=i(9703),u=i(915),d=i(2241),g=i(764),_=i(6933);class f extends a.A{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){(0,h.b0)()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;(0,c.Zz)(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),(0,c.T9)(n,i)}forEachFeatureAtCoordinate(t,e,i,n,s,r,o,a){let l;const h=e.viewState;function c(t,e,i,n){return s.call(r,e,t?i:null,n)}const d=h.projection,f=(0,_.Li)(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&n){const t=d.getExtent(),e=(0,u.RG)(t);p.push([-e,0],[e,0])}const m=e.layerStatesArray,x=m.length,v=[],y=[];for(let n=0;n=0;--s){const r=m[s],u=r.layer;if(u.hasRenderer()&&(0,g.l)(r,h)&&o.call(a,u)){const s=u.getRenderer(),o=u.getSource();if(s&&o){const a=o.getWrapX()?f:t,h=c.bind(null,r.managed);y[0]=a[0]+p[n][0],y[1]=a[1]+p[n][1],l=s.forEachFeatureAtCoordinate(y,e,i,h,v)}if(l)return l}}if(0===v.length)return;const E=1/v.length;return v.forEach(((t,e)=>t.distanceSq+=e*E)),v.sort(((t,e)=>t.distanceSq-e.distanceSq)),v.some((t=>l=t.callback(t.feature,t.layer,t.geometry))),l}hasFeatureAtCoordinate(t,e,i,n,s,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,l.rT,this,s,r)}getMap(){return this.map_}renderFrame(t){(0,h.b0)()}scheduleExpireIconCache(t){d.ue.canExpireCache()&&t.postRenderFunctions.push(p)}}function p(t,e){d.ue.expire()}const m=f;var x=i(8450),v=i(9960),y=i(3984),E=i(5176),T=i(8774),A=i(9438),C=i(8711);const S=class extends m{constructor(t){super(t),this.fontChangeListenerKey_=(0,A.KT)(T.yY,x.A.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=E.XI+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new v.A(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){(0,A.JH)(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent(y.A.PRECOMPOSE,t);const e=t.layerStatesArray.sort(((t,e)=>t.zIndex-e.zIndex));e.some((t=>t.layer instanceof o.A&&t.layer.getDeclutter()))&&(t.declutter={});const i=t.viewState;this.children_.length=0;const n=[];let s=null;for(let r=0,o=e.length;r=0;--i){const n=e[i],s=n.layer;s.getDeclutter()&&s.renderDeclutter(t,n)}e.forEach((e=>e.layer.renderDeferred(t)))}}};var R=i(6837),w=i(8620),b=i(1685),I=i(588),L=i(3530);class P extends b.Ay{constructor(t,e){super(t),this.layer=e}}const M="layers";class F extends w.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(M,this.handleLayersChanged_),i?Array.isArray(i)?i=new s.A(i.slice(),{unique:!0}):(0,I.v)("function"==typeof i.getArray,"Expected `layers` to be an array or a `Collection`"):i=new s.A(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(A.JH),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push((0,A.KT)(t,r.A.ADD,this.handleLayersAdd_,this),(0,A.KT)(t,r.A.REMOVE,this.handleLayersRemove_,this));for(const t in this.listenerKeys_)this.listenerKeys_[t].forEach(A.JH);(0,L.I)(this.listenerKeys_);const e=t.getArray();for(let t=0,i=e.length;t{this.clickTimeoutId_=void 0;const e=new O.A(k.A.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==k.A.POINTERUP||e.type==k.A.POINTERCANCEL){delete this.trackedTouches_[i];for(const t in this.trackedTouches_)if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}else e.type!=k.A.POINTERDOWN&&e.type!=k.A.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new O.A(k.A.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(A.JH),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new O.A(k.A.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push((0,A.KT)(t,k.A.POINTERMOVE,this.handlePointerMove_,this),(0,A.KT)(t,k.A.POINTERUP,this.handlePointerUp_,this),(0,A.KT)(this.element_,k.A.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push((0,A.KT)(this.element_.getRootNode(),k.A.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new O.A(k.A.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new O.A(k.A.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&((0,A.JH)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(R.A.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&((0,A.JH)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(A.JH),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const B=j;var U=i(5801),X=i(2585),W=i(3116);const Y=1/0,Z=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,(0,L.I)(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){(0,I.v)(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Y&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,s=e[t],r=i[t],o=t;for(;t>1;){const s=this.getLeftChildIndex_(t),r=this.getRightChildIndex_(t),o=rt;){const t=this.getParentIndex_(e);if(!(n[t]>r))break;i[e]=i[t],n[e]=n[t],e=t}i[e]=s,n[e]=r}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const s=e.length;let r,o,a;for(o=0;o0;){const t=this.dequeue()[0],e=t.getKey();t.getState()!==V.A.IDLE||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}};var K=i(3568),q=i(2703),$=i(7456),J=i(2898),Q=i(9186),tt=i(6068),et=i(4473),it=i(4051),nt=i(4423),st=i(9888),rt=i(6856);const ot=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const s=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,s),this.initialVelocity_=Math.sqrt(s*s+r*r)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}};var at=i(8751),lt=i(3711),ht=i(5243),ct=i(6514),ut=i(3407),dt=i(4401),gt=i(4422);function _t(t){t instanceof g.A?t.setMapInternal(null):t instanceof D&&t.getLayers().forEach(_t)}function ft(t,e){if(t instanceof g.A)t.setMapInternal(e);else if(t instanceof D){const i=t.getLayers().getArray();for(let t=0,n=i.length;tthis.updateSize())),this.controls=e.controls||function(t){t=t||{};const e=new s.A;return(void 0===t.zoom||t.zoom)&&e.push(new Q.A(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&e.push(new J.A(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&e.push(new $.A(t.attributionOptions)),e}(),this.interactions=e.interactions||function(t){t=t||{};const e=new s.A,i=new ot(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new it.A),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new tt.A({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&e.push(new et.A({onFocusOnly:t.onFocusOnly,kinetic:i})),(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new lt.A),(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new ht.A({duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(e.push(new st.A),e.push(new rt.A({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new at.A({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new nt.A({duration:t.zoomDuration})),e}({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new H(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(W.A.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(W.A.VIEW,this.handleViewChanged_),this.addChangeListener(W.A.SIZE,this.handleSizeChanged_),this.addChangeListener(W.A.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;!t.view||t.view instanceof K.Ay||t.view.then((function(t){i.setView(new K.Ay(t))})),this.controls.addEventListener(r.A.ADD,(t=>{t.element.setMap(this)})),this.controls.addEventListener(r.A.REMOVE,(t=>{t.element.setMap(null)})),this.interactions.addEventListener(r.A.ADD,(t=>{t.element.setMap(this)})),this.interactions.addEventListener(r.A.REMOVE,(t=>{t.element.setMap(null)})),this.overlays_.addEventListener(r.A.ADD,(t=>{this.addOverlayInternal_(t.element)})),this.overlays_.addEventListener(r.A.REMOVE,(t=>{const e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)})),this.controls.forEach((t=>{t.setMap(this)})),this.interactions.forEach((t=>{t.setMap(this)})),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){ft(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t),s=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:l.rT,o=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,s,o,e,null,r,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i}getAllLayers(){const t=[];return function e(i){i.forEach((function(i){i instanceof D?e(i.getLayers()):t.push(i)}))}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:l.rT,s=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,r,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const e=this.viewport_.getBoundingClientRect(),i=this.getSize(),n=e.width/i[0],s=e.height/i[1],r="changedTouches"in t?t.changedTouches[0]:t;return[(r.clientX-e.left)/n,(r.clientY-e.top)/s]}getTarget(){return this.get(W.A.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return(0,ut.te)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?(0,c.Bb)(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(W.A.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof s.A)return void e.setLayers(t);const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;i--){const n=e[i];if(n.getMap()===this&&n.getActive()&&this.getTargetElement()&&(!n.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,n=i;if(t){const e=t.viewHints;if(e[q.A.ANIMATING]||e[q.A.INTERACTING]){const e=Date.now()-t.time>8;i=e?0:8,n=e?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()}),0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new P("removelayer",e)),this.set(W.A.LAYERGROUP,t)}setSize(t){this.set(W.A.SIZE,t)}setTarget(t){this.set(W.A.TARGET,t)}setView(t){if(!t||t instanceof K.Ay)return void this.set(W.A.VIEW,t);this.set(W.A.VIEW,new K.Ay);const e=this;t.then((function(t){e.setView(new K.Ay(t))}))}updateSize(){const t=this.getTargetElement();let e;if(t){const i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),s=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(s)||(e=[Math.max(0,n),Math.max(0,s)],!(0,dt.Ie)(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&(0,gt.R8)("No map visible because the map container's width or height are 0."))}const i=this.getSize();!e||i&&(0,ct.aI)(e,i)||(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}const mt=pt},277:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(5801);class s extends n.A{constructor(t,e,i,n,s,r){super(t,e,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=r}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const r=s},3445:(t,e,i)=>{i.d(e,{A:()=>s});var n=i(6837);const s={SINGLECLICK:"singleclick",CLICK:n.A.CLICK,DBLCLICK:n.A.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},5801:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(1685);class s extends n.Ay{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}}const r=s},2585:(t,e,i)=>{i.d(e,{A:()=>n});const n={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"}},3116:(t,e,i)=>{i.d(e,{A:()=>n});const n={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"}},4120:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(1685),s=i(8450),r=i(1854),o=i(4087),a=i(3530);class l extends n.Ay{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class h extends r.A{constructor(t){super(),this.on,this.once,this.un,(0,o.v6)(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new l(i,t,e)),i=s.A.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new l(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],(0,a.p)(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const c=h},8450:(t,e,i)=>{i.d(e,{A:()=>n});const n={PROPERTYCHANGE:"propertychange"}},1854:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(9332),s=i(6837),r=i(9438);class o extends n.A{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(s.A.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;s{i.d(e,{A:()=>f});var n=i(4120),s=i(2585),r=i(5176),o=i(915),a=i(9438),l=i(8711);const h="element",c="map",u="offset",d="position",g="positioning";class _ extends n.A{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container "+r.Q5,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(h,this.handleElementChanged),this.addChangeListener(c,this.handleMapChanged),this.addChangeListener(u,this.handleOffsetChanged),this.addChangeListener(d,this.handlePositionChanged),this.addChangeListener(g,this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get(h)}getId(){return this.id}getMap(){return this.get(c)||null}getOffset(){return this.get(u)}getPosition(){return this.get(d)}getPositioning(){return this.get(g)}handleElementChanged(){(0,l.gS)(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),(0,a.JH)(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=(0,a.KT)(t,s.A.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(h,t)}setMap(t){this.set(c,t)}setOffset(t){this.set(u,t)}setPosition(t){this.set(d,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(d))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),s=this.getRect(n,[(0,l.Gq)(n),(0,l.DK)(n)]),r=void 0===(t=t||{}).margin?20:t.margin;if(!(0,o.ms)(i,s)){const n=s[0]-i[0],o=i[2]-s[2],a=s[1]-i[1],l=i[3]-s[3],h=[0,0];if(n<0?h[0]=n-r:o<0&&(h[0]=Math.abs(o)+r),a<0?h[1]=a-r:l<0&&(h[1]=Math.abs(l)+r),0!==h[0]||0!==h[1]){const i=e.getView().getCenterInternal(),n=e.getPixelFromCoordinateInternal(i);if(!n)return;const s=[n[0]+h[0],n[1]+h[1]],r=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(s),duration:r.duration,easing:r.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,s=i.top+window.pageYOffset;return[n,s,n+e[0],s+e[1]]}setPositioning(t){this.set(g,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);const i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),s=this.getPositioning();this.setVisible(!0);let r="0%",o="0%";"bottom-right"==s||"center-right"==s||"top-right"==s?r="-100%":"bottom-center"!=s&&"center-center"!=s&&"top-center"!=s||(r="-50%"),"bottom-left"==s||"bottom-center"==s||"bottom-right"==s?o="-100%":"center-left"!=s&&"center-center"!=s&&"center-right"!=s||(o="-50%");const a=`translate(${r}, ${o}) translate(${Math.round(t[0]+n[0])+"px"}, ${Math.round(t[1]+n[1])+"px"})`;this.rendered.transform_!=a&&(this.rendered.transform_=a,i.transform=a)}getOptions(){return this.options}}const f=_},8143:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(9332),s=i(6837),r=i(1078),o=i(4087),a=i(3474);class l extends n.A{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(s.A.CHANGE)}release(){this.state===r.A.ERROR&&this.setState(r.A.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==r.A.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){(0,o.b0)()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;const n=e-i+1e3/60;return n>=this.transition_?1:(0,a.a6)(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}const h=l},61:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(4969),s=i(186);class r extends n.A{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(0===this.getCount())return;const t=this.peekFirstKey(),e=(0,s.K)(t)[0];this.forEach((t=>{t.tileCoord[0]!==e&&(this.remove((0,s.i7)(t.tileCoord)),t.release())}))}}const o=r},1110:(t,e,i)=>{i.d(e,{A:()=>r,N:()=>s});class n{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function s(t,e,i,s,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=s,r):new n(t,e,i,s)}const r=n},1078:(t,e,i)=>{i.d(e,{A:()=>n});const n={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},3568:(t,e,i)=>{i.d(e,{Ay:()=>R});var n=i(4120),s=i(2703),r=i(9015),o=i(9496),a=i(3407),l=i(4238),h=i(6933),c=i(588),u=i(1597);function d(t,e,i){return function(n,s,r,o,a){if(!n)return;if(!s&&!e)return n;const l=e?0:r[0]*s,h=e?0:r[1]*s,c=a?a[0]:0,d=a?a[1]:0;let g=t[0]+l/2+c,_=t[2]-l/2+c,f=t[1]+h/2+d,p=t[3]-h/2+d;g>_&&(g=(_+g)/2,_=g),f>p&&(f=(p+f)/2,p=f);let m=(0,u.qE)(n[0],g,_),x=(0,u.qE)(n[1],f,p);if(o&&i&&s){const t=30*s;m+=-t*Math.log(1+Math.max(0,g-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-_)/t),x+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-p)/t)}return[m,x]}}function g(t){return t}var _=i(915),f=i(6514);function p(t,e,i,n){const s=(0,_.RG)(e)/i[0],r=(0,_.Oq)(e)/i[1];return n?Math.min(t,Math.max(s,r)):Math.min(t,Math.min(s,r))}function m(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),(0,u.qE)(n,i/2,2*e)}function x(t,e,i,n,s){return i=void 0===i||i,function(r,o,a,l){if(void 0!==r){const o=n?p(t,n,a,s):t;return i&&l?m(r,o,e):(0,u.qE)(r,e,o)}}}var v=i(4498),y=i(3474),E=i(1064);class T extends n.A{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=(0,a.Av)(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&(0,a.RJ)(),t.center&&(t.center=(0,a.Ad)(t.center,this.projection_)),t.extent&&(t.extent=(0,a.SD)(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in r.A)delete e[t];this.setProperties(e,!0);const i=function(t){let e,i,n;let s=void 0!==t.minZoom?t.minZoom:0,r=void 0!==t.maxZoom?t.maxZoom:28;const l=void 0!==t.zoomFactor?t.zoomFactor:2,h=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,g=(0,a.Av)(t.projection,"EPSG:3857"),v=g.getExtent();let y=t.constrainOnlyCenter,E=t.extent;if(h||E||!g.isGlobal()||(y=!1,E=v),void 0!==t.resolutions){const o=t.resolutions;i=o[s],n=void 0!==o[r]?o[r]:o[o.length-1],e=t.constrainResolution?function(t,e,i,n){return e=void 0===e||e,function(s,r,o,a){if(void 0!==s){const l=t[0],h=t[t.length-1],c=i?p(l,i,o,n):l;if(a)return e?m(s,c,h):(0,u.qE)(s,h,c);const d=Math.min(c,s),g=Math.floor((0,f.FT)(t,d,r));return t[g]>c&&g1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n0}getInteracting(){return this.hints_[s.A.INTERACTING]>0}cancelAnimations(){let t;this.setHint(s.A.ANIMATING,-this.hints_[s.A.ANIMATING]);for(let e=0,i=this.animations_.length;e=0;--i){const n=this.animations_[i];let r=!0;for(let i=0,s=n.length;i0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;const l=s.easing(a);if(s.sourceCenter){const t=s.sourceCenter[0],e=s.sourceCenter[1],i=s.targetCenter[0],n=s.targetCenter[1];this.nextCenter_=s.targetCenter;const r=t+l*(i-t),o=e+l*(n-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){const t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){const e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){const t=1===l?(0,u.xP)(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){const e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[i]=null,this.setHint(s.A.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=n[0].callback;t&&A(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return void 0!==n&&(i=[n[0]-e[0],n[1]-e[1]],(0,h.e$)(i,t-this.getRotation()),(0,h.WQ)(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),s=this.getResolution();return void 0!==n&&void 0!==s&&(i=[e[0]-t*(e[0]-n[0])/s,e[1]-t*(e[1]-n[1])/s]),i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t?(0,a.te)(t,this.getProjection()):t}getCenterInternal(){return this.get(r.A.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return(0,a.JR)(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();(0,c.v)(e,"The view center is not defined");const i=this.getResolution();(0,c.v)(void 0!==i,"The view resolution is not defined");const n=this.getRotation();return(0,c.v)(void 0!==n,"The view rotation is not defined"),(0,_.Bg)(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(r.A.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal((0,a.SD)(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=(0,_.RG)(t)/e[0],n=(0,_.Oq)(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(i){return e/Math.pow(t,i*n)}}getRotation(){return this.get(r.A.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const s=this.padding_;if(s){const t=this.getViewportSizeMinusPadding_();n=S(n,this.getViewportSize_(),[t[0]/2+s[3],t[1]/2+s[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){const s=(0,f.FT)(this.resolutions_,t,1);n=s,e=this.resolutions_[s],i=s==this.resolutions_.length-1?2:e/this.resolutions_[s+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=(0,u.qE)(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,(0,u.qE)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if((0,c.v)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){(0,c.v)(!(0,_.Im)(t),"Cannot fit empty extent provided as `geometry`");const e=(0,a.SD)(t,this.getProjection());i=(0,E.VY)(e)}else if("Circle"===t.getType()){const e=(0,a.SD)(t.getExtent(),this.getProjection());i=(0,E.VY)(e),i.rotate(this.getRotation(),(0,_.q1)(e))}else{const e=(0,a.Tf)();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),s=t.getFlatCoordinates(),r=t.getStride();let o=1/0,a=1/0,l=-1/0,h=-1/0;for(let t=0,e=s.length;t{i.d(e,{A:()=>n});const n={ANIMATING:0,INTERACTING:1}},9015:(t,e,i)=>{i.d(e,{A:()=>n});const n={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"}},6514:(t,e,i)=>{function n(t,e,i){let n,r;i=i||s;let o=0,a=t.length,l=!1;for(;o>1),r=+i(t[n],e),r<0?o=n+1:(a=n,l=!r);return l?o:~o}function s(t,e){return t>e?1:te?-1:0}function o(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let s=1;s0?s-1:s}return n-1}if(i>0){for(let i=1;i0||i&&0===r)}))}i.d(e,{El:()=>n,FT:()=>o,V_:()=>s,WC:()=>c,X$:()=>l,aI:()=>h,gI:()=>a,rG:()=>r})},588:(t,e,i)=>{function n(t,e){if(!t)throw new Error(e)}i.d(e,{v:()=>n})},3730:(t,e,i)=>{i.d(e,{_j:()=>T,oJ:()=>_,sH:()=>E,cD:()=>y,S8:()=>A,eE:()=>v,dI:()=>C,fu:()=>x});const n={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var s={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};s.max=s.whitepoint[2].D65,s.rgb=function(t,e){e=e||s.whitepoint[2].E;var i,n,r,o=t[0]/e[0],a=t[1]/e[1],l=t[2]/e[2];return n=-.96924363628087*o+1.87596750150772*a+.041555057407175*l,r=.055630079696993*o+-.20397695888897*a+1.056971514242878*l,i=(i=3.240969941904521*o+-1.537383177570093*a+-.498610760293*l)>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*=12.92,[255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},n.xyz=function(t,e){var i=t[0]/255,n=t[1]/255,r=t[2]/255,o=.21263900587151*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.71516867876775*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.072192315360733*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92),a=.019330818715591*i+.11919477979462*n+.95053215224966*r;return[(.41239079926595*i+.35758433938387*n+.18048078840183*r)*(e=e||s.whitepoint[2].E)[0],o*e[1],a*e[2]]};const r=s,o={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,i){var n,s,o,a,l,h,c,u,d;return o=t[0],a=t[1],l=t[2],0===o?[0,0,0]:(e=e||"D65",i=i||2,n=a/(13*o)+4*(c=r.whitepoint[i][e][0])/(c+15*(u=r.whitepoint[i][e][1])+3*(d=r.whitepoint[i][e][2]))||0,s=l/(13*o)+9*u/(c+15*u+3*d)||0,[9*(h=o>8?u*Math.pow((o+16)/116,3):u*o*.0011070564598794539)*n/(4*s)||0,h,h*(12-3*n-20*s)/(4*s)||0])}};r.luv=function(t,e,i){var n,s,o,a,l,h,c,u,d,g,_;e=e||"D65",i=i||2,g=4*(c=r.whitepoint[i][e][0])/(c+15*(u=r.whitepoint[i][e][1])+3*(d=r.whitepoint[i][e][2])),_=9*u/(c+15*u+3*d),n=4*(a=t[0])/(a+15*(l=t[1])+3*(h=t[2]))||0,s=9*l/(a+15*l+3*h)||0;var f=l/u;return[o=f<=.008856451679035631?903.2962962962961*f:116*Math.pow(f,1/3)-16,13*o*(n-g),13*o*(s-_)]};var a={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},xyz:function(t){return o.xyz(a.luv(t))}};const l=a;o.lchuv=function(t){var e=t[0],i=t[1],n=t[2],s=Math.sqrt(i*i+n*n),r=360*Math.atan2(n,i)/2/Math.PI;return r<0&&(r+=360),[e,s,r]},r.lchuv=function(t){return o.lchuv(r.luv(t))};const h={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c=function(t){var e,i,n=[],s=1;if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),h[t])n=h[t].slice(),i="rgb";else if("transparent"===t)s=0,i="rgb",n=[0,0,0];else if("#"===t[0]){var r=t.slice(1),o=r.length;s=1,o<=4?(n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],4===o&&(s=parseInt(r[3]+r[3],16)/255)):(n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],8===o&&(s=parseInt(r[6]+r[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var a=e[1],l="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=n.shift()),s=(n=n.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]?100*t:"l"!==i[0]||e?"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t:100*t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==u[t])return u[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>l?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:n,alpha:s}};var u={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};const d={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,i,n,s,r,o=t[0]/360,a=t[1]/100,l=t[2]/100,h=0;if(0===a)return[r=255*l,r,r];for(e=2*l-(i=l<.5?l*(1+a):l+a-l*a),s=[0,0,0];h<3;)(n=o+1/3*-(h-1))<0?n++:n>1&&n--,r=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,s[h++]=255*r;return s}};n.hsl=function(t){var e,i,n=t[0]/255,s=t[1]/255,r=t[2]/255,o=Math.min(n,s,r),a=Math.max(n,s,r),l=a-o;return a===o?e=0:n===a?e=(s-r)/l:s===a?e=2+(r-n)/l:r===a&&(e=4+(n-s)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+a)/2,[e,100*(a===o?0:i<=.5?l/(a+o):l/(2-a-o)),100*i]};var g=i(1597);function _(t){return"string"==typeof t?t:C(t)}const f=1024,p={};let m=0;function x(t){if(4===t.length)return t;const e=t.slice();return e[3]=1,e}function v(t){const e=r.lchuv(n.xyz(t));return e[3]=t[3],e}function y(t){const e=r.rgb(l.xyz(t));return e[3]=t[3],e}function E(t){if(p.hasOwnProperty(t))return p[t];if(m>=f){let t=0;for(const e in p)3&t++||(delete p[e],--m)}const e=function(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var i=c(t);if(!i.space)return[];const s="h"===i.space[0]?d.min:n.min,r="h"===i.space[0]?d.max:n.max;return(e=Array(3))[0]=Math.min(Math.max(i.values[0],s[0]),r[0]),e[1]=Math.min(Math.max(i.values[1],s[1]),r[1]),e[2]=Math.min(Math.max(i.values[2],s[2]),r[2]),"h"===i.space[0]&&(e=d.rgb(e)),e.push(Math.min(Math.max(i.alpha,0),1)),e}(t);if(4!==e.length)throw new Error('failed to parse "'+t+'" as color');for(const i of e)if(isNaN(i))throw new Error('failed to parse "'+t+'" as color');return A(e),p[t]=e,++m,e}function T(t){return Array.isArray(t)?t:E(t)}function A(t){return t[0]=(0,g.qE)(t[0]+.5|0,0,255),t[1]=(0,g.qE)(t[1]+.5|0,0,255),t[2]=(0,g.qE)(t[2]+.5|0,0,255),t[3]=(0,g.qE)(t[3],0,1),t}function C(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}},7295:(t,e,i)=>{i.d(e,{F:()=>l});var n=i(6141),s=i(8711),r=i(7907),o=i(2241),a=i(3730);function l(t){return t?Array.isArray(t)?(0,a.dI)(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return o.ue.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,i=o.ue.getPattern(e,void 0,t.color);if(i)return i;const a=o.ue.get(t.src,"anonymous",null);if(a.getImageState()!==n.A.LOADED)return null;const l=(0,s.Y)(t.size[0],t.size[1]);return l.drawImage(a.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),(0,r.J)(l.canvas,e,void 0,n.A.LOADED,t.color,!0),o.ue.getPattern(e,void 0,t.color)}(t):t:null}},4422:(t,e,i)=>{i.d(e,{R8:()=>r,z3:()=>o});const n={info:1,warn:2,error:3,none:4};let s=n.info;function r(...t){s>n.warn||console.warn(...t)}function o(...t){s>n.error||console.error(...t)}},7456:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(972),s=i(6837),r=i(5176),o=i(6514),a=i(8711),l=i(4238);class h extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1);const e=void 0!==t.className?t.className:"ol-attribution",i=void 0!==t.tipLabel?t.tipLabel:"Attributions",n=void 0!==t.expandClassName?t.expandClassName:e+"-expand",o=void 0!==t.collapseLabel?t.collapseLabel:"›",a=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof o?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const l=void 0!==t.label?t.label:"i";"string"==typeof l?(this.label_=document.createElement("span"),this.label_.textContent=l,this.label_.className=n):this.label_=l;const h=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(h),this.toggleButton_.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const c=e+" "+r.XI+" "+r.$N+(this.collapsed_&&this.collapsible_?" "+r.nT:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=c,u.appendChild(this.toggleButton_),u.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),i=Array.from(new Set(e.flatMap((e=>e.getAttributions(t)))));if(!this.overrideCollapsible_){const t=!e.some((t=>!1===t.getSource()?.getAttributionsCollapsible()));this.setCollapsible(t)}return i}async updateElement_(t){if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=await Promise.all(this.collectSourceAttributions_(t).map((t=>(0,l.hq)((()=>t))))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!(0,o.aI)(e,this.renderedAttributions_)){(0,a.gS)(this.ulElement_);for(let t=0,i=e.length;t{i.d(e,{A:()=>l});var n=i(4120),s=i(2585),r=i(4238),o=i(9438);class a extends n.A{constructor(t){super();const e=t.element;!e||t.target||e.style.pointerEvents||(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let t=0,e=this.listenerKeys.length;t{i.d(e,{A:()=>_});var n=i(972),s=i(6837),r=i(3116),o=i(5176),a=i(9438),l=i(8711);const h=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"];class c extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=void 0!==t.keys&&t.keys,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=void 0!==t.className?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=void 0!==t.activeClassName?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=void 0!==t.inactiveClassName?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=void 0!==t.label?t.label:"⤢";this.labelNode_="string"==typeof e?document.createTextNode(e):e;const i=void 0!==t.labelActive?t.labelActive:"×";this.labelActiveNode_="string"==typeof i?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${o.XI} ${o.$N}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(u(e))if(d(e))!function(t){t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}(e);else{let i;i=this.source_?"string"==typeof this.source_?e.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():g(t)}(i):g(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=d(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?((0,l.fo)(this.labelActiveNode_,this.labelNode_),this.dispatchEvent("enterfullscreen")):((0,l.fo)(this.labelNode_,this.labelActiveNode_),this.dispatchEvent("leavefullscreen")),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(r.A.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(r.A.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,i=t.length;e{i.d(e,{A:()=>u});var n=i(972),s=i(613),r=i(3407),o=i(9438),a=i(6933);const l="projection",h="coordinateFormat";class c extends n.A{constructor(t){t=t||{};const e=document.createElement("div");e.className=void 0!==t.className?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(l,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=void 0!==t.placeholder,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=!1!==t.wrapX}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(h)}getProjection(){return this.get(l)}handleMouseMove(t){const e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){const e=t.getViewport();this.listenerKeys.push((0,o.KT)(e,s.A.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push((0,o.KT)(e,s.A.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(h,t)}setProjection(t){this.set(l,(0,r.Jt)(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){const t=this.getProjection();this.transform_=t?(0,r.FO)(this.mapProjection_,t):r.R6}const i=this.getMap().getCoordinateFromPixelInternal(t);if(i){const t=(0,r.Tf)();if(t&&(this.transform_=(0,r.FO)(this.mapProjection_,t)),this.transform_(i,i),this.wrapX_){const e=t||this.getProjection()||this.mapProjection_;(0,a.Li)(i,e)}const n=this.getCoordinateFormat();e=n?n(i):i.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){const e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}}const u=c},6950:(t,e,i)=>{i.d(e,{A:()=>v});var n=i(71),s=i(972),r=i(6837),o=i(2961),a=i(2585),l=i(3116),h=i(8450),c=i(1795),u=i(3568),d=i(9015),g=i(5176),_=i(915),f=i(9438),p=i(1064),m=i(8711);class x extends s.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=void 0===t.collapsed||t.collapsed,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=void 0!==t.rotateWithView&&t.rotateWithView,this.viewExtent_=void 0;const e=void 0!==t.className?t.className:"ol-overviewmap",i=void 0!==t.tipLabel?t.tipLabel:"Overview map",s=void 0!==t.collapseLabel?t.collapseLabel:"‹";"string"==typeof s?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const a=void 0!==t.label?t.label:"›";"string"==typeof a?(this.label_=document.createElement("span"),this.label_.textContent=a):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=i,h.appendChild(l),h.addEventListener(r.A.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view;const u=new o.A({view:t.view,controls:new n.A,interactions:new n.A});this.ovmap_=u,t.layers&&t.layers.forEach((function(t){u.addLayer(t)}));const d=document.createElement("div");d.className="ol-overviewmap-box",d.style.boxSizing="border-box",this.boxOverlay_=new c.A({position:[0,0],positioning:"center-center",element:d}),this.ovmap_.addOverlay(this.boxOverlay_);const _=e+" "+g.XI+" "+g.$N+(this.collapsed_&&this.collapsible_?" "+g.nT:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=_,f.appendChild(this.ovmapDiv_),f.appendChild(h);const p=this,m=this.boxOverlay_,x=this.boxOverlay_.getElement(),v=function(t){const e={clientX:(i=t).clientX,clientY:i.clientY};var i;const n=u.getEventCoordinate(e);m.setPosition(n)},y=function(t){const e=u.getEventCoordinateInternal(t);p.getMap().getView().setCenterInternal(e),window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",y)};this.ovmapDiv_.addEventListener("pointerdown",(function(){event.target===x&&window.addEventListener("pointermove",v),window.addEventListener("pointerup",y)}))}setMap(t){const e=this.getMap();if(t!==e){if(e){const t=e.getView();t&&this.unbindView_(t),this.ovmap_.setTarget(null)}if(super.setMap(t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push((0,f.KT)(t,h.A.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const e=t.getView();e&&this.bindView_(e),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===l.A.VIEW){const e=t.oldValue;e&&this.unbindView_(e);const i=this.getMap().getView();this.bindView_(i)}else this.ovmap_.isRendered()||t.key!==l.A.TARGET&&t.key!==l.A.SIZE||this.ovmap_.updateSize()}bindView_(t){if(!this.view_){const e=new u.Ay({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(d.A.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),t.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(t){t.removeChangeListener(d.A.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView().calculateExtentInternal(i);if(this.viewExtent_&&(0,_.aI)(n,this.viewExtent_))return;this.viewExtent_=n;const s=e.getSize(),r=e.getView().calculateExtentInternal(s),o=e.getPixelFromCoordinateInternal((0,_.Py)(n)),a=e.getPixelFromCoordinateInternal((0,_.k_)(n)),l=Math.abs(o[0]-a[0]),h=Math.abs(o[1]-a[1]),c=s[0],u=s[1];l<.1*c||h<.1*u||l>.75*c||h>.75*u?this.resetExtent_():(0,_.ms)(r,n)||this.recenter_()}resetExtent_(){const t=this.getMap(),e=this.ovmap_,i=t.getSize(),n=t.getView().calculateExtentInternal(i),s=e.getView(),r=Math.log(7.5)/Math.LN2,o=1/(.1*Math.pow(2,r/2));(0,_.Af)(n,o),s.fitInternal((0,p.VY)(n))}recenter_(){const t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView(),s=e.getView(),r=this.rotateWithView_?0:-n.getRotation(),o=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=n.getCenter(),h=n.getResolution(),c=s.getResolution(),u=i[0]*h/c,d=i[1]*h/c;if(o.setPosition(l),a){a.style.width=u+"px",a.style.height=d+"px";const t="rotate("+r+"rad)";a.style.transform=t}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=(0,f.Jz)(this.ovmap_,a.A.POSTRENDER,(t=>{delete this.ovmapPostrenderKey_,this.updateBox_()})))}handleClick_(t){t.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(g.nT),this.collapsed_?(0,m.fo)(this.collapseLabel_,this.label_):(0,m.fo)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())}setCollapsed(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(t){this.validateExtent_(),this.updateBox_()}}const v=x},2898:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(972),s=i(6837),r=i(5176),o=i(3474);class a extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",i=void 0!==t.label?t.label:"⇧",n=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof i?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const l=e+" "+r.XI+" "+r.$N,h=this.element;h.className=l,h.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(r.Si)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:o.vT}):t.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const t="rotate("+i+"rad)";if(this.autoHide_){const t=this.element.classList.contains(r.Si);t||0!==i?t&&0!==i&&this.element.classList.remove(r.Si):this.element.classList.add(r.Si)}this.label_.style.transform=t}this.rotation_=i}}const l=a},3965:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(972),s=i(5176),r=i(3407);const o="units",a=[1,2,5],l=25.4/.28;class h extends n.A{constructor(t){t=t||{};const e=document.createElement("div");e.style.pointerEvents="none",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un;const i=void 0!==t.className?t.className:t.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+s.XI,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==t.minWidth?t.minWidth:64,this.maxWidth_=t.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(o,this.handleUnitsChanged_),this.setUnits(t.units||"metric"),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(o)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(o,t)}setDpi(t){this.dpi_=t}updateElement_(){const t=this.viewState_;if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=t.center,i=t.projection,n=this.getUnits(),s="degrees"==n?"degrees":"m";let o=(0,r.hO)(i,t.resolution,e,s);const h=this.minWidth_*(this.dpi_||l)/l,c=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||l)/l:void 0;let u=h*o,d="";if("degrees"==n){const t=r.Ig.degrees;u*=t,u=c){g=p,_=m,f=x;break}if(_>=h)break;p=g,m=_,x=f,++v}const y=this.scaleBar_?this.createScaleBar(_,g,d):g.toFixed(f<0?-f:0)+" "+d;this.renderedHTML_!=y&&(this.innerElement_.innerHTML=y,this.renderedHTML_=y),this.renderedWidth_!=_&&(this.innerElement_.style.width=_+"px",this.renderedWidth_=_),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(t,e,i){const n=this.getScaleForResolution(),s=n<1?Math.round(1/n).toLocaleString()+" : 1":"1 : "+Math.round(n).toLocaleString(),r=this.scaleBarSteps_,o=t/r,a=[this.createMarker("absolute")];for(let n=0;n
    `+this.createMarker("relative")+(n%2==0||2===r?this.createStepText(n,t,!1,e,i):"")+"")}return a.push(this.createStepText(r,t,!0,e,i)),(this.scaleBarText_?`
    `+s+"
    ":"")+a.join("")}createMarker(t){return`
    `}createStepText(t,e,i,n,s){const r=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+s);return`
    `+r+"
    "}getScaleForResolution(){return(0,r.hO)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||l)}render(t){const e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}}const c=h},9186:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(972),s=i(6837),r=i(5176),o=i(3474);class a extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",i=void 0!==t.delta?t.delta:1,n=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",o=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",a=void 0!==t.zoomInLabel?t.zoomInLabel:"+",l=void 0!==t.zoomOutLabel?t.zoomOutLabel:"–",h=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",c=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=n,u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof a?document.createTextNode(a):a),u.addEventListener(s.A.CLICK,this.handleClick_.bind(this,i),!1);const d=document.createElement("button");d.className=o,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(s.A.CLICK,this.handleClick_.bind(this,-i),!1);const g=e+" "+r.XI+" "+r.$N,_=this.element;_.className=g,_.appendChild(u),_.appendChild(d),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const e=this.getMap().getView();if(!e)return;const i=e.getZoom();if(void 0!==i){const n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:o.vT})):e.setZoom(n)}}}const l=a},9439:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(972),s=i(6837),r=i(613),o=i(5176),a=i(1597),l=i(3474),h=i(9438),c=i(1685);class u extends n.A{constructor(t){super({target:(t=t||{}).target,element:document.createElement("div"),render:t.render}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=0,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.startX_,this.startY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==t.duration?t.duration:200;const e=void 0!==t.className?t.className:"ol-zoomslider",i=document.createElement("button");i.setAttribute("type","button"),i.className=e+"-thumb "+o.XI;const n=this.element;n.className=e+" "+o.XI+" "+o.$N,n.appendChild(i),n.addEventListener(r.A.POINTERDOWN,this.handleDraggerStart_.bind(this),!1),n.addEventListener(r.A.POINTERMOVE,this.handleDraggerDrag_.bind(this),!1),n.addEventListener(r.A.POINTERUP,this.handleDraggerEnd_.bind(this),!1),n.addEventListener(s.A.CLICK,this.handleContainerClick_.bind(this),!1),i.addEventListener(s.A.CLICK,c.dG,!1)}setMap(t){super.setMap(t),t&&t.render()}initSlider_(){const t=this.element;let e=t.offsetWidth,i=t.offsetHeight;if(0===e&&0===i)return this.sliderInitialized_=!1;const n=getComputedStyle(t);e-=parseFloat(n.paddingRight)+parseFloat(n.paddingLeft),i-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom);const s=t.firstElementChild,r=getComputedStyle(s),o=s.offsetWidth+parseFloat(r.marginRight)+parseFloat(r.marginLeft),a=s.offsetHeight+parseFloat(r.marginTop)+parseFloat(r.marginBottom);return this.thumbSize_=[o,a],e>i?(this.direction_=1,this.widthLimit_=e-o):(this.direction_=0,this.heightLimit_=i-a),this.sliderInitialized_=!0}handleContainerClick_(t){const e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(i),s=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:s,duration:this.duration_,easing:l.vT})}handleDraggerStart_(t){if(!this.dragging_&&t.target===this.element.firstElementChild){const e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){const t=this.handleDraggerDrag_,e=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push((0,h.KT)(i,r.A.POINTERMOVE,t,this),(0,h.KT)(i,r.A.POINTERUP,e,this))}}}handleDraggerDrag_(t){if(this.dragging_){const e=t.clientX-this.startX_,i=t.clientY-this.startY_,n=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}}handleDraggerEnd_(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(h.JH),this.dragListenerKeys_.length=0)}setThumbPosition_(t){const e=this.getPositionForResolution_(t),i=this.element.firstElementChild;1==this.direction_?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"}getRelativePosition_(t,e){let i;return i=1===this.direction_?t/this.widthLimit_:e/this.heightLimit_,(0,a.qE)(i,0,1)}getResolutionForPosition_(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)}getPositionForResolution_(t){const e=this.getMap().getView().getValueForResolutionFunction();return(0,a.qE)(1-e(t),0,1)}render(t){if(!t.frameState)return;if(!this.sliderInitialized_&&!this.initSlider_())return;const e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}const d=u},1727:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(972),s=i(6837),r=i(5176),o=i(3407),a=i(1064);class l extends n.A{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.extent=t.extent?t.extent:null;const e=void 0!==t.className?t.className:"ol-zoom-extent",i=void 0!==t.label?t.label:"E",n=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=n,o.appendChild("string"==typeof i?document.createTextNode(i):i),o.addEventListener(s.A.CLICK,this.handleClick_.bind(this),!1);const a=e+" "+r.XI+" "+r.$N,l=this.element;l.className=a,l.appendChild(o)}handleClick_(t){t.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),e=this.extent?(0,o.SD)(this.extent,t.getProjection()):t.getProjection().getExtent();t.fitInternal((0,a.VY)(e))}}const h=l},6933:(t,e,i)=>{i.d(e,{$x:()=>_,Io:()=>g,Li:()=>f,U$:()=>p,WQ:()=>o,aI:()=>h,aP:()=>l,e$:()=>c,hG:()=>d,hs:()=>u,sG:()=>a});var n=i(915),s=i(1597),r=i(2806);function o(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function a(t,e){const i=t[0],n=t[1],s=e[0],r=e[1],o=s[0],a=s[1],l=r[0],h=r[1],c=l-o,u=h-a,d=0===c&&0===u?0:(c*(i-o)+u*(n-a))/(c*c+u*u||0);let g,_;return d<=0?(g=o,_=a):d>=1?(g=l,_=h):(g=o+d*c,_=a+d*u),[g,_]}function l(t,e,i){const n=(0,s.xP)(e+180,360)-180,o=Math.abs(3600*n),a=i||0;let l=Math.floor(o/3600),h=Math.floor((o-3600*l)/60),c=(0,s.Mg)(o-3600*l-60*h,a);c>=60&&(c=0,h+=1),h>=60&&(h=0,l+=1);let u=l+"°";return 0===h&&0===c||(u+=" "+(0,r.H)(h,2)+"′"),0!==c&&(u+=" "+(0,r.H)(c,2,a)+"″"),0!==n&&(u+=" "+t.charAt(n<0?1:0)),u}function h(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function c(t,e){const i=Math.cos(e),n=Math.sin(e),s=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=s,t[1]=r,t}function u(t,e){return t[0]*=e,t[1]*=e,t}function d(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function g(t,e){return Math.sqrt(d(t,e))}function _(t,e){return d(t,a(t,e))}function f(t,e){if(e.canWrapX()){const i=(0,n.RG)(e.getExtent()),s=p(t,e,i);s&&(t[0]-=s*i)}return t}function p(t,e,i){const s=e.getExtent();let r=0;return e.canWrapX()&&(t[0]s[2])&&(i=i||(0,n.RG)(s),r=Math.floor((t[0]-s[0])/i)),r}},5176:(t,e,i)=>{i.d(e,{$N:()=>a,K5:()=>u,Q5:()=>s,Si:()=>n,Vv:()=>o,XI:()=>r,nT:()=>l});const n="ol-hidden",s="ol-selectable",r="ol-unselectable",o="ol-unsupported",a="ol-control",l="ol-collapsed",h=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),c=["style","variant","weight","size","lineHeight","family"],u=function(t){const e=t.match(h);if(!e)return null;const i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let t=0,n=c.length;t{i.d(e,{DK:()=>h,Gq:()=>l,WM:()=>d,Y:()=>s,Yg:()=>a,fo:()=>c,gS:()=>u,lr:()=>o});var n=i(7771);function s(t,e,i,s){let r;return r=i&&i.length?i.shift():n.Wl?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",s)}let r;function o(){return r||(r=s(1,1)),r}function a(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function l(t){let e=t.offsetWidth;const i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),e}function h(t){let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),e}function c(t,e){const i=e.parentNode;i&&i.replaceChild(t,e)}function u(t){for(;t.lastChild;)t.lastChild.remove()}function d(t,e){const i=t.childNodes;for(let n=0;;++n){const s=i[n],r=e[n];if(!s&&!r)break;s!==r&&(s?r?t.insertBefore(r,s):(t.removeChild(s),--n):t.appendChild(r))}}},3474:(t,e,i)=>{function n(t){return Math.pow(t,3)}function s(t){return 1-n(1-t)}function r(t){return 3*t*t-2*t*t*t}function o(t){return t}i.d(e,{T9:()=>r,a6:()=>n,sn:()=>o,vT:()=>s})},9438:(t,e,i)=>{i.d(e,{JH:()=>o,Jz:()=>r,KT:()=>s});var n=i(3530);function s(t,e,i,n,s){if(s){const s=i;i=function(){t.removeEventListener(e,i),s.apply(n??this,arguments)}}else n&&n!==t&&(i=i.bind(n));const r={target:t,type:e,listener:i};return t.addEventListener(e,i),r}function r(t,e,i,n){return s(t,e,i,n,!0)}function o(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),(0,n.I)(t))}},1685:(t,e,i)=>{function n(t){t.stopPropagation()}i.d(e,{Ay:()=>s,dG:()=>n});const s=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}},6837:(t,e,i)=>{i.d(e,{A:()=>n});const n={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},9332:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(25),s=i(1685),r=i(4238),o=i(3530);class a extends n.A{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const o=e?new s.Ay(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});let h;i in a||(a[i]=0,l[i]=0),++a[i];for(let t=0,e=n.length;t0)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=r.tV,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}}const l=a},8704:(t,e,i)=>{i.d(e,{A4:()=>E,GB:()=>x,Gk:()=>u,IO:()=>h,Js:()=>l,Kg:()=>v,Q7:()=>a,TS:()=>p,Zm:()=>g,at:()=>d,eL:()=>c,fs:()=>T,k5:()=>m,qG:()=>f,t5:()=>_,tE:()=>y});var n=i(3445),s=i(4238),r=i(7771),o=i(588);function a(t){const e=arguments;return function(t){let i=!0;for(let n=0,s=e.length;n{i.d(e,{DG:()=>y,Fq:()=>u,SR:()=>E,T8:()=>a,Ye:()=>P,ZD:()=>A,_D:()=>v,cT:()=>h,go:()=>p,mE:()=>c,qA:()=>d,qg:()=>T,wl:()=>l});var n=i(6514),s=i(3730),r=i(4401);let o=0;const a=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string"},C={[A.Get]:L(R(1,1/0),(function(t,e,i){const n=t.length-1,s=new Array(n);for(let e=0;ee)throw new Error(`expected ${e===1/0?`${t} or more`:`${t} to ${e}`} arguments for ${r}, got ${o}`)}}function w(t,e,i){const n=t.length-1,s=new Array(n);for(let r=0;r{i.d(e,{uZ:()=>x,nR:()=>v,VO:()=>c,Lm:()=>g,z0:()=>p,$R:()=>l,Tl:()=>_,Sl:()=>f});const n=class{constructor(t,e){this.name=t,this.data=e,this.texture_=null}getTexture(t){if(!this.texture_){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_}delete(t){this.texture_&&t.deleteTexture(this.texture_),this.texture_=null}};var s=i(9825),r=i(2323),o=i(3730),a=i(4401);function l(t){const e=t.toString();return e.includes(".")?e:e+".0"}function h(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${t.length}(${t.map(l).join(", ")})`}function c(t){const e=(0,o._j)(t),i=e.length>3?e[3]:1;return h([e[0]/255*i,e[1]/255*i,e[2]/255*i,i])}const u={};let d=0;function g(t){return t in u||(u[t]=d++),u[t]}function _(t){return l(g(t))}function f(t){return"u_var_"+t}function p(){return{inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}}}const m="getBandValue",x="u_paletteTextures";function v(t,e,i,n){return T((0,s.qg)(t,e,i),e,n)}function y(t){return(e,i,n)=>{const s=i.args.length,r=new Array(s);for(let t=0;t{const i=e.args[0].value;return i in t.properties||(t.properties[i]={name:i,type:e.type}),(t.inFragmentShader?"v_prop_":"a_prop_")+i},[s.ZD.GeometryType]:(t,e,i)=>{const n="geometryType";return n in t.properties||(t.properties[n]={name:n,type:s.cT,evaluator:t=>(0,s.Ye)(t.getGeometry())}),(t.inFragmentShader?"v_prop_":"a_prop_")+n},[s.ZD.Var]:(t,e)=>{const i=e.args[0].value;return i in t.variables||(t.variables[i]={name:i,type:e.type}),f(i)},[s.ZD.Resolution]:()=>"u_resolution",[s.ZD.Zoom]:()=>"u_zoom",[s.ZD.Time]:()=>"u_time",[s.ZD.Any]:y((t=>`(${t.join(" || ")})`)),[s.ZD.All]:y((t=>`(${t.join(" && ")})`)),[s.ZD.Not]:y((([t])=>`(!${t})`)),[s.ZD.Equal]:y((([t,e])=>`(${t} == ${e})`)),[s.ZD.NotEqual]:y((([t,e])=>`(${t} != ${e})`)),[s.ZD.GreaterThan]:y((([t,e])=>`(${t} > ${e})`)),[s.ZD.GreaterThanOrEqualTo]:y((([t,e])=>`(${t} >= ${e})`)),[s.ZD.LessThan]:y((([t,e])=>`(${t} < ${e})`)),[s.ZD.LessThanOrEqualTo]:y((([t,e])=>`(${t} <= ${e})`)),[s.ZD.Multiply]:y((t=>`(${t.join(" * ")})`)),[s.ZD.Divide]:y((([t,e])=>`(${t} / ${e})`)),[s.ZD.Add]:y((t=>`(${t.join(" + ")})`)),[s.ZD.Subtract]:y((([t,e])=>`(${t} - ${e})`)),[s.ZD.Clamp]:y((([t,e,i])=>`clamp(${t}, ${e}, ${i})`)),[s.ZD.Mod]:y((([t,e])=>`mod(${t}, ${e})`)),[s.ZD.Pow]:y((([t,e])=>`pow(${t}, ${e})`)),[s.ZD.Abs]:y((([t])=>`abs(${t})`)),[s.ZD.Floor]:y((([t])=>`floor(${t})`)),[s.ZD.Ceil]:y((([t])=>`ceil(${t})`)),[s.ZD.Round]:y((([t])=>`floor(${t} + 0.5)`)),[s.ZD.Sin]:y((([t])=>`sin(${t})`)),[s.ZD.Cos]:y((([t])=>`cos(${t})`)),[s.ZD.Atan]:y((([t,e])=>void 0!==e?`atan(${t}, ${e})`:`atan(${t})`)),[s.ZD.Sqrt]:y((([t])=>`sqrt(${t})`)),[s.ZD.Match]:y((t=>{const e=t[0],i=t[t.length-1];let n=null;for(let s=t.length-3;s>=1;s-=2)n=`(${e} == ${t[s]} ? ${t[s+1]} : ${n||i})`;return n})),[s.ZD.Between]:y((([t,e,i])=>`(${t} >= ${e} && ${t} <= ${i})`)),[s.ZD.Interpolate]:y((([t,e,...i])=>{let n="";for(let s=0;s{const e=t[t.length-1];let i=null;for(let n=t.length-3;n>=0;n-=2)i=`(${t[n]} ? ${t[n+1]} : ${i||e})`;return i})),[s.ZD.In]:y((([t,...e],i)=>{const n=function(t,e){return`operator_in_${Object.keys(e.functions).length}`}(0,i),s=[];for(let t=0;t`vec${t.length}(${t.join(", ")})`)),[s.ZD.Color]:y((t=>{if(1===t.length)return`vec4(vec3(${t[0]} / 255.0), 1.0)`;if(2===t.length)return`(${t[1]} * vec4(vec3(${t[0]} / 255.0), 1.0))`;const e=t.slice(0,3).map((t=>`${t} / 255.0`));return 3===t.length?`vec4(${e.join(", ")}, 1.0)`:`(${t[3]} * vec4(${e.join(", ")}, 1.0))`})),[s.ZD.Band]:y((([t,e,i],n)=>{if(!(m in n.functions)){let t="";const e=n.bandCount||1;for(let i=0;i{const[i,...r]=e.args,a=r.length,l=new Uint8Array(4*a);for(let t=0;t0)return l(t.value);if((t.type&s.T8)>0)return t.value.toString();if((t.type&s.cT)>0)return _(t.value.toString());if((t.type&s.mE)>0)return c(t.value);if((t.type&s.Fq)>0)return h(t.value);if((t.type&s.qA)>0)return n=t.value,h((0,a.xq)(n));var n;throw new Error(`Unexpected expression ${t.value} (expected type ${(0,s.go)(e)})`)}},915:(t,e,i)=>{i.d(e,{$C:()=>y,$u:()=>N,Af:()=>G,Bg:()=>I,HY:()=>O,Im:()=>k,Ld:()=>a,Li:()=>B,Mx:()=>z,N:()=>g,NW:()=>j,Oq:()=>L,Py:()=>M,QJ:()=>U,R:()=>S,R8:()=>E,RG:()=>D,Rj:()=>c,S5:()=>d,Tr:()=>s,UG:()=>C,Vy:()=>p,WU:()=>F,X$:()=>v,Ym:()=>l,_N:()=>P,aI:()=>m,aZ:()=>_,bE:()=>x,dP:()=>f,k_:()=>R,ms:()=>h,o8:()=>o,q1:()=>w,qF:()=>b,r:()=>r,sB:()=>A,vz:()=>u});var n=i(1580);function s(t){const e=[1/0,1/0,-1/0,-1/0];for(let i=0,n=t.length;ir&&(h|=n.A.RIGHT),lo&&(h|=n.A.ABOVE),h===n.A.UNKNOWN&&(h=n.A.INTERSECTING),h}function d(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,i,n,s){return s?(s[0]=t,s[1]=e,s[2]=i,s[3]=n,s):[t,e,i,n]}function _(t){return g(1/0,1/0,-1/0,-1/0,t)}function f(t,e){const i=t[0],n=t[1];return g(i,n,i,n,e)}function p(t,e,i,n,s){return E(_(s),t,e,i,n)}function m(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function x(t,e,i){return Math.abs(t[0]-e[0])t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function y(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function E(t,e,i,n,s){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function k(t){return t[2]=a&&p<=h),s||!(o&n.A.RIGHT)||r&n.A.RIGHT||(m=_-(g-h)*f,s=m>=l&&m<=c),s||!(o&n.A.BELOW)||r&n.A.BELOW||(p=g-(_-l)/f,s=p>=a&&p<=h),s||!(o&n.A.LEFT)||r&n.A.LEFT||(m=_-(g-a)*f,s=m>=l&&m<=c)}return s}function j(t,e,i,n){if(k(t))return _(i);let s=[];if(n>1){const e=t[2]-t[0],i=t[3]-t[1];for(let r=0;r=i[2])){const e=D(i),s=Math.floor((n[0]-i[0])/e)*e;t[0]-=s,t[2]-=s}return t}function U(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];B(t,e);const s=D(n);if(D(t)>s&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-s,t[3]]]}return[t]}},1580:(t,e,i)=>{i.d(e,{A:()=>n});const n={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16}},1142:(t,e,i)=>{i.d(e,{m8:()=>r,nF:()=>o});var n=i(4238);let s=!1;function r(t,e,i,n,r,o,a){const l=new XMLHttpRequest;l.open("GET","function"==typeof t?t(i,n,r):t,!0),"arraybuffer"==e.getType()&&(l.responseType="arraybuffer"),l.withCredentials=s,l.onload=function(t){if(!l.status||l.status>=200&&l.status<300){const t=e.getType();try{let n;"text"==t||"json"==t?n=l.responseText:"xml"==t?n=l.responseXML||l.responseText:"arraybuffer"==t&&(n=l.response),n?o(e.readFeatures(n,{extent:i,featureProjection:r}),e.readProjection(n)):a()}catch{a()}}else a()},l.onerror=a,l.send()}function o(t,e){return function(i,s,o,a,l){const h=this;r(t,e,i,s,o,(function(t,e){h.addFeatures(t),void 0!==a&&a(t)}),l||n.tV)}}},6067:(t,e,i)=>{i.d(e,{A:()=>V});var n=i(4087);function s(t,e){return r(t,e,[]).join("")}function r(t,e,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{let n;for(n=t.firstChild;n;n=n.nextSibling)r(n,e,i)}return i}function o(t,e){return function(i,n){const s=t.call(e??this,i,n);void 0!==s&&n[n.length-1].push(s)}}function a(t,e,i){return function(n,s){const r=t.call(i??this,n,s);if(void 0!==r){const t=s[s.length-1],i=void 0!==e?e:n.localName;let o;i in t?o=t[i]:(o=[],t[i]=o),o.push(r)}}}function l(t,e,i){return function(n,s){const r=t.call(i??this,n,s);void 0!==r&&(s[s.length-1][void 0!==e?e:n.localName]=r)}}function h(t,e,i){let n,s;for(i=void 0!==i?i:{},n=0,s=t.length;n{i.d(e,{B4:()=>a,W8:()=>r,hq:()=>l,rT:()=>s,tV:()=>o});var n=i(6514);function s(){return!0}function r(){return!1}function o(){}function a(t){let e,i,s;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===s&&(0,n.aI)(r,i)||(s=this,i=r,e=t.apply(this,arguments)),e}}function l(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}},7430:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(4120),s=i(4087),r=i(9703),o=i(915),a=i(3407),l=i(4238),h=i(7622);const c=(0,r.vt)();class u extends n.A{constructor(){super(),this.extent_=(0,o.S5)(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=(0,l.B4)(((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return(0,s.b0)()}closestPointXY(t,e,i,n){return(0,s.b0)()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return(0,s.b0)()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&(0,o.aZ)(t),this.extentRevision_=this.getRevision()}return(0,o.$u)(this.extent_,t)}rotate(t,e){(0,s.b0)()}scale(t,e,i){(0,s.b0)()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return(0,s.b0)()}getType(){return(0,s.b0)()}applyTransform(t){(0,s.b0)()}intersectsExtent(t){return(0,s.b0)()}translate(t,e){(0,s.b0)()}transform(t,e){const i=(0,a.Jt)(t),n="tile-pixels"==i.getUnits()?function(t,n,s){const l=i.getExtent(),u=i.getWorldExtent(),d=(0,o.Oq)(u)/(0,o.Oq)(l);return(0,r.Zz)(c,u[0],u[3],d,-d,0,0,0),(0,h.Rc)(t,0,t.length,s,c,n),(0,a.RG)(i,e)(t,n,s)}:(0,a.RG)(i,e);return this.applyTransform(n),this}}const d=u},4338:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(7430),r=i(915),o=i(9438);class a extends s.A{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(o.JH),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;et.clone()))}const h=a},1217:(t,e,i)=>{i.d(e,{A:()=>f});var n=i(2096),s=i(3953),r=i(915),o=i(2497),a=i(3671),l=i(6514),h=i(1374),c=i(6361),u=i(9969),d=i(4350),g=i(904);class _ extends n.Ay{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){(0,l.X$)(this.flatCoordinates,t),this.changed()}clone(){const t=new _(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.MD)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.n)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return(0,h.j)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(e=void 0!==e&&e,(0,u.gr)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return(0,c.n2)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return(0,u.SH)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return(0,g.k)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=(0,a.P4)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new _(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return(0,d.gp)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,o.z2)(this.flatCoordinates,0,t,this.stride),this.changed()}}const f=_},6702:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(1217),s=i(2096),r=i(3953),o=i(915),a=i(2497),l=i(3671),h=i(6514),c=i(6361),u=i(9969),d=i(4350);class g extends s.Ay{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{const e=t,i=[],n=[];for(let t=0,s=e.length;t{i.d(e,{A:()=>u});var n=i(4294),s=i(2096),r=i(915),o=i(2497),a=i(6514),l=i(6361),h=i(1597);class c extends s.Ay{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){(0,a.X$)(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new c(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<(0,r.Ld)(this.getExtent(),t,e))return n;const s=this.flatCoordinates,o=this.stride;for(let r=0,a=s.length;r{i.d(e,{A:()=>v});var n=i(503),s=i(1064),r=i(2096),o=i(3953),a=i(915),l=i(2497),h=i(6514),c=i(2616),u=i(6361),d=i(4350),g=i(3402),_=i(8609),f=i(4049),p=i(2845),m=i(3671);class x extends r.Ay{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){const n=t,s=[],r=[];for(let t=0,e=n.length;t{i.d(e,{A:()=>l});var n=i(2096),s=i(915),r=i(2497),o=i(1597);class a extends n.Ay{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new a(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const s=this.flatCoordinates,r=(0,o.hG)(t,e,s[0],s[1]);if(r{i.d(e,{kj:()=>T,Ay:()=>E,nD:()=>C,VY:()=>A});var n=i(2096),s=i(3953),r=i(915),o=i(2497),a=i(3671),l=i(6361),h=i(8609);class c extends n.Ay{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new c(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.MD)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.n)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return(0,h.eN)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return(0,l.n2)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=(0,a.P4)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new c(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,o.z2)(this.flatCoordinates,0,t,this.stride),this.changed()}}const u=c;var d=i(4294),g=i(6514),_=i(2616),f=i(4350),p=i(3402),m=i(2845),x=i(1597),v=i(2490);class y extends n.Ay{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?(0,g.X$)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new y(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<(0,r.Ld)(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.HX)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.oW)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return(0,m.zb)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return(0,h.PK)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),(0,p.ug)(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,(0,l.cD)(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=(0,r.q1)(this.getExtent());this.flatInteriorPoint_=(0,_.J)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new d.A(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new u(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let s=0;for(let r=0,o=i.length;r{i.d(e,{Ay:()=>u,dn:()=>h,p0:()=>l,v7:()=>c});var n=i(7430),s=i(4087),r=i(915),o=i(7622);class a extends n.A{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return(0,r.Vy)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return(0,s.b0)()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length{function n(t,e,i,n){let s=0;const r=t[i-n],o=t[i-n+1];let a=0,l=0;for(;er,PK:()=>s,eN:()=>n})},4049:(t,e,i)=>{i.d(e,{C:()=>s});var n=i(915);function s(t,e,i,s){const r=[];let o=(0,n.S5)();for(let a=0,l=i.length;a{i.d(e,{HX:()=>o,MD:()=>r,c:()=>a,n:()=>l,oW:()=>h,te:()=>c});var n=i(1597);function s(t,e,i,s,r,o,a){const l=t[e],h=t[e+1],c=t[i]-l,u=t[i+1]-h;let d;if(0===c&&0===u)d=e;else{const g=((r-l)*c+(o-h)*u)/(c*c+u*u);if(g>1)d=i;else{if(g>0){for(let r=0;rr&&(r=l),o=i,a=s}return r}function o(t,e,i,n,s){for(let o=0,a=i.length;o{i.d(e,{Gd:()=>a,a_:()=>r,t7:()=>s,zb:()=>o});var n=i(915);function s(t,e,i,s,o){return!(0,n.sB)(o,(function(n){return!r(t,e,i,s,n[0],n[1])}))}function r(t,e,i,n,s,r){let o=0,a=t[i-n],l=t[i-n+1];for(;er&&(i-a)*(r-l)-(s-a)*(n-l)>0&&o++:n<=r&&(i-a)*(r-l)-(s-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function o(t,e,i,n,s,o){if(0===i.length)return!1;if(!r(t,e,i[0],n,s,o))return!1;for(let e=1,a=i.length;e{function n(t,e,i,n){for(let n=0,s=i.length;nr,_n:()=>n,d6:()=>o,z2:()=>s})},6361:(t,e,i)=>{function n(t,e,i,n,s){s=void 0!==s?s:[];let r=0;for(let o=e;or,cD:()=>s,n2:()=>n})},2616:(t,e,i)=>{i.d(e,{J:()=>r,p:()=>o});var n=i(6514),s=i(2845);function r(t,e,i,r,o,a,l){let h,c,u,d,g,_,f;const p=o[a+1],m=[];for(let n=0,s=i.length;nv&&(u=(d+g)/2,(0,s.zb)(t,e,i,r,u,p)&&(x=u,v=n)),d=g}return isNaN(x)&&(x=o[a]),l?(l.push(x,p,v),l):[x,p,v]}function o(t,e,i,n,s){let o=[];for(let a=0,l=i.length;a{i.d(e,{L8:()=>a,SH:()=>r,gr:()=>o});var n=i(6514),s=i(1597);function r(t,e,i,r,o,a,l){let h,c;const u=(i-e)/r;if(1===u)h=e;else if(2===u)h=e,c=o;else if(0!==u){let s=t[e],a=t[e+1],l=0;const u=[0];for(let n=e+r;n1?l:2,a=a||new Array(l);for(let e=0;e>1;r{i.d(e,{HT:()=>h,Wp:()=>c,fB:()=>a,gp:()=>o,sj:()=>l});var n=i(915),s=i(1374),r=i(2845);function o(t,e,i,r,o){const a=(0,n.R8)((0,n.S5)(),t,e,i,r);return!!(0,n.HY)(o,a)&&(!!(0,n.ms)(o,a)||a[0]>=o[0]&&a[2]<=o[2]||a[1]>=o[1]&&a[3]<=o[3]||(0,s.j)(t,e,i,r,(function(t,e){return(0,n.Mx)(o,t,e)})))}function a(t,e,i,n,s){for(let r=0,a=i.length;r{function n(t,e,i,n){let s=t[e],r=t[e+1],o=0;for(let a=e+n;an})},3402:(t,e,i)=>{function n(t,e,i,n){for(;e0}function r(t,e,i,n,r){r=void 0!==r&&r;for(let o=0,a=i.length;oh,PA:()=>r,mb:()=>o,ug:()=>a,NK:()=>l})},1374:(t,e,i)=>{function n(t,e,i,n,s){let r;for(e+=n;en})},3671:(t,e,i)=>{i.d(e,{AL:()=>r,Hg:()=>l,P4:()=>s,n$:()=>o,sx:()=>h});var n=i(1597);function s(t,e,i,s,r,o,a){const l=(i-e)/s;if(l<3){for(;e0;){const i=c.pop(),o=c.pop();let a=0;const l=t[o],d=t[o+1],g=t[i],_=t[i+1];for(let e=o+s;ea&&(u=e,a=r)}a>r&&(h[(u-e)/s]=1,o+s0&&f>g)&&(_<0&&p<_||_==p||_>0&&p>_)?(l=i,h=d):(r[a++]=l,r[a++]=h,c=l,u=h,l=i,h=d)}return r[a++]=l,r[a++]=h,a}function l(t,e,i,n,s,r,o,l){for(let h=0,c=i.length;h{function n(t,e,i,n,s,r){r=r||[];let o=0;for(let a=e;an,Tl:()=>o,e$:()=>s,hs:()=>r})},7771:(t,e,i)=>{i.d(e,{DT:()=>c,FT:()=>d,Wl:()=>h,XM:()=>u,_p:()=>s,cr:()=>l,ew:()=>a,j:()=>o,oF:()=>r});const n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",s=n.includes("firefox"),r=n.includes("safari")&&!n.includes("chrom")&&(n.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(n)),o=n.includes("webkit")&&!n.includes("edge"),a=n.includes("macintosh"),l="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,h="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,c="undefined"!=typeof Image&&Image.prototype.decode,u="function"==typeof createImageBitmap,d=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}()},6068:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(6292),s=i(3445);class r extends n.Ay{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==s.A.DBLCLICK){const i=t.originalEvent,s=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();(0,n.D2)(a,o,r,this.duration_),i.preventDefault(),e=!0}return!e}}const o=r},422:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(1685),s=i(1409),r=i(25),o=i(1064);class a extends r.A{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new o.Ay([i])}getGeometry(){return this.geometry_}}const l=a;var h=i(8704);const c="boxcancel";class u extends n.Ay{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class d extends s.A{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new l(t.className||"ol-dragbox"),this.minArea_=void 0!==t.minArea?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:h.at,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],s=i[1]-e[1];return n*n+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new u("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new u(e?"boxend":c,t.coordinate,t)),!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new u("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new u(c,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}}const g=d},4473:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(1409),s=i(4238),r=i(8704),o=i(3474),a=i(6933);class l extends n.A{constructor(t){super({stopDown:s.W8}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:(0,r.Q7)(r.TS,r.fs);this.condition_=t.onFocusOnly?(0,r.Q7)(r.eL,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,s=e.getEventPixel((0,n.v)(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const e=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],i=t.map.getView();(0,a.hs)(e,i.getResolution()),(0,a.e$)(e,i.getRotation()),i.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const t=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),s=i.getCenterInternal(),r=e.getPixelFromCoordinateInternal(s),a=e.getCoordinateFromPixelInternal([r[0]-t*Math.cos(n),r[1]-t*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:o.vT})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const h=l},4051:(t,e,i)=>{i.d(e,{A:()=>l});var n=i(1409),s=i(4238),r=i(8704),o=i(4498);class a extends n.A{constructor(t){t=t||{},super({stopDown:s.W8}),this.condition_=t.condition?t.condition:r.IO,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!(0,r.A4)(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===o.b8)return;const n=e.getSize(),s=t.pixel,a=Math.atan2(n[1]/2-s[1],s[0]-n[0]/2);if(void 0!==this.lastAngle_){const t=a-this.lastAngle_;i.adjustRotationInternal(-t)}this.lastAngle_=a}handleUpEvent(t){return!(0,r.A4)(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!!(0,r.A4)(t)&&(!(!(0,r.at)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))}}const l=a},4423:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(422),s=i(3474),r=i(8704);class o extends n.A{constructor(t){super({condition:(t=t||{}).condition?t.condition:r.Kg,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){const e=this.getMap().getView();let i=this.getGeometry();if(this.out_){const t=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(t),s=e.getResolution()/n;i=i.clone(),i.scale(s*s)}e.fitInternal(i,{duration:this.duration_,easing:s.vT})}}const a=o},9964:(t,e,i)=>{i.d(e,{Ay:()=>W});var n=i(2096),s=i(915),r=i(2497),o=i(7622);class a extends n.Ay{constructor(t,e,i){super(),void 0!==i&&void 0===e?this.setFlatCoordinates(i,t):(e=e||0,this.setCenterAndRadius(t,e,i))}clone(){const t=new a(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const s=this.flatCoordinates,r=t-s[0],o=e-s[1],a=r*r+o*o;if(a=e[0]||t[1]<=e[1]&&t[3]>=e[1]||(0,s.sB)(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){const e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let i=1;i=i?t[e-i]:t[e]}function O(t,e,i){let n,s;eo)return F(B(t,n),B(t,s));let a=0;n=i?n-=i:n<0&&(n+=i);let r=n+1;r>=i&&(r-=i);const o=t[n],a=o[0],l=o[1],h=t[r];return[a+(h[0]-a)*s,l+(h[1]-l)*s]}class U extends E.A{constructor(t){const e=t;e.stopDown||(e.stopDown=S.W8),super(e),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:"Polygon"===this.mode_?3:2,this.maxPoints_="Circle"===this.mode_?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:S.rT,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let i=t.geometryFunction;if(!i){const t=this.mode_;if("Circle"===t)i=(t,e,i)=>{const n=e||new l([NaN,NaN]),s=(0,L.Ad)(t[0],i),r=(0,I.hG)(s,(0,L.Ad)(t[t.length-1],i));n.setCenterAndRadius(s,Math.sqrt(r),this.geometryLayout_);const o=(0,L.Tf)();return o&&n.transform(i,o),n};else{let e;"Point"===t?e=y.A:"LineString"===t?e=_.A:"Polygon"===t&&(e=T.Ay),i=(i,n,s)=>(n?"Polygon"===t?i[0].length?n.setCoordinates([i[0].concat([i[0][0]])],this.geometryLayout_):n.setCoordinates([],this.geometryLayout_):n.setCoordinates(i,this.geometryLayout_):n=new e(i,this.geometryLayout_),n)}}this.geometryFunction_=i,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new A.A({source:new C.A({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:X(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:R.TS,this.freehandCondition_,t.freehand?this.freehandCondition_=R.Gk:this.freehandCondition_=t.freehandCondition?t.freehandCondition:R.Kg,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(g.A.ACTIVE,this.updateState_)}setTrace(t){let e;e=t?!0===t?R.Gk:t:R.Zm,this.traceCondition_=e}setMap(t){super.setMap(t),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(t){t.originalEvent.type===c.A.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_="Point"!==this.mode_&&this.freehandCondition_(t);let e=t.type===p.A.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&t.type===p.A.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===p.A.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===p.A.POINTERDOWN?i=!1:e&&this.getPointerCount()<2?(i=t.type===p.A.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):("mouse"===t.originalEvent.pointerType||t.type===p.A.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t)):t.type===p.A.DBLCLICK&&(i=!1),super.handleEvent(t)&&i}handleDownEvent(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((()=>{this.handlePointerMove_(new f.A(p.A.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active)return void this.deactivateTrace_();const e=this.getMap(),i=e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),n=e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),r=(0,s.Tr)([i,n]),o=this.traceSource_.getFeaturesInExtent(r);if(0===o.length)return;const a=function(t,e){const i=[];for(let n=0;nt.endIndex||!i&&et.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let i=0;if(t0&&this.removeLastPoints_(i)}addTracedCoordinates_(t,e,i){if(e===i)return;const n=[];if(e=r;--e)n.push(D(t.coordinates,e))}n.length&&this.appendCoordinates(n)}updateTrace_(t){const e=this.traceState_;if(!e.active)return;if(-1===e.targetIndex&&(0,I.Io)(e.startPx,t.pixel)i.startIndex?hi.startIndex&&(h-=n.length)),l=h,a=t)}const h=e.targets[a];let c=h.ring;if(e.targetIndex===a&&c){const t=B(h.coordinates,l),s=i.getPixelFromCoordinate(t);(0,I.Io)(s,e.startPx)>n&&(c=!1)}if(c){const t=h.coordinates,e=t.length,i=h.startIndex,n=l;if(ithis.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?(this.updateTrace_(t),this.modifyDrawing_(t.coordinate)):this.createOrUpdateSketchPoint_(t.coordinate.slice())}atFinish_(t,e){let i=!1;if(this.sketchFeature_){let n=!1,s=[this.finishCoordinate_];const r=this.mode_;if("Point"===r)i=!0;else if("Circle"===r)i=2===this.sketchCoords_.length;else if("LineString"===r)n=!e&&this.sketchCoords_.length>this.minPoints_;else if("Polygon"===r){const t=this.sketchCoords_;n=t[0].length>this.minPoints_,s=[t[0][0],t[0][t[0].length-2]],s=e?[t[0][0]]:[t[0][0],t[0][t[0].length-2]]}if(n){const e=this.getMap();for(let n=0,r=s.length;n=this.maxPoints_&&(this.freehand_?s.pop():n=!0),s.push(t.slice()),this.geometryFunction_(s,e,i)):"Polygon"===r&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():n=!0),s.push(t.slice()),n&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,e,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),n?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;for(let s=0;s=2){this.finishCoordinate_=t[t.length-2].slice();const e=this.finishCoordinate_.slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}this.geometryFunction_(t,e,i),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if("Polygon"===n){t=this.sketchCoords_[0],t.splice(-2,1);const n=this.sketchLine_.getGeometry();if(t.length>=2){const e=t[t.length-2].slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}n.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}if(1===t.length){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return null;let e=this.sketchCoords_;const i=t.getGeometry(),n=this.getMap().getView().getProjection();return"LineString"===this.mode_?(e.pop(),this.geometryFunction_(e,i,n)):"Polygon"===this.mode_&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new x.A([e])):"MultiLineString"===this.type_?t.setGeometry(new m.A([e])):"MultiPolygon"===this.type_&&t.setGeometry(new v.A([e])),this.dispatchEvent(new M("drawend",t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t),t}abortDrawing_(){this.finishCoordinate_=null;const t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){const t=this.abortDrawing_();t&&this.dispatchEvent(new M("drawabort",t))}appendCoordinates(t){const e=this.mode_,i=!this.sketchFeature_;let n;if(i&&this.startDrawing_(t[0]),"LineString"===e||"Circle"===e)n=this.sketchCoords_;else{if("Polygon"!==e)return;n=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}i&&n.shift(),n.pop();for(let e=0;e{i.d(e,{Ay:()=>h,D2:()=>l,e4:()=>a});var n=i(4120),s=i(2187),r=i(3474);class o extends n.A{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(s.A.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(s.A.ACTIVE,t)}setMap(t){this.map_=t}}function a(t,e,i){const n=t.getCenterInternal();if(n){const s=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:r.sn,center:t.getConstrainedCenter(s)})}}function l(t,e,i,n){const s=t.getZoom();if(void 0===s)return;const o=t.getConstrainedZoom(s+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==n?n:250,easing:r.vT})}const h=o},9888:(t,e,i)=>{i.d(e,{A:()=>u});var n=i(6837),s=i(6292);const r="ArrowLeft",o="ArrowRight",a="ArrowDown";var l=i(8704),h=i(6933);class c extends s.Ay{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return(0,l.TS)(t)&&(0,l.tE)(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==n.A.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==a||n==r||n==o||"ArrowUp"==n)){const l=t.map.getView(),c=l.getResolution()*this.pixelDelta_;let u=0,d=0;n==a?d=-c:n==r?u=-c:n==o?u=c:d=c;const g=[u,d];(0,h.e$)(g,l.getRotation()),(0,s.e4)(l,g,this.duration_),i.preventDefault(),e=!0}}return!e}}const u=c},6856:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(6837),s=i(6292),r=i(8704);class o extends s.Ay{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!(0,r.GB)(t)&&(0,r.tE)(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==n.A.KEYDOWN||t.type==n.A.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&("+"===n||"-"===n)){const r=t.map,o="+"===n?this.delta_:-this.delta_,a=r.getView();(0,s.D2)(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const a=o},9132:(t,e,i)=>{i.d(e,{A:()=>M});var n=i(71),s=i(2135),r=i(1685),o=i(6837),a=i(6717),l=i(3445),h=i(4294),c=i(1409),u=i(5902),d=i(8280),g=i(2757),_=i(731),f=i(8704),p=i(915),m=i(6933),x=i(9276),v=i(6514),y=i(1064),E=i(3407),T=i(4087);const A=[0,0,0,0],C=[],S="modifyend";class R extends r.Ay{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}class w extends c.A{constructor(t){let e;if(super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:f.fs,this.defaultDeleteCondition_=function(t){return(0,f.Js)(t)&&(0,f.t5)(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:f.Gk,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new u.A,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new g.A({source:new _.A({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:P(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null,t.features?e=t.features:t.source&&(this.source_=t.source,e=new n.A(this.source_.getFeatures()),this.source_.addEventListener(d.A.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(d.A.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(s.A.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(s.A.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=void 0===t.snapToPointer?!this.hitDetection_:t.snapToPointer}addFeature_(t){const e=t.getGeometry();if(e){const i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(o.A.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new n.A;const i=this.featuresBeingModified_.getArray();for(let t=0,n=e.length;t=0;--t){const n=i[t];for(let t=this.dragSegments_.length-1;t>=0;--t)this.dragSegments_[t][0]===n&&this.dragSegments_.splice(t,1);e.remove(n)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)}writeMultiPointGeometry_(t,e){const i=e.getCoordinates();for(let n=0,s=i.length;n=0;--t)this.insertVertex_(s[t],r)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){const i=this.dragSegments_[e][0],n=i.geometry;if("Circle"===n.getType()){const e=n.getCenter(),s=i.featureSegments[0],r=i.featureSegments[1];s.segment[0]=e,s.segment[1]=e,r.segment[0]=e,r.segment[1]=e,this.rBush_.update((0,p.dP)(e),s);let o=n;const a=(0,E.Tf)();if(a){const e=t.map.getView().getProjection();o=o.clone().transform(a,e),o=(0,y.nD)(o).transform(e,a)}this.rBush_.update(o.getExtent(),r)}else this.rBush_.update((0,p.Tr)(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new R(S,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,i){const n=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection(),r=function(t,e){return I(n,t,s)-I(n,e,s)};let o,l;if(this.hitDetection_){const i="object"==typeof this.hitDetection_?t=>t===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,((t,e,i)=>{i&&"Point"===i.getType()&&(i=new h.A((0,E.te)(i.getCoordinates(),s)));const n=i||t.getGeometry();if(t instanceof a.A&&this.features_.getArray().includes(t)){l=n;const e=t.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:l,segment:[e,e]}]}return!0}),{layerFilter:i})}if(!o){const t=(0,E.SD)((0,p.dP)(n,A),s),i=e.getView().getResolution()*this.pixelTolerance_,r=(0,E.JR)((0,p.r)(t,i,A),s);o=this.rBush_.getInExtent(r)}if(o&&o.length>0){const i=o.sort(r)[0],a=i.segment;let h=L(n,i,s);const c=e.getPixelFromCoordinate(h);let u=(0,m.Io)(t,c);if(l||u<=this.pixelTolerance_){const t={};if(t[(0,T.v6)(a)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-n[0],this.delta_[1]=h[1]-n[1]),"Circle"===i.geometry.getType()&&1===i.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);else{const n=e.getPixelFromCoordinate(a[0]),s=e.getPixelFromCoordinate(a[1]),r=(0,m.hG)(c,n),l=(0,m.hG)(c,s);u=Math.sqrt(Math.min(r,l)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(h=r>l?a[1]:a[0]),this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);const d={};d[(0,T.v6)(i.geometry)]=!0;for(let e=1,i=o.length;e=0;--o)s=t[o],u=s[0],d=(0,T.v6)(u.feature),u.depth&&(d+="-"+u.depth.join("-")),d in e||(e[d]={}),0===s[1]?(e[d].right=u,e[d].index=u.index):1==s[1]&&(e[d].left=u,e[d].index=u.index+1);for(d in e){switch(c=e[d].right,l=e[d].left,a=e[d].index,h=a-1,u=void 0!==l?l:c,h<0&&(h=0),r=u.geometry,n=r.getCoordinates(),i=n,g=!1,r.getType()){case"MultiLineString":n[u.depth[0]].length>2&&(n[u.depth[0]].splice(a,1),g=!0);break;case"LineString":n.length>2&&(n.splice(a,1),g=!0);break;case"MultiPolygon":i=i[u.depth[1]];case"Polygon":i=i[u.depth[0]],i.length>4&&(a==i.length-1&&(a=0),i.splice(a,1),g=!0,0===a&&(i.pop(),i.push(i[0]),h=i.length-1))}if(g){this.setGeometryCoordinates_(r,n);const e=[];if(void 0!==l&&(this.rBush_.remove(l),e.push(l.segment[0])),void 0!==c&&(this.rBush_.remove(c),e.push(c.segment[1])),void 0!==l&&void 0!==c){const t={depth:u.depth,feature:u.feature,geometry:u.geometry,index:h,segment:e};this.rBush_.insert((0,p.Tr)(t.segment),t)}this.updateSegmentIndices_(r,a,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return g}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(s){s.geometry===t&&(void 0===i||void 0===s.depth||(0,v.aI)(s.depth,i))&&s.index>e&&(s.index+=n)}))}}function b(t,e){return t.index-e.index}function I(t,e,i){const n=e.geometry;if("Circle"===n.getType()){let s=n;if(1===e.index){const e=(0,E.Tf)();e&&(s=s.clone().transform(e,i));const n=(0,m.hG)(s.getCenter(),(0,E.Ad)(t,i)),r=Math.sqrt(n)-s.getRadius();return r*r}}const s=(0,E.Ad)(t,i);return C[0]=(0,E.Ad)(e.segment[0],i),C[1]=(0,E.Ad)(e.segment[1],i),(0,m.$x)(s,C)}function L(t,e,i){const n=e.geometry;if("Circle"===n.getType()&&1===e.index){let e=n;const s=(0,E.Tf)();return s&&(e=e.clone().transform(s,i)),(0,E.te)(e.getClosestPoint((0,E.Ad)(t,i)),i)}const s=(0,E.Ad)(t,i);return C[0]=(0,E.Ad)(e.segment[0],i),C[1]=(0,E.Ad)(e.segment[1],i),(0,E.te)((0,m.sG)(s,C),i)}function P(){const t=(0,x.mY)();return function(e,i){return t.Point}}const M=w},8751:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(6292),r=i(7771),o=i(8704),a=i(1597);class l extends s.Ay{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:o.Gk;this.condition_=t.onFocusOnly?(0,o.Q7)(o.eL,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t))return!0;if(t.type!==n.A.WHEEL)return!0;const e=t.map,i=t.originalEvent;let s;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==n.A.WHEEL&&(s=i.deltaY,r._p&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=r.cr),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),0===s)return!1;this.lastDelta_=s;const o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=e.getView();if("trackpad"===this.mode_&&!a.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-(0,a.qE)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),(0,s.D2)(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}const h=l},3711:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(1409),s=i(4238),r=i(4498);class o extends n.A{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=s.W8),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],s=this.targetPointers[1],o=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(void 0!==this.lastAngle_){const t=o-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=o;const a=t.map,l=a.getView();l.getConstraints().rotation!==r.b8&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel((0,n.v)(this.targetPointers))),this.rotating_&&(a.render(),l.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const a=o},5243:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(1409),s=i(4238);class r extends n.A{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=s.W8),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel((0,n.v)(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}const o=r},1409:(t,e,i)=>{i.d(e,{A:()=>a,v:()=>o});var n=i(6292),s=i(3445);class r extends n.Ay{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==s.A.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==s.A.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==s.A.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==s.A.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function o(t){const e=t.length;let i=0,n=0;for(let s=0;s{i.d(e,{A:()=>n});const n={ACTIVE:"active"}},4458:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(71),s=i(1685),r=i(6717),o=i(2187),a=i(1409),l=i(4238),h=i(8704),c=i(3407);class u extends s.Ay{constructor(t,e,i,n,s){super(t),this.features=e,this.coordinate=i,this.startCoordinate=n,this.mapBrowserEvent=s}}class d extends a.A{constructor(t){let e;if(super(t=t||{}),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=void 0!==t.features?t.features:null,t.layers&&!this.features_)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=l.rT;this.layerFilter_=e,this.filter_=t.filter&&!this.features_?t.filter:l.rT,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:h.Gk,this.lastFeature_=null,this.addChangeListener(o.A.ACTIVE,this.handleActiveChanged_)}handleDownEvent(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);const e=this.features_||new n.A([this.lastFeature_]);return this.dispatchEvent(new u("translatestart",e,t.coordinate,this.startCoordinate_,t)),!0}return!1}handleUpEvent(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);const e=this.features_||new n.A([this.lastFeature_]);return this.dispatchEvent(new u("translateend",e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1}handleDragEvent(t){if(this.lastCoordinate_){const e=t.coordinate,i=t.map.getView().getProjection(),s=(0,c.Ad)(e,i),r=(0,c.Ad)(this.lastCoordinate_,i),o=s[0]-r[0],a=s[1]-r[1],l=this.features_||new n.A([this.lastFeature_]),h=(0,c.Tf)();l.forEach((function(t){const e=t.getGeometry();h?(e.transform(h,i),e.translate(o,a),e.transform(i,h)):e.translate(o,a),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new u("translating",l,e,this.startCoordinate_,t))}}handleMoveEvent(t){const e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}featuresAtPixel_(t,e){return e.forEachFeatureAtPixel(t,((t,e)=>{if(t instanceof r.A&&this.filter_(t,e)&&(!this.features_||this.features_.getArray().includes(t)))return t}),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(t){this.hitTolerance_=t}setMap(t){const e=this.getMap();super.setMap(t),this.updateState_(e)}handleActiveChanged_(){this.updateState_(null)}updateState_(t){let e=this.getMap();const i=this.getActive();e&&i||(e=e||t,!e)||e.getViewport().classList.remove("ol-grab","ol-grabbing")}}const g=d},8620:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(4120),s=i(5332),r=i(4087),o=i(588),a=i(1597);class l extends n.A{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[s.A.OPACITY]=void 0!==t.opacity?t.opacity:1,(0,o.v)("number"==typeof e[s.A.OPACITY],"Layer opacity must be a number"),e[s.A.VISIBLE]=void 0===t.visible||t.visible,e[s.A.Z_INDEX]=t.zIndex,e[s.A.MAX_RESOLUTION]=void 0!==t.maxResolution?t.maxResolution:1/0,e[s.A.MIN_RESOLUTION]=void 0!==t.minResolution?t.minResolution:0,e[s.A.MIN_ZOOM]=void 0!==t.minZoom?t.minZoom:-1/0,e[s.A.MAX_ZOOM]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=(0,a.qE)(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return(0,r.b0)()}getLayerStatesArray(t){return(0,r.b0)()}getExtent(){return this.get(s.A.EXTENT)}getMaxResolution(){return this.get(s.A.MAX_RESOLUTION)}getMinResolution(){return this.get(s.A.MIN_RESOLUTION)}getMinZoom(){return this.get(s.A.MIN_ZOOM)}getMaxZoom(){return this.get(s.A.MAX_ZOOM)}getOpacity(){return this.get(s.A.OPACITY)}getSourceState(){return(0,r.b0)()}getVisible(){return this.get(s.A.VISIBLE)}getZIndex(){return this.get(s.A.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(s.A.EXTENT,t)}setMaxResolution(t){this.set(s.A.MAX_RESOLUTION,t)}setMinResolution(t){this.set(s.A.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(s.A.MAX_ZOOM,t)}setMinZoom(t){this.set(s.A.MIN_ZOOM,t)}setOpacity(t){(0,o.v)("number"==typeof t,"Layer opacity must be a number"),this.set(s.A.OPACITY,t)}setVisible(t){this.set(s.A.VISIBLE,t)}setZIndex(t){this.set(s.A.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const h=l},2808:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(764),s=i(5360);class r extends n.A{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(s.A.PRELOAD)}setPreload(t){this.set(s.A.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(s.A.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(s.A.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const o=r},2284:(t,e,i)=>{i.d(e,{A:()=>Y});var n=i(764),s=i(48),r=i(9276),o=i(7733),a=i(3628),l=i(9700),h=i(6936),c=i(953),u=i(1426),d=i(9825),g=i(3730);function _(t,e,i){return f((0,d.qg)(t,e,i),i)}function f(t,e){if(t instanceof d._D){if(t.type===d.mE&&"string"==typeof t.value){const e=(0,g.sH)(t.value);return function(){return e}}return function(){return t.value}}const i=t.operator;switch(i){case d.ZD.Number:case d.ZD.String:case d.ZD.Coalesce:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{for(let e=0;e{for(let e=0;e{const n=t.args;let s=i.properties[e];for(let t=1,e=n.length;tt.variables[e];default:throw new Error(`Unsupported accessor operator ${t.operator}`)}}(t);case d.ZD.Id:return t=>t.featureId;case d.ZD.GeometryType:return t=>t.geometryType;case d.ZD.Concat:{const i=t.args.map((t=>f(t,e)));return t=>"".concat(...i.map((e=>e(t).toString())))}case d.ZD.Resolution:return t=>t.resolution;case d.ZD.Any:case d.ZD.All:case d.ZD.Between:case d.ZD.In:case d.ZD.Not:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{for(let e=0;e{for(let e=0;e{const e=s[0](t),i=s[1](t),n=s[2](t);return e>=i&&e<=n};case d.ZD.In:return t=>{const e=s[0](t);for(let i=1;i!s[0](t);default:throw new Error(`Unsupported logical operator ${i}`)}}(t,e);case d.ZD.Equal:case d.ZD.NotEqual:case d.ZD.LessThan:case d.ZD.LessThanOrEqualTo:case d.ZD.GreaterThan:case d.ZD.GreaterThanOrEqualTo:return function(t,e){const i=t.operator,n=f(t.args[0],e),s=f(t.args[1],e);switch(i){case d.ZD.Equal:return t=>n(t)===s(t);case d.ZD.NotEqual:return t=>n(t)!==s(t);case d.ZD.LessThan:return t=>n(t)n(t)<=s(t);case d.ZD.GreaterThan:return t=>n(t)>s(t);case d.ZD.GreaterThanOrEqualTo:return t=>n(t)>=s(t);default:throw new Error(`Unsupported comparison operator ${i}`)}}(t,e);case d.ZD.Multiply:case d.ZD.Divide:case d.ZD.Add:case d.ZD.Subtract:case d.ZD.Clamp:case d.ZD.Mod:case d.ZD.Pow:case d.ZD.Abs:case d.ZD.Floor:case d.ZD.Ceil:case d.ZD.Round:case d.ZD.Sin:case d.ZD.Cos:case d.ZD.Atan:case d.ZD.Sqrt:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{let e=1;for(let i=0;is[0](t)/s[1](t);case d.ZD.Add:return t=>{let e=0;for(let i=0;is[0](t)-s[1](t);case d.ZD.Clamp:return t=>{const e=s[0](t),i=s[1](t);if(en?n:e};case d.ZD.Mod:return t=>s[0](t)%s[1](t);case d.ZD.Pow:return t=>Math.pow(s[0](t),s[1](t));case d.ZD.Abs:return t=>Math.abs(s[0](t));case d.ZD.Floor:return t=>Math.floor(s[0](t));case d.ZD.Ceil:return t=>Math.ceil(s[0](t));case d.ZD.Round:return t=>Math.round(s[0](t));case d.ZD.Sin:return t=>Math.sin(s[0](t));case d.ZD.Cos:return t=>Math.cos(s[0](t));case d.ZD.Atan:return 2===n?t=>Math.atan2(s[0](t),s[1](t)):t=>Math.atan(s[0](t));case d.ZD.Sqrt:return t=>Math.sqrt(s[0](t));default:throw new Error(`Unsupported numeric operator ${i}`)}}(t,e);case d.ZD.Case:return function(t,e){const i=t.args.length,n=new Array(i);for(let s=0;s{for(let e=0;e{const e=n[0](t);for(let s=1;s{const e=n[0](t),s=n[1](t);let r,o;for(let a=2;a=s)return 2===a?l:h?m(e,s,r,o,i,l):p(e,s,r,o,i,l);r=i,o=l}return o}}(t,e);case d.ZD.ToString:return function(t,e){const i=t.operator,n=t.args.length,s=new Array(n);for(let i=0;i{const i=s[0](e);return t.args[0].type===d.mE?(0,g.dI)(i):i.toString()};throw new Error(`Unsupported convert operator ${i}`)}(t,e);default:throw new Error(`Unsupported operator ${i}`)}}function p(t,e,i,n,s,r){const o=s-i;if(0===o)return n;const a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(r-n)}function m(t,e,i,n,s,r){if(0==s-i)return n;const o=(0,g.eE)(n),a=(0,g.eE)(r);let l=a[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const h=[p(t,e,i,o[0],s,a[0]),p(t,e,i,o[1],s,a[1]),o[2]+p(t,e,i,0,s,l),p(t,e,i,n[3],s,r[3])];return(0,g.S8)((0,g.cD)(h))}var x=i(3530),v=i(4401);function y(t){return!0}function E(t){const e=(0,d.SR)(),i=t.length,n=new Array(i);for(let s=0;snull;n=b(t,e+"fill-color",i)}if(!n)return null;const s=new a.A;return function(t){const e=n(t);return"none"===e?null:(s.setColor(e),s)}}function C(t,e,i){const n=S(t,e+"stroke-width",i),s=b(t,e+"stroke-color",i);if(!n&&!s)return null;const r=R(t,e+"stroke-line-cap",i),o=R(t,e+"stroke-line-join",i),a=I(t,e+"stroke-line-dash",i),l=S(t,e+"stroke-line-dash-offset",i),h=S(t,e+"stroke-miter-limit",i),u=new c.A;return function(t){if(s){const e=s(t);if("none"===e)return null;u.setColor(e)}if(n&&u.setWidth(n(t)),r){const e=r(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw new Error("Expected butt, round, or square line cap");u.setLineCap(e)}if(o){const e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw new Error("Expected bevel, round, or miter line join");u.setLineJoin(e)}return a&&u.setLineDash(a(t)),l&&u.setLineDashOffset(l(t)),h&&u.setMiterLimit(h(t)),u}}function S(t,e,i){if(!(e in t))return;const n=_(t[e],d.wl,i);return function(t){return j(n(t),e)}}function R(t,e,i){if(!(e in t))return null;const n=_(t[e],d.cT,i);return function(t){return z(n(t),e)}}function w(t,e,i){if(!(e in t))return null;const n=_(t[e],d.T8,i);return function(t){const i=n(t);if("boolean"!=typeof i)throw new Error(`Expected a boolean for ${e}`);return i}}function b(t,e,i){if(!(e in t))return null;const n=_(t[e],d.mE,i);return function(t){return B(n(t),e)}}function I(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){return G(n(t),e)}}function L(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){const i=G(n(t),e);if(2!==i.length)throw new Error(`Expected two numbers for ${e}`);return i}}function P(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq,i);return function(t){return U(n(t),e)}}function M(t,e,i){if(!(e in t))return null;const n=_(t[e],d.Fq|d.wl,i);return function(t){return i=n(t),s=e,"number"==typeof i?i:U(i,s);var i,s}}function F(t,e){const i=t[e];if(void 0!==i){if("number"!=typeof i)throw new Error(`Expected a number for ${e}`);return i}}function D(t,e){const i=t[e];if(void 0!==i){if("number"==typeof i)return(0,v.xq)(i);if(!Array.isArray(i))throw new Error(`Expected a number or size array for ${e}`);if(2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])throw new Error(`Expected a number or size array for ${e}`);return i}}function O(t,e){const i=t[e];if(void 0!==i){if("bottom-left"!==i&&"bottom-right"!==i&&"top-left"!==i&&"top-right"!==i)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return i}}function k(t,e){const i=t[e];if(void 0!==i){if("pixels"!==i&&"fraction"!==i)throw new Error(`Expected pixels or fraction for ${e}`);return i}}function N(t,e){const i=t[e];if(void 0!==i){if("string"!=typeof i)throw new Error(`Expected a string for ${e}`);if("declutter"!==i&&"obstacle"!==i&&"none"!==i)throw new Error(`Expected declutter, obstacle, or none for ${e}`);return i}}function G(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const i=t.length;for(let n=0;n4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return i}function U(t,e){const i=G(t,e);if(2!==i.length)throw new Error(`Expected an array of two numbers for ${e}`);return i}const X="renderOrder";class W extends n.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(X)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter==0&&(t.declutter[i]=new s.A(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(X,t)}setStyle(t){this.style_=void 0===t?r.d1:t;const e=function(t){if(void 0===t)return r.d1;if(!t)return null;if("function"==typeof t)return t;if(t instanceof r.Ay)return t;if(!Array.isArray(t))return E([t]);if(0===t.length)return[];const e=t.length,i=t[0];if(i instanceof r.Ay){const i=new Array(e);for(let n=0;n{i.d(e,{A:()=>A});var n=i(71),s=i(3984),r=i(6717),o=i(3628),a=i(1217),l=i(4294),h=i(953),c=i(9276),u=i(1426),d=i(2757),g=i(731),_=i(915),f=i(1597),p=i(6933),m=i(3407),x=i(7331);function v(t,e,i){const n=[];let s=t(0),r=t(1),o=e(s),a=e(r);const l=[r,s],h=[a,o],c=[1,0],u={};let d,g,_,p,m,x,v=1e5;for(;--v>0&&c.length>0;)_=c.pop(),s=l.pop(),o=h.pop(),x=_.toString(),x in u||(n.push(o[0],o[1]),u[x]=!0),p=c.pop(),r=l.pop(),a=h.pop(),m=(_+p)/2,d=t(m),g=e(d),(0,f.Q1)(g[0],g[1],o[0],o[1],a[0],a[1]){const e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_},this.latLabelStyleBase_=new c.Ay({text:void 0!==t.latLabelStyle?t.latLabelStyle.clone():new u.A({font:"12px Calibri,sans-serif",textAlign:"right",fill:new o.A({color:"rgba(0,0,0,1)"}),stroke:new h.A({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=t=>{const e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_},this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(s.A.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=void 0!==t.intervals?t.intervals:E,this.setSource(new g.A({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new n.A,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new c.Ay({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(t,e){let i=t.slice();return this.projection_&&this.getSource().getWrapX()&&(0,_.Li)(i,this.projection_),this.loadedExtent_&&((0,_.bE)(this.loadedExtent_,i,e)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]}loaderFunction(t,e,i){this.loadedExtent_=t;const n=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=(0,_._N)(s,t);if(this.renderedExtent_&&(0,_.aI)(this.renderedExtent_,o)&&this.renderedResolution_===e)return;if(this.renderedExtent_=o,this.renderedResolution_=e,(0,_.Im)(o))return;const a=(0,_.q1)(o),l=e*e/4;(!this.projection_||!(0,m.tI)(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(o,a,e,l);let h,c=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(c+=this.meridians_.length),this.parallelsLabels_&&(c+=this.parallels_.length);c>this.featurePool_.length;)h=new r.A,this.featurePool_.push(h);const u=n.getFeaturesCollection();u.clear();let d,g,f=0;for(d=0,g=this.meridians_.length;dMath.PI/2);const d=(0,x.r2)(t);for(let t=a;t<=l;++t){let i,n,c,g,_=this.meridians_.length+this.parallels_.length;if(this.meridiansLabels_)for(n=0,c=this.meridiansLabels_.length;n=a?(t[0]=o[0],t[2]=o[2]):r=!0);const l=[(0,f.qE)(e[0],this.minX_,this.maxX_),(0,f.qE)(e[1],this.minY_,this.maxY_)],h=this.toLonLatTransform_(l);isNaN(h[1])&&(h[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let c=(0,f.qE)(h[0],this.minLon_,this.maxLon_),u=(0,f.qE)(h[1],this.minLat_,this.maxLat_);const d=this.maxLines_;let g,p,m,x,v=t;r||(v=[(0,f.qE)(t[0],this.minX_,this.maxX_),(0,f.qE)(t[1],this.minY_,this.maxY_),(0,f.qE)(t[2],this.minX_,this.maxX_),(0,f.qE)(t[3],this.minY_,this.maxY_)]);const y=(0,_.NW)(v,this.toLonLatTransform_,void 0,8);let E=y[3],T=y[2],A=y[1],C=y[0];if(r||((0,_.Ym)(v,this.bottomLeft_)&&(C=this.minLon_,A=this.minLat_),(0,_.Ym)(v,this.bottomRight_)&&(T=this.maxLon_,A=this.minLat_),(0,_.Ym)(v,this.topLeft_)&&(C=this.minLon_,E=this.maxLat_),(0,_.Ym)(v,this.topRight_)&&(T=this.maxLon_,E=this.maxLat_),E=(0,f.qE)(E,u,this.maxLat_),T=(0,f.qE)(T,c,this.maxLon_),A=(0,f.qE)(A,this.minLat_,u),C=(0,f.qE)(C,this.minLon_,c)),c=Math.floor(c/s)*s,x=(0,f.qE)(c,this.minLon_,this.maxLon_),p=this.addMeridian_(x,A,E,n,t,0),g=0,r)for(;(x-=s)>=C&&g++n[r]&&(s=r,r=1);const o=Math.max(e[1],n[s]),a=Math.min(e[3],n[r]),l=(0,f.qE)(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,a),h=[n[s-1]+(n[r-1]-n[s-1])*(l-n[s])/(n[r]-n[s]),l],c=this.meridiansLabels_[i].geom;return c.setCoordinates(h),c}getMeridians(){return this.meridians_}getParallel_(t,e,i,n,s){const r=function(t,e,i,n,s){const r=(0,m.Jt)("EPSG:4326");return v((function(n){return[e+(i-e)*n,t]}),(0,m.RG)(r,n),s)}(t,e,i,this.projection_,n);let o=this.parallels_[s];return o?(o.setFlatCoordinates("XY",r),o.changed()):o=new a.A(r,"XY"),o}getParallelPoint_(t,e,i){const n=t.getFlatCoordinates();let s=0,r=n.length-2;n[s]>n[r]&&(s=r,r=0);const o=Math.max(e[0],n[s]),a=Math.min(e[2],n[r]),l=(0,f.qE)(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,a),h=[l,n[s+1]+(n[r+1]-n[s+1])*(l-n[s])/(n[r]-n[s])],c=this.parallelsLabels_[i].geom;return c.setCoordinates(h),c}getParallels(){return this.parallels_}updateProjectionInfo_(t){const e=(0,m.Jt)("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const n=(0,m.RG)(t,e);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}}const A=T},1905:(t,e,i)=>{i.d(e,{A:()=>z});var n=i(2284),s=i(8280),r=i(2703),o=i(259),a=i(492),l=i(6514);const h=new Uint8Array(4),c=class{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){(0,l.aI)(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return h[0]=0,h[1]=0,h[2]=0,h[3]=0,h;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return h[0]=this.data_[4*i],h[1]=this.data_[4*i+1],h[2]=this.data_[4*i+2],h[3]=this.data_[4*i+3],h}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}};var u=i(130),d=i(9777);const g="GENERATE_POINT_BUFFERS";var _=i(9703),f=i(588),p=i(915);function m(t,e){const i=256,n=255;return(e=e||[])[0]=Math.floor(t/i/i/i)/n,e[1]=Math.floor(t/i/i)%i/n,e[2]=Math.floor(t/i)%i/n,e[3]=t%i/n,e}var x=i(3407),v=i(4087),y=i(9438);class E extends a.A{constructor(t,e){const i=e.uniforms||{},n=(0,_.vt)();i[d.M8.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new o.Ay(u.H7,u.Be),this.indicesBuffer_=new o.Ay(u.IP,u.Be),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const r=e.attributes?e.attributes.map((function(t){return{name:"a_prop_"+t.name,size:1,type:d.jQ.FLOAT}})):[];this.attributes=[{name:"a_position",size:2,type:d.jQ.FLOAT},{name:"a_index",size:1,type:d.jQ.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:d.jQ.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:d.jQ.FLOAT})),this.attributes.push(...r),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=(0,p.S5)(),this.currentTransform_=n,this.renderTransform_=(0,_.vt)(),this.invertRenderTransform_=(0,_.vt)(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=function(){const t='const t="GENERATE_POLYGON_BUFFERS",e="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function x(t,e){const n=(r=e)[0]*r[3]-r[1]*r[2];var r;!function(t,e){if(!t)throw new Error(e)}(0!==n,"Transformation matrix cannot be inverted");const x=e[0],o=e[1],u=e[2],i=e[3],f=e[4],s=e[5];return t[0]=i/n,t[1]=-o/n,t[2]=-u/n,t[3]=x/n,t[4]=(u*s-i*f)/n,t[5]=-(x*s-o*f)/n,t}function o(t,e,n=2){const r=e&&e.length,x=r?e[0]*n:t.length;let o=u(t,0,x,n,!0);const i=[];if(!o||o.next===o.prev)return i;let s,l,c;if(r&&(o=function(t,e,n,r){const x=[];for(let n=0,o=e.length;n80*n){s=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;oe&&(e=n),x>r&&(r=x)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return f(o,i,n,s,l,c,0),i}function u(t,e,n,r,x){let o;if(x===function(t,e,n,r){let x=0;for(let o=e,u=n-r;o0)for(let x=e;x=e;x-=r)o=z(x/r|0,t[x],t[x+1],o);return o&&M(o,o.next)&&(F(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(F(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function f(t,e,n,r,x,o,u){if(!t)return;!u&&o&&function(t,e,n,r){let x=t;do{0===x.z&&(x.z=v(x.x,x.y,e,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==t);x.prevZ.nextZ=null,x.prevZ=null,function(t){let e,n=1;do{let r,x=t;t=null;let o=null;for(e=0;x;){e++;let u=x,i=0;for(let t=0;t0||f>0&&u;)0!==i&&(0===f||!u||x.z<=u.z)?(r=x,x=x.nextZ,i--):(r=u,u=u.nextZ,f--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;x=u}o.nextZ=null,n*=2}while(e>1)}(x)}(t,r,x,o);let y=t;for(;t.prev!==t.next;){const h=t.prev,p=t.next;if(o?l(t,r,x,o):s(t))e.push(h.i,t.i,p.i),F(t),t=p.next,y=p.next;else if((t=p)===y){u?1===u?f(t=c(i(t),e),e,n,r,x,o,2):2===u&&a(t,e,n,r,x,o):f(i(t),e,n,r,x,o,1);break}}}function s(t){const e=t.prev,n=t,r=t.next;if(d(e,n,r)>=0)return!1;const x=e.x,o=n.x,u=r.x,i=e.y,f=n.y,s=r.y,l=xo?x>u?x:u:o>u?o:u,y=i>f?i>s?i:s:f>s?f:s;let h=r.next;for(;h!==e;){if(h.x>=l&&h.x<=a&&h.y>=c&&h.y<=y&&b(x,i,o,f,u,s,h.x,h.y)&&d(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function l(t,e,n,r){const x=t.prev,o=t,u=t.next;if(d(x,o,u)>=0)return!1;const i=x.x,f=o.x,s=u.x,l=x.y,c=o.y,a=u.y,y=if?i>s?i:s:f>s?f:s,g=l>c?l>a?l:a:c>a?c:a,Z=v(y,h,e,n,r),M=v(p,g,e,n,r);let w=t.prevZ,m=t.nextZ;for(;w&&w.z>=Z&&m&&m.z<=M;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=Z;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=M;){if(m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(t,e){let n=t;do{const r=n.prev,x=n.next.next;!M(r,x)&&w(r,n,n.next,x)&&E(r,x)&&E(x,r)&&(e.push(r.i,n.i,x.i),F(n),F(n.next),n=t=x),n=n.next}while(n!==t);return i(n)}function a(t,e,n,r,x,o){let u=t;do{let t=u.next.next;for(;t!==u.prev;){if(u.i!==t.i&&Z(u,t)){let s=I(u,t);return u=i(u,u.next),s=i(s,s.next),f(u,e,n,r,x,o,0),void f(s,e,n,r,x,o,0)}t=t.next}u=u.next}while(u!==t)}function y(t,e){return t.x-e.x}function h(t,e){const n=function(t,e){let n=e;const r=t.x,x=t.y;let o,u=-1/0;do{if(x<=n.y&&x>=n.next.y&&n.next.y!==n.y){const t=n.x+(x-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>u&&(u=t,o=n.x=n.x&&n.x>=f&&r!==n.x&&b(xo.x||n.x===o.x&&p(o,n)))&&(o=n,l=e)}n=n.next}while(n!==i);return o}(t,e);if(!n)return e;const r=I(n,t);return i(r,r.next),i(n,n.next)}function p(t,e){return d(t.prev,t,e.prev)<0&&d(e.next,t,t.next)<0}function v(t,e,n,r,x){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){let e=t,n=t;do{(e.x=(t-u)*(o-i)&&(t-u)*(r-i)>=(n-u)*(e-i)&&(n-u)*(o-i)>=(x-u)*(r-i)}function Z(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){let n=t,r=!1;const x=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&x<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(d(t.prev,t,e.prev)||d(t,e.prev,e))||M(t,e)&&d(t.prev,t,t.next)>0&&d(e.prev,e,e.next)>0)}function d(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function M(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,n,r){const x=A(d(t,e,n)),o=A(d(t,e,r)),u=A(d(n,r,t)),i=A(d(n,r,e));return x!==o&&u!==i||(!(0!==x||!m(t,n,e))||(!(0!==o||!m(t,r,e))||(!(0!==u||!m(n,t,r))||!(0!==i||!m(n,e,r)))))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function A(t){return t>0?1:t<0?-1:0}function E(t,e){return d(t.prev,t,t.next)<0?d(t,e,t.next)>=0&&d(t,t.prev,e)>=0:d(t,e,t.prev)<0||d(t,t.next,e)<0}function I(t,e){const n=P(t.i,t.x,t.y),r=P(e.i,e.x,e.y),x=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=x,x.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function z(t,e,n,r){const x=P(t,e,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function F(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function P(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}new Array(6);const B=[],N={vertexPosition:0,indexPosition:0};function R(t,e,n,r,x){t[e+0]=n,t[e+1]=r,t[e+2]=x}function S(t,e,n,r,x,o){const u=3+x,i=t[e+0],f=t[e+1],s=B;s.length=x;for(let n=0;n0?f:2*Math.PI-f}let Z=-1,d=-1,M=c;const w=null!==o;if(null!==x){Z=b(v,g,r(s,[...[t[x],t[x+1]]])),Math.cos(Z)<=.985&&(M+=Math.tan((Z-Math.PI)/2))}if(w){d=b(g,v,r(s,[...[t[o],t[o+1]]])),Math.cos(d)<=.985&&(M+=Math.tan((Math.PI-d)/2))}function m(t,e){return 0===e?1e4*t:Math.sign(e)*(1e4*t+Math.abs(e))}return u.push(h[0],h[1],p[0],p[1],Z,d,l,m(0,c)),u.push(...f),u.push(h[0],h[1],p[0],p[1],Z,d,l,m(1,c)),u.push(...f),u.push(h[0],h[1],p[0],p[1],Z,d,l,m(2,c)),u.push(...f),u.push(h[0],h[1],p[0],p[1],Z,d,l,m(3,c)),u.push(...f),i.push(y,y+1,y+2,y+1,y+3,y+2),{length:l+Math.sqrt((g[0]-v[0])*(g[0]-v[0])+(g[1]-v[1])*(g[1]-v[1])),angle:M}}function _(t,e,n,r,x){const u=2+x;let i=e;const f=t.slice(i,i+x);i+=x;const s=t[i++];let l=0;const c=new Array(s-1);for(let e=0;e{const o=r.data;switch(o.type){case e:{const t=3,e=2,n=o.customAttributesSize,r=e+n,x=new Float32Array(o.renderInstructions),u=x.length/r,i=4*u*(n+t),f=new Uint32Array(6*u),s=new Float32Array(i);let l;for(let t=0;t0?h=i+(n-1)*r:c&&(h=o-r);let p=null;n{const e=t.data;if(e.type===g){const i=e.projectionTransform;this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,(0,_.T9)(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}})),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[(0,y.KT)(a,s.A.ADDFEATURE,this.handleSourceFeatureAdded_,this),(0,y.KT)(a,s.A.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),(0,y.KT)(a,s.A.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),(0,y.KT)(a,s.A.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature((t=>{this.featureCache_[(0,v.v6)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new c(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[(0,v.v6)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[(0,v.v6)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[(0,v.v6)(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,s]=function(t,e){const i=t.viewState.projection,n=e.getSource().getWrapX()&&i.canWrapX(),s=i.getExtent(),r=t.extent,o=n?(0,p.RG)(s):null,a=n?Math.ceil((r[2]-s[2])/o)+1:1;return[n?Math.floor((r[0]-s[0])/o):0,a,o]}(t,this.getLayer());return this.renderWorlds(t,!1,i,n,s),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),s=t.viewState,o=!t.viewHints[r.A.ANIMATING]&&!t.viewHints[r.A.INTERACTING],a=!(0,p.aI)(this.previousExtent_,t.extent),l=this.sourceRevision_ 0) {\n if (gl_FragColor.a < 0.05) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}getStrokeVertexShader(){return this.hasStroke_?`${C}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute float a_index;\nattribute vec2 a_segmentStart;\nattribute vec2 a_segmentEnd;\nattribute float a_parameters;\nattribute float a_distance;\nattribute vec2 a_joinAngles;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvec2 worldToPx(vec2 worldPos) {\n vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvec4 pxToScreen(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return vec4(screenPos, u_depth, 1.0);\n}\n\nbool isCap(float joinAngle) {\n return joinAngle < -0.1;\n}\n\nvec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) {\n float halfAngle = joinAngle / 2.0;\n float c = cos(halfAngle);\n float s = sin(halfAngle);\n vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y);\n float length = 1.0 / s;\n return angleBisectorNormal * length;\n}\n\nvec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) {\n // if on a cap or the join angle is too high, offset the line along the segment normal\n if (cos(joinAngle) > 0.998 || isCap(joinAngle)) {\n return point - normal * offsetPx;\n }\n // offset is applied along the inverted normal (positive offset goes "right" relative to line direction)\n return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx;\n}\n\nvoid main(void) {\n v_angleStart = a_joinAngles.x;\n v_angleEnd = a_joinAngles.y;\n float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5);\n // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45)\n float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters);\n\n float lineWidth = ${this.strokeWidthExpression_};\n float lineOffsetPx = ${this.strokeOffsetExpression_};\n\n // compute segment start/end in px with offset\n vec2 segmentStartPx = worldToPx(a_segmentStart);\n vec2 segmentEndPx = worldToPx(a_segmentEnd);\n vec2 tangentPx = normalize(segmentEndPx - segmentStartPx);\n vec2 normalPx = vec2(-tangentPx.y, tangentPx.x);\n segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx),\n segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx);\n \n // compute current vertex position\n float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0;\n float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0;\n float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd;\n vec2 joinDirection;\n vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx;\n // if angle is too high, do not make a proper join\n if (cos(angle) > 0.985 || isCap(angle)) {\n joinDirection = normalPx * normalDir - tangentPx * tangentDir;\n } else {\n joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle);\n }\n positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing\n gl_Position = pxToScreen(positionPx);\n\n v_segmentStart = segmentStartPx;\n v_segmentEnd = segmentEndPx;\n v_width = lineWidth;\n v_prop_hitColor = a_prop_hitColor;\n v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum);\n${this.varyings_.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${C}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\n\nvec2 pxToWorld(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nbool isCap(float joinAngle) {\n return joinAngle < -0.1;\n}\n\nfloat segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n vec2 tangent = normalize(end - start);\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 startToPoint = point - start;\n return abs(dot(startToPoint, normal)) - width * 0.5;\n}\n\nfloat buttCapDistanceField(vec2 point, vec2 start, vec2 end) {\n vec2 startToPoint = point - start;\n vec2 tangent = normalize(end - start);\n return dot(startToPoint, -tangent);\n}\n\nfloat squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n return buttCapDistanceField(point, start, end) - width * 0.5;\n}\n\nfloat roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment\n return length(point - start) - width * 0.5 - onSegment;\n}\n\nfloat roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n return roundCapDistanceField(point, start, end, width);\n}\n\nfloat bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n vec2 startToPoint = point - start;\n vec2 tangent = normalize(end - start);\n float c = cos(joinAngle * 0.5);\n float s = sin(joinAngle * 0.5);\n float direction = -sign(sin(joinAngle));\n vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y);\n float radius = width * 0.5 * s;\n return dot(startToPoint, bisector * direction) - radius;\n}\n\nfloat miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n if (cos(joinAngle) > 0.985) { // avoid risking a division by zero\n return bevelJoinField(point, start, end, width, joinAngle);\n }\n float miterLength = 1. / sin(joinAngle * 0.5);\n float miterLimit = ${this.strokeMiterLimitExpression_};\n if (miterLength > miterLimit) {\n return bevelJoinField(point, start, end, width, joinAngle);\n }\n return -1000.;\n}\n\nfloat capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {\n if (capType == ${(0,A.Tl)("butt")}) {\n return buttCapDistanceField(point, start, end);\n } else if (capType == ${(0,A.Tl)("square")}) {\n return squareCapDistanceField(point, start, end, width);\n }\n return roundCapDistanceField(point, start, end, width);\n}\n\nfloat joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {\n if (joinType == ${(0,A.Tl)("bevel")}) {\n return bevelJoinField(point, start, end, width, joinAngle);\n } else if (joinType == ${(0,A.Tl)("miter")}) {\n return miterJoinDistanceField(point, start, end, width, joinAngle);\n }\n return roundJoinDistanceField(point, start, end, width);\n}\n\nfloat computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) {\n if (isCap(joinAngle)) {\n return capDistanceField(point, start, end, width, capType);\n }\n return joinDistanceField(point, start, end, width, joinAngle, joinType);\n}\n\nvoid main(void) {\n vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio;\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n vec2 worldPos = pxToWorld(currentPoint);\n if (\n abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n worldPos[0] < u_renderExtent[0] ||\n worldPos[1] < u_renderExtent[1] ||\n worldPos[0] > u_renderExtent[2] ||\n worldPos[1] > u_renderExtent[3]\n )\n ) {\n discard;\n }\n #endif\n if (${this.discardExpression_}) { discard; }\n\n float segmentLength = length(v_segmentEnd - v_segmentStart);\n vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength;\n vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x);\n vec2 startToPoint = currentPoint - v_segmentStart;\n float currentLengthPx = max(0., min(dot(segmentTangent, startToPoint), segmentLength)) + v_distanceOffsetPx; \n float currentRadiusPx = abs(dot(segmentNormal, startToPoint));\n float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width;\n vec4 color = ${this.strokeColorExpression_} * u_globalAlpha;\n float capType = ${this.strokeCapExpression_};\n float joinType = ${this.strokeJoinExpression_};\n float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType);\n float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType);\n float distance = max(\n segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width),\n max(segmentStartDistance, segmentEndDistance)\n );\n distance = max(distance, ${this.strokeDistanceFieldExpression_});\n gl_FragColor = color * smoothstep(0.5, -0.5, distance);\n if (u_hitDetection > 0) {\n if (gl_FragColor.a < 0.1) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}getFillVertexShader(){return this.hasFill_?`${C}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0);\n v_prop_hitColor = a_prop_hitColor;\n${this.varyings_.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getFillFragmentShader(){return this.hasFill_?`${C}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\nvec2 pxToWorld(vec2 pxPos) {\n vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nvec2 worldToPx(vec2 worldPos) {\n vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvoid main(void) {\n vec2 pxPos = gl_FragCoord.xy / u_pixelRatio;\n vec2 pxOrigin = worldToPx(u_patternOrigin);\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n vec2 worldPos = pxToWorld(pxPos);\n if (\n abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n worldPos[0] < u_renderExtent[0] ||\n worldPos[1] < u_renderExtent[1] ||\n worldPos[0] > u_renderExtent[2] ||\n worldPos[1] > u_renderExtent[3]\n )\n ) {\n discard;\n }\n #endif\n if (${this.discardExpression_}) { discard; }\n gl_FragColor = ${this.fillColorExpression_} * u_globalAlpha;\n if (u_hitDetection > 0) {\n if (gl_FragColor.a < 0.1) { discard; };\n gl_FragColor = v_prop_hitColor;\n }\n}`:null}}var M=i(1597),F=i(8711);const D="blur",O="gradient",k="radius",N=["#00f","#0ff","#0f0","#ff0","#f00"];class G extends n.A{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(O,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:N),this.setBlur(void 0!==t.blur?t.blur:15),this.setRadius(void 0!==t.radius?t.radius:8);const i=t.weight?t.weight:"weight";this.weightFunction_="string"==typeof i?t=>t.get(i):i,this.setRenderOrder(null)}getBlur(){return this.get(D)}getGradient(){return this.get(O)}getRadius(){return this.get(k)}handleGradientChanged_(){this.gradient_=function(t){const e=(0,F.Y)(1,256),i=e.createLinearGradient(0,0,1,256),n=1/(t.length-1);for(let e=0,s=t.length;e{const e=this.weightFunction_(t);return void 0!==e?(0,M.qE)(e,0,1):1}}],uniforms:{u_size:()=>2*(this.get(k)+this.get(D)),u_blurSlope:()=>this.get(k)/Math.max(1,this.get(D))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}const z=G},8044:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(764);class s extends n.A{constructor(t){super(t=t||{})}}const r=s;var o=i(6769),a=i(6141),l=i(2703),h=i(9703),c=i(915),u=i(3407);class d extends o.A{constructor(t){super(t),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,n=t.viewState,s=n.resolution,r=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(void 0!==e.extent&&(h=(0,c._N)(h,(0,u.SD)(e.extent,n.projection))),!o[l.A.ANIMATING]&&!o[l.A.INTERACTING]&&!(0,c.Im)(h))if(r){const t=n.projection,e=r.getImage(h,s,i,t);e&&(this.loadImage(e)?this.image=e:e.getState()===a.A.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=(0,h.Bb)(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!(0,c.Ym)(s,n))return null;const r=this.image.getExtent(),o=this.image.getImage(),a=(0,c.RG)(r),l=Math.floor(o.width*((n[0]-r[0])/a));if(l<0||l>=o.width)return null;const u=(0,c.Oq)(r),d=Math.floor(o.height*((r[3]-n[1])/u));return d<0||d>=o.height?null:this.getImageData(o,l,d)}renderFrame(t,e){const i=this.image,n=i.getExtent(),s=i.getResolution(),[r,o]=Array.isArray(s)?s:[s,s],a=i.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],d=t.pixelRatio,g=t.viewState,_=g.center,f=g.resolution,p=d*r/(f*a),m=d*o/(f*a);this.prepareContainer(t,e);const x=this.context.canvas.width,v=this.context.canvas.height,y=this.getRenderContext(t);let E=!1,T=!0;if(l.extent){const e=(0,u.SD)(l.extent,g.projection);T=(0,c.HY)(e,t.extent),E=T&&!(0,c.ms)(e,t.extent),E&&this.clipUnrotated(y,t,e)}const A=i.getImage(),C=(0,h.Zz)(this.tempTransform,x/2,v/2,p,m,0,a*(n[0]-_[0])/r,a*(_[1]-n[3])/o);this.renderedResolution=o*d/a;const S=A.width*C[0],R=A.height*C[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,t),T&&S>=.5&&R>=.5){const t=C[4],e=C[5],i=l.opacity;1!==i&&(y.save(),y.globalAlpha=i),y.drawImage(A,0,0,+A.width,+A.height,t,e,S,R),1!==i&&y.restore()}return this.postRender(this.context,t),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}const g=d,_=class extends r{constructor(t){super(t)}createRenderer(){return new g(this)}getData(t){return super.getData(t)}}},764:(t,e,i)=>{i.d(e,{A:()=>g,l:()=>d});var n=i(8620),s=i(6837),r=i(5332),o=i(3984),a=i(3568),l=i(588),h=i(915),c=i(9438);class u extends n.A{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(r.A.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(r.A.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&((0,c.JH)(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=(0,c.KT)(t,s.A.CHANGE,this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout((()=>{this.dispatchEvent("sourceready")}),0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const i=this.getMapInternal();let n;!t&&i&&(t=i.getView()),e=t instanceof a.Ay?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray()),n=e.layerStatesArray?e.layerStatesArray.find((t=>t.layer===this)):this.getLayerState();const s=this.getExtent();return d(n,e.viewState)&&(!s||(0,h.HY)(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];let i=e(t instanceof a.Ay?t.getViewStateAndExtent():t);return Array.isArray(i)||(i=[i]),i}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(r.A.MAP,t)}getMapInternal(){return this.get(r.A.MAP)}setMap(t){this.mapPrecomposeKey_&&((0,c.JH)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&((0,c.JH)(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=(0,c.KT)(t,o.A.PRECOMPOSE,(t=>{const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);(0,l.v)(!e.some((function(t){return t.layer===i.layer})),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)})),this.mapRenderKey_=(0,c.KT)(this,s.A.CHANGE,t.render,t),this.changed())}setSource(t){this.set(r.A.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function d(t,e){if(!t.visible)return!1;const i=e.resolution;if(i=t.maxResolution)return!1;const n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const g=u},5332:(t,e,i)=>{i.d(e,{A:()=>n});const n={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"}},945:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(2808),s=i(4029);class r extends n.A{constructor(t){super(t)}createRenderer(){return new s.A(this,{cacheSize:this.getCacheSize()})}}const o=r},5360:(t,e,i)=>{i.d(e,{A:()=>n});const n={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"}},2757:(t,e,i)=>{i.d(e,{A:()=>y});var n=i(2284),s=i(136),r=i(6769),o=i(7343),a=i(3984),l=i(2703),h=i(3663),c=i(915),u=i(8711),d=i(3608),g=i(6514),_=i(3407),f=i(4087),p=i(6933);class m extends r.A{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=(0,c.S5)(),this.wrappedRenderedExtent_=(0,c.S5)(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,s=e.viewState,r=s.center,a=s.resolution,h=s.projection,u=s.rotation,d=h.getExtent(),g=this.getLayer().getSource(),_=this.getLayer().getDeclutter(),f=e.pixelRatio,p=e.viewHints,m=!(p[l.A.ANIMATING]||p[l.A.INTERACTING]),x=this.context,v=Math.round((0,c.RG)(n)/a*f),y=Math.round((0,c.Oq)(n)/a*f),E=g.getWrapX()&&h.canWrapX(),T=E?(0,c.RG)(d):null,A=E?Math.ceil((n[2]-d[2])/T)+1:1;let C=E?Math.floor((n[0]-d[0])/T):0;do{let n=this.getRenderTransform(r,a,0,f,v,y,C*T);e.declutter&&(n=n.slice(0)),t.execute(x,[x.canvas.width,x.canvas.height],n,u,m,void 0===i?o.y2:i?o.$i:o.x$,i?_&&e.declutter[_]:void 0)}while(++C{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,s=this.renderedProjection_,r=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*h.tF,u=t[1]*h.tF;a.push(this.getRenderTransform(e,i,n,h.tF,l,u,0).slice());const g=o.getSource(),f=s.getExtent();if(g.getWrapX()&&s.canWrapX()&&!(0,c.ms)(f,r)){let t=r[0];const s=(0,c.RG)(f);let o,d=0;for(;tf[2];)++d,o=s*d,a.push(this.getRenderTransform(e,i,n,h.tF,l,u,o).slice()),t-=s}const p=(0,_.Tf)();this.hitDetectionImageData_=(0,h._7)(t,a,this.renderedFeatures_,o.getStyleFunction(),r,i,n,(0,d.j)(i,this.renderedPixelRatio_),p?s:null)}e((0,h.F8)(t,this.renderedFeatures_,this.hitDetectionImageData_))}))}forEachFeatureAtCoordinate(t,e,i,n,s){if(!this.replayGroup_)return;const r=e.viewState.resolution,o=e.viewState.rotation,a=this.getLayer(),l={},h=function(t,e,i){const r=(0,f.v6)(t),o=l[r];if(o){if(!0!==o&&ic=n.forEachFeatureAtCoordinate(t,r,o,i,h,d&&e.declutter[d]?e.declutter[d].all().map((t=>t.value)):null))),c}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[l.A.ANIMATING],r=t.viewHints[l.A.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const u=t.extent,f=t.viewState,m=f.projection,x=f.resolution,v=t.pixelRatio,y=e.getRevision(),E=e.getRenderBuffer();let T=e.getRenderOrder();void 0===T&&(T=d.Eo);const A=f.center.slice(),C=(0,c.r)(u,E*x),S=C.slice(),R=[C.slice()],w=m.getExtent();if(i.getWrapX()&&m.canWrapX()&&!(0,c.ms)(w,t.extent)){const t=(0,c.RG)(w),e=Math.max((0,c.RG)(C)/2,t);C[0]=w[0]-e,C[2]=w[2]+e,(0,p.Li)(A,m);const i=(0,c.Li)(R[0],m);i[0]w[0]&&i[2]>w[2]&&R.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==x&&this.renderedRevision_==y&&this.renderedRenderOrder_==T&&this.renderedFrameDeclutter_===!!t.declutter&&(0,c.ms)(this.wrappedRenderedExtent_,C))return(0,g.aI)(this.renderedExtent_,S)||(this.hitDetectionImageData_=null,this.renderedExtent_=S),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const b=new s.A((0,d.gY)(x,v),C,x,v),I=(0,_.Tf)();let L;if(I){for(let t=0,e=R.length;t{let n;const s=t.getStyleFunction()||e.getStyleFunction();if(s&&(n=s(t,x)),n){const e=this.renderFeature(t,P,n,b,L,this.getLayer().getDeclutter(),i);M=M&&!e}},D=(0,_.JR)(C,m),O=i.getFeaturesInExtent(D);T&&O.sort(T);for(let t=0,e=O.length;t{i.d(e,{A:()=>S});var n=i(2284),s=i(136),r=i(7343),o=i(4029),a=i(1078),l=i(2703),h=i(808),c=i(3663),u=i(9703),d=i(6514),g=i(915),_=i(3608),f=i(4087),p=i(4401),m=i(6933);const x={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},v={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class y extends o.A{constructor(t,e){super(t,e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=(0,u.vt)(),this.tileClipContexts_=null}drawTile(t,e,i,n,s,r,o,a){this.updateExecutorGroup_(t,e.pixelRatio,e.viewState.projection),this.tileImageNeedsRender_(t)&&this.renderTileImage_(t,e),super.drawTile(t,e,i,n,s,r,o,a)}getTile(t,e,i,n){const s=this.getOrCreateTile(t,e,i,n);if(!s)return null;const r=n.viewState.resolution,o=n.viewHints;return!(!o[l.A.ANIMATING]&&!o[l.A.INTERACTING])&&s.wantedResolution||(s.wantedResolution=r),s}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,i){const n=this.getLayer(),o=n.getRevision(),l=n.getRenderOrder()||null,h=t.wantedResolution,c=t.getReplayState(n);if(!c.dirty&&c.renderedResolution===h&&c.renderedRevision==o&&c.renderedRenderOrder==l)return;const u=n.getSource(),d=!!n.getDeclutter(),p=u.getTileGrid(),m=u.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),x=u.getSourceTiles(e,i,t),v=(0,f.v6)(n);delete t.hitDetectionImageData[v],t.executorGroups[v]=[],c.dirty=!1;for(let i=0,o=x.length;i{const s=x?e.declutter[x].all().map((t=>t.value)):null;for(let e=0,a=n.length;e{const n=this.getLayer(),s=(0,f.v6)(n),r=n.getSource(),o=this.renderedProjection,l=o.getExtent(),h=this.renderedResolution,d=r.getTileGridForProjection(o),_=(0,u.Bb)(this.renderedPixelToCoordinateTransform_,t.slice()),x=d.getTileCoordForCoordAndResolution(_,h);let v;for(let t=0,e=this.renderedTiles.length;t0)return void e([]);const y=d.getTileCoordExtent(v.wrappedTileCoord),E=(0,g.Py)(y),T=[(_[0]-E[0])/h,(E[1]-_[1])/h],A=v.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]);let C=v.hitDetectionImageData[s];if(!C){const t=(0,p.xq)(d.getTileSize(d.getZForResolution(h,r.zDirection))),e=this.renderedRotation_,i=[this.getRenderTransform(d.getTileCoordCenter(v.wrappedTileCoord),h,0,c.tF,t[0]*c.tF,t[1]*c.tF,0)];C=(0,c._7)(t,i,A,n.getStyleFunction(),d.getTileCoordExtent(v.wrappedTileCoord),v.getReplayState(n).renderedResolution,e),v.hitDetectionImageData[s]=C}e((0,c.F8)(T,A,C))}))}getFeaturesInExtent(t){const e=[],i=this.getTileCache();if(0===i.getCount())return e;const n=this.getLayer().getSource().tileGrid,s=n.getZForResolution(this.renderedResolution);return i.forEach((i=>{if(i.tileCoord[0]!==s||i.getState()!==a.A.LOADED)return;const r=i.getSourceTiles();for(let i=0,s=r.length;i=0;--e)n[e].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(i,t),t.viewState.rotation,o,r.$i,s?t.declutter[s]:void 0)}i.globalAlpha=n}renderDeferredInternal(t){const e=this.renderedTiles.reduce(((t,e,i)=>(e.executorGroups[(0,f.v6)(this.getLayer())].forEach((e=>t.push({executorGroup:e,index:i}))),t)),[]),i=e.map((({executorGroup:t})=>t.getDeferredZIndexContexts())),n={};for(let t=0,i=e.length;t{i.forEach(((i,n)=>{i[t]&&(i[t].forEach((t=>{const{executorGroup:i,index:s}=e[n],r=i.getRenderedContext(),o=r.globalAlpha;r.globalAlpha=this.renderedOpacity_;const a=this.tileClipContexts_[s];a&&a.draw(r),t.draw(r),a&&r.restore(),r.globalAlpha=o,t.clear()})),i[t].length=0)}))}))}getTileRenderTransform(t,e){const i=e.pixelRatio,n=e.viewState,s=n.center,r=n.resolution,o=n.rotation,a=e.size,l=Math.round(a[0]*i),h=Math.round(a[1]*i),c=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,g=c.getTileCoordExtent(t.wrappedTileCoord),_=c.getTileCoordExtent(d,this.tempExtent)[0]-g[0];return(0,u.lw)((0,u.hs)(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,r,o,i,l,h,_))}postRender(t,e){const i=e.viewHints,n=!(i[l.A.ANIMATING]||i[l.A.INTERACTING]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const c=s.getDeclutter(),u=c?v[o].filter((t=>!r.$i.includes(t))):v[o],d=e.viewState,_=d.rotation,p=s.getSource(),m=p.getTileGridForProjection(d.projection).getZForResolution(d.resolution,p.zDirection),x=this.renderedTiles,y=[],E=[],T=[];let A=!0;for(let i=x.length-1;i>=0;--i){const r=x[i];A=A&&!r.getReplayState(s).dirty;const o=r.executorGroups[(0,f.v6)(s)].filter((t=>t.hasExecutors(u)));if(0===o.length)continue;const a=this.getTileRenderTransform(r,e),l=r.tileCoord[0];let d=!1;const p=o[0].getClipCoords(a);let v,C=t;if(p){v=new h.A,C=v.getContext();for(let t=0,e=y.length;t{i.d(e,{A:()=>u});var n=i(2808),s=i(5332),r=i(2323),o=i(9825),a=i(5516);function l(t,e,i){const n=(0,o.SR)();return(0,a.nR)(e,i,n,t)}function h(t,e){const i=`\n attribute vec2 ${r.eS.TEXTURE_COORD};\n uniform mat4 ${r.gF.TILE_TRANSFORM};\n uniform float ${r.gF.TEXTURE_PIXEL_WIDTH};\n uniform float ${r.gF.TEXTURE_PIXEL_HEIGHT};\n uniform float ${r.gF.TEXTURE_RESOLUTION};\n uniform float ${r.gF.TEXTURE_ORIGIN_X};\n uniform float ${r.gF.TEXTURE_ORIGIN_Y};\n uniform float ${r.gF.DEPTH};\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ${r.eS.TEXTURE_COORD};\n v_mapCoord = vec2(\n ${r.gF.TEXTURE_ORIGIN_X} + ${r.gF.TEXTURE_RESOLUTION} * ${r.gF.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],\n ${r.gF.TEXTURE_ORIGIN_Y} - ${r.gF.TEXTURE_RESOLUTION} * ${r.gF.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]\n );\n gl_Position = ${r.gF.TILE_TRANSFORM} * vec4(${r.eS.TEXTURE_COORD}, ${r.gF.DEPTH}, 1.0);\n }\n `,n={...(0,a.z0)(),inFragmentShader:!0,bandCount:e,style:t},s=[];if(void 0!==t.color){const e=l(n,t.color,o.mE);s.push(`color = ${e};`)}if(void 0!==t.contrast){const e=l(n,t.contrast,o.wl);s.push(`color.rgb = clamp((${e} + 1.0) * color.rgb - (${e} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.exposure){const e=l(n,t.exposure,o.wl);s.push(`color.rgb = clamp((${e} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.saturation){const e=l(n,t.saturation,o.wl);s.push(`\n float saturation = ${e} + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n `)}if(void 0!==t.gamma){const e=l(n,t.gamma,o.wl);s.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${e}));`)}if(void 0!==t.brightness){const e=l(n,t.brightness,o.wl);s.push(`color.rgb = clamp(color.rgb + ${e}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const h={},c=Object.keys(n.variables).length;if(c>1&&!t.variables)throw new Error(`Missing variables in style (expected ${n.variables})`);for(let e=0;e ${r.gF.RENDER_EXTENT}[2] ||\n v_mapCoord[1] > ${r.gF.RENDER_EXTENT}[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(${r.gF.TILE_TEXTURE_ARRAY}[0], v_textureCoord);\n\n ${s.join("\n")}\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ${r.gF.TRANSITION_ALPHA};\n }`,uniforms:h,paletteTextures:n.paletteTextures}}class c extends n.A{constructor(t){const e=(t=t?Object.assign({},t):{}).style||{};delete t.style,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.styleVariables_=this.style_.variables||{},this.addChangeListener(s.A.SOURCE,this.handleSourceUpdate_)}getSources(t,e){const i=this.getSource();return this.sources_?"function"==typeof this.sources_?this.sources_(t,e):this.sources_:i?[i]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const t=this.getRenderSource();return t?t.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache(),this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4}createRenderer(){const t=h(this.style_,this.getSourceBandCount_());return new r.Ay(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(t,e){const i=this.getRenderer();let n;for(let s=0,r=e.length;s{"ready"==e.getState()&&(e.removeEventListener("change",t),this.changed())};e.addEventListener("change",t)}s=s&&"ready"==i}const r=this.renderSources(t,n);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=i.resolution,r;if(this.renderedResolution_>.5*i.resolution){const e=this.getSources(t.extent,this.renderedResolution_).filter((t=>!n.includes(t)));if(e.length>0)return this.renderSources(t,e)}return r}setStyle(t){if(this.styleVariables_=t.variables||{},this.style_=t,this.hasRenderer()){const t=h(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures}),this.changed()}}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}c.prototype.dispose;const u=c},1597:(t,e,i)=>{function n(t,e,i){return Math.min(Math.max(t,e),i)}function s(t,e,i,n,s,o){const a=s-i,l=o-n;if(0!==a||0!==l){const r=((t-i)*a+(e-n)*l)/(a*a+l*l);r>1?(i=s,n=o):r>0&&(i+=a*r,n+=l*r)}return r(t,e,i,n)}function r(t,e,i,n){const s=i-t,r=n-e;return s*s+r*r}function o(t){const e=t.length;for(let i=0;is&&(s=e,n=r)}if(0===s)return null;const r=t[n];t[n]=t[i],t[i]=r;for(let n=i+1;n=0;n--){i[n]=t[n][e]/t[n][n];for(let s=n-1;s>=0;s--)t[s][e]-=t[s][n]*i[n]}return i}function a(t){return 180*t/Math.PI}function l(t){return t*Math.PI/180}function h(t,e){const i=t%e;return i*e<0?i+e:i}function c(t,e,i){return t+i*(e-t)}function u(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function d(t,e){return Math.round(u(t,e))}function g(t,e){return Math.floor(u(t,e))}function _(t,e){return Math.ceil(u(t,e))}i.d(e,{Cc:()=>c,KU:()=>o,LI:()=>d,Mg:()=>u,Q1:()=>s,RI:()=>g,eh:()=>l,hG:()=>r,mk:()=>_,qE:()=>n,xP:()=>h,xW:()=>a})},3530:(t,e,i)=>{function n(t){for(const e in t)delete t[e]}function s(t){let e;for(e in t)return!1;return!e}i.d(e,{I:()=>n,p:()=>s})},613:(t,e,i)=>{i.d(e,{A:()=>n});const n={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},3407:(t,e,i)=>{i.d(e,{Ig:()=>f.I,MF:()=>n.A,hB:()=>F,O3:()=>L,bF:()=>w,Av:()=>P,wU:()=>H,RJ:()=>C,tI:()=>k,Rb:()=>D,Ad:()=>W,SD:()=>Z,Jt:()=>b,hO:()=>I,RG:()=>G,FO:()=>N,Tf:()=>U,R6:()=>R,WP:()=>O,te:()=>X,JR:()=>Y,vN:()=>V,pd:()=>z,DI:()=>j});var n=i(5286);const s=6378137,r=Math.PI*s,o=[-r,-r,r,r],a=[-180,-85,180,85],l=s*Math.log(Math.tan(Math.PI/2));class h extends n.A{constructor(t){super({code:t,units:"m",extent:o,global:!0,worldExtent:a,getPointResolution:function(t,e){return t/Math.cosh(e[1]/s)}})}}const c=[new h("EPSG:3857"),new h("EPSG:102100"),new h("EPSG:102113"),new h("EPSG:900913"),new h("http://www.opengis.net/def/crs/EPSG/0/3857"),new h("http://www.opengis.net/gml/srs/epsg.xml#3857")];const u=[-180,-90,180,90],d=6378137*Math.PI/180;class g extends n.A{constructor(t,e){super({code:t,units:"degrees",extent:u,axisOrientation:e,global:!0,metersPerUnit:d,worldExtent:u})}}const _=[new g("CRS:84"),new g("EPSG:4326","neu"),new g("urn:ogc:def:crs:OGC:1.3:CRS84"),new g("urn:ogc:def:crs:OGC:2:84"),new g("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new g("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new g("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var f=i(8100);let p={};var m=i(3158),x=i(915),v=i(1597),y=i(6933),E=i(2490),T=i(4422);let A=!0;function C(t){A=!(void 0===t||t)}function S(t,e){if(void 0!==e)for(let i=0,n=t.length;i=o?e[r+t]:s[t]}return i}}function F(t,e,i,n){const s=b(t),r=b(e);(0,m.WQ)(s,r,M(i)),(0,m.WQ)(r,s,M(n))}function D(t,e){return C(),z(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function O(t,e){const i=z(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=(0,v.xP)(n+180,360)-180),i}function k(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||N(t,e)===S)&&i}function N(t,e){const i=t.getCode(),n=e.getCode();let s=(0,m.Jt)(i,n);return s||(s=R),s}function G(t,e){return N(b(t),b(e))}function z(t,e,i){return G(e,i)(t,void 0,t.length)}function j(t,e,i,n){const s=G(e,i);return(0,x.NW)(t,s,void 0,n)}let B=null;function U(){return B}function X(t,e){return B?z(t,e,B):t}function W(t,e){return B?z(t,B,e):(A&&!(0,y.aI)(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(A=!1,(0,T.R8)("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Y(t,e){return B?j(t,e,B):t}function Z(t,e){return B?j(t,B,e):t}function V(t,e){if(!B)return t;const i=b(e).getMetersPerUnit(),n=B.getMetersPerUnit();return i&&n?t*i/n:t}function H(t,e,i){return function(n){let s,r;if(t.canWrapX()){const e=t.getExtent(),o=(0,x.RG)(e);n=n.slice(0),r=(0,y.U$)(n,t,o),r&&(n[0]=n[0]-r*o),n[0]=(0,v.qE)(n[0],e[0],e[2]),n[1]=(0,v.qE)(n[1],e[1],e[3]),s=i(n)}else s=i(n);return r&&e.canWrapX()&&(s[0]+=r*(0,x.RG)(e.getExtent())),s}}var K,q,$;L(c),L(_),K=c,q=function(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let o=0;ol?i=l:i<-l&&(i=-l),e[o+1]=i}return e},$=function(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let o=0;o{i.d(e,{A:()=>s});var n=i(8100);const s=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||n.I[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}},8100:(t,e,i)=>{i.d(e,{I:()=>r,q:()=>s});const n={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function s(t){return n[t]}const r={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937}},3158:(t,e,i)=>{i.d(e,{Jt:()=>r,WQ:()=>s});let n={};function s(t,e,i){const s=t.getCode(),r=e.getCode();s in n||(n[s]={}),n[s][r]=i}function r(t,e){let i;return t in n&&e in n[t]&&(i=n[t][e]),i}},7331:(t,e,i)=>{i.d(e,{r2:()=>a});var n=i(2236),s=i(9703),r=i(3608),o=i(3407);function a(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const e=t.inversePixelTransform[0],i=t.inversePixelTransform[1],a=Math.sqrt(e*e+i*i),l=t.frameState,h=(0,s.lw)(t.inversePixelTransform.slice(),l.coordinateToPixelTransform),c=(0,r.j)(l.viewState.resolution,a);let u;const d=(0,o.Tf)();return d&&(u=(0,o.FO)(d,l.viewState.projection)),new n.A(t.context,a,l.extent,h,l.viewState.rotation,c,u)}},9960:(t,e,i)=>{i.d(e,{A:()=>r});var n=i(1685);class s extends n.Ay{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const r=s},3984:(t,e,i)=>{i.d(e,{A:()=>n});const n={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}},4778:(t,e,i)=>{i.d(e,{Ay:()=>p});var n=i(9703),s=i(915),r=i(3671),o=i(6514),a=i(2616),l=i(3407),h=i(3402),c=i(9969),u=i(4049),d=i(4238),g=i(7622);const _=(0,n.vt)();class f{constructor(t,e,i,n,s,r){this.styleFunction,this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?(0,s.dP)(this.flatCoordinates_):(0,s.Vy)(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=(0,s.q1)(this.getExtent());this.flatInteriorPoints_=(0,a.J)(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=(0,h.yJ)(this.flatCoordinates_,this.ends_),e=(0,u.C)(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=(0,a.p)(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=(0,c.SH)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let n=0,s=i.length;n{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=(0,r.P4)(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=(0,r.AL)(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=(0,r.Hg)(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n)}return n&&(this.simplifiedGeometry_=new f(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_})),this}}f.prototype.getFlatCoordinates=f.prototype.getOrientedFlatCoordinates;const p=f},2826:(t,e,i)=>{i.d(e,{A:()=>n});const n=class{drawCustom(t,e,i,n,s){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}},8774:(t,e,i)=>{i.d(e,{Jw:()=>L,M8:()=>m,MY:()=>p,NT:()=>f,Oq:()=>u,TA:()=>b,Tq:()=>x,ZV:()=>l,_K:()=>g,_m:()=>c,aq:()=>v,eL:()=>_,fZ:()=>C,jT:()=>I,qY:()=>h,vk:()=>d,yY:()=>y});var n=i(4120),s=i(7771),r=i(3530),o=i(8711),a=i(5176);const l="10px sans-serif",h="#000",c="round",u=[],d=0,g="round",_=10,f="#000",p="center",m="middle",x=[0,0,0,0],v=1,y=new n.A;let E,T=null;const A={},C=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let s,o;function l(s,r,a){let l=!0;for(let h=0;hMath.max(e,w(t,i))),0);return i[e]=n,n}function I(t,e){const i=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=e.length;h<=c;h+=2){const u=e[h];if("\n"===u||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=e[h+1]||t.font,g=w(d,u);i.push(g),o+=g;const _=S(d);n.push(_),l=Math.max(l,_)}return{width:r,height:a,widths:i,heights:n,lineWidths:s}}function L(t,e,i,n,s,r,o,a,l,h,c){t.save(),1!==i&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=i:t.globalAlpha*=i),e&&t.transform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(c[0],c[1]),function(t,e){const i=t.contextInstructions;for(let t=0,n=i.length;t{i.d(e,{A:()=>d});var n=i(6429),s=i(1580),r=i(2826),o=i(7295),a=i(915),l=i(8774),h=i(6514),c=i(6361);class u extends r.A{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,s=this.coordinates;let r=s.length;for(let o=0,l=t.length;ol&&(this.instructions.push([n.Ay.CUSTOM,l,u,t,i,c.n2,r]),this.hitDetectionInstructions.push([n.Ay.CUSTOM,l,u,t,s||i,c.n2,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),u=this.coordinates.length,this.instructions.push([n.Ay.CUSTOM,l,u,t,i,void 0,r]),this.hitDetectionInstructions.push([n.Ay.CUSTOM,l,u,t,s||i,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[n.Ay.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[n.Ay.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const i=t.length;let s,r,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[n.Ay.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[n.Ay.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,r=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!(0,h.aI)(t.currentLineDash,s)||t.currentLineDashOffset!=r||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=r,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[n.Ay.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(0,a.o8)(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;(0,a.r)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const d=u},136:(t,e,i)=>{i.d(e,{A:()=>p});var n=i(8130),s=i(6429),r=i(915);class o extends n.A{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!(0,r.Ym)(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,l=this.appendFlatPointCoordinates(n,o);this.instructions.push([s.Ay.DRAW_IMAGE,a,l,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([s.Ay.DRAW_IMAGE,a,l,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),o=[];for(let e=0,i=n.length;e{i.d(e,{y2:()=>R,$i:()=>w,x$:()=>b,Ay:()=>L});var n=i(6429),s=i(808),r=i(3624),o=i(9703),a=i(915),l=i(8774),h=i(1597),c=i(7622);function u(t,e,i,n,s,r,o,a,l,u,d,g){let _=t[e],f=t[e+1],p=0,m=0,x=0,v=0;function y(){p=_,m=f,_=t[e+=n],f=t[e+1],v+=x,x=Math.sqrt((_-p)*(_-p)+(f-m)*(f-m))}do{y()}while(et[2]}else I=T>w;const L=Math.PI,P=[],M=C+n===e;let F;if(x=0,v=S,_=t[e=C],f=t[e+1],M){y(),F=Math.atan2(f-m,_-p),I&&(F+=F>0?-L:L);const t=(w+T)/2,e=(b+A)/2;return P[0]=[t,e,(R-r)/2,F,s],P}for(let t=0,c=(s=s.replace(/\n/g," ")).length;t0?-L:L),void 0!==F){let t=g-F;if(t+=t>L?-2*L:t<-L?2*L:0,Math.abs(t)>o)return null}F=g;const T=t;let A=0;for(;t0&&t.push("\n",""),t.push(e,""),t}const A=class{constructor(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=(0,o.vt)(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new s.A:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const o=n?this.strokeStates[n]:null,a=i?this.fillStates[i]:null,h=this.textStates[e],c=this.pixelRatio,u=[h.scale[0]*c,h.scale[1]*c],d=h.justify?r.E[h.justify]:E(Array.isArray(t)?t[0]:t,h.textAlign||l.MY),g=n&&o.lineWidth?o.lineWidth:0,_=Array.isArray(t)?t:String(t).split("\n").reduce(T,[]),{width:f,height:p,widths:m,heights:x,lineWidths:v}=(0,l.jT)(h,_),y=f+g,A=[],C=(y+2)*u[0],S=(p+g)*u[1],R={width:C<0?Math.floor(C):Math.ceil(C),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:A};1==u[0]&&1==u[1]||A.push("scale",u),n&&(A.push("strokeStyle",o.strokeStyle),A.push("lineWidth",g),A.push("lineCap",o.lineCap),A.push("lineJoin",o.lineJoin),A.push("miterLimit",o.miterLimit),A.push("setLineDash",[o.lineDash]),A.push("lineDashOffset",o.lineDashOffset)),i&&A.push("fillStyle",a.fillStyle),A.push("textBaseline","middle"),A.push("textAlign","center");const w=.5-d;let b=d*y+w*g;const I=[],L=[];let P,M=0,F=0,D=0,O=0;for(let t=0,e=_.length;tt?t-c:s,R=r+u>e?e-u:r,w=y[3]+S*g[0]+y[1],b=y[0]+R*g[1]+y[2],I=A-y[3],L=C-y[0];let P;return(E||0!==d)&&(f[0]=I,x[0]=I,f[1]=L,p[1]=L,p[0]=I+w,m[0]=p[0],m[1]=L+b,x[1]=m[1]),0!==d?(P=(0,o.Zz)((0,o.vt)(),i,n,1,1,d,-i,-n),(0,o.Bb)(P,f),(0,o.Bb)(P,p),(0,o.Bb)(P,m),(0,o.Bb)(P,x),(0,a.N)(Math.min(f[0],p[0],m[0],x[0]),Math.min(f[1],p[1],m[1],x[1]),Math.max(f[0],p[0],m[0],x[0]),Math.max(f[1],p[1],m[1],x[1]),_)):(0,a.N)(Math.min(I,I+w),Math.min(L,L+b),Math.max(I,I+w),Math.max(L,L+b),_),v&&(A=Math.round(A),C=Math.round(C)),{drawImageX:A,drawImageY:C,drawImageW:S,drawImageH:R,originX:c,originY:u,declutterBox:{minX:_[0],minY:_[1],maxX:_[2],maxY:_[3],value:T},canvasTransform:P,scale:g}}replayImageOrLabel_(t,e,i,n,s,r,o){const a=!(!r&&!o),h=n.declutterBox,c=o?o[2]*n.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(a&&this.replayTextBackground_(t,f,p,m,x,r,o),(0,l.Jw)(t,n.canvasTransform,s,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=(0,o.Bb)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const s=this.textStates[e],o=this.createLabel(t,e,n,i),a=this.strokeStates[i],h=this.pixelRatio,c=E(Array.isArray(t)?t[0]:t,s.textAlign||l.MY),u=r.E[s.textBaseline||l.M8],d=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:c*(o.width/h-2*s.scale[0])+2*(.5-c)*d,anchorY:u*o.height/h+2*(.5-u)*d}}execute_(t,e,i,s,r,h,_,f){const p=this.zIndexContext_;let m;this.pixelCoordinates_&&(0,d.aI)(i,this.renderedTransform_)?m=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),m=(0,c.Rc)(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),(0,o.k3)(this.renderedTransform_,i));let x=0;const y=s.length;let T,A,C,S,R,w,b,I,L,P,M,F,D,O=0,k=0,N=0,G=null,z=null;const j=this.coordinateCache_,B=this.viewRotation_,U=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,X={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},W=this.instructions!=s||this.overlaps?0:200;let Y,Z,V,H;for(;xW&&(this.fill_(t),k=0),N>W&&(t.stroke(),N=0),k||N||(t.beginPath(),R=NaN,w=NaN),++x;break;case n.Ay.CIRCLE:O=i[1];const s=m[O],o=m[O+1],c=m[O+2]-s,d=m[O+3]-o,y=Math.sqrt(c*c+d*d);t.moveTo(s+y,o),t.arc(s,o,y,0,2*Math.PI,!0),++x;break;case n.Ay.CLOSE_PATH:t.closePath(),++x;break;case n.Ay.CUSTOM:O=i[1],T=i[2];const K=i[3],q=i[4],$=i[5];X.geometry=K,X.feature=Y,x in j||(j[x]=[]);const J=j[x];$?$(m,O,T,2,J):(J[0]=m[O],J[1]=m[O+1],J.length=2),p&&(p.zIndex=i[6]),q(J,X),++x;break;case n.Ay.DRAW_IMAGE:O=i[1],T=i[2],L=i[3],A=i[4],C=i[5];let Q=i[6];const tt=i[7],et=i[8],it=i[9],nt=i[10];let st=i[11];const rt=i[12];let ot=i[13];S=i[14]||"declutter";const at=i[15];if(!L&&i.length>=20){P=i[19],M=i[20],F=i[21],D=i[22];const t=this.drawLabelWithPointPlacement_(P,M,F,D);L=t.label,i[3]=L;const e=i[23];A=(t.anchorX-e)*this.pixelRatio,i[4]=A;const n=i[24];C=(t.anchorY-n)*this.pixelRatio,i[5]=C,Q=L.height,i[6]=Q,ot=L.width,i[13]=ot}let lt,ht,ct,ut;i.length>25&&(lt=i[25]),i.length>17?(ht=i[16],ct=i[17],ut=i[18]):(ht=l.Tq,ct=!1,ut=!1),nt&&U?st+=B:nt||U||(st-=B);let dt=0;for(;O!w.includes(t))),I={},L=class{constructor(t,e,i,n,s,r,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=(0,o.vt)(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);const s=t[i];for(const t in s){const i=s[t];n[t]=new A(this.resolution_,this.pixelRatio_,this.overlaps_,i,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let e=0,n=t.length;ei)break;let a=n[o];a||(a=[],n[o]=a),a.push(4*((t+s)*e+(t+r))+3),s>0&&a.push(4*((t-s)*e+(t+r))+3),r>0&&(a.push(4*((t+s)*e+(t-r))+3),s>0&&a.push(4*((t-s)*e+(t-r))+3))}const s=[];for(let t=0,e=n.length;t0){if(!r||"none"===i||"Image"!==f&&"Text"!==f||r.includes(t)){const i=(_[a]-3)/4,r=n-i%l,o=n-(i/l|0),h=s(t,e,r*r+o*o);if(h)return h}u.clearRect(0,0,l,l);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);let x,v,y,E,T;for(m.sort(d.V_),x=m.length-1;x>=0;--x){const t=m[x].toString();for(y=this.executorsByZIndex_[t],v=R.length-1;v>=0;--v)if(f=R[v],E=y[f],void 0!==E&&(T=E.executeHitDetection(u,h,i,p,g),T))return T}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],r=e[3],o=[i,n,i,r,s,r,s,n];return(0,c.Rc)(o,0,8,2,t,o),o}isEmpty(){return(0,S.p)(this.executorsByZIndex_)}execute(t,e,i,n,s,r,o){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(d.V_),r=r||R;const l=R.length;let h,c,u,g,_;for(o&&a.reverse(),h=0,c=a.length;hd.execute(t,e,i,n,s,o))):d.execute(g,e,i,n,s,o),_&&g.restore(),r){r.offset();const t=a[h]*l+u;this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(r)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(d.V_);for(let i=0,n=e.length;i{t.draw(this.renderedContext_),t.clear()})),t[e[i]].length=0}}},2236:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(2826),s=i(7295),r=i(9703),o=i(8774),a=i(6514),l=i(915),h=i(1597),c=i(7622),u=i(2096);class d extends n.A{constructor(t,e,i,n,s,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?(0,h.Mg)(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=(0,r.vt)()}drawImages_(t,e,i,n){if(!this.image_)return;const s=(0,c.Rc)(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;0===this.transformRotation_&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let t=0,e=s.length;tt*this.pixelRatio_)),lineDashOffset:(r||o.vk)*this.pixelRatio_,lineJoin:void 0!==a?a:o._K,lineWidth:(void 0!==l?l:o.aq)*this.pixelRatio_,miterLimit:void 0!==h?h:o.eL,strokeStyle:(0,s.F)(t||o.NT)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const r=t.getScaleArray();this.imageScale_=[r[0]*this.pixelRatio_/i,r[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:(0,s.F)(t||o.qY)}}else this.textFillState_=null;const i=t.getStroke();if(i){const t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),r=i.getLineDashOffset(),a=i.getLineJoin(),l=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:o._m,lineDash:n||o.Oq,lineDashOffset:r||o.vk,lineJoin:void 0!==a?a:o._K,lineWidth:void 0!==l?l:o.aq,miterLimit:void 0!==h?h:o.eL,strokeStyle:(0,s.F)(t||o.NT)}}else this.textStrokeState_=null;const n=t.getFont(),r=t.getOffsetX(),a=t.getOffsetY(),l=t.getRotateWithView(),h=t.getRotation(),c=t.getScaleArray(),u=t.getText(),d=t.getTextAlign(),g=t.getTextBaseline();this.textState_={font:void 0!==n?n:o.ZV,textAlign:void 0!==d?d:o.MY,textBaseline:void 0!==g?g:o.M8},this.text_=void 0!==u?Array.isArray(u)?u.reduce(((t,e,i)=>t+(i%2?" ":e)),""):u:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==a?this.pixelRatio_*a:0,this.textRotateWithView_=void 0!==l&&l,this.textRotation_=void 0!==h?h:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}else this.text_=""}}const g=d},6429:(t,e,i)=>{i.d(e,{Ay:()=>l,I5:()=>s,VD:()=>r,kx:()=>a,th:()=>o});const n={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},s=[n.FILL],r=[n.STROKE],o=[n.BEGIN_PATH],a=[n.CLOSE_PATH],l=n},3624:(t,e,i)=>{i.d(e,{E:()=>d,A:()=>_});var n=i(8130),s=i(6429),r=i(7295),o=i(8774),a=i(4087),l=i(915),h=i(1597);function c(t,e,i,n,s){const r=[];let o=i,a=0,l=e.slice(i,2);for(;a=t){const e=(t-a+d)/d,g=(0,h.Cc)(i,c,e),_=(0,h.Cc)(n,u,e);l.push(g,_),r.push(l),l=[g,_],a==t&&(o+=s),a=0}else if(a0&&r.push(l),r}function u(t,e,i,n,s){let r,o,a,l,h,c,u,d,g,_,f=i,p=i,m=0,x=0,v=i;for(o=i;ot&&(x>m&&(m=x,f=v,p=o),x=0,v=o-s)),a=l,u=g,d=_),h=i,c=n}return x+=l,x>m?[v,o]:[f,p]}const d={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class g extends n.A{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[o.qY]={fillStyle:o.qY},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const n=this.textFillState_,r=this.textStrokeState_,a=this.textState_;if(""===this.text_||!a||!n&&!r)return;const h=this.coordinates;let d=h.length;const g=t.getType();let _=null,f=t.getStride();if("line"!==a.placement||"LineString"!=g&&"MultiLineString"!=g&&"Polygon"!=g&&"MultiPolygon"!=g){let n=a.overflow?null:[];switch(g){case"Point":case"MultiPoint":_=t.getFlatCoordinates();break;case"LineString":_=t.getFlatMidpoint();break;case"Circle":_=t.getCenter();break;case"MultiLineString":_=t.getFlatMidpoints(),f=2;break;case"Polygon":_=t.getFlatInteriorPoint(),a.overflow||n.push(_[2]/this.resolution),f=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();_=[];for(let t=0,i=e.length;t{const n=h[2*(t+i)]===_[i*f]&&h[2*(t+i)+1]===_[i*f+1];return n||--t,n}))}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&this.updateFillStyle(this.state,this.createFill),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let l=a.padding;if(l!=o.Tq&&(a.scale[0]<0||a.scale[1]<0)){let t=a.padding[0],e=a.padding[1],i=a.padding[2],n=a.padding[3];a.scale[0]<0&&(e=-e,n=-n),a.scale[1]<0&&(t=-t,i=-i),l=[t,e,i,n]}const c=this.pixelRatio;this.instructions.push([s.Ay.DRAW_IMAGE,d,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,l==o.Tq?o.Tq:l.map((function(t){return t*c})),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);const u=1/c,p=this.state.fillStyle;a.backgroundFill&&(this.state.fillStyle=o.qY,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([s.Ay.DRAW_IMAGE,d,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[u,u],NaN,this.declutterMode_,this.declutterImageWithText_,l,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?o.qY:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),a.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}else{if(!(0,l.HY)(this.maxExtent,t.getExtent()))return;let n;if(_=t.getFlatCoordinates(),"LineString"==g)n=[_.length];else if("MultiLineString"==g)n=t.getEnds();else if("Polygon"==g)n=t.getEnds().slice(0,1);else if("MultiPolygon"==g){const e=t.getEndss();n=[];for(let t=0,i=e.length;t{i.d(e,{A:()=>s});var n=i(8711);const s=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy((0,n.lr)(),{get:(t,e)=>{if("function"==typeof(0,n.lr)()[e])return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach((e=>{for(let i=0,n=e.length;i{i.d(e,{F8:()=>d,_7:()=>u,tF:()=>c});var n=i(2236),s=i(9700),r=i(6514),o=i(1597),a=i(8711),l=i(3407),h=i(915);const c=.5;function u(t,e,i,o,u,d,g,_,f){const p=f?(0,l.JR)(u,f):u,m=t[0]*c,x=t[1]*c,v=(0,a.Y)(m,x);v.imageSmoothingEnabled=!1;const y=v.canvas,E=new n.A(v,c,u,null,g,_,f?(0,l.FO)((0,l.Tf)(),f):null),T=i.length,A=Math.floor(16777215/T),C={};for(let t=1;t<=T;++t){const e=i[t-1],n=e.getStyleFunction()||o;if(!n)continue;let r=n(e,d);if(!r)continue;Array.isArray(r)||(r=[r]);const l=(t*A).toString(16).padStart(7,"#00000");for(let t=0,i=r.length;t{i.d(e,{A:()=>l});var n=i(6837),s=i(6141),r=i(1854),o=i(4087);class a extends r.A{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return(0,o.b0)()}getData(t){return null}prepareFrame(t){return(0,o.b0)()}renderFrame(t,e){return(0,o.b0)()}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;e.getState()!==s.A.LOADED&&e.getState()!==s.A.ERROR||this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=s.A.LOADED&&e!=s.A.ERROR&&t.addEventListener(n.A.CHANGE,this.boundHandleImageChange_),e==s.A.IDLE&&(t.load(),e=t.getState()),e==s.A.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const l=a},6769:(t,e,i)=>{i.d(e,{A:()=>f,B:()=>d});var n=i(5986),s=i(9960),r=i(3984),o=i(808),a=i(9703),l=i(3730),h=i(8711),c=i(6514),u=i(915);const d=[];let g=null;class _ extends n.A{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=(0,a.vt)(),this.pixelTransform=(0,a.vt)(),this.inversePixelTransform=(0,a.vt)(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,i){let n;g||(g=(0,h.Y)(1,1,void 0,{willReadFrequently:!0})),g.clearRect(0,0,1,1);try{g.drawImage(t,e,i,1,1,0,0,1,1),n=g.getImageData(0,0,1,1).data}catch(t){return g=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let s,r;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&(0,c.aI)((0,l._j)(t.style.backgroundColor),(0,l._j)(i)))){const e=t.firstElementChild;e instanceof HTMLCanvasElement&&(r=e.getContext("2d"))}if(r&&r.canvas.style.transform===e?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=n;let t=s.style;t.position="absolute",t.width="100%",t.height="100%",r=(0,h.Y)();const e=r.canvas;s.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=s,this.context=r}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=(0,u.Py)(i),s=(0,u.WU)(i),r=(0,u.k_)(i),o=(0,u.R)(i);(0,a.Bb)(e.coordinateToPixelTransform,n),(0,a.Bb)(e.coordinateToPixelTransform,s),(0,a.Bb)(e.coordinateToPixelTransform,r),(0,a.Bb)(e.coordinateToPixelTransform,o);const l=this.inversePixelTransform;(0,a.Bb)(l,n),(0,a.Bb)(l,s),(0,a.Bb)(l,r),(0,a.Bb)(l,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const i=t.extent,n=t.viewState.resolution,s=t.viewState.rotation,r=t.pixelRatio,o=Math.round((0,u.RG)(i)/n*r),l=Math.round((0,u.Oq)(i)/n*r);(0,a.Zz)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/r,1/r,s,-o/2,-l/2),(0,a.T9)(this.inversePixelTransform,this.pixelTransform);const h=(0,a.dI)(this.pixelTransform);if(this.useContainer(e,h,this.getBackground(t)),!this.containerReused){const t=this.context.canvas;t.width!=o||t.height!=l?(t.width=o,t.height=l):this.context.clearRect(0,0,o,l),h!==t.style.transform&&(t.style.transform=h)}}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const r=new s.A(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(r.A.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(r.A.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new o.A),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(r.A.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(r.A.POSTRENDER,this.context,t))}getRenderTransform(t,e,i,n,s,r,o){const l=s/2,h=r/2,c=n/e,u=-c,d=-t[0]+o,g=-t[1];return(0,a.Zz)(this.tempTransform,l,h,c,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const f=_},4029:(t,e,i)=>{i.d(e,{A:()=>A});var n=i(6769),s=i(7607),r=i(190),o=i(4969),a=i(8596),l=i(7404),h=i(1110),c=i(1078),u=i(9703),d=i(6514),g=i(915),_=i(186),f=i(3407),p=i(4087),m=i(4401);function x(t,e,i,n){return`${t},${(0,_.dp)(e,i,n)}`}function v(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;const n=t[i],s=n.has(e);return s||n.add(e),!s}function y(t,e,i){const n=t[i];return!!n&&n.delete(e)}function E(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=(0,g._N)(e,(0,f.SD)(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=(0,g._N)(e,i))}return e}class T extends n.A{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=(0,g.S5)(),this.tempTileRange_=new h.A(0,0,0,0),this.tempTileCoord_=(0,_.N)(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new o.A(i),this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){const s=this.tileCache_,r=this.getLayer().getSource(),o=x(r.getKey(),t,e,i);let a;if(s.containsKey(o))a=s.get(o);else{if(a=r.getTile(t,e,i,n.pixelRatio,n.viewState.projection),!a)return null;s.set(o,a)}return a}getTile(t,e,i,n){return this.getOrCreateTile(t,e,i,n)||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=(0,u.Bb)(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!(0,g.Ym)(o,n))return null;const a=e.viewState,l=i.getRenderSource(),h=l.getTileGridForProjection(a.projection),d=l.getTilePixelRatio(e.pixelRatio);for(let t=h.getZForResolution(a.resolution);t>=h.getMinZoom();--t){const i=h.getTileCoordForCoordAndZ(n,t),o=this.getTile(t,i[1],i[2],e);if(!o||o.getState()!==c.A.LOADED)continue;const u=h.getOrigin(t),g=(0,m.xq)(h.getTileSize(t)),_=h.getResolution(t);let f;if(o instanceof r.A)f=o.getImage();else{if(!(o instanceof s.Ay))continue;if(f=(0,s.xo)(o.getData()),!f)continue}const p=Math.floor(d*((n[0]-u[0])/_-i[1]*g[0])),x=Math.floor(d*((u[1]-n[1])/_-i[2]*g[1])),v=Math.round(d*l.getGutterForProjection(a.projection));return this.getImageData(f,p+v,x+v)}return null}prepareFrame(t){const e=this.getLayer().getSource();if(!e)return!1;const i=this.getLayer().getSource().getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(t,e,i,n,s){const r=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(r.projection),h=(0,p.v6)(a);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],d=o.getMapInternal(),g=Math.max(i-s,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection));for(let s=i;s>=g;--s){const i=l.getTileRangeForExtentAndZ(e,s,this.tempTileRange_),r=l.getResolution(s);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){const i=this.getTile(s,e,o,t);if(!i)continue;if(!v(n,i,s))continue;const a=i.getKey();if(u[a]=!0,i.getState()===c.A.IDLE&&!t.tileQueue.isKeyQueued(a)){const n=(0,_.N)(s,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,h,l.getTileCoordCenter(n),r])}}}}findStaleTile_(t,e){const i=this.tileCache_,n=t[0],s=t[1],r=t[2],o=this.getStaleKeys();for(let t=0;t0&&setTimeout((()=>{this.enqueueTiles(t,O,T-1,F,D-1)}),0);const k=(0,p.v6)(this),N=t.time;for(const e of F[T]){const i=e.getState();if((e instanceof l.A||e instanceof a.A)&&i===c.A.EMPTY)continue;const n=e.tileCoord;if(i===c.A.LOADED&&1===e.getAlpha(k,N)){e.endTransition(k);continue}if(this.renderComplete=!1,this.findStaleTile_(n,F)){y(F,e,T),t.animate=!0;continue}if(this.findAltTiles_(v,n,T+1,F))continue;const s=v.getMinZoom();for(let t=T-1;t>=s&&!this.findAltTiles_(v,n,t,F);--t);}const G=A/r*h/R,z=this.getRenderContext(t);(0,u.Zz)(this.tempTransform,w/2,b/2,G,G,0,-w/2,-b/2),i.extent&&this.clipUnrotated(z,t,I),m.getInterpolate()||(z.imageSmoothingEnabled=!1),this.preRender(z,t),this.renderedTiles.length=0;const j=Object.keys(F).map(Number);let B;j.sort(d.V_);const U=[],X=[];for(let e=j.length-1;e>=0;--e){const i=j[e],n=m.getTilePixelSize(i,h,s),r=v.getResolution(i)/A,o=n[0]*r*G,a=n[1]*r*G,l=v.getTileCoordForCoordAndZ((0,g.Py)(M),i),d=v.getTileCoordExtent(l),_=(0,u.Bb)(this.tempTransform,[R*(d[0]-M[0])/A,R*(M[3]-d[3])/A]),f=R*m.getGutterForProjection(s);for(const e of F[i]){if(e.getState()!==c.A.LOADED)continue;const n=e.tileCoord,s=l[1]-n[1],r=Math.round(_[0]-(s-1)*o),h=l[2]-n[2],u=Math.round(_[1]-(h-1)*a),d=Math.round(_[0]-s*o),p=Math.round(_[1]-h*a),x=r-d,v=u-p,y=1===j.length;let E=!1;B=[d,p,d+x,p,d+x,p+v,d,p+v];for(let t=0,e=U.length;t{const i=(0,p.v6)(m),n=e.wantedTiles[i],s=n?Object.keys(n).length:0;this.updateCacheSize(s),this.tileCache_.expireCache()})),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,r,o,a,l){let h;if(t instanceof s.Ay){if(h=(0,s.xo)(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(e),u=(0,p.v6)(this),d=e.layerStatesArray[e.layerIndex],g=d.opacity*(l?t.getAlpha(u,e.time):1),_=g!==c.globalAlpha;_&&(c.save(),c.globalAlpha=g),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,i,n,r,o),_&&c.restore(),g!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const n=(0,p.v6)(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}}const A=T},3608:(t,e,i)=>{i.d(e,{Eo:()=>a,gY:()=>h,j:()=>l,nl:()=>c});var n=i(6141),s=i(4087);const r=.5,o={Point:function(t,e,i,s,r,o){const a=i.getImage(),l=i.getText(),h=l&&l.getText(),c=o&&a&&h?{}:void 0;if(a){if(a.getImageState()!=n.A.LOADED)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,c),o.drawPoint(e,s,r)}if(h){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(l,c),n.drawText(e,s,r)}},LineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},Polygon:function(t,e,i,n,s){const r=i.getFill(),o=i.getStroke();if(r||o){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,o),a.drawPolygon(e,n,s)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n,s)}},MultiPoint:function(t,e,i,s,r,o){const a=i.getImage(),l=a&&0!==a.getOpacity(),h=i.getText(),c=h&&h.getText(),u=o&&l&&c?{}:void 0;if(l){if(a.getImageState()!=n.A.LOADED)return;const o=t.getBuilder(i.getZIndex(),"Image");o.setImageStyle(a,u),o.drawMultiPoint(e,s,r)}if(c){const n=t.getBuilder(i.getZIndex(),"Text");n.setTextStyle(h,u),n.drawText(e,s,r)}},MultiLineString:function(t,e,i,n,s){const r=i.getStroke();if(r){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,r),o.drawMultiLineString(e,n,s)}const o=i.getText();if(o&&o.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(o),r.drawText(e,n,s)}},MultiPolygon:function(t,e,i,n,s){const r=i.getFill(),o=i.getStroke();if(o||r){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,o),a.drawMultiPolygon(e,n,s)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n,s)}},GeometryCollection:function(t,e,i,n,s,r){const a=e.getGeometriesArray();let l,h;for(l=0,h=a.length;l0;return _&&Promise.all(c).then((()=>r(null))),function(t,e,i,n,s,r,a){const l=i.getGeometryFunction()(e);if(!l)return;const h=l.simplifyTransformed(n,s);i.getRenderer()?u(t,h,i,e,a):(0,o[h.getType()])(t,h,i,e,a,r)}(t,e,i,s,a,l,h),_}function u(t,e,i,n,s){if("GeometryCollection"!=e.getType())t.getBuilder(i.getZIndex(),"Default").drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer(),s);else{const r=e.getGeometries();for(let e=0,o=r.length;e{i.d(e,{A:()=>c});var n=i(5332),s=i(5986),r=i(9960),o=i(3984),a=i(9777),l=i(9703);class h extends s.A{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=(0,l.vt)(),this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(n.A.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(o.A.PRECOMPOSE)){const n=new r.A(o.A.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(o.A.POSTCOMPOSE)){const n=new r.A(o.A.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e,i=!0,n=-1;for(let s=0,r=t.layerStatesArray.length;s{i.d(e,{eS:()=>j,gF:()=>z,Ay:()=>U});var n=i(8596),s=i(7404),r=i(1078),o=i(9332),a=i(6837),l=i(190),h=i(4087);class c extends o.A{constructor(t){super(),this.tile,this.handleTileChange_=this.handleTileChange_.bind(this),this.gutter=t.gutter||0,this.helper=t.helper,this.loaded=!1,this.ready=!1}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(a.A.CHANGE,this.handleTileChange_),this.tile=t,this.loaded=t.getState()===r.A.LOADED,this.loaded)this.uploadTile();else{if(t instanceof l.A){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(a.A.CHANGE,this.handleTileChange_)}}uploadTile(){(0,h.b0)()}setReady(){this.ready=!0,this.dispatchEvent(a.A.CHANGE)}handleTileChange_(){this.tile.getState()===r.A.LOADED&&(this.loaded=!0,this.uploadTile())}disposeInternal(){this.tile.removeEventListener(a.A.CHANGE,this.handleTileChange_)}}const u=c;var d=i(7607),g=i(259),_=i(130),f=i(8711),p=i(4401);function m(t,e,i){const n=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function x(t,e,i,n,s,r){const o=t.getGL();let a,l;i instanceof Float32Array?(a=o.FLOAT,t.getExtension("OES_texture_float"),l=null!==t.getExtension("OES_texture_float_linear")):(a=o.UNSIGNED_BYTE,l=!0),m(o,e,r&&l);const h=i.byteLength/n[1];let c,u=1;switch(h%8==0?u=8:h%4==0?u=4:h%2==0&&(u=2),s){case 1:c=o.LUMINANCE;break;case 2:c=o.LUMINANCE_ALPHA;break;case 3:c=o.RGB;break;case 4:c=o.RGBA;break;default:throw new Error(`Unsupported number of bands: ${s}`)}const d=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,u),o.texImage2D(o.TEXTURE_2D,0,c,n[0],n[1],0,c,a,i),o.pixelStorei(o.UNPACK_ALIGNMENT,d)}let v=null;const y=class extends u{constructor(t){super(t),this.textures=[],this.renderSize_=(0,p.xq)(t.grid.getTileSize(t.tile.tileCoord[0])),this.bandCount=NaN;const e=new g.Ay(_.H7,_.Ek);e.fromArray([0,1,1,1,1,0,0,0]),this.helper.flushBufferData(e),this.coords=e,this.setTile(t.tile)}uploadTile(){const t=this.helper,e=t.getGL(),i=this.tile;let n;this.textures.length=0,n=i instanceof l.A||i instanceof s.A?i.getImage():i.getData();const r=(0,d.xo)(n);if(r){const t=e.createTexture();return this.textures.push(t),this.bandCount=4,function(t,e,i,n){m(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(e,t,r,i.interpolate),void this.setReady()}n=(0,d.bL)(n);const o=i.getSize(),a=[o[0]+2*this.gutter,o[1]+2*this.gutter],h=n instanceof Float32Array,c=a[0]*a[1],u=h?Float32Array:Uint8Array,g=u.BYTES_PER_ELEMENT,_=n.byteLength/a[1];this.bandCount=Math.floor(_/g/a[0]);const f=Math.ceil(this.bandCount/4);if(1===f){const s=e.createTexture();return this.textures.push(s),x(t,s,n,a,this.bandCount,i.interpolate),void this.setReady()}const p=new Array(f);for(let t=0;t=p;--s){const i=c.getTileRangeForExtentAndZ(e,s,this.tempTileRange_),a=c.getResolution(s);for(let e=i.minX;e<=i.maxX;++e)for(let h=i.minY;h<=i.maxY;++h){const i=(0,S.N)(s,e,h,this.tempTileCoord_),f=O(l,i);let p,m;if(_.containsKey(f)&&(p=_.get(f),m=p.tile),!(p&&p.tile.key===l.getKey()||(m=l.getTile(s,e,h,t.pixelRatio,o.projection),m)))continue;if(M(n,m))continue;p?p.setTile(m):(p=this.createTileRepresentation({tile:m,grid:c,helper:this.helper,gutter:u}),_.set(f,p)),F(n,p,s);const x=m.getKey();g[x]=!0,m.getState()===r.A.IDLE&&(t.tileQueue.isKeyQueued(x)||t.tileQueue.enqueue([m,d,c.getTileCoordCenter(i),a]))}}}beforeTilesRender(t,e){this.helper.prepareDraw(this.frameState,!e,!0)}beforeTilesMaskRender(t){return!1}renderTile(t,e,i,n,s,r,o,a,l,h,c){}renderTileMask(t,e,i,n){}drawTile_(t,e,i,n,s,r,o){if(!e.ready)return;const a=e.tile.tileCoord,l=(0,S.i7)(a),h=l in r?r[l]:1,c=o.getResolution(i),u=(0,p.xq)(o.getTileSize(i),this.tempSize_),d=o.getOrigin(i),g=o.getTileCoordExtent(a),_=h<1?-1:P(i);h<1&&(t.animate=!0);const f=t.viewState,m=f.center[0],x=f.center[1],v=u[0]+2*n,y=u[1]+2*n,E=v/y,T=(m-d[0])/(u[0]*c),A=(d[1]-x)/(u[1]*c),C=f.resolution/c,w=a[1],b=a[2];(0,R.cL)(this.tileTransform_),(0,R.hs)(this.tileTransform_,2/(t.size[0]*C/v),-2/(t.size[1]*C/v)),(0,R.e$)(this.tileTransform_,f.rotation),(0,R.hs)(this.tileTransform_,1,1/E),(0,R.Tl)(this.tileTransform_,(u[0]*(w-T)-n)/v,(u[1]*(b-A)-n)/y),this.renderTile(e,this.tileTransform_,t,s,c,u,d,g,_,n,h)}renderFrame(t){this.frameState=t,this.renderComplete=!0;const e=this.helper.getGL();this.preRender(e,t);const i=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(i.projection),c=a.getGutterForProjection(i.projection),u=D(t,t.extent),d=l.getZForResolution(i.resolution,a.zDirection),g={tileIds:new Set,representationsByZ:{}},_=o.getPreload();if(t.nextExtent){const e=l.getZForResolution(i.nextResolution,a.zDirection),n=D(t,t.nextExtent);this.enqueueTiles(t,n,e,g,_)}this.enqueueTiles(t,u,d,g,0),_>0&&setTimeout((()=>{this.enqueueTiles(t,u,d-1,g,_-1)}),0);const f={},p=(0,h.v6)(this),m=t.time;let x=!1;const v=g.representationsByZ;if(d in v)for(const t of v[d]){const e=t.tile;if((e instanceof s.A||e instanceof n.A)&&e.getState()===r.A.EMPTY)continue;const i=e.tileCoord;if(t.ready){const t=e.getAlpha(p,m);if(1===t){e.endTransition(p);continue}x=!0,f[(0,S.i7)(i)]=t}if(this.renderComplete=!1,this.findAltTiles_(l,i,d+1,g))continue;const o=l.getMinZoom();for(let t=d-1;t>=o&&!this.findAltTiles_(l,i,t,g);--t);}const y=Object.keys(v).map(Number).sort(w.rG);if(this.beforeTilesMaskRender(t))for(let t=0,e=y.length;tt.dispose())),t.clear()}removeHelper(){this.helper&&this.clearCache(),super.removeHelper()}disposeInternal(){super.disposeInternal(),delete this.frameState}}const N=k;var G=i(9777);const z={TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",RESOLUTION:"u_resolution",ZOOM:"u_zoom",GLOBAL_ALPHA:"u_globalAlpha",PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},j={TEXTURE_COORD:"a_textureCoord"},B=[{name:j.TEXTURE_COORD,size:2,type:G.jQ.FLOAT}],U=class extends N{constructor(t,e){super(t,e),this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new g.Ay(_.IP,_.Ek),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=e.paletteTextures||[]}reset(t){if(super.reset(t),this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}removeHelper(){if(this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}super.removeHelper()}createTileRepresentation(t){return new y(t)}beforeTilesRender(t,e){super.beforeTilesRender(t,e),this.helper.useProgram(this.program_,t)}renderTile(t,e,i,n,s,r,o,a,l,h,c){const u=this.helper.getGL();this.helper.bindBuffer(t.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(B);let d=0;for(;d0&&(v=a,(0,I._N)(v,n,v)),this.helper.setUniformFloatVec4(z.RENDER_EXTENT,v),this.helper.setUniformFloatValue(z.RESOLUTION,g.resolution),this.helper.setUniformFloatValue(z.ZOOM,g.zoom),this.helper.setUniformFloatValue(z.TEXTURE_PIXEL_WIDTH,_),this.helper.setUniformFloatValue(z.TEXTURE_PIXEL_HEIGHT,f),this.helper.setUniformFloatValue(z.TEXTURE_RESOLUTION,s),this.helper.setUniformFloatValue(z.TEXTURE_ORIGIN_X,o[0]+m*r[0]*s-h*s),this.helper.setUniformFloatValue(z.TEXTURE_ORIGIN_Y,o[1]-x*r[1]*s+h*s),this.helper.drawElements(0,this.indices_.getSize())}getData(t){if(!this.helper.getGL())return null;const e=this.frameState;if(!e)return null;const i=this.getLayer(),o=(0,R.Bb)(e.pixelToCoordinateTransform,t.slice()),a=e.viewState,l=i.getExtent();if(l&&!(0,I.Ym)((0,b.SD)(l,a.projection),o))return null;const h=i.getSources((0,I.Tr)([o]),a.resolution);let c,u,d;for(c=h.length-1;c>=0;--c)if(u=h[c],"ready"===u.getState()){if(d=u.getTileGridForProjection(a.projection),u.getWrapX())break;const t=d.getExtent();if(!t||(0,I.Ym)(t,o))break}if(c<0)return null;const g=this.tileRepresentationCache;for(let t=d.getZForResolution(a.resolution);t>=d.getMinZoom();--t){const e=d.getTileCoordForCoordAndZ(o,t),i=O(u,e);if(!g.containsKey(i))continue;const a=g.get(i),l=a.tile;if((l instanceof s.A||l instanceof n.A)&&l.getState()===r.A.EMPTY)return null;if(!a.loaded)continue;const h=d.getOrigin(t),c=(0,p.xq)(d.getTileSize(t)),_=d.getResolution(t),f=(o[0]-h[0])/_-e[1]*c[0],m=(h[1]-o[1])/_-e[2]*c[1];return a.getPixelData(f,m)}return null}disposeInternal(){const t=this.helper;if(t){const e=t.getGL();for(const t of this.paletteTextures_)t.delete(e);this.paletteTextures_.length=0,e.deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)}super.disposeInternal(),delete this.indices_}}},3513:(t,e,i)=>{i.d(e,{BV:()=>l,KQ:()=>u,XX:()=>g,aY:()=>d});var n=i(915),s=i(8711),r=i(3407),o=i(1597);let a;const l=[];function h(t,e,i,n,s){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,s),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,s)),t.restore()}function c(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function u(t,e,i,s){const o=(0,r.pd)(i,e,t);let a=(0,r.hO)(e,s,i);const l=e.getMetersPerUnit();void 0!==l&&(a*=l);const h=t.getMetersPerUnit();void 0!==h&&(a/=h);const c=t.getExtent();if(!c||(0,n.Ym)(c,o)){const e=(0,r.hO)(t,a,o)/a;isFinite(e)&&e>0&&(a/=e)}return a}function d(t,e,i,s){const r=(0,n.q1)(i);let o=u(t,e,r,s);return(!isFinite(o)||o<=0)&&(0,n.sB)(i,(function(i){return o=u(t,e,i,s),isFinite(o)&&o>0})),o}function g(t,e,i,r,u,d,g,_,f,p,m,x,v,y){const E=(0,s.Y)(Math.round(i*t),Math.round(i*e),l);if(x||(E.imageSmoothingEnabled=!1),0===f.length)return E.canvas;function T(t){return Math.round(t*i)/i}E.scale(i,i),E.globalCompositeOperation="lighter";const A=(0,n.S5)();let C;f.forEach((function(t,e,i){(0,n.X$)(A,t.extent)}));const S=i/r,R=(x?1:1+Math.pow(2,-24))/S;if(!v||1!==f.length||0!==p){if(C=(0,s.Y)(Math.round((0,n.RG)(A)*S),Math.round((0,n.Oq)(A)*S),l),x||(C.imageSmoothingEnabled=!1),u&&y){const t=(u[0]-A[0])*S,e=-(u[3]-A[3])*S,i=(0,n.RG)(u)*S,s=(0,n.Oq)(u)*S;C.rect(t,e,i,s),C.clip()}f.forEach((function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){C.save();const e=(t.clipExtent[0]-A[0])*S,i=-(t.clipExtent[3]-A[3])*S,s=(0,n.RG)(t.clipExtent)*S,r=(0,n.Oq)(t.clipExtent)*S;C.rect(x?e:Math.round(e),x?i:Math.round(i),x?s:Math.round(e+s)-Math.round(e),x?r:Math.round(i+r)-Math.round(i)),C.clip()}const e=(t.extent[0]-A[0])*S,i=-(t.extent[3]-A[3])*S,s=(0,n.RG)(t.extent)*S,r=(0,n.Oq)(t.extent)*S;C.drawImage(t.image,p,p,t.image.width-2*p,t.image.height-2*p,x?e:Math.round(e),x?i:Math.round(i),x?s:Math.round(e+s)-Math.round(e),x?r:Math.round(i+r)-Math.round(i)),t.clipExtent&&C.restore()}}))}const w=(0,n.Py)(g);return _.getTriangles().forEach((function(t,e,i){const r=t.source,u=t.target;let g=r[0][0],_=r[0][1],p=r[1][0],m=r[1][1],v=r[2][0],y=r[2][1];const S=T((u[0][0]-w[0])/d),b=T(-(u[0][1]-w[1])/d),I=T((u[1][0]-w[0])/d),L=T(-(u[1][1]-w[1])/d),P=T((u[2][0]-w[0])/d),M=T(-(u[2][1]-w[1])/d),F=g,D=_;g=0,_=0,p-=F,m-=D,v-=F,y-=D;const O=[[p,m,0,0,I-S],[v,y,0,0,P-S],[0,0,p,m,L-b],[0,0,v,y,M-b]],k=(0,o.KU)(O);if(!k)return;if(E.save(),E.beginPath(),function(){if(void 0===a){const t=(0,s.Y)(6,6,l);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",h(t,4,5,4,0),h(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;a=c(e,0)||c(e,4)||c(e,8),(0,s.Yg)(t),l.push(t.canvas)}return a}()||!x){E.moveTo(I,L);const t=4,e=S-I,i=b-L;for(let n=0;n{i.d(e,{A:()=>_});var n=i(3101),s=i(7607),r=i(6837),o=i(1078),a=i(2913),l=i(3513),h=i(1597),c=i(8711),u=i(915),d=i(9438);class g extends s.Ay{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,i=e.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?s?(0,u._N)(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),c=this.targetTileGrid_.getExtent();let d=this.sourceTileGrid_.getExtent();const g=c?(0,u._N)(r,c):r;if(0===(0,u.UG)(g))return void(this.state=o.A.EMPTY);i&&(d=d?(0,u._N)(d,i):i);const _=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),f=t.targetProj,p=(0,l.aY)(e,f,g,_);if(!isFinite(p)||p<=0)return void(this.state=o.A.EMPTY);const m=void 0!==t.errorThreshold?t.errorThreshold:n.l;if(this.triangulation_=new a.A(e,f,g,d,p*m,_),0===this.triangulation_.getTriangles().length)return void(this.state=o.A.EMPTY);this.sourceZ_=this.sourceTileGrid_.getZForResolution(p);let x=this.triangulation_.calculateSourceExtent();if(d&&(e.canWrapX()?(x[1]=(0,h.qE)(x[1],d[1],d[3]),x[3]=(0,h.qE)(x[3],d[1],d[3])):x=(0,u._N)(x,d)),(0,u.UG)(x)){let n=0,s=0;e.canWrapX()&&(n=(0,u.RG)(i),s=Math.floor((x[0]-i[0])/n)),(0,u.QJ)(x.slice(),e,!0).forEach((e=>{const i=this.sourceTileGrid_.getTileRangeForExtentAndZ(e,this.sourceZ_),r=t.getTileFunction;for(let t=i.minX;t<=i.maxX;t++)for(let e=i.minY;e<=i.maxY;e++){const i=r(this.sourceZ_,t,e,this.pixelRatio_);if(i){const t=s*n;this.sourceTiles_.push({tile:i,offset:t})}}++s})),0===this.sourceTiles_.length&&(this.state=o.A.EMPTY)}else this.state=o.A.EMPTY}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach((i=>{const n=i.tile;if(!n||n.getState()!==o.A.LOADED)return;const r=n.getSize(),a=this.gutter_;let l;const h=(0,s.bL)(n.getData());h?l=h:(e=!0,l=(0,s.$r)((0,s.xo)(n.getData())));const c=[r[0]+2*a,r[1]+2*a],u=l instanceof Float32Array,d=c[0]*c[1],g=u?Float32Array:Uint8ClampedArray,_=new g(l.buffer),f=g.BYTES_PER_ELEMENT,p=f*_.length/d,m=_.byteLength/c[1],x=Math.floor(m/f/c[0]),v=d*x;let y=_;if(_.length!==v){y=new g(v);let t=0,e=0;const i=c[0]*x;for(let n=0;n=0;--e){const i=[];for(let n=0,s=t.length;n{const i=e.getState();if(i!==o.A.IDLE&&i!==o.A.LOADING)return;t++;const n=(0,d.KT)(e,r.A.CHANGE,(()=>{const i=e.getState();i!=o.A.LOADED&&i!=o.A.ERROR&&i!=o.A.EMPTY||((0,d.JH)(n),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(n)})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t}){t.getState()==o.A.IDLE&&t.load()}))}unlistenSources_(){this.sourcesListenerKeys_.forEach(d.JH),this.sourcesListenerKeys_=null}}const _=g},7404:(t,e,i)=>{i.d(e,{A:()=>_});var n=i(3101),s=i(6837),r=i(8143),o=i(1078),a=i(2913),l=i(3513),h=i(1597),c=i(915),u=i(9438),d=i(8711);class g extends r.A{constructor(t,e,i,s,r,u,d,g,_,f,p,m){super(r,o.A.IDLE,m),this.renderEdges_=void 0!==p&&p,this.pixelRatio_=d,this.gutter_=g,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=u||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const x=s.getTileCoordExtent(this.wrappedTileCoord_),v=this.targetTileGrid_.getExtent();let y=this.sourceTileGrid_.getExtent();const E=v?(0,c._N)(x,v):x;if(0===(0,c.UG)(E))return void(this.state=o.A.EMPTY);const T=t.getExtent();T&&(y=y?(0,c._N)(y,T):T);const A=s.getResolution(this.wrappedTileCoord_[0]),C=(0,l.aY)(t,i,E,A);if(!isFinite(C)||C<=0)return void(this.state=o.A.EMPTY);const S=void 0!==f?f:n.l;if(this.triangulation_=new a.A(t,i,E,y,C*S,A),0===this.triangulation_.getTriangles().length)return void(this.state=o.A.EMPTY);this.sourceZ_=e.getZForResolution(C);let R=this.triangulation_.calculateSourceExtent();if(y&&(t.canWrapX()?(R[1]=(0,h.qE)(R[1],y[1],y[3]),R[3]=(0,h.qE)(R[3],y[1],y[3])):R=(0,c._N)(R,y)),(0,c.UG)(R)){let i=0,n=0;t.canWrapX()&&(i=(0,c.RG)(T),n=Math.floor((R[0]-T[0])/i)),(0,c.QJ)(R.slice(),t,!0).forEach((t=>{const s=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=s.minX;t<=s.maxX;t++)for(let e=s.minY;e<=s.maxY;e++){const s=_(this.sourceZ_,t,e,d);if(s){const t=n*i;this.sourceTiles_.push({tile:s,offset:t})}}++n})),0===this.sourceTiles_.length&&(this.state=o.A.EMPTY)}else this.state=o.A.EMPTY}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach((e=>{const i=e.tile;if(i&&i.getState()==o.A.LOADED){const n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=e.offset,s[2]+=e.offset),t.push({extent:n,clipExtent:s,image:i.getImage()})}})),this.sourceTiles_.length=0,0===t.length)this.state=o.A.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],s="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),h=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=(0,l.XX)(n,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,h,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=o.A.LOADED}this.changed()}load(){if(this.state==o.A.IDLE){this.state=o.A.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((({tile:e})=>{const i=e.getState();if(i==o.A.IDLE||i==o.A.LOADING){t++;const i=(0,u.KT)(e,s.A.CHANGE,(n=>{const s=e.getState();s!=o.A.LOADED&&s!=o.A.ERROR&&s!=o.A.EMPTY||((0,u.JH)(i),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(i)}})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t},e,i){t.getState()==o.A.IDLE&&t.load()}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(u.JH),this.sourcesListenerKeys_=null}release(){this.canvas_&&((0,d.Yg)(this.canvas_.getContext("2d")),l.BV.push(this.canvas_),this.canvas_=null),super.release()}}const _=g},2913:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(915),s=i(3407),r=i(1597);const o=class{constructor(t,e,i,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const h=(0,s.RG)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){const e=t[0]+"/"+t[1];return l[e]||(l[e]=h(t)),l[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&(0,n.RG)(r)>=(0,n.RG)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,n.RG)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,n.RG)(this.targetProj_.getExtent()):null;const c=(0,n.Py)(i),u=(0,n.WU)(i),d=(0,n.k_)(i),g=(0,n.R)(i),_=this.transformInv_(c),f=this.transformInv_(u),p=this.transformInv_(d),m=this.transformInv_(g),x=10+(a?Math.max(0,Math.ceil(Math.log2((0,n.UG)(i)/(a*a*256*256)))):0);if(this.addQuad_(c,u,d,g,_,f,p,m,x),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach((function(e,i,n){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])})),this.triangles_.forEach((e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);const n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n.5&&d<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const r=(0,n.Tr)([t,e,i,s]);f=(0,n.RG)(r)/this.targetWorldWidth_>.25||f}!_&&this.sourceProj_.isGlobal()&&d&&(f=d>.25||f)}if(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!(0,n.HY)(u,this.maxSourceExtent_))return;let p=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(l[0])&&isFinite(l[1])&&isFinite(h[0])&&isFinite(h[1])))if(c>0)f=!0;else if(p=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(a[0])&&isFinite(a[1])?0:4)+(isFinite(l[0])&&isFinite(l[1])?0:2)+(isFinite(h[0])&&isFinite(h[1])?0:1),1!=p&&2!=p&&4!=p&&8!=p)return;if(c>0){if(!f){const e=[(t[0]+i[0])/2,(t[1]+i[1])/2],n=this.transformInv_(e);let s;s=_?((0,r.xP)(o[0],g)+(0,r.xP)(l[0],g))/2-(0,r.xP)(n[0],g):(o[0]+l[0])/2-n[0];const a=(o[1]+l[1])/2-n[1];f=s*s+a*a>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const n=[(e[0]+i[0])/2,(e[1]+i[1])/2],r=this.transformInv_(n),u=[(s[0]+t[0])/2,(s[1]+t[1])/2],d=this.transformInv_(u);this.addQuad_(t,e,n,u,o,a,r,d,c-1),this.addQuad_(u,n,i,s,d,r,l,h,c-1)}else{const n=[(t[0]+e[0])/2,(t[1]+e[1])/2],r=this.transformInv_(n),u=[(i[0]+s[0])/2,(i[1]+s[1])/2],d=this.transformInv_(u);this.addQuad_(t,n,u,s,o,r,d,h,c-1),this.addQuad_(n,e,i,u,r,a,l,d,c-1)}return}}if(_){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&p||this.addTriangle_(t,i,s,o,l,h),14&p||this.addTriangle_(t,i,e,o,l,a),p&&(13&p||this.addTriangle_(e,s,t,a,h,o),7&p||this.addTriangle_(e,s,i,a,h,l))}calculateSourceExtent(){const t=(0,n.S5)();return this.triangles_.forEach((function(e,i,s){const r=e.source;(0,n.$C)(t,r[0]),(0,n.$C)(t,r[1]),(0,n.$C)(t,r[2])})),t}getTriangles(){return this.triangles_}}},3101:(t,e,i)=>{i.d(e,{l:()=>n});const n=.5},4498:(t,e,i)=>{i.d(e,{a$:()=>o,b8:()=>s,cq:()=>a,dv:()=>r});var n=i(1597);function s(t){if(void 0!==t)return 0}function r(t){if(void 0!==t)return t}function o(t){const e=2*Math.PI/t;return function(t,i){return i?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function a(t){const e=void 0===t?(0,n.eh)(5):t;return function(t,i){return i||void 0===t?t:Math.abs(t)<=e?0:t}}},4401:(t,e,i)=>{function n(t){return t[0]>0&&t[1]>0}function s(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function r(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}i.d(e,{Ie:()=>n,hs:()=>s,xq:()=>r})},6203:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(6837),s=i(6717),r=i(4294),o=i(731),a=i(6933),l=i(588),h=i(915),c=i(4087);class u extends o.A{constructor(t){super({attributions:(t=t||{}).attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(t){const e=t.getGeometry();return(0,l.v)(!e||"Point"===e.getType(),"The default `geometryFunction` can only handle `Point` or null geometries"),e},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,i){this.source?.loadFeatures(t,e,i),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(n.A.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(n.A.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const i=0===t?0:Math.min(e,t)/t,n=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=e,this.interpolationRatio=i,n&&this.refresh()}cluster(){if(void 0===this.resolution||!this.source)return;const t=(0,h.S5)(),e=this.distance*this.resolution,i=this.source.getFeatures(),n={};for(let s=0,r=i.length;s=0;--e){const n=this.geometryFunction(t[e]);n?(0,a.WQ)(i,n.getCoordinates()):t.splice(e,1)}(0,a.hs)(i,1/t.length);const n=(0,h.q1)(e),o=this.interpolationRatio,l=new r.A([i[0]*(1-o)+n[0]*o,i[1]*(1-o)+n[1]*o]);return this.createCustomCluster_?this.createCustomCluster_(l,t):new s.A({geometry:l,features:t})}}const d=u},4977:(t,e,i)=>{i.d(e,{A:()=>m});var n=i(7607),s=i(6837),r=i(8596),o=i(61),a=i(8469),l=i(6017),h=i(1078),c=i(4863),u=i(3407),d=i(186),g=i(4087),_=i(4238),f=i(4401);class p extends l.A{constructor(t){const e=void 0===t.projection?"EPSG:3857":t.projection;let i=t.tileGrid;void 0===i&&e&&(i=(0,c.EN)({extent:(0,c.kZ)(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize})),super({cacheSize:.1,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:e,tileGrid:i,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.tileSize_=t.tileSize?(0,f.xq)(t.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=t.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=void 0===t.bandCount?4:t.bandCount,this.tileGridForProjection_={},this.tileCacheForProjection_={},this.crossOrigin_=t.crossOrigin||"anonymous"}setTileSizes(t){this.tileSizes_=t}getTileSize(t){if(this.tileSizes_)return this.tileSizes_[t];if(this.tileSize_)return this.tileSize_;const e=this.getTileGrid();return e?(0,f.xq)(e.getTileSize(t)):[256,256]}getGutterForProjection(t){const e=this.getProjection();return!e||(0,u.tI)(e,t)?this.gutter_:0}setLoader(t){this.loader_=t}getReprojTile_(t,e,i,n,s){const o=this.getTileCacheForProjection(n),a=(0,d.dp)(t,e,i);if(o.containsKey(a)){const t=o.get(a);if(t&&t.key==this.getKey())return t}const l=this.getTileGrid(),h=Math.max.apply(null,l.getResolutions().map(((t,e)=>{const i=(0,f.xq)(l.getTileSize(e)),n=this.getTileSize(e);return Math.max(n[0]/i[0],n[1]/i[1])}))),c=this.getTileGridForProjection(s),u=this.getTileGridForProjection(n),g=[t,e,i],_=this.getTileCoordForTileUrlFunction(g,n),p=Object.assign({sourceProj:s,sourceTileGrid:c,targetProj:n,targetTileGrid:u,tileCoord:g,wrappedTileCoord:_,pixelRatio:h,gutter:this.getGutterForProjection(s),getTileFunction:(t,e,i,n)=>this.getTile(t,e,i,n,s)},this.tileOptions),m=new r.A(p);return m.key=this.getKey(),m}getTile(t,e,i,r,o){const a=this.getProjection();if(a&&o&&!(0,u.tI)(a,o))return this.getReprojTile_(t,e,i,o,a);const l=this.getTileSize(t),h=(0,d.dp)(t,e,i);if(this.tileCache.containsKey(h))return this.tileCache.get(h);const c=this.loader_,g=new AbortController,f={signal:g.signal,crossOrigin:this.crossOrigin_},p=this.getTileCoordForTileUrlFunction([t,e,i]);if(!p)return null;const m=p[0],x=p[1],v=p[2],y=Object.assign({tileCoord:[t,e,i],loader:function(){return(0,_.hq)((function(){return c(m,x,v,f)}))},size:l,controller:g},this.tileOptions),E=new n.Ay(y);return E.key=this.getKey(),E.addEventListener(s.A.CHANGE,this.handleTileChange_),this.tileCache.set(h,E),E}handleTileChange_(t){const e=t.target,i=(0,g.v6)(e),n=e.getState();let s;n==h.A.LOADING?(this.tileLoadingKeys_[i]=!0,s=a.A.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=n==h.A.ERROR?a.A.TILELOADERROR:n==h.A.LOADED?a.A.TILELOADEND:void 0),s&&this.dispatchEvent(new l.c(s,e))}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||(0,u.tI)(e,t)))return this.tileGrid;const i=(0,g.v6)(t);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=(0,c.pr)(t)),this.tileGridForProjection_[i]}setTileGridForProjection(t,e){const i=(0,u.Jt)(t);if(i){const t=(0,g.v6)(i);t in this.tileGridForProjection_||(this.tileGridForProjection_[t]=e)}}getTileCacheForProjection(t){const e=this.getProjection();if(!e||(0,u.tI)(e,t))return this.tileCache;const i=(0,g.v6)(t);return i in this.tileCacheForProjection_||(this.tileCacheForProjection_[i]=new o.A(.1)),this.tileCacheForProjection_[i]}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const t in this.tileCacheForProjection_){const n=this.tileCacheForProjection_[t];n.expireCache(n==i?e:{})}}clear(){super.clear();for(const t in this.tileCacheForProjection_)this.tileCacheForProjection_[t].clear()}}const m=p},9925:(t,e,i)=>{i.d(e,{Ay:()=>C,VV:()=>T,QD:()=>A});var n=i(1685),s=i(6837),r=i(6141),o=i(3938),a=i(3101),l=i(2913),h=i(3513);function c(t){return Array.isArray(t)?Math.min(...t):t}var u=i(915),d=i(9438);class g extends o.Ay{constructor(t,e,i,n,s,o,c){let d=t.getExtent();d&&t.canWrapX()&&(d=d.slice(),d[0]=-1/0,d[2]=1/0);let g=e.getExtent();g&&e.canWrapX()&&(g=g.slice(),g[0]=-1/0,g[2]=1/0);const _=g?(0,u._N)(i,g):i,f=(0,u.q1)(_),p=(0,h.KQ)(t,e,f,n),m=a.l,x=new l.A(t,e,_,d,p*m,n),v=x.calculateSourceExtent(),y=(0,u.Im)(v)?null:o(v,p,s),E=y?r.A.IDLE:r.A.EMPTY,T=y?y.getPixelRatio():1;super(i,n,T,E),this.targetProj_=e,this.maxSourceExtent_=d,this.triangulation_=x,this.targetResolution_=n,this.targetExtent_=i,this.sourceImage_=y,this.sourcePixelRatio_=T,this.interpolate_=c,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==r.A.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==r.A.LOADED){const t=(0,u.RG)(this.targetExtent_)/this.targetResolution_,e=(0,u.Oq)(this.targetExtent_)/this.targetResolution_;this.canvas_=(0,h.XX)(t,e,this.sourcePixelRatio_,c(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(this.state==r.A.IDLE){this.state=r.A.LOADING,this.changed();const t=this.sourceImage_.getState();t==r.A.LOADED||t==r.A.ERROR?this.reproject_():(this.sourceListenerKey_=(0,d.KT)(this.sourceImage_,s.A.CHANGE,(t=>{const e=this.sourceImage_.getState();e!=r.A.LOADED&&e!=r.A.ERROR||(this.unlistenSource_(),this.reproject_())})),this.sourceImage_.load())}}unlistenSource_(){(0,d.JH)(this.sourceListenerKey_),this.sourceListenerKey_=null}}const _=g;var f=i(6444),p=i(2192),m=i(1597),x=i(3407),v=i(6514);class y extends n.Ay{constructor(t,e){super(t),this.image=e}}class E extends f.A{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:void 0===t.interpolate||t.interpolate}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=!!t.loader&&0===t.loader.length,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();return e&&(t=e[(0,v.FT)(e,t,0)]),t}getImage(t,e,i,n){const s=this.getProjection();if(!s||!n||(0,x.tI)(s,n))return s&&(n=s),this.getImageInternal(t,e,i,n);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&(0,x.tI)(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&(0,u.aI)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new _(s,n,t,e,i,((t,e,i)=>this.getImageInternal(t,e,i,s)),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,i,n){if(this.loader){const r=A(t,e,i,1),a=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===n&&(this.wantedExtent_&&(0,u.ms)(this.wantedExtent_,r)||(0,u.ms)(this.image.getExtent(),r))&&(this.wantedResolution_&&c(this.wantedResolution_)===a||c(this.image.getResolution())===a)))return this.image;this.wantedProjection_=n,this.wantedExtent_=r,this.wantedResolution_=a,this.image=new o.Ay(r,a,i,this.loader),this.image.addEventListener(s.A.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let i;switch(e.getState()){case r.A.LOADING:this.loading=!0,i="imageloadstart";break;case r.A.LOADED:this.loading=!1,i="imageloadend";break;case r.A.ERROR:this.loading=!1,i="imageloaderror";break;default:return}this.hasListener(i)&&this.dispatchEvent(new y(i,e))}}function T(t,e){t.getImage().src=e}function A(t,e,i,n){const s=e/i,r=(0,u.q1)(t),o=(0,m.mk)((0,u.RG)(t)/s,p.B),a=(0,m.mk)((0,u.Oq)(t)/s,p.B),l=o+2*(0,m.mk)((n-1)*o/2,p.B),h=a+2*(0,m.mk)((n-1)*a/2,p.B);return(0,u.Bg)(r,s,0,[l,h])}const C=E},8270:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(6837),s=i(9925),r=i(3938),o=i(915),a=i(3407);class l extends s.Ay{constructor(t){const e=void 0!==t.crossOrigin?t.crossOrigin:null,i=void 0!==t.imageLoadFunction?t.imageLoadFunction:s.VV;super({attributions:t.attributions,interpolate:t.interpolate,projection:(0,a.Jt)(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image=null,this.image=new r.Ay(this.imageExtent_,void 0,1,function(t){const e=t.load||r.D4,i=t.imageExtent,n=t.crossOrigin??null;return()=>{const s=new Image;return s.crossOrigin=n,e(s,t.url).then((t=>{const e=(0,o.RG)(i)/t.width,n=(0,o.Oq)(i)/t.height;return{image:t,extent:i,resolution:e!==n?[e,n]:n,pixelRatio:1}}))}}({url:t.url,imageExtent:t.imageExtent,crossOrigin:e,load:(t,e)=>(this.image.setImage(t),i(this.image,e),(0,r.D4)(t))})),this.image.addEventListener(n.A.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,i,n){return(0,o.HY)(t,this.image.getExtent())?this.image:null}getUrl(){return this.url_}}const h=l},3080:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(4977),s=i(4465);const r=new Error("Image failed to load");function o(t,e,i,n,o){return new Promise(((a,l)=>{const h=new Image;h.crossOrigin=o.crossOrigin??null,h.addEventListener("load",(()=>a(h))),h.addEventListener("error",(()=>l(r))),h.src=(0,s.M)(t,e,i,n,o.maxY)}))}function a(t){return function(e,i,n,r){return o((0,s.de)(t,e,i,n),e,i,n,r)}}function l(t){let e;if(Array.isArray(t))e=a(t);else if("string"==typeof t)e=a((0,s.Uu)(t));else{if("function"!=typeof t)throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");i=t,e=function(t,e,n,s){return o(i(t,e,n,s),t,e,n,s)}}var i;return e}let h=0;function c(t){return Array.isArray(t)?t.join("\n"):"string"==typeof t?t:(++h,"url-function-key-"+h)}class u extends n.A{constructor(t){let e,i=(t=t||{}).loader;t.url&&(i=l(t.url),e=c(t.url));const n=i?t.state:"loading",s=void 0===t.wrapX||t.wrapX;super({loader:i,key:e,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize,gutter:t.gutter,maxResolution:t.maxResolution,projection:t.projection,tileGrid:t.tileGrid,state:n,wrapX:s,transition:t.transition,interpolate:!1!==t.interpolate,crossOrigin:t.crossOrigin})}setUrl(t){const e=l(t);this.setLoader(e),this.setKey(c(t)),"ready"!==this.getState()&&this.setState("ready")}}const d=u},1011:(t,e,i)=>{i.d(e,{A:()=>h});var n=i(9925),s=i(3513),r=i(7500),o=i(3938),a=i(3407);class l extends n.Ay{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:n.VV,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,i,n){const o=(0,a.Jt)(i),l=this.getProjection();l&&l!==o&&(e=(0,s.KQ)(l,o,t,e),t=(0,a.pd)(t,o,l));const h={url:this.url_,params:{...this.params_,...n},projection:l||o};return(0,r.y4)(h,t,e)}getLegendUrl(t,e){return(0,r.$q)({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,i,n){return void 0===this.url_?null:(this.loader&&this.loaderProjection_===n||(this.loaderProjection_=n,this.loader=(0,r.Eq)({crossOrigin:this.crossOrigin_,params:this.params_,projection:n,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(t,e)=>(this.image.setImage(t),this.imageLoadFunction_(this.image,e),(0,o.D4)(t))})),super.getImageInternal(t,e,i,n))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const h=l},7896:(t,e,i)=>{i.d(e,{A:()=>o,o:()=>s});var n=i(702);const s='© OpenStreetMap contributors.';class r extends n.A{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:[s];const i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const o=r},6444:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(4120),s=i(3407);class r extends n.A{constructor(t){super(),this.projection=(0,s.Jt)(t.projection),this.attributions_=o(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise((function(t,i){e.viewResolver=t,e.viewRejector=i}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=o(t),this.changed()}setState(t){this.state_=t,this.changed()}}function o(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),e=>t):null}const a=r},6017:(t,e,i)=>{i.d(e,{A:()=>_,c:()=>g});var n=i(1685),s=i(6444),r=i(61),o=i(4087),a=i(588),l=i(3407),h=i(4863),c=i(4401),u=i(186);class d extends s.A{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;this.tileGrid&&(0,c.xq)(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tileCache=new r.A(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,s){return(0,o.b0)()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:(0,h.pr)(t)}getTileCacheForProjection(t){const e=this.getProjection();return(0,a.v)(null===e||(0,l.tI)(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),r=(0,c.xq)(n.getTileSize(t),this.tmpSize);return 1==s?r:(0,c.hs)(r,s,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=void 0!==e?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=(0,h.Li)(i,t,e)),(0,u.N5)(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}useTile(t,e,i,n){}}class g extends n.Ay{constructor(t,e){super(t),this.tile=e}}const _=d},8469:(t,e,i)=>{i.d(e,{A:()=>n});const n={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"}},8512:(t,e,i)=>{i.d(e,{A:()=>f});var n=i(6837),s=i(190),r=i(7404),o=i(61),a=i(1078),l=i(6164),h=i(3407),c=i(186),u=i(4863),d=i(4087);class g extends l.A{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:_,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:s.A,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const t in this.tileCacheForProjection){const n=this.tileCacheForProjection[t];n.expireCache(n==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!(0,h.tI)(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||(0,h.tI)(e,t)))return this.tileGrid;const i=(0,d.v6)(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=(0,u.pr)(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||(0,h.tI)(e,t))return this.tileCache;const i=(0,d.v6)(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new o.A(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,s,r,o){const l=[t,e,i],h=this.getTileCoordForTileUrlFunction(l,r),c=h?this.tileUrlFunction(h,s,r):void 0,u=new this.tileClass(l,void 0!==c?a.A.IDLE:a.A.EMPTY,void 0!==c?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(n.A.CHANGE,this.handleTileChange.bind(this)),u}getTile(t,e,i,n,s){const o=this.getProjection();if(!o||!s||(0,h.tI)(o,s))return this.getTileInternal(t,e,i,n,o||s);const a=this.getTileCacheForProjection(s),l=[t,e,i];let u;const d=(0,c.i7)(l);a.containsKey(d)&&(u=a.get(d));const g=this.getKey();if(u&&u.key==g)return u;const _=this.getTileGridForProjection(o),f=this.getTileGridForProjection(s),p=this.getTileCoordForTileUrlFunction(l,s),m=new r.A(o,_,s,f,l,p,this.getTilePixelRatio(n),this.getGutter(),((t,e,i,n)=>this.getTileInternal(t,e,i,n,o)),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=g,u?a.replace(d,m):a.set(d,m),m}getTileInternal(t,e,i,n,s){const r=(0,c.dp)(t,e,i),o=this.getKey();if(!this.tileCache.containsKey(r)){const a=this.createTile_(t,e,i,n,s,o);return this.tileCache.set(r,a),a}let a=this.tileCache.get(r);return a.key!=o&&(a=this.createTile_(t,e,i,n,s,o),this.tileCache.replace(r,a)),a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(t,e){const i=(0,h.Jt)(t);if(i){const t=(0,d.v6)(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function _(t,e){t.getImage().src=e}const f=g},4218:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(8512),s=i(915),r=i(2654),o=i(4863),a=i(3407),l=i(4087);Error,Error;class h extends n.A{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:(0,a.Jt)("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)!function(t,e,i){const n=document.createElement("script"),s="olc_"+(0,l.v6)(e);function r(){delete window[s],n.parentNode.removeChild(n)}n.async=!0,n.src=t+(t.includes("?")?"&":"?")+"callback="+s;const o=setTimeout((function(){r(),i&&i()}),1e4);window[s]=function(t){clearTimeout(o),r(),e(t)},document.head.appendChild(n)}(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=(0,a.Jt)("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=(0,a.FO)(e,i);n=(0,s.NW)(t.bounds,r)}const l=(0,o.kZ)(i),h=t.minzoom||0,c=t.maxzoom||22,u=(0,o.EN)({extent:l,maxZoom:c,minZoom:h,tileSize:this.tileSize_});if(this.tileGrid=u,this.tileUrlFunction=(0,r.Qz)(t.tiles,u),t.attribution&&!this.getAttributions()){const e=void 0!==n?n:l;this.setAttributions((function(i){return(0,s.HY)(e,i.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}}const c=h},2728:(t,e,i)=>{i.d(e,{A:()=>g});var n=i(8512),s=i(7500),r=i(4465),o=i(915),a=i(3513),l=i(2806),h=i(3407),c=i(1597),u=i(186);class d extends n.A{constructor(t){t=t||{};const e=Object.assign({},t.params);super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=(0,o.S5)(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,i,n){const r=(0,h.Jt)(i),l=this.getProjection()||r;let c=this.getTileGrid();c||(c=this.getTileGridForProjection(l));const u=(0,h.pd)(t,r,l),d=(0,a.KQ)(l,r,t,e),g=c.getZForResolution(d,this.zDirection),_=c.getResolution(g),f=c.getTileCoordForCoordAndZ(u,g);if(c.getResolutions().length<=f[0])return;let p=c.getTileCoordExtent(f,this.tmpExtent_);const m=this.gutter_;0!==m&&(p=(0,o.r)(p,_*m,p));const x={QUERY_LAYERS:this.params_.LAYERS};Object.assign(x,(0,s.W3)(this.params_,"GetFeatureInfo"),n);const v=Math.floor((u[0]-p[0])/_),y=Math.floor((p[3]-u[1])/_);return x[this.v13_?"I":"X"]=v,x[this.v13_?"J":"Y"]=y,this.getRequestUrl_(f,p,1,l||r,x)}getLegendUrl(t,e){if(void 0===this.urls[0])return;const i={SERVICE:"WMS",VERSION:s.jD,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){const t=this.params_.LAYERS;if(Array.isArray(t)&&1!==t.length)return;i.LAYER=t}if(void 0!==t){const e=this.getProjection()?this.getProjection().getMetersPerUnit():1,n=28e-5;i.SCALE=t*e/n}return Object.assign(i,e),(0,r.LW)(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r){const o=this.urls;if(!o)return;let a;return a=1==o.length?o[0]:o[(0,c.xP)((0,u.tW)(t),o.length)],(0,s.AE)(e,(this.tileGrid||this.getTileGridForProjection(n)).getResolution(t[0]),i,n,a,r,this.serverType_)}getTilePixelRatio(t){return this.hidpi_&&void 0!==this.serverType_?t:1}getKeyForParams_(){let t=0;const e=[];for(const i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||s.jD;this.v13_=(0,l.Z)(t,"1.3")>=0}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);const r=n.getResolution(t[0]);let a=n.getTileCoordExtent(t,this.tmpExtent_);const l=this.gutter_;0!==l&&(a=(0,o.r)(a,r*l,a));const h=Object.assign({},(0,s.W3)(this.params_,"GetMap"));return this.getRequestUrl_(t,a,e,i,h)}}const g=d},6164:(t,e,i)=>{i.d(e,{A:()=>u});var n=i(8469),s=i(6017),r=i(1078),o=i(2654),a=i(4465),l=i(186),h=i(4087);class c extends s.A{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===c.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=(0,h.v6)(e),o=e.getState();let a;o==r.A.LOADING?(this.tileLoadingKeys_[i]=!0,a=n.A.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],a=o==r.A.ERROR?n.A.TILELOADERROR:o==r.A.LOADED?n.A.TILELOADEND:void 0),null!=a&&this.dispatchEvent(new s.c(a,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=(0,a.Uu)(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction((0,o.Qz)(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=(0,l.dp)(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}const u=c},731:(t,e,i)=>{i.d(e,{A:()=>A});var n=i(71),s=i(2135),r=i(1685),o=i(6837),a=i(8450),l=i(5902),h=i(4778),c=i(6444),u=i(8280),d=i(4238);function g(t,e){return[[-1/0,-1/0,1/0,1/0]]}i(3407);var _=i(588),f=i(915),p=i(6514),m=i(4087),x=i(3530),v=i(9438),y=i(1142);class E extends r.Ay{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class T extends c.A{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=d.tV,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&((0,_.v)(this.format_,"`format` must be set when `url` is set"),this.loader_=(0,y.nF)(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:g;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let i,s;this.featuresRtree_=e?new l.A:null,this.loadedExtentsRtree_=new l.A,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),e||void 0!==i||(i=new n.A(s)),void 0!==s&&this.addFeaturesInternal(s),void 0!==i&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=(0,m.v6)(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const e=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new E(u.A.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof h.Ay||(this.featureChangeKeys_[t]=[(0,v.KT)(e,o.A.CHANGE,this.handleFeatureChange_,this),(0,v.KT)(e,a.A.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(void 0!==e.getId()){const t=String(e.getId());if(t in this.idIndex_)if(e instanceof h.Ay){const n=this.idIndex_[t];n instanceof h.Ay?Array.isArray(n)?n.push(e):this.idIndex_[t]=[n,e]:i=!1}else i=!1;else this.idIndex_[t]=e}return i&&((0,_.v)(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let e=0,n=t.length;e{e||(e=!0,this.addFeature(t.element),e=!1)})),t.addEventListener(s.A.REMOVE,(t=>{e||(e=!0,this.removeFeature(t.element),e=!1)})),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(v.JH);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const t=t=>{this.removeFeatureInternal(t)};this.featuresRtree_.forEach(t);for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new E(u.A.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){const n=i.getGeometry();if(n instanceof h.Ay||n.intersectsCoordinate(t))return e(i)}))}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,(function(i){const n=i.getGeometry();if(n instanceof h.Ay||n.intersectsExtent(t)){const t=e(i);if(t)return t}}))}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),(0,x.p)(this.nullGeometryFeatures_)||(0,p.X$)(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=(0,f.QJ)(t,e);return[].concat(...i.map((t=>this.featuresRtree_.getInExtent(t))))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const r=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||d.rT,this.featuresRtree_.forEachInExtent(a,(function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e instanceof h.Ay?0:e.closestPointXY(i,n,r,o),o{--this.loadingExtentsCount_,this.dispatchEvent(new E(u.A.FEATURESLOADEND,void 0,t))}),(()=>{--this.loadingExtentsCount_,this.dispatchEvent(new E(u.A.FEATURESLOADERROR))})),n.insert(r,{extent:r.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,(function(e){if((0,f.aI)(e.extent,t))return i=e,!0})),i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;i{i.d(e,{A:()=>n});const n={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"}},5620:(t,e,i)=>{i.d(e,{A:()=>C});var n=i(6837),s=i(8143),r=i(1078);class o extends s.A{constructor(t,e,i,n,s,r){super(t,e,r),this.extent=null,this.format_=n,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==r.A.IDLE&&(this.setState(r.A.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(t,e){this.setFeatures(t)}onError(){this.setState(r.A.ERROR)}setFeatures(t){this.features_=t,this.setState(r.A.LOADED)}setLoader(t){this.loader_=t}}const a=o;var l=i(61),h=i(6758),c=i(6164),u=i(8711),d=i(4087);const g=[];class _ extends s.A{constructor(t,e,i,n){super(t,e,{transition:0}),this.context_=null,this.executorGroups=[],this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=n.bind(void 0,this),this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=(0,u.Y)(1,1,g)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(t){const e=(0,d.v6)(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){(0,u.Yg)(this.context_),g.push(this.context_.canvas),this.context_=null,super.release()}}const f=_;var p=i(9496),m=i(915),x=i(4863),v=i(186),y=i(3530),E=i(1142),T=i(4401);class A extends c.A{constructor(t){const e=t.projection||"EPSG:3857",i=t.extent||(0,x.kZ)(e),n=t.tileGrid||(0,x.EN)({extent:i,maxResolution:t.maxResolution,maxZoom:void 0!==t.maxZoom?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,projection:e,state:t.state,tileGrid:n,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:S,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:void 0===t.zDirection?1:t.zDirection}),this.format_=t.format?t.format:null,this.sourceTileCache_=new l.A(128),this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:a,this.tileGrids_={}}getOverlaps(){return this.overlaps_}clear(){this.sourceTileCache_.clear()}expireCache(t,e){const i=this.getTileCacheForProjection(t),n=Object.keys(e).reduce(((t,e)=>{const n=(0,v.gr)(e),s=i.peek(n);if(s){const e=s.sourceTiles;for(let i=0,n=e.length;i{const o=this.tileUrlFunction(s,t,e),a=this.sourceTileCache_.containsKey(o)?this.sourceTileCache_.get(o):new this.tileClass(s,o?r.A.IDLE:r.A.EMPTY,o,this.format_,this.tileLoadFunction);i.sourceTiles.push(a);const l=a.getState();if(l{this.handleTileChange(e);const s=a.getState();if(s===r.A.LOADED||s===r.A.ERROR){const e=a.getKey();e in i.errorTileKeys?a.getState()===r.A.LOADED&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,s===r.A.ERROR?i.errorTileKeys[e]=!0:a.removeEventListener(n.A.CHANGE,t),0===i.loadingSourceTiles&&i.setState((0,y.p)(i.errorTileKeys)?r.A.LOADED:r.A.ERROR)}};a.addEventListener(n.A.CHANGE,t),i.loadingSourceTiles++}l===r.A.IDLE&&(a.extent=c.getTileCoordExtent(s),a.projection=e,a.resolution=c.getResolution(s[0]),this.sourceTileCache_.set(o,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((t=>t.getState()===r.A.ERROR))?r.A.ERROR:r.A.LOADED)}return i.sourceTiles}getTile(t,e,i,n,s){const o=[t,e,i];let a=this.getTileCoordForTileUrlFunction(o,s);const l=this.getTileGrid().getExtent(),h=this.getTileGridForProjection(s);if(a&&l){const e=h.getTileCoordExtent(a);(0,m.r)(e,-h.getResolution(t),e),(0,m.HY)(l,e)||(a=null)}let c=!0;if(null!==a){const e=this.tileGrid,i=h.getResolution(t),r=e.getZForResolution(i,1),o=h.getTileCoordExtent(a);(0,m.r)(o,-i,o),e.forEachTileCoord(o,r,(t=>{c=c&&!this.tileUrlFunction(t,n,s)}))}const u=new f(o,c?r.A.EMPTY:r.A.IDLE,a,this.getSourceTiles.bind(this,n,s));return u.key=this.getKey(),u}getTileGridForProjection(t){const e=t.getCode();let i=this.tileGrids_[e];if(!i){const t=this.tileGrid,n=t.getResolutions().slice(),s=n.map((function(e,i){return t.getOrigin(i)})),r=n.map((function(e,i){return t.getTileSize(i)})),o=p.L+1;for(let t=n.length;t{i.d(e,{A:()=>u,t:()=>d});var n=i(8512),s=i(4465),r=i(915),o=i(6758),a=i(3407);class l extends o.A{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}var h=i(2654);class c extends n.A{constructor(t){const e=void 0!==t.requestEncoding?t.requestEncoding:"KVP",i=t.tileGrid;let n=t.urls;void 0===n&&void 0!==t.url&&(n=(0,s.Uu)(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:n,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),n&&n.length>0&&(this.tileUrlFunction=(0,h.FD)(n.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join("\n");this.setTileUrlFunction((0,h.FD)(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};"KVP"==e&&Object.assign(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t="KVP"==e?(0,s.LW)(t,i):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t}));const n=this.tileGrid,r=this.dimensions_;return function(i,o,a){if(!i)return;const l={TileMatrix:n.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};Object.assign(l,r);let h=t;return h="KVP"==e?(0,s.LW)(h,l):h.replace(/\{(\w+?)\}/g,(function(t,e){return l[e]})),h}}}const u=c;function d(t,e){const i=t.Contents.Layer,n=i?.find((function(t){return t.Identifier==e.layer}));if(!n)return null;const s=t.Contents.TileMatrixSet;let o;o=n.TileMatrixSetLink.length>1?"projection"in e?n.TileMatrixSetLink.findIndex((function(t){const i=s.find((function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,n=(0,a.Jt)(i),r=(0,a.Jt)(e.projection);return n&&r?(0,a.tI)(n,r):i==e.projection})):n.TileMatrixSetLink.findIndex((function(t){return t.TileMatrixSet==e.matrixSet})):0,o<0&&(o=0);const h=n.TileMatrixSetLink[o].TileMatrixSet,c=n.TileMatrixSetLink[o].TileMatrixSetLimits;let u=n.Format[0];"format"in e&&(u=e.format),o=n.Style.findIndex((function(t){return"style"in e?t.Title==e.style:t.isDefault})),o<0&&(o=0);const d=n.Style[o].Identifier,g={};"Dimension"in n&&n.Dimension.forEach((function(t,e,i){const n=t.Identifier;let s=t.Default;void 0===s&&(s=t.Value[0]),g[n]=s}));const _=t.Contents.TileMatrixSet.find((function(t){return t.Identifier==h}));let f;const p=_.SupportedCRS;if(p&&(f=(0,a.Jt)(p)),"projection"in e){const t=(0,a.Jt)(e.projection);t&&(f&&!(0,a.tI)(t,f)||(f=t))}let m=!1;const x=f.getAxisOrientation().startsWith("ne");let v=_.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:v.MatrixWidth-1,MaxTileRow:v.MatrixHeight-1};if(c){y=c[c.length-1];const t=_.TileMatrix.find((t=>t.Identifier===y.TileMatrix||_.Identifier+":"+t.Identifier===y.TileMatrix));t&&(v=t)}const E=28e-5*v.ScaleDenominator/f.getMetersPerUnit(),T=x?[v.TopLeftCorner[1],v.TopLeftCorner[0]]:v.TopLeftCorner,A=v.TileWidth*E,C=v.TileHeight*E;let S=_.BoundingBox;S&&x&&(S=[S[1],S[0],S[3],S[2]]);let R=[T[0]+A*y.MinTileCol,T[1]-C*(1+y.MaxTileRow),T[0]+A*(1+y.MaxTileCol),T[1]-C*y.MinTileRow];if(void 0!==S&&!(0,r.ms)(S,R)){const t=n.WGS84BoundingBox,e=(0,a.Jt)("EPSG:4326").getExtent();if(R=S,t)m=t[0]===e[0]&&t[2]===e[2];else{const t=(0,a.DI)(S,_.SupportedCRS,"EPSG:4326");m=t[0]-1e-10<=e[0]&&t[2]+1e-10>=e[2]}}const w=function(t,e,i){const n=[],s=[],r=[],o=[],h=[];i=void 0!==i?i:[];const c="TileMatrix",u="Identifier",d="ScaleDenominator",g="TopLeftCorner",_=t.SupportedCRS,f=(0,a.Jt)(_),p=f.getMetersPerUnit(),m=f.getAxisOrientation().startsWith("ne");return t[c].sort((function(t,e){return e[d]-t[d]})),t[c].forEach((function(e){let a;if(a=!(i.length>0)||i.find((function(i){return e[u]==i[c]||!e[u].includes(":")&&t[u]+":"+e[u]===i[c]})),a){s.push(e[u]);const t=28e-5*e[d]/p,i=e.TileWidth,a=e.TileHeight;m?r.push([e[g][1],e[g][0]]):r.push(e[g]),n.push(t),o.push(i==a?i:[i,a]),h.push([e.MatrixWidth,e.MatrixHeight])}})),new l({extent:e,origins:r,resolutions:n,matrixIds:s,tileSizes:o,sizes:h})}(_,R,c),b=[];let I=e.requestEncoding;if(I=void 0!==I?I:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata){const e=t.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let t=0,i=e.length;t{i.d(e,{A:()=>o});var n=i(8512),s=i(4863);class r extends n.A{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:(0,s.EN)({extent:(0,s.kZ)(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}}const o=r},2192:(t,e,i)=>{i.d(e,{B:()=>n});const n=4},7500:(t,e,i)=>{i.d(e,{$q:()=>x,AE:()=>_,Eq:()=>p,W3:()=>f,jD:()=>u,y4:()=>m});var n=i(2192),s=i(4465),r=i(2806),o=i(3938),a=i(1597),l=i(915),h=i(3407),c=i(9925);const u="1.3.0",d=[101,101];function g(t,e,i,n,o){o.WIDTH=i[0],o.HEIGHT=i[1];const a=n.getAxisOrientation(),l=(0,r.Z)(o.VERSION,"1.3")>=0;o[l?"CRS":"SRS"]=n.getCode();const h=l&&a.startsWith("ne")?[e[1],e[0],e[3],e[2]]:e;return o.BBOX=h.join(","),(0,s.LW)(t,o)}function _(t,e,i,s,r,o,h){o=Object.assign({REQUEST:"GetMap"},o);const c=e/i,u=[(0,a.LI)((0,l.RG)(t)/c,n.B),(0,a.LI)((0,l.Oq)(t)/c,n.B)];if(1!=i)switch(h){case"geoserver":const t=90*i+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+t:o.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":o.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":o.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return g(r,t,u,s,o)}function f(t,e){return Object.assign({REQUEST:e,SERVICE:"WMS",VERSION:u,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},t)}function p(t){const e=void 0===t.hidpi||t.hidpi,i=(0,h.Jt)(t.projection||"EPSG:3857"),n=t.ratio||1.5,s=t.load||o.D4,r=t.crossOrigin??null;return(o,a,l)=>{o=(0,c.QD)(o,a,l,n),1==l||e&&void 0!==t.serverType||(l=1);const h=_(o,a,l,i,t.url,f(t.params,"GetMap"),t.serverType),u=new Image;return u.crossOrigin=r,s(u,h).then((t=>({image:t,extent:o,pixelRatio:l})))}}function m(t,e,i){if(void 0===t.url)return;const s=(0,h.Jt)(t.projection||"EPSG:3857"),o=(0,l.Bg)(e,i,0,d),c={QUERY_LAYERS:t.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(c,f(t.params,"GetFeatureInfo"),t.params);const u=(0,a.RI)((e[0]-o[0])/i,n.B),_=(0,a.RI)((o[3]-e[1])/i,n.B),p=(0,r.Z)(c.VERSION,"1.3")>=0;return c[p?"I":"X"]=u,c[p?"J":"Y"]=_,g(t.url,o,d,s,c)}function x(t,e){if(void 0===t.url)return;const i={SERVICE:"WMS",VERSION:u,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0!==e){const n=(0,h.Jt)(t.projection||"EPSG:3857").getMetersPerUnit()||1,s=28e-5;i.SCALE=e*n/s}if(Object.assign(i,t.params),void 0!==t.params&&void 0===i.LAYER){const t=i.LAYERS;if(Array.isArray(t)&&1===t.length)return;i.LAYER=t}return(0,s.LW)(t.url,i)}},2490:(t,e,i)=>{i.d(e,{Yf:()=>r,cY:()=>o});var n=i(1597);const s=6371008.8;function r(t,e,i){i=i||s;const r=(0,n.eh)(t[1]),o=(0,n.eh)(e[1]),a=(o-r)/2,l=(0,n.eh)(e[0]-t[0])/2,h=Math.sin(a)*Math.sin(a)+Math.sin(l)*Math.sin(l)*Math.cos(r)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}function o(t,e,i,r){r=r||s;const o=(0,n.eh)(t[1]),a=(0,n.eh)(t[0]),l=e/r,h=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(i)),c=a+Math.atan2(Math.sin(i)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(h));return[(0,n.xW)(c),(0,n.xW)(h)]}},2806:(t,e,i)=>{function n(t,e,i){const n=void 0!==i?t.toFixed(i):""+t;let s=n.indexOf(".");return s=-1===s?n.length:s,s>e?n:new Array(1+e-s).join("0")+n}function s(t,e){const i=(""+t).split("."),n=(""+e).split(".");for(let t=0;ts)return 1;if(s>e)return-1}return 0}i.d(e,{H:()=>n,Z:()=>s})},4969:(t,e,i)=>{i.d(e,{A:()=>s});var n=i(588);const s=class{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return(0,n.v)(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return(0,n.v)(void 0!==e,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t}getValues(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){(0,n.v)(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}},5902:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(48),s=i(915),r=i(4087),o=i(3530);const a=class{constructor(t){this.rbush_=new n.A(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[(0,r.v6)(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,s=e.length;n{i.d(e,{A:()=>r});var n=i(6936);class s extends n.A{constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new s({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}const r=s},3628:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(6141),s=i(7907);class r{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){const t=this.getColor();return new r({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){const e=(0,s.J)(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then((()=>{this.patternImage_=null})),e.getImageState()===n.A.IDLE&&e.load(),e.getImageState()===n.A.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}const o=r},9700:(t,e,i)=>{i.d(e,{A:()=>d});var n=i(6837),s=i(6141),r=i(940),o=i(3730),a=i(588),l=i(7907),h=i(4087);function c(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}class u extends r.A{constructor(t){const e=void 0!==(t=t||{}).opacity?t.opacity:1,i=void 0!==t.rotation?t.rotation:0,n=void 0!==t.scale?t.scale:1,r=void 0!==t.rotateWithView&&t.rotateWithView;super({opacity:e,rotation:i,scale:n,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const u=void 0!==t.img?t.img:null;let d,g=t.src;if((0,a.v)(!(void 0!==g&&u),"`image` and `src` cannot be provided at the same time"),void 0!==g&&0!==g.length||!u||(g=u.src||(0,h.v6)(u)),(0,a.v)(void 0!==g&&g.length>0,"A defined and non-empty `src` or `image` must be provided"),(0,a.v)(!((void 0!==t.width||void 0!==t.height)&&void 0!==t.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?d=s.A.IDLE:void 0!==u&&(d="complete"in u?u.complete?u.src?s.A.LOADED:s.A.IDLE:s.A.LOADING:s.A.LOADED),this.color_=void 0!==t.color?(0,o._j)(t.color):null,this.iconImage_=(0,l.J)(u,g,this.crossOrigin_,d,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,i;if(t.size)[e,i]=t.size;else{const n=this.getImage(1);if(n.width&&n.height)e=n.width,i=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;const i=this.iconImage_.getSize();this.setScale(c(i[0],i[1],t.width,t.height))};return void this.listenImageChange(e)}}void 0!==e&&this.setScale(c(e,i,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new u({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),"top-right"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[0]=-t[0]+e[0]),"bottom-left"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),"top-right"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[0]=i[0]-e[0]-t[0]),"bottom-left"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:this.iconImage_.getImageState()==s.A.LOADED?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:this.iconImage_.getImageState()==s.A.LOADED?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(n.A.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(n.A.CHANGE,t)}ready(){return this.iconImage_.ready()}}const d=u},7907:(t,e,i)=>{i.d(e,{J:()=>d});var n=i(9332),s=i(6837),r=i(6141),o=i(3730),a=i(8711),l=i(3938),h=i(2241);let c=null;class u extends n.A{constructor(t,e,i,n,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=void 0===n?r.A.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===r.A.LOADED){c||(c=(0,a.Y)(1,1,void 0,{willReadFrequently:!0})),c.drawImage(this.image_,0,0);try{c.getImageData(0,0,1,1),this.tainted_=!1}catch(t){c=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(s.A.CHANGE)}handleImageError_(){this.imageState_=r.A.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=r.A.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=(0,a.Y)(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===r.A.IDLE){this.image_||this.initializeImage_(),this.imageState_=r.A.LOADING;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch(t){this.handleImageError_()}this.image_ instanceof HTMLImageElement&&(0,l.RA)(this.image_,this.src_).then((t=>{this.image_=t,this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==r.A.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=(0,o.oJ)(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}ready(){return this.ready_||(this.ready_=new Promise((t=>{if(this.imageState_===r.A.LOADED||this.imageState_===r.A.ERROR)t();else{const e=()=>{this.imageState_!==r.A.LOADED&&this.imageState_!==r.A.ERROR||(this.removeEventListener(s.A.CHANGE,e),t())};this.addEventListener(s.A.CHANGE,e)}}))),this.ready_}}function d(t,e,i,n,s,r){let o=void 0===e?void 0:h.ue.get(e,i,s);return o||(o=new u(t,t&&"src"in t?t.src||void 0:e,i,n,s),h.ue.set(e,i,s,o,r)),r&&o&&!h.ue.getPattern(e,i,s)&&h.ue.set(e,i,s,o,r),o}},2241:(t,e,i)=>{i.d(e,{ue:()=>a});var n=i(6141),s=i(3730),r=i(8711);function o(t,e,i){return e+":"+t+":"+(i?(0,s._j)(i):"null")}const a=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];3&t++||i.hasListener()||(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const n=o(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){const n=o(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,s,a){const l=o(t,e,i),h=l in this.cache_;this.cache_[l]=s,a&&(s.getImageState()===n.A.IDLE&&s.load(),s.getImageState()===n.A.LOADING?s.ready().then((()=>{this.patternCache_[l]=(0,r.lr)().createPattern(s.getImage(1),"repeat")})):this.patternCache_[l]=(0,r.lr)().createPattern(s.getImage(1),"repeat")),h||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}},940:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(4087),s=i(4401);class r{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=(0,s.xq)(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new r({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return(0,n.b0)()}getImage(t){return(0,n.b0)()}getHitDetectionImage(){return(0,n.b0)()}getPixelRatio(t){return 1}getImageState(){return(0,n.b0)()}getImageSize(){return(0,n.b0)()}getOrigin(){return(0,n.b0)()}getSize(){return(0,n.b0)()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=(0,s.xq)(t)}listenImageChange(t){(0,n.b0)()}load(){(0,n.b0)()}unlistenImageChange(t){(0,n.b0)()}ready(){return Promise.resolve()}}const o=r},6936:(t,e,i)=>{i.d(e,{A:()=>c});var n=i(6141),s=i(940),r=i(3730),o=i(7295),a=i(8711),l=i(8774);class h extends s.A{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvases_,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?n.A.LOADING:n.A.LOADED,this.imageState_===n.A.LOADING&&this.ready().then((()=>this.imageState_=n.A.LOADED)),this.render()}clone(){const t=this.getScale(),e=new h({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,n=(0,a.Y)(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius,s=void 0===this.radius2_?n:this.radius2_;if(n{i.d(e,{A:()=>s});class n{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new n({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const s=n},9276:(t,e,i)=>{i.d(e,{Ay:()=>g,d1:()=>c,mC:()=>l,mY:()=>u});var n=i(7733),s=i(3628),r=i(953),o=i(588);class a{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=d,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new a({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=d,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function l(t){let e;if("function"==typeof t)e=t;else{let i;Array.isArray(t)?i=t:((0,o.v)("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`"),i=[t]),e=function(){return i}}return e}let h=null;function c(t,e){if(!h){const t=new s.A({color:"rgba(255,255,255,0.4)"}),e=new r.A({color:"#3399CC",width:1.25});h=[new a({image:new n.A({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return h}function u(){const t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new a({fill:new s.A({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new a({stroke:new r.A({color:e,width:5})}),new a({stroke:new r.A({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new a({image:new n.A({radius:6,fill:new s.A({color:i}),stroke:new r.A({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function d(t){return t.getGeometry()}const g=a},1426:(t,e,i)=>{i.d(e,{A:()=>o});var n=i(3628),s=i(4401);class r{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=(0,s.xq)(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new n.A({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new r({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=(0,s.xq)(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}const o=r},186:(t,e,i)=>{function n(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function s(t,e,i){return t+"/"+e+"/"+i}function r(t){return s(t[0],t[1],t[2])}function o(t){const[e,i,n]=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return s(e,i,n)}function a(t){return t.split("/").map(Number)}function l(t){return h(t[0],t[1],t[2])}function h(t,e,i){return(e<i||i>e.getMaxZoom())return!1;const r=e.getFullTileRange(i);return!r||r.containsXY(n,s)}i.d(e,{K:()=>a,N:()=>n,N5:()=>c,_T:()=>h,dp:()=>s,gr:()=>o,i7:()=>r,tW:()=>l})},4863:(t,e,i)=>{i.d(e,{EN:()=>c,Li:()=>h,kZ:()=>d,pr:()=>l});var n=i(6758),s=i(9496),r=i(3407),o=i(915),a=i(4401);function l(t){let e=t.getDefaultTileGrid();return e||(e=function(t){return function(t,e,i,s){s=void 0!==s?s:"top-left";const r=u(t,e,i);return new n.A({extent:t,origin:(0,o.qF)(t,s),resolutions:r,tileSize:i})}(d(t),void 0,void 0,void 0)}(t),t.setDefaultTileGrid(e)),e}function h(t,e,i){const n=e[0],s=t.getTileCoordCenter(e),r=d(i);if(!(0,o.Ym)(r,s)){const e=(0,o.RG)(r),i=Math.ceil((r[0]-s[0])/e);return s[0]+=e*i,t.getTileCoordForCoordAndZ(s,n)}return e}function c(t){const e=t||{},i=e.extent||(0,r.Jt)("EPSG:3857").getExtent(),s={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:u(i,e.maxZoom,e.tileSize,e.maxResolution)};return new n.A(s)}function u(t,e,i,n){e=void 0!==e?e:s.L,i=(0,a.xq)(void 0!==i?i:s.R);const r=(0,o.Oq)(t),l=(0,o.RG)(t);n=n>0?n:Math.max(l/i[0],r/i[1]);const h=e+1,c=new Array(h);for(let t=0;t{i.d(e,{A:()=>g});var n=i(1110),s=i(9496),r=i(588),o=i(1597),a=i(915),l=i(186),h=i(4350),c=i(6514),u=i(4401);const d=[0,0,0],g=class{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,(0,r.v)((0,c.WC)(this.resolutions_,((t,e)=>e-t),!0),"`resolutions` must be sorted in descending order"),!t.origins)for(let t=0,i=this.resolutions_.length-1;t{const s=new n.A(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){const t=this.getTileRangeForExtentAndZ(i,e);s.minX=Math.max(t.minX,s.minX),s.maxX=Math.min(t.maxX,s.maxX),s.minY=Math.max(t.minY,s.minY),s.maxY=Math.min(t.maxY,s.maxY)}return s})):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,s=n.maxX;t<=s;++t)for(let s=n.minY,r=n.maxY;s<=r;++s)i([e,t,s])}forEachTileCoordParentTileRange(t,e,i,s){let r,o,a,l=null,h=t[0]-1;for(2===this.zoomFactor_?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);h>=this.minZoom;){if(void 0!==o&&void 0!==a?(o=Math.floor(o/2),a=Math.floor(a/2),r=(0,n.N)(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,h,i),e(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e{i.d(e,{L:()=>n,R:()=>s});const n=42,s=256},2654:(t,e,i)=>{i.d(e,{FD:()=>l,Qz:()=>a});var n=i(1597),s=i(4465),r=i(186);function o(t,e){return function(i,n,r){if(!i)return;let o;const a=i[0];if(e){const t=e.getFullTileRange(a);t&&(o=t.getHeight()-1)}return(0,s.M)(t,a,i[1],i[2],o)}}function a(t,e){const i=t.length,n=new Array(i);for(let s=0;s{i.d(e,{Bb:()=>c,T9:()=>f,Tl:()=>g,Zz:()=>_,cL:()=>o,dI:()=>m,e$:()=>u,hs:()=>d,k3:()=>h,lw:()=>a,vt:()=>r});var n=i(588);const s=new Array(6);function r(){return[1,0,0,1,0,0]}function o(t){return l(t,1,0,0,1,0,0)}function a(t,e){const i=t[0],n=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],d=e[4],g=e[5];return t[0]=i*l+s*h,t[1]=n*l+r*h,t[2]=i*c+s*u,t[3]=n*c+r*u,t[4]=i*d+s*g+o,t[5]=n*d+r*g+a,t}function l(t,e,i,n,s,r,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=s,t[4]=r,t[5]=o,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function c(t,e){const i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function u(t,e){const i=Math.cos(e),n=Math.sin(e);return a(t,l(s,i,n,-n,i,0,0))}function d(t,e,i){return a(t,l(s,e,0,0,i,0,0))}function g(t,e,i){return a(t,l(s,1,0,0,1,e,i))}function _(t,e,i,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return t[0]=n*h,t[1]=s*l,t[2]=-n*l,t[3]=s*h,t[4]=o*n*h-a*n*l+e,t[5]=o*s*l+a*s*h+i,t}function f(t,e){const i=(s=e)[0]*s[3]-s[1]*s[2];var s;(0,n.v)(0!==i,"Transformation matrix cannot be inverted");const r=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5];return t[0]=l/i,t[1]=-o/i,t[2]=-a/i,t[3]=r/i,t[4]=(a*c-l*h)/i,t[5]=-(r*c-o*h)/i,t}const p=[1e6,1e6,1e6,1e6,2,2];function m(t){return"matrix("+t.map(((t,e)=>Math.round(t*p[e])/p[e])).join(", ")+")"}},4465:(t,e,i)=>{i.d(e,{LW:()=>r,M:()=>c,Uu:()=>d,de:()=>u});var n=i(186),s=i(1597);function r(t,e){const i=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))}));const n=i.join("&");return t=t.replace(/[?&]$/,""),(t+=t.includes("?")?"&":"?")+n}const o=/\{z\}/g,a=/\{x\}/g,l=/\{y\}/g,h=/\{-y\}/g;function c(t,e,i,n,s){return t.replace(o,e.toString()).replace(a,i.toString()).replace(l,n.toString()).replace(h,(function(){if(void 0===s)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()}))}function u(t,e,i,r){const o=(0,n._T)(e,i,r);return t[(0,s.xP)(o,t.length)]}function d(t){const e=[];let i=/\{([a-z])-([a-z])\}/.exec(t);if(i){const n=i[1].charCodeAt(0),s=i[2].charCodeAt(0);let r;for(r=n;r<=s;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t),i){const n=parseInt(i[2],10);for(let s=parseInt(i[1],10);s<=n;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}},3954:(t,e,i)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}i.d(e,{Z:()=>s,v:()=>n})},130:(t,e,i)=>{i.d(e,{Be:()=>l,Ek:()=>a,H7:()=>s,IP:()=>r,JL:()=>c,SD:()=>_,Ss:()=>o,UD:()=>u,l4:()=>h,zH:()=>d});var n=i(7771);const s=34962,r=34963,o=35040,a=35044,l=35048,h=5121,c=5123,u=5125,d=5126,g=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function _(t,e){e=Object.assign({preserveDrawingBuffer:!0,antialias:!n.oF},e);const i=g.length;for(let n=0;n{i.d(e,{Ay:()=>a});var n=i(130),s=i(588);const r={STATIC_DRAW:n.Ek,STREAM_DRAW:n.Ss,DYNAMIC_DRAW:n.Be};function o(t){switch(t){case n.H7:return Float32Array;case n.IP:return Uint32Array;default:return Float32Array}}const a=class{constructor(t,e){this.array_=null,this.type_=t,(0,s.v)(t===n.H7||t===n.IP,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage_=void 0!==e?e:r.STATIC_DRAW}ofSize(t){return this.array_=new(o(this.type_))(t),this}fromArray(t){return this.array_=o(this.type_).from(t),this}fromArrayBuffer(t){return this.array_=new(o(this.type_))(t),this}getType(){return this.type_}getArray(){return this.array_}getUsage(){return this.usage_}getSize(){return this.array_?this.array_.length:0}}},9777:(t,e,i)=>{i.d(e,{jQ:()=>g,M8:()=>d,Ay:()=>v});const n="webglcontextlost",s="webglcontextrestored";var r=i(25),o=i(4087);const a=class{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n precision mediump float;\n\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n\n uniform vec2 u_screenSize;\n\n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach((i=>{this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}))}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const t=0,n=e.RGBA,s=0,r=e.RGBA,o=e.UNSIGNED_BYTE,a=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,t,n,i[0],i[1],s,r,o,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const s=this.getGL(),r=t.size;if(s.bindFramebuffer(s.FRAMEBUFFER,e?e.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!e){const e=(0,o.v6)(s.canvas);if(!t.renderTargets[e]){const i=s.getContextAttributes();i&&i.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT)),t.renderTargets[e]=!0}}s.disable(s.DEPTH_TEST),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=t.layerStatesArray[t.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(t),i&&i(s,t),s.drawArrays(s.TRIANGLES,0,6),n&&n(s,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach((function(s){if(i="function"==typeof s.value?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof ImageData)s.texture||(s.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,s.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(s.location,n++);else if(Array.isArray(i))switch(i.length){case 2:return void e.uniform2f(s.location,i[0],i[1]);case 3:return void e.uniform3f(s.location,i[0],i[1],i[2]);case 4:return void e.uniform4f(s.location,i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(s.location,i)}))}};var l=i(130),h=i(3530),c=i(9703),u=i(3954);const d={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},g={UNSIGNED_BYTE:l.l4,UNSIGNED_SHORT:l.JL,UNSIGNED_INT:l.UD,FLOAT:l.zH},_={};function f(t){return"shared/"+t}let p=0;class m extends r.A{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?f(t.canvasCacheKey):function(){const t="unique/"+p;return p+=1,t}(),this.gl_=function(t){let e=_[t];if(!e){const i=document.createElement("canvas");i.width=1,i.height=1,i.style.position="absolute",i.style.left="0",e={users:0,context:(0,l.SD)(i)},_[t]=e}return e.users+=1,e.context}(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(n,this.boundHandleWebGLContextLost_),e.addEventListener(s,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=(0,c.vt)(),this.offsetScaleMatrix_=(0,c.vt)(),this.tmpMat4_=(0,u.v)(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map((t=>new a({webGlContext:this.gl_,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms}))):[new a({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===f(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=(0,o.v6)(t);let n=this.bufferCache_[i];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=n),e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,i=(0,o.v6)(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(n,this.boundHandleWebGLContextLost_),t.removeEventListener(s,this.boundHandleWebGLContextRestored_),function(t){const e=_[t];if(!e)return;if(e.users-=1,e.users>0)return;const i=e.context,n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();const s=i.canvas;s.width=1,s.height=1,delete _[t]}(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,s=this.getCanvas(),r=t.size,o=t.pixelRatio;s.width===r[0]*o&&s.height===r[1]*o||(s.width=r[0]*o,s.height=r[1]*o,s.style.width=r[0]+"px",s.style.height=r[1]+"px");for(let e=this.postProcessPasses_.length-1;e>=0;e--)this.postProcessPasses_[e].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}prepareDrawToRenderTarget(t,e,i,n){const s=this.gl_,r=e.getSize();s.bindFramebuffer(s.FRAMEBUFFER,e.getFramebuffer()),s.bindRenderbuffer(s.RENDERBUFFER,e.getDepthbuffer()),s.viewport(0,0,r[0],r[1]),s.bindTexture(s.TEXTURE_2D,e.getTexture()),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,i?s.ZERO:s.ONE_MINUS_SRC_ALPHA),n?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,s=e-t,r=4*t;i.drawElements(i.TRIANGLES,s,n,r)}finalizeDraw(t,e,i){for(let n=0,s=this.postProcessPasses_.length;n{if(i="function"==typeof s.value?s.value(t):s.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData||i instanceof WebGLTexture){i instanceof WebGLTexture&&!s.texture?(s.prevValue=void 0,s.texture=i):s.texture||(s.prevValue=void 0,s.texture=e.createTexture()),this.bindTexture(s.texture,n,s.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const t=!(i instanceof HTMLImageElement)||i.complete;i instanceof WebGLTexture||!t||s.prevValue===i||(s.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++}else if(Array.isArray(i)&&6===i.length)this.setUniformMatrixValue(s.name,(0,u.Z)(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:return void e.uniform2f(this.getUniformLocation(s.name),i[0],i[1]);case 3:return void e.uniform3f(this.getUniformLocation(s.name),i[0],i[1],i[2]);case 4:return void e.uniform4f(this.getUniformLocation(s.name),i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(this.getUniformLocation(s.name),i)}))}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),s=this.compileShader(e,i.VERTEX_SHADER),r=i.createProgram();if(i.attachShader(r,n),i.attachShader(r,s),i.linkProgram(r),!i.getShaderParameter(n,i.COMPILE_STATUS)){const t=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(t)}if(i.deleteShader(n),!i.getShaderParameter(s,i.COMPILE_STATUS)){const t=`Vertex shader compilation failed: ${i.getShaderInfoLog(s)}`;throw new Error(t)}if(i.deleteShader(s),!i.getProgramParameter(r,i.LINK_STATUS)){const t=`GL program linking failed: ${i.getProgramInfoLog(r)}`;throw new Error(t)}return r}getUniformLocation(t){const e=(0,o.v6)(this.currentProgram_);return void 0===this.uniformLocationsByProgram_[e]&&(this.uniformLocationsByProgram_[e]={}),void 0===this.uniformLocationsByProgram_[e][t]&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=(0,o.v6)(this.currentProgram_);return void 0===this.attribLocationsByProgram_[e]&&(this.attribLocationsByProgram_[e]={}),void 0===this.attribLocationsByProgram_[e][t]&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,s=t.viewState.resolution,r=t.viewState.center;return(0,c.Zz)(e,0,0,2/(s*i[0]),2/(s*i[1]),-n,-r[0],-r[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,s){const r=this.getAttributeLocation(t);r<0||(this.gl_.enableVertexAttribArray(r),this.gl_.vertexAttribPointer(r,e,i,!1,n,s))}enableAttributes(t){const e=function(t){let e=0;for(let i=0;i{function n(t,e,i,n,r){s(t,e,i||0,n||t.length-1,r||o)}function s(t,e,i,n,o){for(;n>i;){if(n-i>600){var a=n-i+1,l=e-i+1,h=Math.log(a),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(a-c)/a)*(l-a/2<0?-1:1);s(t,e,Math.max(i,Math.floor(e-l*c/a+u)),Math.min(n,Math.floor(e+(a-l)*c/a+u)),o)}var d=t[e],g=i,_=n;for(r(t,i,e),o(t[n],d)>0&&r(t,i,n);g<_;){for(r(t,g,_),g++,_--;o(t[g],d)<0;)g++;for(;o(t[_],d)>0;)_--}0===o(t[i],d)?r(t,i,_):r(t,++_,n),_<=e&&(i=_+1),e<=_&&(n=_-1)}}function r(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function o(t,e){return te?1:0}i.d(e,{A:()=>a});class a{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!x(t,e))return i;const n=this.toBBox,s=[];for(;e;){for(let r=0;r=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)}_split(t,e){const i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);const r=this._chooseSplitIndex(i,s,n),o=v(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,h(i,this.toBBox),h(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,h(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,s=1/0,r=1/0;for(let o=e;o<=i-e;o++){const e=c(t,0,o,this.toBBox),a=c(t,o,i,this.toBBox),l=p(e,a),h=_(e)+_(a);l=e;n--){const e=t.children[n];u(o,t.leaf?s(e):e),a+=f(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)u(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():h(t[i],this.toBBox)}}function l(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,i,s,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=s)continue;const a=e+Math.ceil((i-e)/s/2)*s;n(t,a,e,i,r),o.push(e,a,a,i)}}}}]); \ No newline at end of file diff --git a/9921.bundle.js b/9921.bundle.js deleted file mode 100644 index 8bf023e3..00000000 --- a/9921.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkrlayers=self.webpackChunkrlayers||[]).push([[9921],{4096:(e,n,o)=>{o.d(n,{A:()=>a});var t=o(1601),r=o.n(t),i=o(6314),l=o.n(i)()(r());l.push([e.id,':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n',""]);const a=l},5045:(e,n,o)=>{var t=o(5072),r=o.n(t),i=o(7825),l=o.n(i),a=o(7659),s=o.n(a),u=o(5056),c=o.n(u),d=o(540),p=o.n(d),b=o(1113),g=o.n(b),m=o(4096),f={};f.styleTagTransform=g(),f.setAttributes=c(),f.insert=s().bind(null,"head"),f.domAPI=l(),f.insertStyleElement=p(),r()(m.A,f),m.A&&m.A.locals&&m.A.locals},8217:(e,n,o)=>{o.d(n,{Ay:()=>m,Bs:()=>h,hX:()=>f,te:()=>x});var t=o(6717),r=o(4778),i=o(4294),l=o(1217),a=o(1064),s=o(503),u=o(6702),c=o(2871),d=o(4338),p=o(4087),b=o(3407),g=o(3402);const m=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=t.A,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let o=n.dataProjection?(0,b.Jt)(n.dataProjection):this.readProjection(e);n.extent&&o&&"tile-pixels"===o.getUnits()&&(o=(0,b.Jt)(o),o.setWorldExtent(n.extent)),n={dataProjection:o,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return(0,p.b0)()}readFeature(e,n){return(0,p.b0)()}readFeatures(e,n){return(0,p.b0)()}readGeometry(e,n){return(0,p.b0)()}readProjection(e){return(0,p.b0)()}writeFeature(e,n){return(0,p.b0)()}writeFeatures(e,n){return(0,p.b0)()}writeGeometry(e,n){return(0,p.b0)()}};function f(e,n,o){const t=o?(0,b.Jt)(o.featureProjection):null,r=o?(0,b.Jt)(o.dataProjection):null;let i=e;if(t&&r&&!(0,b.tI)(t,r)){n&&(i=e.clone());const o=n?t:r,l=n?r:t;"tile-pixels"===o.getUnits()?i.transform(o,l):i.applyTransform((0,b.RG)(o,l))}if(n&&o&&void 0!==o.decimals){const n=Math.pow(10,o.decimals),t=function(e){for(let o=0,t=e.length;oh({...e,geometry:n}))).flat();const t="MultiPolygon"===o.type?"Polygon":o.type;if("GeometryCollection"===t||"Circle"===t)throw new Error("Unsupported geometry type: "+t);const i=o.layout.length;return f(new r.Ay(t,"Polygon"===t?function(e,n,o){return Array.isArray(n[0])?((0,g.mb)(e,0,n,o)||(e=e.slice(),(0,g.NK)(e,0,n,o)),e):((0,g.PA)(e,0,n,o)||(e=e.slice(),(0,g.ug)(e,0,n,o)),e)}(o.flatCoordinates,o.ends,i):o.flatCoordinates,o.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,n)}function x(e,n){if(!e)return null;if(Array.isArray(e)){const o=e.map((e=>x(e,n)));return new d.A(o)}return f(new(0,y[e.type])(e.flatCoordinates,e.layout,e.ends),!1,n)}},1365:(e,n,o)=>{o.d(n,{A:()=>f});var t=o(6717),r=o(8217),i=o(4087);class l extends r.Ay{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(a(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(a(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return(0,i.b0)()}readFeaturesFromObject(e,n){return(0,i.b0)()}readGeometry(e,n){return this.readGeometryFromObject(a(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return(0,i.b0)()}readProjection(e){return this.readProjectionFromObject(a(e))}readProjectionFromObject(e){return(0,i.b0)()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return(0,i.b0)()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return(0,i.b0)()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return(0,i.b0)()}}function a(e){if("string"==typeof e){return JSON.parse(e)||null}return null!==e?e:null}const s=l;var u=o(4778),c=o(2497),d=o(2096),p=o(3407),b=o(3530);function g(e,n){if(!e)return null;let o;switch(e.type){case"Point":o=function(e){const n=e.coordinates;return{type:"Point",flatCoordinates:n,layout:(0,d.p0)(n.length)}}(e);break;case"LineString":o=function(e){const n=e.coordinates,o=n.flat();return{type:"LineString",flatCoordinates:o,ends:[o.length],layout:(0,d.p0)(n[0]?.length||2)}}(e);break;case"Polygon":o=function(e){const n=e.coordinates,o=[],t=n[0]?.[0]?.length;return{type:"Polygon",flatCoordinates:o,ends:(0,c.KG)(o,0,n,t),layout:(0,d.p0)(t)}}(e);break;case"MultiPoint":o=function(e){const n=e.coordinates;return{type:"MultiPoint",flatCoordinates:n.flat(),layout:(0,d.p0)(n[0]?.length||2)}}(e);break;case"MultiLineString":o=function(e){const n=e.coordinates,o=n[0]?.[0]?.length||2,t=[];return{type:"MultiLineString",flatCoordinates:t,ends:(0,c.KG)(t,0,n,o),layout:(0,d.p0)(o)}}(e);break;case"MultiPolygon":o=function(e){const n=e.coordinates,o=[],t=n[0]?.[0]?.[0].length||2;return{type:"MultiPolygon",flatCoordinates:o,ends:(0,c.d6)(o,0,n,t),layout:(0,d.p0)(t)}}(e);break;case"GeometryCollection":o=function(e){const n=e.geometries.map((function(e){return g(e)}));return n}(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type)}return o}function m(e,n){const o=(e=(0,r.hX)(e,!0,n)).getType();let t;switch(o){case"Point":t=function(e){return{type:"Point",coordinates:e.getCoordinates()}}(e);break;case"LineString":t=function(e){return{type:"LineString",coordinates:e.getCoordinates()}}(e);break;case"Polygon":t=function(e,n){let o;return n&&(o=n.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(o)}}(e,n);break;case"MultiPoint":t=function(e){return{type:"MultiPoint",coordinates:e.getCoordinates()}}(e);break;case"MultiLineString":t=function(e){return{type:"MultiLineString",coordinates:e.getCoordinates()}}(e);break;case"MultiPolygon":t=function(e,n){let o;return n&&(o=n.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(o)}}(e,n);break;case"GeometryCollection":t=function(e,n){delete(n=Object.assign({},n)).featureProjection;return{type:"GeometryCollection",geometries:e.getGeometriesArray().map((function(e){return m(e,n)}))}}(e,n);break;case"Circle":t={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return t}const f=class extends s{constructor(e){e=e||{},super(),this.dataProjection=(0,p.Jt)(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=(0,p.Jt)(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let o=null;o="Feature"===e.type?e:{type:"Feature",geometry:e,properties:null};const i=g(o.geometry);if(this.featureClass===u.Ay)return(0,r.Bs)({geometry:i,id:o.id,properties:o.properties},n);const l=new t.A;return this.geometryName_?l.setGeometryName(this.geometryName_):this.extractGeometryName_&&o.geometry_name&&l.setGeometryName(o.geometry_name),l.setGeometry((0,r.te)(i,n)),"id"in o&&l.setId(o.id),o.properties&&l.setProperties(o.properties,!0),l}readFeaturesFromObject(e,n){let o=null;if("FeatureCollection"===e.type){o=[];const t=e.features;for(let e=0,r=t.length;e rlayers - 3.1.0 | Documentation + 3.2.0 | Documentation @@ -17,7 +17,7 @@