jupytergis-core 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jupytergis_core/__init__.py +30 -0
- jupytergis_core/_version.py +4 -0
- jupytergis_core/handler.py +36 -0
- jupytergis_core/jgis_ydoc.py +88 -0
- jupytergis_core-0.1.1.data/data/etc/jupyter/jupyter_server_config.d/jupytergis_core.json +7 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/package.json +127 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/034e72037478aea1bd04.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/037a7a10572d84466a61.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/062a9554f6b4caac9713.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/064f37cecb8130ad66e8.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/08da2741746ddab81d04.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/154.0d16fbe1d1182d138b2c.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/197.34d9096e78e2f4b7138c.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/1a50c2bb32a2f2725468.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/1d440270da19a2f22fee.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/226.280aa14a2e4c0654c374.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/27.aea9e291ba3dd16790fb.js +2 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/27.aea9e291ba3dd16790fb.js.LICENSE.txt +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/2b3d42a470b5ce14859a.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/2bd6cc5cc336dc14664e.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/31780c7e8d2544c4aef1.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/32c7a73662cceb5bb1d7.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/32ef1da9016680ad72ad.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/34d618e9103c659742b2.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/36.96b959ec0acca06df9e7.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/363ca7c5f78deb6fd033.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/366.33cb40029b4f4da3d3ad.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/3d48be10ffea86eb15de.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/3e2abeb6f399328c6ca3.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/407.fa2f7a0dc4d3371a5e2c.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/432.19e693d578a221132366.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/460.a2074380632031c05e8d.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/472.08add5249d72d563ba32.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/4d79d4897dde805afe9a.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/4ed4ae4121d38d85100b.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/509.0d58394cd3a34bdbd0b9.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/527.4e529cf1d6711d0091d4.js +8 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/527.4e529cf1d6711d0091d4.js.LICENSE.txt +17 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/542.3038c6cef679f15b8d9a.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/552.91f202f2e2714d760f63.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/555.7d0c1d2ee9e49a619cb9.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/557.fe291f5575a15c36d24c.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/5c2774ff9757d8ca7266.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/609.d2f38c4cae8c4b9d76a8.js +2 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/609.d2f38c4cae8c4b9d76a8.js.LICENSE.txt +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/618.86523276f857e0a3362e.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/733.9bce9fdd113869d413d0.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/777.bc71fb7e5821a0d2d778.js +2 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/777.bc71fb7e5821a0d2d778.js.LICENSE.txt +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/801d7167d999982b47a6.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/803.959deb5eafbb3ab489c6.js +7 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/91eea6f15a4d37354193.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/991.56c7d43ea8c85659e849.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/99cba4f26941e905077c.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/9ed013096549f2bf7c22.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/a1aec2703ff3dd7cad5c.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/a35b106d2ed63c9415d8.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/a9e04491802b61881be7.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/aa0d1282df07ef3c385f.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/ae2589dc6f6090080a25.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/bf9c5537f242b3244cfd.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/c8b81779c65fdb3c3fa5.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/c9d6b533d9149f46ebb0.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/d0917c2edc1eee1562a2.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/d7eb57ad53f788b1fa92.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/d83457b1b925c1718f6d.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/dbd44be87657cc8485b9.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/dc7cea97d06a8a3d2814.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/f583a55ec54e8fe27ec6.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/fd9328315a97a67c95ab.png +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/gdal3WebAssembly.data +97604 -44
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/gdal3WebAssembly.wasm +0 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/remoteEntry.f3adbeb4239acca483c6.js +1 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/style.js +4 -0
- jupytergis_core-0.1.1.data/data/share/jupyter/labextensions/@jupytergis/jupytergis-core/static/third-party-licenses.json +370 -0
- jupytergis_core-0.1.1.dist-info/METADATA +58 -0
- jupytergis_core-0.1.1.dist-info/RECORD +80 -0
- jupytergis_core-0.1.1.dist-info/WHEEL +4 -0
- jupytergis_core-0.1.1.dist-info/entry_points.txt +2 -0
- jupytergis_core-0.1.1.dist-info/licenses/LICENSE +29 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Lodash <https://lodash.com/>
|
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @license React v16.13.1
|
|
11
|
+
* react-is.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[542],{74660:(e,t,r)=>{function n(e,t){let r=e.length-t,n=0;do{for(let r=t;r>0;r--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function a(e,t,r){let n=0,a=e.length;const i=a/r;for(;a>t;){for(let r=t;r>0;--r)e[n+t]+=e[n],++n;a-=t}const o=e.slice();for(let t=0;t<i;++t)for(let n=0;n<r;++n)e[r*t+n]=o[(r-n-1)*i+t]}r.d(t,{A:()=>i});class i{async decode(e,t){const r=await this.decodeBlock(t),i=e.Predictor||1;if(1!==i){const t=!e.StripOffsets;return function(e,t,r,i,o,s){if(!t||1===t)return e;for(let e=0;e<o.length;++e){if(o[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(o[e]!==o[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const c=o[0]/8,d=2===s?1:o.length;for(let s=0;s<i&&!(s*d*r*c>=e.byteLength);++s){let i;if(2===t){switch(o[0]){case 8:i=new Uint8Array(e,s*d*r*c,d*r*c);break;case 16:i=new Uint16Array(e,s*d*r*c,d*r*c/2);break;case 32:i=new Uint32Array(e,s*d*r*c,d*r*c/4);break;default:throw new Error(`Predictor 2 not allowed with ${o[0]} bits per sample.`)}n(i,d)}else 3===t&&(i=new Uint8Array(e,s*d*r*c,d*r*c),a(i,d,c))}return e}(r,i,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return r}}},5542:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var n=r(74660);class a extends n.A{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(e,t){const r=new Blob([t]),n=await createImageBitmap(r);let a;"undefined"!=typeof document?(a=document.createElement("canvas"),a.width=n.width,a.height=n.height):a=new OffscreenCanvas(n.width,n.height);const i=a.getContext("2d");return i.drawImage(n,0,0),i.getImageData(0,0,n.width,n.height).data.buffer}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[552],{74660:(t,e,a)=>{function i(t,e){let a=t.length-e,i=0;do{for(let a=e;a>0;a--)t[i+e]+=t[i],i++;a-=e}while(a>0)}function n(t,e,a){let i=0,n=t.length;const s=n/a;for(;n>e;){for(let a=e;a>0;--a)t[i+e]+=t[i],++i;n-=e}const r=t.slice();for(let e=0;e<s;++e)for(let i=0;i<a;++i)t[a*e+i]=r[(a-i-1)*s+e]}a.d(e,{A:()=>s});class s{async decode(t,e){const a=await this.decodeBlock(e),s=t.Predictor||1;if(1!==s){const e=!t.StripOffsets;return function(t,e,a,s,r,o){if(!e||1===e)return t;for(let t=0;t<r.length;++t){if(r[t]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[t]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const l=r[0]/8,h=2===o?1:r.length;for(let o=0;o<s&&!(o*h*a*l>=t.byteLength);++o){let s;if(2===e){switch(r[0]){case 8:s=new Uint8Array(t,o*h*a*l,h*a*l);break;case 16:s=new Uint16Array(t,o*h*a*l,h*a*l/2);break;case 32:s=new Uint32Array(t,o*h*a*l,h*a*l/4);break;default:throw new Error(`Predictor 2 not allowed with ${r[0]} bits per sample.`)}i(s,h)}else 3===e&&(s=new Uint8Array(t,o*h*a*l,h*a*l),n(s,h,l))}return t}(a,s,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return a}}},67341:(t,e,a)=>{function i(t){let e=t.length;for(;--e>=0;)t[e]=0}a.d(e,{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]),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 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,m,b;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},y=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},v=(t,e,a)=>{y(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]<t[s]||t[n]===t[s]&&i[e]<=i[a]},Z=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&R(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!R(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},U=(t,e,a)=>{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?v(t,r,e):(o=_[r],v(t,o+256+1,e),l=n[o],0!==l&&(r-=f[o],y(t,r,l)),i--,o=p(i),v(t,o,a),l=s[o],0!==l&&(i-=c[o],y(t,i,l)))}while(h<t.sym_next);v(t,256,e)},S=(t,e)=>{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<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>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,_,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>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),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=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;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],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<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},T=(t,e,a)=>{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<l&&n===r)){if(o<h)do{v(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(v(t,n,t.bl_tree),o--),v(t,16,t.bl_tree),y(t,o-3,2)):o<=10?(v(t,17,t.bl_tree),y(t,o-3,3)):(v(t,18,t.bl_tree),y(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let O=!1;const L=(t,e,a,i)=>{y(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,o;const g=new Array(16);for(a=0,i=0;i<28;i++)for(f[i]=a,t=0;t<1<<n[i];t++)_[a++]=i;for(_[a-1]=i,o=0,i=0;i<16;i++)for(c[i]=o,t=0;t<1<<s[i];t++)d[o++]=i;for(o>>=7;i<30;i++)for(c[i]=o<<7,t=0;t<1<<s[i]-7;t++)d[256+o++]=i;for(e=0;e<=15;e++)g[e]=0;for(t=0;t<=143;)l[2*t+1]=8,t++,g[8]++;for(;t<=255;)l[2*t+1]=9,t++,g[9]++;for(;t<=279;)l[2*t+1]=7,t++,g[7]++;for(;t<=287;)l[2*t+1]=8,t++,g[8]++;for(z(l,287,g),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=x(t,5);w=new u(l,n,257,286,15),m=new u(h,s,0,30,15),b=new u(new Array(0),r,0,19,7)})(),O=!0),t.l_desc=new g(t.dyn_ltree,w),t.d_desc=new g(t.dyn_dtree,m),t.bl_desc=new g(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,A(t)},_tr_stored_block:L,_tr_flush_block:(t,e,a,i)=>{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?L(t,e,a,i):4===t.strategy||s===n?(y(t,2+(i?1:0),3),U(t,l,h)):(y(t,4+(i?1:0),3),((t,e,a,i)=>{let n;for(y(t,e-257,5),y(t,a-1,5),y(t,i-4,4),n=0;n<i;n++)y(t,t.bl_tree[2*o[n]+1],3);T(t,t.dyn_ltree,e-1),T(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,r+1),U(t,t.dyn_ltree,t.dyn_dtree)),A(t),i&&E(t)},_tr_tally:(t,e,a)=>(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=>{y(t,2,3),v(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)}},F=(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 B=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 N=(t,e,a,i)=>{const n=B,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>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:P,_tr_tally:K,_tr_align:Y}=I,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:G,Z_FULL_FLUSH:X,Z_FINISH:$,Z_BLOCK:q,Z_OK:J,Z_STREAM_END:Q,Z_STREAM_ERROR:V,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}=H,dt=258,_t=262,ft=42,ct=113,ut=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<<t.hash_shift^a)&t.hash_mask;const kt=t=>{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))},yt=(t,e)=>{P(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,kt(t.strm)},vt=(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=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(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-_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),o>t.lookahead&&(o=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]&&s<f);if(i=dt-(f-s),s=f-dt,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>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-_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,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==$||e===W||a!==i+t.strm.avail_in))break;r=e===$&&a===i+t.strm.avail_in?1:0,j(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=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_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==W&&e!==$&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&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<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>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===$)&&e!==W&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===$&&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===W)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=K(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=K(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===$?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(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===W)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_length<t.max_lazy_match&&t.strstart-a<=t.w_size-_t&&(t.match_length=At(t,a),t.match_length<=5&&(t.strategy===it||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=K(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&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=K(t,0,t.window[t.strstart-1]),i&&yt(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=K(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===$?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(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!==ft&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==ct&&e.status!==ut?1:0},Lt=t=>{if(Ot(t))return wt(t,V);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?ft:ct,t.adler=2===e.wrap?0:1,e.last_flush=-2,M(e),J},It=t=>{const e=Lt(t);var a;return e===J&&((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},Ft=(t,e,a,i,n,s)=>{if(!t)return V;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,V);8===i&&(i=9);const o=new Tt;return t.state=o,o.strm=t,o.status=ft,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,It(t)};var Bt={deflateInit:(t,e)=>Ft(t,e,ht,15,8,ot),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Lt,deflateSetHeader:(t,e)=>Ot(t)||2!==t.state.wrap?V:(t.state.gzhead=e,J),deflate:(t,e)=>{if(Ot(t)||e>q||e<0)return t?wt(t,V):V;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===ut&&e!==$)return wt(t,0===t.avail_out?et:V);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,J}else if(0===t.avail_in&&mt(e)<=mt(i)&&e!==$)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,J}if(57===a.status)if(t.adler=0,vt(a,31),vt(a,139),vt(a,8),a.gzhead)vt(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)),vt(a,255&a.gzhead.time),vt(a,a.gzhead.time>>8&255),vt(a,a.gzhead.time>>16&255),vt(a,a.gzhead.time>>24&255),vt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),vt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(vt(a,255&a.gzhead.extra.length),vt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(vt(a,0),vt(a,0),vt(a,0),vt(a,0),vt(a,0),vt(a,9===a.level?2:a.strategy>=nt||a.level<2?4:0),vt(a,3),a.status=ct,kt(t),0!==a.pending)return a.last_flush=-1,J;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=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,kt(t),0!==a.pending)return a.last_flush=-1,J;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=N(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=N(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,J;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,vt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(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=N(t.adler,a.pending_buf,a.pending-i,i)),kt(t),0!==a.pending)return a.last_flush=-1,J;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,vt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(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,J;vt(a,255&t.adler),vt(a,t.adler>>8&255),t.adler=0}if(a.status=ct,kt(t),0!==a.pending)return a.last_flush=-1,J}if(0!==t.avail_in||0!==a.lookahead||e!==W&&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===W)return 1;break}if(t.match_length=0,a=K(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===$?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(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===W)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]&&n<s);t.match_length=dt-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=K(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=K(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===$?(yt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(yt(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),J;if(2===i&&(e===G?Y(a):e!==q&&(j(a,0,0,!1),e===X&&(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,J}return e!==$?J:a.wrap<=0?Q:(2===a.wrap?(vt(a,255&t.adler),vt(a,t.adler>>8&255),vt(a,t.adler>>16&255),vt(a,t.adler>>24&255),vt(a,255&t.total_in),vt(a,t.total_in>>8&255),vt(a,t.total_in>>16&255),vt(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?J:Q)},deflateEnd:t=>{if(Ot(t))return V;const e=t.state.status;return t.state=null,e===ct?wt(t,tt):J},deflateSetDictionary:(t,e)=>{let a=e.length;if(Ot(t))return V;const i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ft||i.lookahead)return V;if(1===n&&(t.adler=F(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,J},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(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)Nt(a,e)&&(t[e]=a[e])}}return t},flattenChunks:t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a}};let Ht=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ht=!1}const Mt=new Uint8Array(256);for(let t=0;t<256;t++)Mt[t]=t>=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,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>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;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Mt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?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;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},utf8border:(t,e)=>{(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}},Pt=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 Kt=Object.prototype.toString,{Z_NO_FLUSH:Yt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:Gt,Z_FINISH:Xt,Z_OK:$t,Z_STREAM_END:qt,Z_DEFAULT_COMPRESSION:Jt,Z_DEFAULT_STRATEGY:Qt,Z_DEFLATED:Vt}=H;function te(t){this.options=Ct.assign({level:Jt,method:Vt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Qt},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 Pt,this.strm.avail_out=0;let a=Bt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==$t)throw new Error(C[a]);if(e.header&&Bt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt.string2buf(e.dictionary):"[object ArrayBuffer]"===Kt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Bt.deflateSetDictionary(this.strm,t),a!==$t)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?Xt:Yt,"string"==typeof t?a.input=jt.string2buf(t):"[object ArrayBuffer]"===Kt.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===Wt||s===Gt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Bt.deflate(a,s),n===qt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Bt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===$t;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===$t&&(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,o,l,h,d,_,f,c,u,w,m,b,g,p,k,y,v,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,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>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)-1)];continue e}for(k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,16&p){if(y=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),y+=f&(1<<p)-1,y>o){t.msg="invalid distance too far back",E.mode=ie;break t}if(f>>>=p,c-=p,p=n-s,y>p){if(p=y-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=ie;break t}if(v=0,x=_,0===d){if(v+=l-p,p<k){k-=p;do{A[n++]=_[v++]}while(--p);v=n-y,x=A}}else if(d<p){if(v+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[v++]}while(--p);if(v=0,d<k){p=d,k-=p;do{A[n++]=_[v++]}while(--p);v=n-y,x=A}}}else if(v+=d-p,p<k){k-=p;do{A[n++]=_[v++]}while(--p);v=n-y,x=A}for(;k>2;)A[n++]=x[v++],A[n++]=x[v++],A[n++]=x[v++],k-=3;k&&(A[n++]=x[v++],k>1&&(A[n++]=x[v++]))}else{v=n-y;do{A[n++]=A[v++],A[n++]=A[v++],A[n++]=A[v++],k-=3}while(k>2);k&&(A[n++]=A[v++],k>1&&(A[n++]=A[v++]))}break}if(64&p){t.msg="invalid distance code",E.mode=ie;break t}g=w[(65535&g)+(f&(1<<p)-1)]}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const se=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),re=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),oe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),le=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var he=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,y=0,v=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<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=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;b<g&&0===E[b];b++);for(p<b&&(p=b),v=1,w=1;w<=15;w++)if(v<<=1,v-=E[w],v<0)return-1;if(v>0&&(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;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=se,D=re,u=257):(A=oe,D=le,u=0),z=0,m=0,w=b,c=s,k=p,y=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-y,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-y,d=1<<k,b=d;do{d-=h,n[c+(z>>y)+d]=Z<<24|U<<16|S}while(0!==d);for(h=1<<w-1;z&h;)h>>=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&f)!==_){for(0===y&&(y=p),c+=b,k=w-y,v=1<<k;k+y<g&&(v-=E[k+y],!(v<=0));)k++,v<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s}}return 0!==z&&(n[c+z]=w-y<<24|64<<16),o.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:me,Z_DATA_ERROR:be,Z_MEM_ERROR:ge,Z_BUF_ERROR:pe,Z_DEFLATED:ke}=H,ye=16180,ve=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.mode<ye||e.mode>16211?1:0},Oe=t=>{if(Te(t))return me;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=ye,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},Le=t=>{if(Te(t))return me;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 me;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?me:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Le(t))},Fe=(t,e)=>{if(!t)return me;const a=new De;t.state=a,a.strm=t,a.window=null,a.mode=ye;const i=Ie(t,e);return i!==ce&&(t.state=null),i};let Be,Ne,Ce=!0;const He=t=>{if(Ce){Be=new Int32Array(512),Ne=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,Be,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;he(2,t.lens,0,32,Ne,0,t.work,{bits:5}),Ce=!1}t.lencode=Be,t.lenbits=9,t.distcode=Ne,t.distbits=5},Me=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=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<s.wsize&&(s.whave+=n))),0};var je={inflateReset:Le,inflateReset2:Ie,inflateResetKeep:Oe,inflateInit:t=>Fe(t,15),inflateInit2:Fe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,y,v,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 me;a=t.state,a.mode===xe&&(a.mode=ze),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,d=a.bits,_=o,f=l,x=ce;t:for(;;)switch(a.mode){case ye:if(0===a.wrap){a.mode=ze;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=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=N(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,v=8+(15&h),0===a.wbits&&(a.wbits=v),v>15||v>a.wbits){t.msg="invalid window size",a.mode=Ue;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:xe,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==ke){t.msg="unknown compression method",a.mode=Ue;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Ue;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=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=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=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=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=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=N(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>o&&(c=o),c&&(a.head&&(v=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),v)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{v=i[s+c++],a.head&&v&&a.length<65536&&(a.head.name+=String.fromCharCode(v))}while(v&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,v)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{v=i[s+c++],a.head&&v&&a.length<65536&&(a.head.comment+=String.fromCharCode(v))}while(v&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,v)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Ue;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=Se(h),h=0,d=0,a.mode=ve;case ve: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=d,we;t.adler=a.check=1,a.mode=xe;case xe:if(e===_e||e===fe)break t;case ze:if(a.last){h>>>=7&d,d-=7&d,a.mode=Ze;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=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===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>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>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=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<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=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<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Ue;break}v=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,v=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,v=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++]=v}}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(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=d,ne(t,f),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,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&!(240&b)){for(p=m,k=b,y=g;z=a.lencode[y+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=xe;break}if(64&b){t.msg="invalid literal/length code",a.mode=Ue;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(!(240&b)){for(p=m,k=b,y=g;z=a.distcode[y+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Ue;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=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===l)break t;if(c=f-l,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>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=Re);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=Re;break;case Ze:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:Se(h))!==a.check){t.msg="incorrect data check",a.mode=Ue;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Ue;break}h=0,d=0}a.mode=16208;case 16208:x=ue;break t;case Ue:x=be;break t;case 16210:return ge;default:return me}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Ue&&(a.mode<Ze||e!==de))&&Me(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===xe?128:0)+(a.mode===Ee||a.mode===Ae?256:0),(0===_&&0===f||e===de)&&x===ce&&(x=pe),x},inflateEnd:t=>{if(Te(t))return me;let e=t.state;return e.window&&(e.window=null),t.state=null,ce},inflateGetHeader:(t,e)=>{if(Te(t))return me;const a=t.state;return 2&a.wrap?(a.head=e,e.done=!1,ce):me},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return Te(t)?me:(i=t.state,0!==i.wrap&&i.mode!==ve?me:i.mode===ve&&(n=1,n=F(n,e,a,0),n!==i.check)?be:(s=Me(t,e,a,a),s?(i.mode=16210,ge):(i.havedict=1,ce)))},inflateInfo:"pako inflate (from Nodeca project)"},Pe=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 Ke=Object.prototype.toString,{Z_NO_FLUSH:Ye,Z_FINISH:We,Z_OK:Ge,Z_STREAM_END:Xe,Z_NEED_DICT:$e,Z_STREAM_ERROR:qe,Z_DATA_ERROR:Je,Z_MEM_ERROR:Qe}=H;function Ve(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 Pt,this.strm.avail_out=0;let a=je.inflateInit2(this.strm,e.windowBits);if(a!==Ge)throw new Error(C[a]);if(this.header=new Pe,je.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt.string2buf(e.dictionary):"[object ArrayBuffer]"===Ke.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=je.inflateSetDictionary(this.strm,e.dictionary),a!==Ge)))throw new Error(C[a])}function ta(t,e){const a=new Ve(e);if(a.push(t),a.err)throw a.msg||C[a.err];return a.result}Ve.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?We:Ye,"[object ArrayBuffer]"===Ke.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===$e&&n&&(s=je.inflateSetDictionary(a,n),s===Ge?s=je.inflate(a,r):s===Je&&(s=$e));a.avail_in>0&&s===Xe&&a.state.wrap>0&&0!==t[a.next_in];)je.inflateReset(a),s=je.inflate(a,r);switch(s){case qe:case Je:case $e:case Qe:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Xe))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!==Ge||0!==o){if(s===Xe)return s=je.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(t){this.chunks.push(t)},Ve.prototype.onEnd=function(t){t===Ge&&("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:Ve,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:oa,inflateRaw:la,ungzip:ha}=ea;var da=oa}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[555],{74660:(e,t,n)=>{function r(e,t){let n=e.length-t,r=0;do{for(let n=t;n>0;n--)e[r+t]+=e[r],r++;n-=t}while(n>0)}function s(e,t,n){let r=0,s=e.length;const o=s/n;for(;s>t;){for(let n=t;n>0;--n)e[r+t]+=e[r],++r;s-=t}const a=e.slice();for(let t=0;t<o;++t)for(let r=0;r<n;++r)e[n*t+r]=a[(n-r-1)*o+t]}n.d(t,{A:()=>o});class o{async decode(e,t){const n=await this.decodeBlock(t),o=e.Predictor||1;if(1!==o){const t=!e.StripOffsets;return function(e,t,n,o,a,i){if(!t||1===t)return e;for(let e=0;e<a.length;++e){if(a[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(a[e]!==a[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const c=a[0]/8,l=2===i?1:a.length;for(let i=0;i<o&&!(i*l*n*c>=e.byteLength);++i){let o;if(2===t){switch(a[0]){case 8:o=new Uint8Array(e,i*l*n*c,l*n*c);break;case 16:o=new Uint16Array(e,i*l*n*c,l*n*c/2);break;case 32:o=new Uint32Array(e,i*l*n*c,l*n*c/4);break;default:throw new Error(`Predictor 2 not allowed with ${a[0]} bits per sample.`)}r(o,l)}else 3===t&&(o=new Uint8Array(e,i*l*n*c,l*n*c),s(o,l,c))}return e}(n,o,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return n}}},50555:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var r=n(74660);const s=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),o=4017,a=799,i=3406,c=2276,l=1567,f=3784,h=5793,u=2896;function d(e,t){let n=0;const r=[];let s=16;for(;s>0&&!e[s-1];)--s;r.push({children:[],index:0});let o,a=r[0];for(let i=0;i<s;i++){for(let s=0;s<e[i];s++){for(a=r.pop(),a.children[a.index]=t[n];a.index>0;)a=r.pop();for(a.index++,r.push(a);r.length<=i;)r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;n++}i+1<s&&(r.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o)}return r[0].children}function m(e,t,n,r,o,a,i,c,l){const{mcusPerLine:f,progressive:h}=n,u=t;let d=t,m=0,p=0;function b(){if(p>0)return p--,m>>p&1;if(m=e[d++],255===m){const t=e[d++];if(t)throw new Error(`unexpected marker: ${(m<<8|t).toString(16)}`)}return p=7,m>>>7}function w(e){let t,n=e;for(;null!==(t=b());){if(n=n[t],"number"==typeof n)return n;if("object"!=typeof n)throw new Error("invalid huffman sequence")}return null}function k(e){let t=e,n=0;for(;t>0;){const e=b();if(null===e)return;n=n<<1|e,--t}return n}function g(e){const t=k(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y,P=0,A=0;function C(e,t,n,r,s){const o=n%f,a=(n/f|0)*e.v+r,i=o*e.h+s;t(e,e.blocks[a][i])}function T(e,t,n){const r=n/e.blocksPerLine|0,s=n%e.blocksPerLine;t(e,e.blocks[r][s])}const v=r.length;let x,L,E,I,U,D;D=h?0===a?0===c?function(e,t){const n=w(e.huffmanTableDC),r=0===n?0:g(n)<<l;e.pred+=r,t[0]=e.pred}:function(e,t){t[0]|=b()<<l}:0===c?function(e,t){if(P>0)return void P--;let n=a;const r=i;for(;n<=r;){const r=w(e.huffmanTableAC),o=15&r,a=r>>4;if(0===o){if(a<15){P=k(a)+(1<<a)-1;break}n+=16}else n+=a,t[s[n]]=g(o)*(1<<l),n++}}:function(e,t){let n=a;const r=i;let o=0;for(;n<=r;){const r=s[n],a=t[r]<0?-1:1;switch(A){case 0:{const t=w(e.huffmanTableAC),n=15&t;if(o=t>>4,0===n)o<15?(P=k(o)+(1<<o),A=4):(o=16,A=1);else{if(1!==n)throw new Error("invalid ACn encoding");y=g(n),A=o?2:3}continue}case 1:case 2:t[r]?t[r]+=(b()<<l)*a:(o--,0===o&&(A=2===A?3:0));break;case 3:t[r]?t[r]+=(b()<<l)*a:(t[r]=y<<l,A=0);break;case 4:t[r]&&(t[r]+=(b()<<l)*a)}n++}4===A&&(P--,0===P&&(A=0))}:function(e,t){const n=w(e.huffmanTableDC),r=0===n?0:g(n);e.pred+=r,t[0]=e.pred;let o=1;for(;o<64;){const n=w(e.huffmanTableAC),r=15&n,a=n>>4;if(0===r){if(a<15)break;o+=16}else o+=a,t[s[o]]=g(r),o++}};let j,q,z=0;q=1===v?r[0].blocksPerLine*r[0].blocksPerColumn:f*n.mcusPerColumn;const O=o||q;for(;z<q;){for(L=0;L<v;L++)r[L].pred=0;if(P=0,1===v)for(x=r[0],U=0;U<O;U++)T(x,D,z),z++;else for(U=0;U<O;U++){for(L=0;L<v;L++){x=r[L];const{h:e,v:t}=x;for(E=0;E<t;E++)for(I=0;I<e;I++)C(x,D,z,E,I)}if(z++,z===q)break}if(p=0,j=e[d]<<8|e[d+1],j<65280)throw new Error("marker was not found");if(!(j>=65488&&j<=65495))break;d+=2}return d-u}function p(e,t){const n=[],{blocksPerLine:r,blocksPerColumn:s}=t,d=r<<3,m=new Int32Array(64),p=new Uint8Array(64);function b(e,n,r){const s=t.quantizationTable;let d,m,p,b,w,k,g,y,P;const A=r;let C;for(C=0;C<64;C++)A[C]=e[C]*s[C];for(C=0;C<8;++C){const e=8*C;0!==A[1+e]||0!==A[2+e]||0!==A[3+e]||0!==A[4+e]||0!==A[5+e]||0!==A[6+e]||0!==A[7+e]?(d=h*A[0+e]+128>>8,m=h*A[4+e]+128>>8,p=A[2+e],b=A[6+e],w=u*(A[1+e]-A[7+e])+128>>8,y=u*(A[1+e]+A[7+e])+128>>8,k=A[3+e]<<4,g=A[5+e]<<4,P=d-m+1>>1,d=d+m+1>>1,m=P,P=p*f+b*l+128>>8,p=p*l-b*f+128>>8,b=P,P=w-g+1>>1,w=w+g+1>>1,g=P,P=y+k+1>>1,k=y-k+1>>1,y=P,P=d-b+1>>1,d=d+b+1>>1,b=P,P=m-p+1>>1,m=m+p+1>>1,p=P,P=w*c+y*i+2048>>12,w=w*i-y*c+2048>>12,y=P,P=k*a+g*o+2048>>12,k=k*o-g*a+2048>>12,g=P,A[0+e]=d+y,A[7+e]=d-y,A[1+e]=m+g,A[6+e]=m-g,A[2+e]=p+k,A[5+e]=p-k,A[3+e]=b+w,A[4+e]=b-w):(P=h*A[0+e]+512>>10,A[0+e]=P,A[1+e]=P,A[2+e]=P,A[3+e]=P,A[4+e]=P,A[5+e]=P,A[6+e]=P,A[7+e]=P)}for(C=0;C<8;++C){const e=C;0!==A[8+e]||0!==A[16+e]||0!==A[24+e]||0!==A[32+e]||0!==A[40+e]||0!==A[48+e]||0!==A[56+e]?(d=h*A[0+e]+2048>>12,m=h*A[32+e]+2048>>12,p=A[16+e],b=A[48+e],w=u*(A[8+e]-A[56+e])+2048>>12,y=u*(A[8+e]+A[56+e])+2048>>12,k=A[24+e],g=A[40+e],P=d-m+1>>1,d=d+m+1>>1,m=P,P=p*f+b*l+2048>>12,p=p*l-b*f+2048>>12,b=P,P=w-g+1>>1,w=w+g+1>>1,g=P,P=y+k+1>>1,k=y-k+1>>1,y=P,P=d-b+1>>1,d=d+b+1>>1,b=P,P=m-p+1>>1,m=m+p+1>>1,p=P,P=w*c+y*i+2048>>12,w=w*i-y*c+2048>>12,y=P,P=k*a+g*o+2048>>12,k=k*o-g*a+2048>>12,g=P,A[0+e]=d+y,A[56+e]=d-y,A[8+e]=m+g,A[48+e]=m-g,A[16+e]=p+k,A[40+e]=p-k,A[24+e]=b+w,A[32+e]=b-w):(P=h*r[C+0]+8192>>14,A[0+e]=P,A[8+e]=P,A[16+e]=P,A[24+e]=P,A[32+e]=P,A[40+e]=P,A[48+e]=P,A[56+e]=P)}for(C=0;C<64;++C){const e=128+(A[C]+8>>4);n[C]=e<0?0:e>255?255:e}}for(let e=0;e<s;e++){const s=e<<3;for(let e=0;e<8;e++)n.push(new Uint8Array(d));for(let o=0;o<r;o++){b(t.blocks[e][o],p,m);let r=0;const a=o<<3;for(let e=0;e<8;e++){const t=n[s+e];for(let e=0;e<8;e++)t[a+e]=p[r++]}}}return n}class b{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function n(){const n=e[t]<<8|e[t+1];return t+=2,n}function r(){const r=n(),s=e.subarray(t,t+r-2);return t+=s.length,s}function o(e){let t,n,r=0,s=0;for(n in e.components)e.components.hasOwnProperty(n)&&(t=e.components[n],r<t.h&&(r=t.h),s<t.v&&(s=t.v));const o=Math.ceil(e.samplesPerLine/8/r),a=Math.ceil(e.scanLines/8/s);for(n in e.components)if(e.components.hasOwnProperty(n)){t=e.components[n];const i=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/r),c=Math.ceil(Math.ceil(e.scanLines/8)*t.v/s),l=o*t.h,f=a*t.v,h=[];for(let e=0;e<f;e++){const e=[];for(let t=0;t<l;t++)e.push(new Int32Array(64));h.push(e)}t.blocksPerLine=i,t.blocksPerColumn=c,t.blocks=h}e.maxH=r,e.maxV=s,e.mcusPerLine=o,e.mcusPerColumn=a}let a=n();if(65496!==a)throw new Error("SOI not found");for(a=n();65497!==a;){switch(a){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=r();65504===a&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===a&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const r=n()+t-2;for(;t<r;){const r=e[t++],o=new Int32Array(64);if(r>>4){if(r>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++)o[s[e]]=n()}else for(let n=0;n<64;n++)o[s[n]]=e[t++];this.quantizationTables[15&r]=o}break}case 65472:case 65473:case 65474:{n();const r={extended:65473===a,progressive:65474===a,precision:e[t++],scanLines:n(),samplesPerLine:n(),components:{},componentsOrder:[]},s=e[t++];let i;for(let n=0;n<s;n++){i=e[t];const n=e[t+1]>>4,s=15&e[t+1],o=e[t+2];r.componentsOrder.push(i),r.components[i]={h:n,v:s,quantizationIdx:o},t+=3}o(r),this.frames.push(r);break}case 65476:{const r=n();for(let n=2;n<r;){const r=e[t++],s=new Uint8Array(16);let o=0;for(let n=0;n<16;n++,t++)s[n]=e[t],o+=s[n];const a=new Uint8Array(o);for(let n=0;n<o;n++,t++)a[n]=e[t];n+=17+o,r>>4?this.huffmanTablesAC[15&r]=d(s,a):this.huffmanTablesDC[15&r]=d(s,a)}break}case 65501:n(),this.resetInterval=n();break;case 65498:{n();const r=e[t++],s=[],o=this.frames[0];for(let n=0;n<r;n++){const n=o.components[e[t++]],r=e[t++];n.huffmanTableDC=this.huffmanTablesDC[r>>4],n.huffmanTableAC=this.huffmanTablesAC[15&r],s.push(n)}const a=e[t++],i=e[t++],c=e[t++],l=m(e,t,o,s,this.resetInterval,a,i,c>>4,15&c);t+=l;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(`unknown JPEG marker ${a.toString(16)}`)}a=n()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:n,componentsOrder:r}=t,s=[],o=t.samplesPerLine,a=t.scanLines;for(let e=0;e<r.length;e++){const o=n[r[e]];s.push({lines:p(0,o),scaleX:o.h/t.maxH,scaleY:o.v/t.maxV})}const i=new Uint8Array(o*a*s.length);let c=0;for(let e=0;e<a;++e)for(let t=0;t<o;++t)for(let n=0;n<s.length;++n){const r=s[n];i[c]=r.lines[0|e*r.scaleY][0|t*r.scaleX],++c}return i}}class w extends r.A{constructor(e){super(),this.reader=new b,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[557],{92557:(e,t,r)=>{r.r(t),r.d(t,{IJGISExternalCommandRegistryToken:()=>g,IJGISFormSchemaRegistryToken:()=>c,IJGISLayerBrowserRegistryToken:()=>f,IJupyterGISDocTracker:()=>p,JupyterGISDoc:()=>d,JupyterGISModel:()=>u});var s=r(81473),i=r(74602),a=r(26803),n=r.n(a),o=r(22697),h=r(67262);class d extends o.YDocument{constructor(){super(),this.editable=!0,this._optionsObserver=e=>{this._optionsChanged.emit(e.keys)},this._optionsChanged=new i.Signal(this),this._layersChanged=new i.Signal(this),this._layerTreeChanged=new i.Signal(this),this._sourcesChanged=new i.Signal(this),this._terrainChanged=new i.Signal(this),this._options=this.ydoc.getMap("options"),this._layers=this.ydoc.getMap("layers"),this._layerTree=this.ydoc.getArray("layerTree"),this._sources=this.ydoc.getMap("sources"),this._terrain=this.ydoc.getMap("terrain"),this.undoManager.addToScope(this._layers),this.undoManager.addToScope(this._sources),this.undoManager.addToScope(this._layerTree),this._layers.observeDeep(this._layersObserver.bind(this)),this._layerTree.observe(this._layerTreeObserver.bind(this)),this._sources.observeDeep(this._sourcesObserver.bind(this)),this._terrain.observe(this._terrainObserver.bind(this)),this._options.observe(this._optionsObserver.bind(this))}dispose(){super.dispose()}get version(){return"0.1.0"}get layers(){return h.JSONExt.deepCopy(this._layers.toJSON())}set layers(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._layers.set(t,r)}))}set sources(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._sources.set(t,r)}))}get sources(){return h.JSONExt.deepCopy(this._sources.toJSON())}get layerTree(){return h.JSONExt.deepCopy(this._layerTree.toJSON())}set layerTree(e){this.transact((()=>{this._layerTree.delete(0,this._layerTree.length),this._layerTree.push(e)}))}get terrain(){return h.JSONExt.deepCopy(this._terrain.toJSON())}set terrain(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._terrain.set(t,r)}))}getLayer(e){if(this._layers.has(e))return h.JSONExt.deepCopy(this._layers.get(e))}getSource(e){if(this._sources.has(e))return h.JSONExt.deepCopy(this._sources.get(e))}set options(e){this.transact((()=>{for(const[t,r]of Object.entries(e))this._options.set(t,r)}))}get options(){return h.JSONExt.deepCopy(this._options.toJSON())}get layersChanged(){return this._layersChanged}get layerTreeChanged(){return this._layerTreeChanged}get sourcesChanged(){return this._sourcesChanged}get optionsChanged(){return this._optionsChanged}get terrainChanged(){return this._terrainChanged}layerExists(e){return Boolean(this._getLayerAsYMap(e))}removeLayer(e){this.transact((()=>{this._layers.delete(e)}))}addLayer(e,t){this.transact((()=>{this._layers.set(e,t)}))}updateLayer(e,t){this.transact((()=>{this._layers.set(e,t)}))}addLayerTreeItem(e,t){this.transact((()=>{this._layerTree.insert(e,[t])}))}updateLayerTreeItem(e,t){this.transact((()=>{this._layerTree.delete(e),t&&this._layerTree.insert(e,[t])}))}getObject(e){const t=this.getLayer(e);if(t)return t;return this.getSource(e)||void 0}updateObjectParameters(e,t){const r=this.getLayer(e);r&&(r.parameters=Object.assign(Object.assign({},r.parameters),t),this.updateLayer(e,r));const s=this.getSource(e);s&&(s.parameters=Object.assign(Object.assign({},s.parameters),t),this.updateSource(e,s))}sourceExists(e){return Boolean(this._getSourceAsYMap(e))}removeSource(e){this.transact((()=>{this._sources.delete(e)}))}addSource(e,t){this.transact((()=>{this._sources.set(e,t)}))}updateSource(e,t){this.transact((()=>this._sources.set(e,t)))}getOption(e){const t=this._options.get(e);if(t)return h.JSONExt.deepCopy(t)}setOption(e,t){this.transact((()=>{this._options.set(e,t)}))}static create(){return new d}_getLayerAsYMap(e){if(this._layers.has(e))return this._layers.get(e)}_getSourceAsYMap(e){if(this._sources.has(e))return this._sources.get(e)}_layersObserver(e){const t=[];let r=!1;e.forEach((e=>{e.keys.forEach(((s,i)=>{r||(r=!0),t.push({id:i,newValue:h.JSONExt.deepCopy(e.target.toJSON()[i])})}))})),r=0===t.length||r,r&&this._layersChanged.emit({layerChange:t})}_layerTreeObserver(e){const t=e.delta;this._layerTreeChanged.emit({layerTreeChange:t})}_sourcesObserver(e){const t=[];let r=!1;e.forEach((e=>{e.keys.forEach(((s,i)=>{r||(r=!0),t.push({id:i,newValue:h.JSONExt.deepCopy(e.target.toJSON()[i])})}))})),r=0===t.length||r,r&&this._sourcesChanged.emit({sourceChange:t})}_terrainObserver(e){this._terrainChanged.emit(this.terrain)}}const l=JSON.parse('{"type":"object","title":"IJGISContent","required":["layers","sources"],"additionalProperties":false,"properties":{"layers":{"$ref":"#/definitions/jGISLayers"},"sources":{"$ref":"#/definitions/jGISSources"},"layerTree":{"$ref":"#/definitions/jGISLayerTree"},"terrain":{"$ref":"#/definitions/jGISTerrain"},"options":{"$ref":"#/definitions/jGISOptions"}},"definitions":{"layerType":{"type":"string","enum":["RasterLayer","VectorLayer","VectorTileLayer","HillshadeLayer","WebGlLayer","ImageLayer"]},"sourceType":{"type":"string","enum":["RasterSource","VectorTileSource","GeoJSONSource","RasterDemSource","VideoSource","ImageSource","ShapefileSource","GeoTiffSource"]},"jGISLayer":{"title":"IJGISLayer","type":"object","additionalProperties":false,"required":["name","type","visible"],"properties":{"name":{"type":"string"},"type":{"$ref":"#/definitions/layerType"},"visible":{"type":"boolean","default":true},"parameters":{"type":"object"},"filters":{"$ref":"#/definitions/jGISFilter"}}},"jGISSource":{"title":"IJGISSource","type":"object","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string"},"type":{"$ref":"#/definitions/sourceType"},"parameters":{"type":"object"}}},"jGISLayerGroup":{"title":"IJGISLayerGroup","type":"object","additionalProperties":false,"required":["name","layers"],"properties":{"name":{"type":"string"},"layers":{"type":"array","default":[],"items":{"$ref":"#/definitions/jGISLayerItem"}},"visible":{"type":"boolean","default":true},"parameters":{"type":"object"}}},"jGISLayerItem":{"title":"IJGISLayerItem","oneOf":[{"type":"string"},{"$ref":"#/definitions/jGISLayerGroup"}]},"jGISLayers":{"title":"IJGISLayers","type":"object","default":{},"additionalProperties":{"$ref":"#/definitions/jGISLayer"}},"jGISSources":{"title":"IJGISSources","type":"object","default":{},"additionalProperties":{"$ref":"#/definitions/jGISSource"}},"jGISLayerTree":{"title":"IJGISLayerTree","type":"array","default":[],"items":{"$ref":"#/definitions/jGISLayerItem"}},"jGISTerrain":{"title":"IJGISTerrain","type":"object","default":{},"required":["source","exaggeration"],"additionalProperties":false,"properties":{"source":{"type":"string","description":"The id of the DEM source","default":""},"exaggeration":{"type":"number","default":1}}},"jGISOptions":{"title":"IJGISOptions","type":"object","default":{},"required":[],"additionalProperties":false,"properties":{"latitude":{"type":"number","default":0},"longitude":{"type":"number","default":0},"zoom":{"type":"number","default":0},"bearing":{"type":"number","default":0},"pitch":{"type":"number","default":0},"extent":{"type":"array","default":null,"items":{"type":"number"}},"projection":{"type":"string","default":"EPSG:3857"}}},"jGISFilterItem":{"title":"IJGISFilterItem","type":"object","default":{},"required":["operator","feature","value"],"additionalProperties":false,"properties":{"operator":{"type":"string","enum":["==","!=",">","<",">=","<="],"default":"=="},"feature":{"type":"string","default":""},"value":{"type":["string","number"]}}},"jGISFilter":{"title":"IJGISFilter","type":"object","required":["logicalOp","appliedFilters"],"additionalProperties":false,"properties":{"logicalOp":{"type":"string","default":"all"},"appliedFilters":{"type":"array","default":[],"items":{"$ref":"#/definitions/jGISFilterItem"}}}}}}');class u{constructor(e){this._onSharedModelChanged=(e,t)=>{var r;t&&(null===(r=null==t?void 0:t.objectChange)||void 0===r?void 0:r.length)&&(this._contentChanged.emit(void 0),this.dirty=!0)},this.collaborative=!0,this._onClientStateChanged=e=>{const t=this.sharedModel.awareness.getStates();this._clientStateChanged.emit(t),this._sharedModel.awareness.on("change",(e=>{(e.added.length||e.removed.length)&&this._userChanged.emit(this.users)}))},this.defaultKernelName="",this.defaultKernelLanguage="",this._dirty=!1,this._readOnly=!1,this._isDisposed=!1,this._userChanged=new i.Signal(this),this._disposed=new i.Signal(this),this._contentChanged=new i.Signal(this),this._stateChanged=new i.Signal(this),this._themeChanged=new i.Signal(this),this._clientStateChanged=new i.Signal(this);const{sharedModel:t}=e;t?this._sharedModel=t:(this._sharedModel=d.create(),this._sharedModel.changed.connect(this._onSharedModelChanged)),this.sharedModel.awareness.on("change",this._onClientStateChanged)}get sharedModel(){return this._sharedModel}get isDisposed(){return this._isDisposed}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get themeChanged(){return this._themeChanged}get currentUserId(){var e;return null===(e=this.sharedModel)||void 0===e?void 0:e.awareness.clientID}get users(){var e;this._usersMap=null===(e=this._sharedModel)||void 0===e?void 0:e.awareness.getStates();const t=[];return this._usersMap&&this._usersMap.forEach(((e,r)=>{t.push({userId:r,userData:e.user})})),t}get userChanged(){return this._userChanged}get dirty(){return this._dirty}set dirty(e){this._dirty=e}get readOnly(){return this._readOnly}set readOnly(e){this._readOnly=e}get localState(){return this.sharedModel.awareness.getLocalState()}get clientStateChanged(){return this._clientStateChanged}get sharedOptionsChanged(){return this.sharedModel.optionsChanged}get sharedLayersChanged(){return this.sharedModel.layersChanged}get sharedLayerTreeChanged(){return this.sharedModel.layerTreeChanged}get sharedSourcesChanged(){return this.sharedModel.sourcesChanged}get terrainChanged(){return this.sharedModel.terrainChanged}get disposed(){return this._disposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._sharedModel.dispose(),this._disposed.emit(),i.Signal.clearData(this))}toString(){return JSON.stringify(this.getContent(),null,2)}fromString(e){const t=JSON.parse(e),r=(new(n())).compile(l);if(!r(t)){let e="File format errors:\n";for(const t of r.errors||[])e=`${e}- ${t.instancePath} ${t.message}\n`;throw Error(e)}this.sharedModel.transact((()=>{var e,r,s,i,a;this.sharedModel.sources=null!==(e=t.sources)&&void 0!==e?e:{},this.sharedModel.layers=null!==(r=t.layers)&&void 0!==r?r:{},this.sharedModel.layerTree=null!==(s=t.layerTree)&&void 0!==s?s:[],this.sharedModel.terrain=null!==(i=t.terrain)&&void 0!==i?i:{source:"",exaggeration:0},this.sharedModel.options=null!==(a=t.options)&&void 0!==a?a:{latitude:0,longitude:0,zoom:0,bearing:0,pitch:0,projection:"EPSG:3857"}})),this.dirty=!0}toJSON(){return JSON.parse(this.toString())}fromJSON(e){}initialize(){}getWorker(){return u.worker}getContent(){return{sources:this.sharedModel.sources,layers:this.sharedModel.layers,layerTree:this.sharedModel.layerTree,options:this.sharedModel.options,terrain:this.sharedModel.terrain}}setDrive(e,t){this._drive=e,this._filePath=t}getLayers(){return this.sharedModel.layers}getSources(){return this.sharedModel.sources}getLayerTree(){return this.sharedModel.layerTree}getLayer(e){return this.sharedModel.getLayer(e)}getSource(e){return this.sharedModel.getSource(e)}getSourcesByType(e){const t={};for(const r of Object.keys(this.getSources()||{})){const s=this.getSource(r);(null==s?void 0:s.type)===e&&(t[r]=s.name)}return t}getLayersBySource(e){const t=[];return Object.entries(this.getLayers()||{}).forEach((([r,s])=>{var i;(null===(i=s.parameters)||void 0===i?void 0:i.source)===e&&t.push(r)})),t}async readGeoJSON(e){if(!this._drive)return;let t=s.PathExt.dirname(this._filePath);t.includes(":")&&(t=t.split(":")[1]);const r=s.PathExt.join(t,e);return this._drive.get(r).then((e=>JSON.parse(e.content))).catch((e=>{throw e}))}addGroup(e,t,r){if(y.findItemPath(this.getLayerTree(),e).length)return void console.warn(`The group "${t}" already exist in the layer tree`);const s={name:e,layers:[]};this._addLayerTreeItem(s,t,r)}addLayer(e,t,r,s){this.getLayer(e)||this.sharedModel.addLayer(e,t),this._addLayerTreeItem(e,r,s)}removeLayer(e){this._removeLayerTreeLayer(this.getLayerTree(),e),this.sharedModel.removeLayer(e)}setTerrain(e){this._sharedModel.terrain=e}setOptions(e){this._sharedModel.options=e}getOptions(){return this._sharedModel.options}syncSelected(e,t){this.sharedModel.awareness.setLocalStateField("selected",{value:e,emitter:t})}setUserToFollow(e){this._sharedModel&&this._sharedModel.awareness.setLocalStateField("remoteUser",e)}getClientId(){return this.sharedModel.awareness.clientID}_addLayerTreeItem(e,t,r){if(t){const s=this._getLayerTreeInfo(t);s&&(s.workingGroup.layers.splice(null!=r?r:s.workingGroup.layers.length,0,e),this._sharedModel.updateLayerTreeItem(s.mainGroupIndex,s.mainGroup))}else this.sharedModel.addLayerTreeItem(null!=r?r:this.getLayerTree().length,e)}moveItemsToGroup(e,t,r){const s=this.getLayerTree();for(const i of e)if(this.getLayer(i))this._removeLayerTreeLayer(s,i),this._addLayerTreeItem(i,t,r);else{const e=this._getLayerTreeInfo(i);if(void 0===e)continue;const a=Object.assign({},e.workingGroup);this._removeLayerTreeGroup(s,i),this._addLayerTreeItem(a,t,r)}}moveItemRelatedTo(e,t,r){var s;const i=this.getLayerTree();let a;if(this.getLayer(e))this._removeLayerTreeLayer(i,e),a=e;else{const t=this._getLayerTreeInfo(e);if(void 0===t)return;a=Object.assign({},t.workingGroup),this._removeLayerTreeGroup(i,e)}const n=y.findItemPath(i,t),o=(null!==(s=n.pop())&&void 0!==s?s:0)+(r?1:0);let h="",d=n.shift();if(void 0!==d){let e=i[d];for(;n.length&&(d=n.shift(),void 0!==d);)e=e.layers[d];h=e.name}this._addLayerTreeItem(a,h,o)}addNewLayerGroup(e,t){const r=this.getLayerTree();for(const t in e)this._removeLayerTreeLayer(r,t);this._addLayerTreeItem(t)}_removeLayerTreeLayer(e,t){for(let r=0;r<e.length;r++){const s=e[r];"string"==typeof s&&s===t?(e.splice(r,1),r--):"string"!=typeof s&&"layers"in s&&this._removeLayerTreeLayer(s.layers,t)}this.sharedModel.layerTree=e}_removeLayerTreeGroup(e,t){for(let r=0;r<e.length;r++){const s=e[r];"string"!=typeof s&&s.name===t?(e.splice(r,1),r--):"string"!=typeof s&&"layers"in s&&this._removeLayerTreeGroup(s.layers,t)}this.sharedModel.layerTree=e}renameLayerGroup(e,t){const r=this._getLayerTreeInfo(e);r?(r.workingGroup.name=t,this._sharedModel.updateLayerTreeItem(r.mainGroupIndex,r.mainGroup)):console.log("Something went wrong when renaming layer")}removeLayerGroup(e){const t=this.getLayerTree(),r=this._getLayerTreeInfo(e),s=function e(t,r){const s=[];for(const i of t)if("string"==typeof i)s.push(i);else if(i.name!==r){const t=e(i.layers,r);s.push(Object.assign(Object.assign({},i),{layers:t}))}return s}(t,e);r&&this._sharedModel.updateLayerTreeItem(r.mainGroupIndex,s[r.mainGroupIndex])}_getLayerTreeInfo(e){const t=this.getLayerTree(),r=y.findItemPath(t,e);if(!r.length)return void console.warn(`The group "${e}" does not exist in the layer tree`);const s=r.shift();if(void 0===s)return;const i=t[s];let a=i;for(;r.length;){const e=r.shift();if(void 0===e)break;a=a.layers[e]}return{mainGroup:i,workingGroup:a,mainGroupIndex:s}}}var y;!function(e){e.getOrderedLayerIds=function(e){return y.layerTreeRecursion(e.sharedModel.layerTree)}}(u||(u={})),function(e){e.layerTreeRecursion=function e(t,r=[]){for(const s of t)"string"==typeof s?r.push(s):r.push(...e(s.layers));return r},e.findItemPath=function e(t,r,s=[]){for(let i=0;i<t.length;i++){const a=t[i];if("string"==typeof a){if(a===r){const e=[...s];return e.push(i),e}}else{const t=[...s];if(t.push(i),a.name===r)return t;const n=e(a.layers,r,t);if(n.length>t.length)return n}}return s}}(y||(y={}));const p=new h.Token("jupyterGISDocTracker"),c=new h.Token("jupytergisFormSchemaRegistry"),g=new h.Token("jupytergisExternalCommandRegistry"),f=new h.Token("jupytergisExternalCommandRegistry")}}]);
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 609.d2f38c4cae8c4b9d76a8.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[609],{21018:(e,t,a)=>{"use strict";a.r(t),a.d(t,{BaseForm:()=>B,CommandIDs:()=>d,ControlPanelHeader:()=>Ye,ControlPanelModel:()=>It,CreationFormDialog:()=>X,CreationFormWrapper:()=>K,JupyterGISMainViewPanel:()=>Fe,JupyterGISPanel:()=>Qe,JupyterGISWidget:()=>qe,LeftPanelWidget:()=>xt,LuminoSchemaForm:()=>R,MainView:()=>We,MainViewModel:()=>Ue,ObjectProperties:()=>jt,RightPanelWidget:()=>kt,Separator:()=>Bt,TOOLBAR_GROUPNAME_CLASS:()=>Rt,TOOLBAR_SEPARATOR_CLASS:()=>Dt,ToolbarWidget:()=>Pt,UsersItem:()=>Nt,addCommands:()=>ge,createDefaultLayerRegistry:()=>L,createHeader:()=>Ke,debounce:()=>w,deepCopy:()=>j,getCSSVariableColor:()=>I,getElementFromProperty:()=>C,getLayerTileInfo:()=>G,getSourceLayerNames:()=>O,icons:()=>u,isLightTheme:()=>M,nearest:()=>x,requestAPI:()=>E,throttle:()=>_});var r=a(12200),o=a(87460);const s=new o.LabIcon({name:"jupytergis::raster",svgstr:'<svg height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon2 jp-icon-selectable" fill="#e2e2e2">\n <path d="M 22,8 H 2 v 1 h 20 z m 0,10.5 H 2 v 1 H 22 Z M 22,15 H 2 v 1 h 20 z m 0,-3.5 H 2 v 1 h 20 z m 0,-7 H 2 v 1 H 22 Z M 5.5,2 h -1 v 20 h 1 z M 9,2 H 8 v 20 h 1 z m 3.5,0 h -1 v 20 h 1 z M 16,2 h -1 v 20 h 1 z m 3.5,0 h -1 v 20 h 1 z"/>\n </g>\n</svg>\n'}),n=new o.LabIcon({name:"jupytergis::visibility",svgstr:'<svg height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3 jp-icon-selectable" fill="#616161">\n <path d="M 12,7.5117187 C 9.5269955,7.5117186 7.5117187,9.5269959 7.5117187,12 c 4e-7,2.473004 2.0152771,4.488281 4.4882813,4.488281 2.473004,0 4.488281,-2.015277 4.488281,-4.488281 0,-2.4730039 -2.015277,-4.488281 -4.488281,-4.4882813 z m 0,1.0000001 c 1.932565,10e-8 3.488281,1.5557172 3.488281,3.4882812 0,1.932564 -1.555716,3.488281 -3.488281,3.488281 C 10.067435,15.488281 8.511719,13.932564 8.5117188,12 8.5117187,10.067436 10.067435,8.5117187 12,8.5117188 Z"/>\n <path d="M 12 10.5 A 1.5 1.5 0 0 0 10.5 12 A 1.5 1.5 0 0 0 12 13.5 A 1.5 1.5 0 0 0 13.5 12 A 1.5 1.5 0 0 0 13.130859 11.013672 A 0.60000002 0.60000002 0 0 1 13.205078 11.304688 A 0.60000002 0.60000002 0 0 1 12.605469 11.90625 A 0.60000002 0.60000002 0 0 1 12.005859 11.304688 A 0.60000002 0.60000002 0 0 1 12.605469 10.705078 A 0.60000002 0.60000002 0 0 1 12.830078 10.75 A 1.5 1.5 0 0 0 12 10.5 z "/>\n <path d="M 11.941406,6.4980469 C 7.3733981,6.5024661 3.2961559,8.5768767 1.9492187,11.804688 l -0.080078,0.193359 0.080078,0.193359 c 1.3480417,3.227968 5.4258411,5.302394 9.9941403,5.306641 4.573757,-0.0034 8.655672,-2.083243 10,-5.316406 l 0.08008,-0.191407 -0.08008,-0.193359 C 20.590947,8.5700472 16.509943,6.4982838 11.941406,6.4980469 Z m 0,1 c 4.152317,2.153e-4 7.72176,1.9081199 8.947266,4.4941411 -1.219637,2.589986 -4.788912,4.502755 -8.945313,4.505859 -4.1514043,-0.0039 -7.7169499,-1.913838 -8.9394527,-4.5 1.2215174,-2.5858023 4.786394,-4.4959842 8.9374997,-4.5000001 z"/>\n </g>\n</svg>\n'}),i=new o.LabIcon({name:"jupytergis::nonVisibility",svgstr:'<svg height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg">\n <g class="jp-icon3 jp-icon-selectable" fill="#616161">\n <path d="M 12,7.5117187 C 9.5269955,7.5117186 7.5117187,9.5269959 7.5117187,12 c 4e-7,2.473004 2.0152771,4.488281 4.4882813,4.488281 2.473004,0 4.488281,-2.015277 4.488281,-4.488281 0,-2.4730039 -2.015277,-4.488281 -4.488281,-4.4882813 z m 0,1.0000001 c 1.932565,10e-8 3.488281,1.5557172 3.488281,3.4882812 0,1.932564 -1.555716,3.488281 -3.488281,3.488281 C 10.067435,15.488281 8.511719,13.932564 8.5117188,12 8.5117187,10.067436 10.067435,8.5117187 12,8.5117188 Z"/>\n <path d="M 12 10.5 A 1.5 1.5 0 0 0 10.5 12 A 1.5 1.5 0 0 0 12 13.5 A 1.5 1.5 0 0 0 13.5 12 A 1.5 1.5 0 0 0 13.130859 11.013672 A 0.60000002 0.60000002 0 0 1 13.205078 11.304688 A 0.60000002 0.60000002 0 0 1 12.605469 11.90625 A 0.60000002 0.60000002 0 0 1 12.005859 11.304688 A 0.60000002 0.60000002 0 0 1 12.605469 10.705078 A 0.60000002 0.60000002 0 0 1 12.830078 10.75 A 1.5 1.5 0 0 0 12 10.5 z "/>\n <path d="M 11.941406,6.4980469 C 7.3733981,6.5024661 3.2961559,8.5768767 1.9492187,11.804688 l -0.080078,0.193359 0.080078,0.193359 c 1.3480417,3.227968 5.4258411,5.302394 9.9941403,5.306641 4.573757,-0.0034 8.655672,-2.083243 10,-5.316406 l 0.08008,-0.191407 -0.08008,-0.193359 C 20.590947,8.5700472 16.509943,6.4982838 11.941406,6.4980469 Z m 0,1 c 4.152317,2.153e-4 7.72176,1.9081199 8.947266,4.4941411 -1.219637,2.589986 -4.788912,4.502755 -8.945313,4.505859 -4.1514043,-0.0039 -7.7169499,-1.913838 -8.9394527,-4.5 1.2215174,-2.5858023 4.786394,-4.4959842 8.9374997,-4.5000001 z"/>\n <path d="M 5.0664062,4.359375 4.359375,5.0664062 18.933594,19.638672 19.640625,18.931641 Z"/>\n </g>\n</svg>\n'}),l=new o.LabIcon({name:"jupytergis::geoJSON",svgstr:'\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n<svg\n width="16px"\n height="16px"\n viewBox="0 0 100 100"\n xmlns="http://www.w3.org/2000/svg"\n class="iconify iconify--gis">\n <g class="jp-icon2 jp-icon-selectable" fill="#e2e2e2">\n <path d="M13.996 0a2.5 2.5 0 0 0-2.5 2.5V70H0v22h11.496v5.5a2.5 2.5 0 0 0 2.5 2.5h72a2.5 2.5 0 0 0 2.5-2.5V21.625c.027-1.113.004-1.777-.732-2.59L69.46.732A2.5 2.5 0 0 0 67.662 0H13.996zm2.5 5h48.902l1.252 14.568a2.5 2.5 0 0 0 2.278 2.278l14.568 1.252V95h-67v-3H80V70H16.496V5zm54.275 4.115l8.61 8.61l-7.928-.682l-.682-7.928zM10.48 73c1.37 0 2.439.379 3.207 1.137c.772.751 1.269 1.793 1.49 3.125l-2.213.543c-.156-.712-.45-1.271-.881-1.68c-.426-.415-.961-.623-1.603-.623c-.974 0-1.748.406-2.325 1.217c-.572.81-.86 2.012-.86 3.607c0 1.72.292 3.014.874 3.877c.582.857 1.346 1.285 2.289 1.285c.467 0 .932-.118 1.398-.355a4.72 4.72 0 0 0 1.213-.881v-1.838h-2.55v-2.443h4.8v5.775c-.466.593-1.143 1.118-2.03 1.572c-.884.449-1.78.672-2.688.672c-1.154 0-2.16-.316-3.018-.949c-.858-.64-1.504-1.549-1.936-2.728C5.215 83.126 5 81.835 5 80.445c0-1.51.241-2.85.723-4.023c.481-1.173 1.187-2.073 2.115-2.7c.707-.48 1.587-.722 2.64-.722zm37.33 0c1.384 0 2.425.4 3.123 1.197c.702.798 1.07 1.862 1.105 3.194l-2.226.129c-.096-.745-.302-1.281-.618-1.604c-.31-.33-.78-.494-1.408-.494c-.647 0-1.153.176-1.52.525c-.235.224-.353.523-.353.899c0 .342.11.637.33.88c.281.31.963.633 2.047.97c1.084.336 1.886.686 2.402 1.048c.522.356.928.847 1.22 1.473c.295.62.443 1.388.443 2.304c0 .831-.175 1.607-.526 2.333c-.351.725-.848 1.267-1.49 1.623c-.642.349-1.444.523-2.402.523c-1.395 0-2.466-.422-3.213-1.266c-.748-.85-1.195-2.085-1.34-3.707l2.168-.277c.13.956.392 1.657.789 2.105c.401.449.942.672 1.619.672c.717 0 1.256-.196 1.617-.591c.366-.403.551-.87.551-1.405c0-.343-.079-.634-.234-.87c-.15-.245-.416-.456-.797-.634c-.261-.118-.855-.33-1.783-.632c-1.195-.39-2.033-.867-2.514-1.434c-.678-.798-1.018-1.77-1.018-2.916a4.6 4.6 0 0 1 .475-2.066a3.361 3.361 0 0 1 1.377-1.475c.602-.336 1.328-.504 2.176-.504zm11.318 0c1.626 0 2.925.663 3.898 1.988c.979 1.325 1.47 3.168 1.47 5.528c0 2.34-.486 4.17-1.454 5.496c-.968 1.318-2.262 1.978-3.883 1.978c-1.64 0-2.946-.657-3.914-1.969c-.968-1.318-1.453-3.13-1.453-5.437c0-1.477.168-2.717.504-3.719c.25-.738.592-1.4 1.023-1.986c.437-.587.915-1.021 1.432-1.305c.687-.382 1.479-.574 2.377-.574zm-19.777.248h2.218v9.176c0 1.2-.08 2.121-.24 2.767c-.216.844-.607 1.523-1.174 2.038c-.567.507-1.314.761-2.242.761c-1.089 0-1.927-.4-2.514-1.197c-.587-.804-.883-1.98-.888-3.53l2.1-.316c.024.83.118 1.417.279 1.76c.24.52.606.781 1.097.781c.497 0 .85-.183 1.055-.552c.206-.376.309-1.151.309-2.325v-9.363zm26.898 0h2.166l4.516 9.68v-9.68H75v14.494h-2.234l-4.45-9.451v9.451h-2.068V73.248zm-7.098 2.254c-.918 0-1.658.415-2.22 1.246c-.562.824-.842 2.069-.842 3.736c0 1.642.288 2.888.865 3.739c.577.843 1.31 1.265 2.197 1.265c.888 0 1.615-.418 2.182-1.256c.572-.843.86-2.106.86-3.787c0-1.66-.28-2.9-.837-3.716c-.551-.818-1.286-1.227-2.205-1.227zm-38.752 1.502c1.19 0 2.128.518 2.815 1.553c.687 1.028 1.016 2.607.986 4.736h-5.3c.015.824.186 1.466.512 1.928c.326.455.732.683 1.219.683c.331 0 .61-.12.836-.357c.226-.237.396-.62.512-1.147l2.107.465c-.271 1.015-.7 1.79-1.287 2.324c-.582.528-1.312.791-2.19.791c-1.39 0-2.418-.595-3.086-1.789c-.526-.955-.79-2.162-.79-3.619c0-1.74.346-3.102 1.038-4.084c.693-.989 1.569-1.484 2.627-1.484zm9.159 0c1.209 0 2.202.518 2.974 1.553c.773 1.028 1.158 2.33 1.158 3.906c0 1.589-.39 2.907-1.173 3.955c-.778 1.041-1.76 1.562-2.944 1.562c-.732 0-1.432-.217-2.1-.652c-.662-.435-1.165-1.07-1.511-1.908c-.346-.844-.52-1.87-.52-3.076c0-.923.174-1.816.52-2.68c.346-.863.835-1.522 1.467-1.977a3.58 3.58 0 0 1 2.129-.683zm-9.032 2.127c-.461 0-.841.22-1.142.662c-.301.442-.45 1.04-.445 1.799H22.1c-.015-.804-.174-1.413-.475-1.828c-.301-.422-.668-.633-1.1-.633zm9.04.139c-.552 0-1.017.276-1.393.83c-.376.553-.565 1.35-.565 2.392c0 1.042.189 1.839.565 2.393c.376.553.84.832 1.392.832c.552 0 1.014-.279 1.385-.832c.377-.554.565-1.358.565-2.412c0-1.029-.188-1.82-.565-2.373c-.371-.554-.833-.83-1.385-.83z"></path>\n <path d="M51.252 18v10.11h8.852a25.56 25.56 0 0 0-1.707-3.881c-1.985-3.606-4.507-5.78-7.145-6.229zm-2.504.1c-2.469.613-4.813 2.735-6.682 6.13a25.56 25.56 0 0 0-1.706 3.881h8.388zm-5.769.678a22.547 22.547 0 0 0-12.005 9.333h6.739c.594-1.851 1.318-3.562 2.16-5.089c.897-1.63 1.942-3.067 3.106-4.244zm14.729.231c1.074 1.134 2.044 2.488 2.883 4.013c.841 1.527 1.564 3.238 2.157 5.089h6.278a22.56 22.56 0 0 0-11.318-9.102zM29.595 30.615a22.435 22.435 0 0 0-2.095 8.329h8.408c.097-2.941.48-5.744 1.103-8.329zm10.004 0c-.662 2.542-1.078 5.357-1.184 8.329h10.333v-8.329zm11.653 0v8.329h10.797c-.106-2.972-.523-5.787-1.184-8.329zm12.197 0a41.505 41.505 0 0 1 1.1 8.329H72.5a22.435 22.435 0 0 0-2.095-8.329zM27.5 41.447a22.435 22.435 0 0 0 2.095 8.329h7.298c-.588-2.593-.934-5.396-.999-8.329zm10.898 0c.07 2.962.452 5.774 1.075 8.329h9.275v-8.329zm12.854 0v8.329h9.738c.624-2.555 1.005-5.367 1.075-8.329zm13.31 0c-.065 2.932-.409 5.736-.995 8.329h6.838a22.435 22.435 0 0 0 2.095-8.329zM30.973 52.28a22.565 22.565 0 0 0 11.33 9.105a20.107 20.107 0 0 1-2.432-3.514c-.917-1.666-1.697-3.546-2.319-5.591zm9.212 0c.532 1.61 1.165 3.084 1.88 4.383c1.753 3.182 3.923 5.246 6.222 5.997c.154.01.306.03.46.03V52.275zm11.066 0v10.415c.357-.02.713-.04 1.065-.08c2.247-.789 4.364-2.834 6.08-5.951c.716-1.299 1.349-2.773 1.88-4.383zm11.656 0c-.62 2.045-1.4 3.926-2.317 5.591a20.4 20.4 0 0 1-2.197 3.243a22.568 22.568 0 0 0 10.632-8.834z"></path>\n </g>\n</svg>\n'}),c=new o.LabIcon({name:"jupytergis::mound",svgstr:'<svg\n width="16px"\n height="16px"\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 576 512">\n <g class="jp-icon2 jp-icon-selectable" fill="#e2e2e2">\n <path d="M144.1 179.2C173.8 127.7 228.6 96 288 96s114.2 31.7 143.9 83.2L540.4 368c12.3 21.3-3.1 48-27.7 48H63.3c-24.6 0-40-26.6-27.7-48L144.1 179.2z"/>\n </g>\n</svg>\n'});var d;!function(e){e.createNew="jupytergis:create-new-jGIS-file",e.redo="jupytergis:redo",e.undo="jupytergis:undo",e.symbology="jupytergis:symbology",e.openLayerBrowser="jupytergis:openLayerBrowser",e.newRasterEntry="jupytergis:newRasterEntry",e.newVectorTileEntry="jupytergis:newVectorTileEntry",e.newGeoJSONEntry="jupytergis:newGeoJSONEntry",e.newHillshadeEntry="jupytergis:newHillshadeEntry",e.newImageEntry="jupytergis:newImageEntry",e.newVideoEntry="jupytergis:newVideoEntry",e.newGeoTiffEntry="jupytergis:newGeoTiffEntry",e.newRasterSource="jupytergis:newRasterSource",e.newRasterDemSource="jupytergis:newRasterDemSource",e.newVectorSource="jupytergis:newVectorSource",e.newGeoJSONSource="jupytergis:newGeoJSONSource",e.newImageSource="jupytergis:imageSource",e.newVideoSource="jupytergis:videoSource",e.newShapefileSource="jupytergis:shapefileSource",e.newGeoTiffSource="jupytergis:newGeoTiffSource",e.newRasterLayer="jupytergis:newRasterLayer",e.newVectorLayer="jupytergis:newVectorLayer",e.newHillshadeLayer="jupytergis:newHillshadeLayer",e.newImageLayer="jupytergis:newImageLayer",e.newVideoLayer="jupytergis:newVideoLayer",e.newShapefileLayer="jupytergis:newShapefileLayer",e.newWebGlTileLayer="jupytergis:newWebGlTileLayer",e.renameLayer="jupytergis:renameLayer",e.removeLayer="jupytergis:removeLayer",e.renameGroup="jupytergis:renameGroup",e.removeGroup="jupytergis:removeGroup",e.moveLayersToGroup="jupytergis:moveLayersToGroup",e.moveLayerToNewGroup="jupytergis:moveLayerToNewGroup",e.renameSource="jupytergis:renameSource",e.removeSource="jupytergis:removeSource",e.newTerrain="jupytergis:newTerrain",e.removeTerrain="jupytergis:removeTerrain",e.toggleConsole="jupytergis:toggleConsole",e.invokeCompleter="jupytergis:invokeConsoleCompleter",e.removeConsole="jupytergis:removeConsole",e.executeConsole="jupytergis:executeConsole",e.selectCompleter="jupytergis:selectConsoleCompleter"}(d||(d={}));const m={RasterSource:{icon:s},RasterDemSource:{icon:c},VectorTileSource:{iconClass:"fa fa-vector-square"},GeoJSONSource:{icon:l},ImageSource:{iconClass:"fa fa-image"},VideoSource:{iconClass:"fa fa-video"},ShapefileSource:{iconClass:"fa fa-file"},RasterLayer:{icon:s},VectorLayer:{iconClass:"fa fa-vector-square"},HillshadeLayer:{icon:c},ImageLayer:{iconClass:"fa fa-image"},VideoLayer:{iconClass:"fa fa-video"},[d.redo]:{icon:o.redoIcon},[d.undo]:{icon:o.undoIcon},[d.openLayerBrowser]:{iconClass:"fa fa-book-open"},[d.newRasterEntry]:{icon:s},[d.newVectorTileEntry]:{iconClass:"fa fa-vector-square"},[d.newGeoJSONEntry]:{icon:l},[d.newHillshadeEntry]:{icon:c},[d.newImageEntry]:{iconClass:"fa fa-image"},[d.newVideoEntry]:{iconClass:"fa fa-video"},[d.newShapefileLayer]:{iconClass:"fa fa-file"},[d.newGeoTiffEntry]:{iconClass:"fa fa-image"},[d.newTerrain]:{iconClass:"fa fa-mountain"},[d.symbology]:{iconClass:"fa fa-brush"}},u=new Map(Object.entries(m));var p=a(93345),h=a.n(p),g=a(38286),y=a(80313),S=a(81473),v=a(57354),b=a(8996);const f=JSON.parse('{"OpenStreetMap":{"Mapnik":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-Mapnik.png","url":"https://tile.openstreetmap.org/{z}/{x}/{y}.png","max_zoom":19,"html_attribution":"© <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors","attribution":"(C) OpenStreetMap contributors","name":"OpenStreetMap.Mapnik"},"DE":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-DE.png","url":"https://tile.openstreetmap.de/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"© <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors","attribution":"(C) OpenStreetMap contributors","name":"OpenStreetMap.DE"},"CH":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-CH.png","url":"https://tile.osm.ch/switzerland/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"© <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors","attribution":"(C) OpenStreetMap contributors","bounds":[[45,5],[48,11]],"name":"OpenStreetMap.CH"},"France":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-France.png","url":"https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png","max_zoom":20,"html_attribution":"© OpenStreetMap France | © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors","attribution":"(C) OpenStreetMap France | (C) OpenStreetMap contributors","name":"OpenStreetMap.France"},"HOT":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-HOT.png","url":"https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png","max_zoom":19,"html_attribution":"© <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors, Tiles style by <a href=\\"https://www.hotosm.org/\\" target=\\"_blank\\">Humanitarian OpenStreetMap Team</a> hosted by <a href=\\"https://openstreetmap.fr/\\" target=\\"_blank\\">OpenStreetMap France</a>","attribution":"(C) OpenStreetMap contributors, Tiles style by Humanitarian OpenStreetMap Team hosted by OpenStreetMap France","name":"OpenStreetMap.HOT"},"BZH":{"thumbnailPath":"rasterlayer_gallery/OpenStreetMap-BZH.png","url":"https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png","max_zoom":19,"html_attribution":"© <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors, Tiles courtesy of <a href=\\"http://www.openstreetmap.bzh/\\" target=\\"_blank\\">Breton OpenStreetMap Team</a>","attribution":"(C) OpenStreetMap contributors, Tiles courtesy of Breton OpenStreetMap Team","bounds":[[46.2,-5.5],[50,0.7]],"name":"OpenStreetMap.BZH"}},"NASAGIBS":{"ModisTerraTrueColorCR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraTrueColorCR.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":9,"format":"jpg","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_CorrectedReflectance_TrueColor","name":"NASAGIBS.ModisTerraTrueColorCR"},"ModisTerraBands367CR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraBands367CR.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":9,"format":"jpg","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_CorrectedReflectance_Bands367","name":"NASAGIBS.ModisTerraBands367CR"},"ViirsEarthAtNight2012":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ViirsEarthAtNight2012.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":8,"format":"jpg","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"VIIRS_CityLights_2012","name":"NASAGIBS.ViirsEarthAtNight2012"},"ModisTerraLSTDay":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraLSTDay.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":7,"format":"png","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_Land_Surface_Temp_Day","opacity":0.75,"name":"NASAGIBS.ModisTerraLSTDay"},"ModisTerraSnowCover":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraSnowCover.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":8,"format":"png","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_NDSI_Snow_Cover","opacity":0.75,"name":"NASAGIBS.ModisTerraSnowCover"},"ModisTerraAOD":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraAOD.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":6,"format":"png","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_Aerosol","opacity":0.75,"name":"NASAGIBS.ModisTerraAOD"},"ModisTerraChlorophyll":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraChlorophyll.png","url":"https://map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{max_zoom}/{z}/{y}/{x}.{format}","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","bounds":[[-85.0511287776,-179.999999975],[85.0511287776,179.999999975]],"min_zoom":1,"max_zoom":7,"format":"png","time":"2024-09-12","tilematrixset":"GoogleMapsCompatible_Level","variant":"MODIS_Terra_L2_Chlorophyll_A","opacity":0.75,"name":"NASAGIBS.ModisTerraChlorophyll","status":"broken"},"ModisTerraBands721CR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisTerraBands721CR.png","url":"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Terra_CorrectedReflectance_Bands721/default/{time}/GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg","max_zoom":9,"attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","name":"NASAGIBS.ModisTerraBands721CR","time":"2024-09-12"},"ModisAquaTrueColorCR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisAquaTrueColorCR.png","url":"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Aqua_CorrectedReflectance_TrueColor/default/{time}/GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg","max_zoom":9,"attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","name":"NASAGIBS.ModisAquaTrueColorCR","time":"2024-09-12"},"ModisAquaBands721CR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ModisAquaBands721CR.png","url":"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/MODIS_Aqua_CorrectedReflectance_Bands721/default/{time}/GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg","max_zoom":9,"attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","name":"NASAGIBS.ModisAquaBands721CR","time":"2024-09-12"},"ViirsTrueColorCR":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ViirsTrueColorCR.png","url":"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_SNPP_CorrectedReflectance_TrueColor/default/{time}/GoogleMapsCompatible_Level9/{z}/{y}/{x}.jpg","max_zoom":9,"attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","name":"NASAGIBS.ViirsTrueColorCR","time":"2024-09-12"},"ASTER_GDEM_Greyscale_Shaded_Relief":{"thumbnailPath":"rasterlayer_gallery/NASAGIBS-ASTER_GDEM_Greyscale_Shaded_Relief.png","url":"https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/ASTER_GDEM_Greyscale_Shaded_Relief/default/GoogleMapsCompatible_Level12/{z}/{y}/{x}.jpg","max_zoom":12,"attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (ESDIS) with funding provided by NASA/HQ.","html_attribution":"Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System (<a href=\\"https://earthdata.nasa.gov\\">ESDIS</a>) with funding provided by NASA/HQ.","name":"NASAGIBS.ASTER_GDEM_Greyscale_Shaded_Relief"}},"USGS":{"USTopo":{"thumbnailPath":"rasterlayer_gallery/USGS-USTopo.png","url":"https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}","max_zoom":20,"html_attribution":"Tiles courtesy of the <a href=\\"https://usgs.gov/\\">U.S. Geological Survey</a>","attribution":"Tiles courtesy of the U.S. Geological Survey","name":"USGS.USTopo"},"USImagery":{"thumbnailPath":"rasterlayer_gallery/USGS-USImagery.png","url":"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}","max_zoom":20,"html_attribution":"Tiles courtesy of the <a href=\\"https://usgs.gov/\\">U.S. Geological Survey</a>","attribution":"Tiles courtesy of the U.S. Geological Survey","name":"USGS.USImagery"},"USImageryTopo":{"thumbnailPath":"rasterlayer_gallery/USGS-USImageryTopo.png","url":"https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/{z}/{y}/{x}","max_zoom":20,"html_attribution":"Tiles courtesy of the <a href=\\"https://usgs.gov/\\">U.S. Geological Survey</a>","attribution":"Tiles courtesy of the U.S. Geological Survey","name":"USGS.USImageryTopo"}},"WaymarkedTrails":{"hiking":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-hiking.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"hiking","name":"WaymarkedTrails.hiking"},"cycling":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-cycling.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"cycling","name":"WaymarkedTrails.cycling"},"mtb":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-mtb.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"mtb","name":"WaymarkedTrails.mtb"},"slopes":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-slopes.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"slopes","name":"WaymarkedTrails.slopes"},"riding":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-riding.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"riding","name":"WaymarkedTrails.riding"},"skating":{"thumbnailPath":"rasterlayer_gallery/WaymarkedTrails-skating.png","url":"https://tile.waymarkedtrails.org/{variant}/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://waymarkedtrails.org\\">waymarkedtrails.org</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) waymarkedtrails.org (CC-BY-SA)","variant":"skating","name":"WaymarkedTrails.skating"}},"Gaode":{"Normal":{"thumbnailPath":"rasterlayer_gallery/Gaode-Normal.png","url":"http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}","max_zoom":19,"attribution":"© <a href=\\"http://www.gaode.com/\\">Gaode.com</a>","html_attribution":"© <a href=\\"http://www.gaode.com/\\">Gaode.com</a>","name":"Gaode.Normal"},"Satellite":{"thumbnailPath":"rasterlayer_gallery/Gaode-Satellite.png","url":"http://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}","max_zoom":19,"attribution":"© <a href=\\"http://www.gaode.com/\\">Gaode.com</a>","html_attribution":"© <a href=\\"http://www.gaode.com/\\">Gaode.com</a>","name":"Gaode.Satellite"}},"Strava":{"All":{"thumbnailPath":"rasterlayer_gallery/Strava-All.png","url":"https://heatmap-external-a.strava.com/tiles/all/hot/{z}/{x}/{y}.png","max_zoom":15,"attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","html_attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","name":"Strava.All"},"Ride":{"thumbnailPath":"rasterlayer_gallery/Strava-Ride.png","url":"https://heatmap-external-a.strava.com/tiles/ride/hot/{z}/{x}/{y}.png","max_zoom":15,"attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","html_attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","name":"Strava.Ride"},"Run":{"thumbnailPath":"rasterlayer_gallery/Strava-Run.png","url":"https://heatmap-external-a.strava.com/tiles/run/bluered/{z}/{x}/{y}.png","max_zoom":15,"attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","html_attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","name":"Strava.Run"},"Water":{"thumbnailPath":"rasterlayer_gallery/Strava-Water.png","url":"https://heatmap-external-a.strava.com/tiles/water/blue/{z}/{x}/{y}.png","max_zoom":15,"attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","html_attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","name":"Strava.Water"},"Winter":{"thumbnailPath":"rasterlayer_gallery/Strava-Winter.png","url":"https://heatmap-external-a.strava.com/tiles/winter/hot/{z}/{x}/{y}.png","max_zoom":15,"attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","html_attribution":"Map tiles by <a href=\\"https://labs.strava.com/heatmap\\">Strava 2021</a>","name":"Strava.Winter"}},"OPNVKarte":{"thumbnailPath":"rasterlayer_gallery/OPNVKarte.png","url":"https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png","max_zoom":18,"html_attribution":"Map <a href=\\"https://memomaps.de/\\">memomaps.de</a> <a href=\\"http://creativecommons.org/licenses/by-sa/2.0/\\">CC-BY-SA</a>, map data © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors","attribution":"Map memomaps.de CC-BY-SA, map data (C) OpenStreetMap contributors","name":"OPNVKarte"},"OpenTopoMap":{"thumbnailPath":"rasterlayer_gallery/OpenTopoMap.png","url":"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png","max_zoom":17,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors, <a href=\\"http://viewfinderpanoramas.org\\">SRTM</a> | Map style: © <a href=\\"https://opentopomap.org\\">OpenTopoMap</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)","name":"OpenTopoMap"},"OpenRailwayMap":{"thumbnailPath":"rasterlayer_gallery/OpenRailwayMap.png","url":"https://{s}.tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png","max_zoom":19,"html_attribution":"Map data: © <a href=\\"https://www.openstreetmap.org/copyright\\">OpenStreetMap</a> contributors | Map style: © <a href=\\"https://www.OpenRailwayMap.org\\">OpenRailwayMap</a> (<a href=\\"https://creativecommons.org/licenses/by-sa/3.0/\\">CC-BY-SA</a>)","attribution":"Map data: (C) OpenStreetMap contributors | Map style: (C) OpenRailwayMap (CC-BY-SA)","name":"OpenRailwayMap"}}'),w=(e,t=100)=>{let a;return(...r)=>{clearTimeout(a),a=window.setTimeout((()=>{e(...r)}),t)}};function _(e,t=100){let a,r;return function(...o){const s=+new Date;a&&s<a+t?(clearTimeout(r),r=setTimeout((()=>{a=s,e(...o)}),t)):(a=s,e(...o))}}function C(e,t){if(!e||!t)return;const a=document.querySelector(`[data-path="${e}"]`);return a?a.querySelector(`[id$=${t}]`):void 0}function x(e,t){const a=Math.round(e);return Math.abs(a-e)<t?a:e}function I(e){const t=window.getComputedStyle(document.body).getPropertyValue(e)||"#ffffff";return b.Qh(t).formatHex()}async function E(e="",t={}){const a=v.ServerConnection.makeSettings(),r=S.URLExt.join(a.baseUrl,e);let o;try{o=await v.ServerConnection.makeRequest(r,t,a)}catch(e){throw new v.ServerConnection.NetworkError(e)}let s=await o.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.log("Not a JSON response body.",o)}if(!o.ok)throw new v.ServerConnection.ResponseError(o,s.message||s);return s}function M(){return"true"===document.body.getAttribute("data-jp-theme-light")}function j(e){return e?JSON.parse(JSON.stringify(e)):e}function L(e){const t={},r=a(74864);var o;(o=r).keys().forEach((e=>{const a=e.replace("./","").replace(/\.\w+$/,"");t[a]=o(e)}));for(const t of Object.keys(f)){const a=f[t];if("url"in a){const r=s(t,a);e.addRegistryLayer(r)}else Object.keys(a).forEach((r=>{const o=s(a[r].name,a[r],t);e.addRegistryLayer(o)}))}function s(e,a,r){const o={};return a.time&&(o.time=a.time),a.variant&&(o.variant=a.variant),a.tilematrixset&&(o.tilematrixset=a.tilematrixset),a.format&&(o.format=a.format),{name:e,thumbnail:t[a.name.replace(".","-")],source:{url:a.url,minZoom:a.min_zoom||0,maxZoom:a.max_zoom||24,attribution:a.attribution||"",provider:null!=r?r:e,urlParameters:o}}}}async function G(e,t,a){if(e.includes(".json")){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch json: ${t.statusText}`);e=(await t.json()).tiles[0]}const r=t.extent?(t.extent[1]+t.extent[3])/2:t.latitude||0,o=t.extent?(t.extent[0]+t.extent[2])/2:t.longitude||0,s=t.zoom||0,{xTile:n,yTile:i}=function(e,t,a){const r=e*(Math.PI/180),o=1<<a;return{xTile:Math.floor((t+180)/360*o),yTile:Math.floor(o*(1-Math.log(Math.tan(r)+1/Math.cos(r))/Math.PI)/2)}}(r,o,s);if(e=e.replace("{z}",String(Math.floor(s))).replace("{x}",String(n)).replace("{y}",String(i)),a)for(const t of Object.keys(a))e=e.replace(`{${t}}`,a[t]);const l=await fetch(e);if(!l.ok)throw new Error(`Failed to fetch tile: ${l.statusText}`);const c=await l.arrayBuffer();return new y.cW(new g.A(c))}async function O(e,t){const a=await G(e,{latitude:0,longitude:0,zoom:0,extent:[]},t);return Object.keys(a.layers)}var T=a(67262),A=a(74602),k=a(72858),N=a(46230),D=a(35256);const R=e=>{const t=p.useRef(null),{children:a}=e;return p.useEffect((()=>{const e=a;try{N.MessageLoop.sendMessage(e,D.Widget.Msg.BeforeAttach),t.current.insertBefore(e.node,null),N.MessageLoop.sendMessage(e,D.Widget.Msg.AfterAttach)}catch(e){console.warn("Exception while attaching Lumino widget.",e)}return()=>{try{(e.isAttached||e.node.isConnected)&&D.Widget.detach(e)}catch(e){console.warn("Exception while detaching Lumino widget.",e)}}}),[a]),p.createElement("div",{ref:t})};class B extends p.Component{constructor(e){super(e),this.currentFormData=j(this.props.sourceData),this.state={schema:e.schema,extraErrors:{}}}componentDidUpdate(e,t){if(e.sourceData!==this.props.sourceData){this.currentFormData=j(this.props.sourceData);const e=j(this.props.schema);this.setState((t=>Object.assign(Object.assign({},t),{schema:e})))}}processSchema(e,t,a){t.properties&&Object.entries(t.properties).forEach((([r,o])=>{a[r]={},"array"===o.type&&(a[r]=Object.assign({"ui:options":{orderable:!1,removable:!1,addable:!1}},a[r]),"array"===o.items.type&&(a[r]=Object.assign({items:Object.assign({"ui:options":{orderable:!1,removable:!1,addable:!1}},a[r].items)},a[r]))),"object"===o.type&&this.processSchema(e,o,a[r]),o.readOnly&&("create"===this.props.formContext&&delete o.readOnly,"update"===this.props.formContext&&this.removeFormEntry(r,e,t,a))}))}removeFormEntry(e,t,a,r){t&&delete t[e],delete a.properties[e],delete r[e],a.required&&a.required.includes(e)&&a.required.splice(a.required.indexOf(e),1)}syncData(e){e&&this.props.syncData(e)}onFormChange(e){if(this.currentFormData=e.formData,this.props.formChangedSignal&&this.props.formChangedSignal.emit(this.currentFormData||{}),this.props.formErrorSignal){const e=Object.keys(this.state.extraErrors).length>0;this.props.formErrorSignal.emit(e)}}onFormBlur(e,t){}onFormSubmit(e){this.currentFormData=e.formData,this.syncData(this.currentFormData),this.props.cancel&&this.props.cancel()}render(){var e,t;if(this.props.schema){const a=Object.assign(Object.assign({},this.state.schema),{additionalProperties:!0}),r=this.currentFormData,o={additionalProperties:{"ui:label":!1,classNames:"jGIS-hidden-field"}};this.processSchema(r,a,o);const s=p.createRef();null===(e=this.props.ok)||void 0===e||e.connect((()=>{var e;null===(e=s.current)||void 0===e||e.click()}));const n=new k.q(a,{liveValidate:!0,formData:r,onChange:this.onFormChange.bind(this),onSubmit:this.onFormSubmit.bind(this),onBlur:this.onFormBlur.bind(this),uiSchema:o,children:p.createElement("button",{ref:s,type:"submit",style:{display:"none"}}),extraErrors:this.state.extraErrors});return p.createElement("div",{className:"jGIS-property-panel","data-path":null!==(t=this.props.filePath)&&void 0!==t?t:""},p.createElement("div",{className:"jGIS-property-outer"},p.createElement(R,null,n)),!this.props.ok&&p.createElement("div",{className:"jGIS-property-buttons"},p.createElement("button",{className:"jp-Dialog-button jp-mod-accept jp-mod-styled",onClick:()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.click()}},p.createElement("div",{className:"jp-Dialog-buttonLabel"},"Ok"))))}}}var P=a(32193),z=a(34639),V=a.t(z,2);class W extends B{constructor(e){var t,a;super(e);const r=new P.Ajv;this._validate=r.compile(V),this._validatePath(null!==(a=null===(t=e.sourceData)||void 0===t?void 0:t.path)&&void 0!==a?a:"")}processSchema(e,t,a){""!==(null==e?void 0:e.path)&&this.removeFormEntry("data",e,t,a),super.processSchema(e,t,a),t.properties&&e&&delete t.properties.valid}onFormBlur(e,t){e.endsWith("_path")&&this._validatePath(t)}onFormSubmit(e){var t,a,o;(null===(o=null===(a=null===(t=this.state.extraErrors)||void 0===t?void 0:t.path)||void 0===a?void 0:a.__errors)||void 0===o?void 0:o.length)>=1?(0,r.showErrorMessage)("Invalid JSON file",this.state.extraErrors.path.__errors[0]):super.onFormSubmit(e)}async _validatePath(e){const t={path:{__errors:[]}};this.props.model.readGeoJSON(e).then((async a=>{var r;const o=this._validate(a);o?delete t.path:(t.path.__errors=[`"${e}" is not a valid GeoJSON file`],null===(r=this._validate.errors)||void 0===r||r.reverse().forEach((e=>{t.path.__errors.push(e.message)}))),this.setState({extraErrors:t}),this.props.formErrorSignal&&this.props.formErrorSignal.emit(!o)})).catch((a=>{t.path.__errors=[`Cannot read "${e}"`],this.setState({extraErrors:t}),this.props.formErrorSignal&&this.props.formErrorSignal.emit(!0)}))}}class F extends B{constructor(e){super(e),this.sourceFormChangedSignal=e.sourceFormChangedSignal}processSchema(e,t,a){if(super.processSchema(e,t,a),!t.properties.source)return;const r=this.props.model.getSourcesByType(this.props.sourceType);t.properties.source.enumNames=Object.values(r),t.properties.source.enum=Object.keys(r)}}class U extends F{processSchema(e,t,a){super.processSchema(e,t,a),a.shadowColor={"ui:widget":"color"}}}class H extends B{constructor(){super(...arguments),this._urlParameters=[]}processSchema(e,t,a){if(super.processSchema(e,t,a),!t.properties||!e)return;const r=/\{([^}]+)\}/g,o=[];let s;for(;null!==(s=r.exec(e.url));)["max_zoom","min_zoom","x","y","z"].includes(s[1])||o.push(s[1]);if(this._urlParameters=o,0===o.length)return void this.removeFormEntry("urlParameters",e,t,a);const n={};t.properties.urlParameters={type:"object",required:this._urlParameters,properties:n};for(const e of this._urlParameters)n[e]="time"===e?{type:"string",format:"date"}:{type:"string"}}onFormBlur(e,t){super.onFormBlur(e,t),e.endsWith("_url")&&this.forceUpdate()}}class $ extends F{constructor(e){super(e),this.sourceLayers=[],this.fetchSourceLayers(this.props.sourceData),this.sourceFormChangedSignal&&this.sourceFormChangedSignal.connect(((e,t)=>{"VectorTileSource"===this.props.sourceType&&this.fetchSourceLayers(this.currentFormData,t)})),e.model.clientStateChanged.connect((()=>{var t;if(!(null===(t=e.model.localState)||void 0===t?void 0:t.selected.value))return;const a=this.props.model.getLayer(Object.keys(e.model.localState.selected.value)[0]),r=this.props.model.getSource(null==a?void 0:a.parameters.source);if(!r||"VectorTileSource"!==r.type)return;const o=r.parameters;this.fetchSourceLayers(this.currentFormData,o)}))}onFormChange(e){if(super.onFormChange(e),this.currentSourceId===e.formData.source)return;const t=this.props.model.getSource(e.formData.source);t&&"VectorTileSource"===t.type&&this.fetchSourceLayers(this.currentFormData,t.parameters)}processSchema(e,t,a){super.processSchema(e,t,a),a.color={"ui:widget":"color"},e&&0!==this.sourceLayers.length&&(e.sourceLayer&&this.sourceLayers.includes(e.sourceLayer)||(e.sourceLayer=this.sourceLayers[0]),t.properties.sourceLayer.enum=this.sourceLayers)}async fetchSourceLayers(e,t){if(e&&e.source){if(this.currentSourceId=e.source,!t){const a=this.props.model.getSource(e.source);if(!a||"VectorTileSource"!==a.type)return this.sourceLayers=[],void this.forceUpdate();t=a.parameters}try{this.sourceLayers=await O(t.url,t.urlParameters),this.forceUpdate()}catch(e){console.error(e)}}else this.currentSourceId="",this.sourceLayers=[],this.forceUpdate()}}class J extends F{processSchema(e,t,a){this.removeFormEntry("color",e,t,a),super.processSchema(e,t,a)}}function Z(e){let t=F;switch(e){case"VectorTileLayer":case"VectorLayer":t=$;break;case"HillshadeLayer":t=U;break;case"WebGlLayer":t=J}return t}function q(e){let t=B;switch(e){case"GeoJSONSource":t=W;break;case"RasterSource":case"VectorTileSource":t=H}return t}var Q=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]])}return a};class Y extends p.Component{constructor(e){super(e),this.sourceFormChangedSignal=new A.Signal(this),this.filePath=e.context.path,this.jGISModel=e.context.model}render(){var e;const t=T.UUID.uuid4();let a;const r=Z(this.props.layerType||"RasterLayer"),o=j(this.props.layerData||{});if(this.props.createLayer){if(!this.props.layerType)return void console.error("Cannot create a layer without specifying its type");if(a=j(this.props.formSchemaRegistry.getSchemas().get(this.props.layerType)),!a)return void console.error(`Cannot find schema for ${this.props.layerType}`);this.props.createSource&&(null===(e=a.properties)||void 0===e||delete e.source,o.source=t),a.required=["name",...a.required],a.properties=Object.assign({name:{type:"string",description:"The name of the layer"}},a.properties)}let s;const n=q(this.props.sourceType||"RasterSource");if(this.props.sourceType){if(s=j(this.props.formSchemaRegistry.getSchemas().get(this.props.sourceType)),!s)return void console.error(`Cannot find schema for ${this.props.sourceType}`);this.props.createLayer||(s.required=["name",...s.required],s.properties=Object.assign({name:{type:"string",description:"The name of the source"}},s.properties))}const i=[];let l,c;return this.props.createLayer&&(l=new T.PromiseDelegate,i.push(l.promise)),this.props.createSource&&(c=new T.PromiseDelegate,i.push(c.promise)),Promise.all(i).then((async()=>{if(this.props.createSource){let e="";const a=await(null==c?void 0:c.promise),{name:r}=a,o=Q(a,["name"]);e=r||(await(null==l?void 0:l.promise)).name+" Source";const s={type:this.props.sourceType||"RasterSource",name:e,parameters:o};this.jGISModel.sharedModel.addSource(t,s)}if(this.props.createLayer){let e="";const t=await(null==l?void 0:l.promise),{name:a}=t,r=Q(t,["name"]);e=a||(await(null==l?void 0:l.promise)).name+" Layer";const o={type:this.props.layerType||"RasterLayer",parameters:r,visible:!0,name:e};this.jGISModel.addLayer(T.UUID.uuid4(),o)}})),p.createElement("div",null,this.props.createSource&&p.createElement("div",null,p.createElement("h3",null,"Source Properties"),p.createElement(n,{formContext:"create",model:this.jGISModel,filePath:`${this.filePath}::panel`,schema:s,sourceData:this.props.sourceData,syncData:e=>{null==c||c.resolve(e)},ok:this.props.ok,cancel:this.props.cancel,formChangedSignal:this.sourceFormChangedSignal,formErrorSignal:this.props.formErrorSignal})),this.props.createLayer&&p.createElement("div",null,p.createElement("h3",null,"Layer Properties"),p.createElement(r,{formContext:"create",sourceType:this.props.sourceType,model:this.jGISModel,filePath:`${this.filePath}::panel`,schema:a,sourceData:o,syncData:e=>{null==l||l.resolve(e)},ok:this.props.ok,cancel:this.props.cancel,sourceFormChangedSignal:this.sourceFormChangedSignal,formErrorSignal:this.props.formErrorSignal})))}}const K=e=>{var t;const[a,r]=p.useState(!1),o=p.useRef(),s=p.useRef();return Promise.all([e.okSignalPromise.promise,null===(t=e.formErrorSignalPromise)||void 0===t?void 0:t.promise]).then((([e,t])=>{o.current=e,s.current=t,r(!0)})),a&&p.createElement(Y,{context:e.context,formSchemaRegistry:e.formSchemaRegistry,createLayer:e.createLayer,createSource:e.createSource,layerType:e.layerType,sourceType:e.sourceType,sourceData:e.sourceData,layerData:e.layerData,ok:o.current,cancel:e.cancel,formErrorSignal:s.current})};class X extends r.Dialog{constructor(e){const t=new T.PromiseDelegate,a=new T.PromiseDelegate,o=p.createElement("div",{style:{overflow:"auto"}},p.createElement(K,{context:e.context,formSchemaRegistry:e.formSchemaRegistry,createLayer:e.createLayer,createSource:e.createSource,layerType:e.layerType,sourceType:e.sourceType,sourceData:e.sourceData,layerData:e.layerData,okSignalPromise:t,cancel:()=>{this.resolve(0)},formErrorSignalPromise:a}));super({title:e.title,body:o,buttons:[r.Dialog.cancelButton(),r.Dialog.okButton()]}),this.okSignal=new A.Signal(this);const s=new A.Signal(this);s.connect(((e,t)=>{t||this.node.querySelector(":invalid")?this.node.getElementsByClassName("jp-mod-accept")[0].setAttribute("disabled",""):this.node.getElementsByClassName("jp-mod-accept")[0].removeAttribute("disabled")})),t.resolve(this.okSignal),a.resolve(s),this.addClass("jGIS-layer-CreationFormDialog")}resolve(e){0===e&&super.resolve(e),1===e&&this.okSignal.emit(1)}}var ee=a(68326),te=a(90560),ae=a(62778);const re=({context:e,registry:t,formSchemaRegistry:a,okSignalPromise:r,cancel:o})=>{const[s,n]=(0,p.useState)(""),[i,l]=(0,p.useState)([]),[c,d]=(0,p.useState)(),[m,u]=(0,p.useState)(!1),[g,y]=(0,p.useState)(t),S=[...new Set(t.map((e=>e.source.provider)))],v=g.filter((e=>e.name.toLowerCase().includes(s)));(0,p.useEffect)((()=>(e.model.sharedModel.layersChanged.connect(b),()=>{e.model.sharedModel.layersChanged.disconnect(b)})),[]);const b=(t,a)=>{l(Object.values(e.model.sharedModel.layers).map((e=>e.name.split(" ")[0])))},f=e=>{const a=e.target,r=a.innerText===(null==c?void 0:c.innerText);a.classList.toggle("jGIS-layer-browser-category-selected"),null==c||c.classList.remove("jGIS-layer-browser-category-selected");const o=r?t:t.filter((e=>{var t;return null===(t=e.source.provider)||void 0===t?void 0:t.includes(a.innerText)}));y(o),n(""),d(r?null:a)};return m?(r.promise.then((e=>{e.disconnect(o,void 0)})),h().createElement("div",{className:"jGIS-customlayer-form"},h().createElement(K,{context:e,formSchemaRegistry:a,createLayer:!0,createSource:!0,layerType:"RasterLayer",sourceType:"RasterSource",layerData:{name:"Custom Raster"},sourceData:{url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",maxZoom:24,minZoom:0,attribution:"(C) OpenStreetMap contributors"},okSignalPromise:r,cancel:o}))):(r.promise.then((e=>{e.connect(o,void 0)})),h().createElement("div",{className:"jGIS-layer-browser-container"},h().createElement("div",{className:"jGIS-layer-browser-header-container"},h().createElement("div",{className:"jGIS-layer-browser-header"},h().createElement("h2",{className:"jGIS-layer-browser-header-text"},"Layer Browser"),h().createElement("div",{className:"jGIS-layer-browser-header-search-container"},h().createElement("input",{type:"text",placeholder:"Search...",value:s,onChange:e=>{n(e.target.value.toLowerCase())},className:"jGIS-layer-browser-header-search"}))),h().createElement("div",{className:"jGIS-layer-browser-categories"},S.map((e=>h().createElement("span",{className:"jGIS-layer-browser-category",onClick:f},e))))),h().createElement("div",{className:"jGIS-layer-browser-grid"},h().createElement("div",{className:"jGIS-layer-browser-tile jGIS-layer-browser-custom-tile",onClick:()=>{u(!0)}},h().createElement("div",{className:"jGIS-layer-browser-tile-img-container"},h().createElement("img",{className:"jGIS-layer-browser-img",src:ae}),h().createElement("div",{className:"jGIS-layer-browser-icon"},h().createElement(te.g,{style:{height:20},icon:ee.QLR}))),h().createElement("div",{className:"jGIS-layer-browser-text-container"},h().createElement("div",{className:"jGIS-layer-browser-text-info"},h().createElement("h3",{className:"jGIS-layer-browser-text-header jGIS-layer-browser-text-general"},"Custom Raster Layer")),h().createElement("p",{className:"jGIS-layer-browser-text-general jGIS-layer-browser-text-source"},"Create A Custom Raster Layer"))),v.map((t=>h().createElement("div",{className:"jGIS-layer-browser-tile",onClick:()=>(t=>{const a=T.UUID.uuid4(),r={type:"RasterSource",name:t.name,parameters:t.source},o={type:"RasterLayer",parameters:{source:a},visible:!0,name:t.name+" Layer"};e.model.sharedModel.addSource(a,r),e.model.addLayer(T.UUID.uuid4(),o)})(t)},h().createElement("div",{className:"jGIS-layer-browser-tile-img-container"},h().createElement("img",{className:"jGIS-layer-browser-img",src:t.thumbnail}),-1===i.indexOf(t.name)?h().createElement("div",{className:"jGIS-layer-browser-icon"},h().createElement(te.g,{style:{height:20},icon:ee.QLR})):h().createElement("div",{className:"jGIS-layer-browser-icon jGIS-layer-browser-added"},h().createElement(te.g,{style:{height:20},icon:ee.e68}),h().createElement("p",{className:"jGIS-layer-browser-text-general"},"Added!"))),h().createElement("div",{className:"jGIS-layer-browser-text-container"},h().createElement("div",{className:"jGIS-layer-browser-text-info"},h().createElement("h3",{className:"jGIS-layer-browser-text-header jGIS-layer-browser-text-general"},t.name)),h().createElement("p",{className:"jGIS-layer-browser-text-general jGIS-layer-browser-text-source"},t.source.attribution))))))))};class oe extends r.Dialog{constructor(e){let t;t=()=>{this.resolve(0)};const a=new T.PromiseDelegate;super({body:h().createElement(re,{context:e.context,registry:e.registry,formSchemaRegistry:e.formSchemaRegistry,okSignalPromise:a,cancel:t}),buttons:[r.Dialog.cancelButton(),r.Dialog.okButton()]}),this.id="jupytergis::layerBrowser",this.okSignal=new A.Signal(this),a.resolve(this.okSignal),this.addClass("jGIS-layerbrowser-FormDialog")}resolve(e){0===e&&super.resolve(e),1===e&&this.okSignal.emit(1)}}var se=a(66519),ne=a.n(se);const ie=({index:e,bandRow:t,bandRows:a,setSelectedBand:r,setBandRows:o})=>{const[s,n]=(0,p.useState)(t.stats.minimum),[i,l]=(0,p.useState)(t.stats.maximum),c=()=>{const t=[...a];t[e].stats.minimum=s,t[e].stats.maximum=i,o(t)};return h().createElement(h().Fragment,null,h().createElement("div",{className:"jp-gis-symbology-row"},h().createElement("label",{htmlFor:`band-select-${e}`},"Band:"),h().createElement("div",{className:"jp-select-wrapper"},h().createElement("select",{name:`band-select-${e}`,onChange:e=>r(+e.target.value),className:"jp-mod-styled"},a.map(((e,a)=>h().createElement("option",{key:a,value:e.band,selected:e.band===t.band,className:"jp-mod-styled"},`Band ${e.band} (${e.colorInterpretation})`)))))),h().createElement("div",{className:"jp-gis-symbology-row",style:{gap:"0.5rem"}},h().createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"50%"}},h().createElement("label",{htmlFor:"band-min",style:{alignSelf:"center"}},"Min"),h().createElement("input",{type:"number",className:"jp-mod-styled",style:{marginRight:15},value:s,onChange:e=>{n(+e.target.value),c()}})),h().createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"50%",paddingRight:"2px"}},h().createElement("label",{htmlFor:"band-max",style:{alignSelf:"center"}},"Max"),h().createElement("input",{type:"number",className:"jp-mod-styled",value:i,onChange:e=>{l(+e.target.value),c()},onBlur:c}))))},le=({index:e,value:t,outputValue:a,stopRows:r,setStopRows:s,deleteRow:n})=>{return h().createElement("div",{className:"jp-gis-color-row"},h().createElement("input",{id:`jp-gis-color-value-${e}`,type:"number",value:t,onChange:t=>{const a=[...r];a[e].value=+t.target.value,s(a)},onBlur:()=>{const e=[...r];e.sort(((e,t)=>e.value<t.value?-1:e.value>t.value?1:0)),s(e)},className:"jp-mod-styled"}),h().createElement("input",{id:`jp-gis-color-color-${e}`,value:(i=a,"#"+i.slice(0,-1).map((e=>e.toString(16).padStart(2,"0"))).join("")),type:"color",onChange:t=>{const a=[...r];a[e].color=(e=>{const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]:(console.warn("Unable to parse hex value, defaulting to black"),[parseInt("0",16),parseInt("0",16),parseInt("0",16)])})(t.target.value),s(a)},className:"jp-mod-styled"}),h().createElement(o.Button,{id:`jp-gis-remove-color-${e}`,className:"jp-Button jp-gis-filter-icon"},h().createElement(te.g,{icon:ee.yLS,onClick:n})));var i},ce=({context:e,state:t,okSignalPromise:a,cancel:r,layerId:s})=>{const n=(0,p.useRef)(),i=(0,p.useRef)([]),l=(0,p.useRef)(),[c,d]=(0,p.useState)(),[m,u]=(0,p.useState)(1),[g,y]=(0,p.useState)([]),[S,v]=(0,p.useState)([]);if(!s)return;const b=e.model.getLayer(s);if(!b)return;(0,p.useEffect)((()=>{w(),f()}),[]),(0,p.useEffect)((()=>{i.current=S,_()}),[S]),(0,p.useEffect)((()=>{n.current=g}),[g]),(0,p.useEffect)((()=>{l.current=c}),[c]);const f=()=>{var e;if(!(null===(e=b.parameters)||void 0===e?void 0:e.color))return;const t=b.parameters.color;if("interpolate"===t[0])return void d("linear");const a=t[3][0];d("<="===a?"discrete":"exact")},w=async()=>{var a,r;const o=[],n=e.model.getSource(null===(a=null==b?void 0:b.parameters)||void 0===a?void 0:a.source),i=null===(r=null==n?void 0:n.parameters)||void 0===r?void 0:r.urls[0];if(!i.url)return;let l;const c=await t.fetch(s);if(c)l=JSON.parse(c);else{const e=await ne()({path:"lab/extensions/@jupytergis/jupytergis-core/static",useWorker:!1}),t=await fetch(i.url),a=new File([await t.blob()],"loaded.tif"),r=(await e.open(a)).datasets[0];l=await e.gdalinfo(r,["-stats"]),e.close(r)}l.bands.forEach((e=>{var t,a;o.push({band:e.band,colorInterpretation:e.colorInterpretation,stats:{minimum:null!==(t=i.min)&&void 0!==t?t:e.minimum,maximum:null!==(a=i.max)&&void 0!==a?a:e.maximum,mean:e.mean,stdDev:e.stdDev},metadata:e.metadata})})),v(o),console.log("tifData",l),console.log("bandsArr",o)},_=()=>{var e;if(!(null===(e=b.parameters)||void 0===e?void 0:e.color))return;const t=b.parameters.color;if("string"==typeof t)return;const a=[];switch(t[0]){case"interpolate":for(let e=5;e<t.length;e+=2){const r={value:x(t[e]),color:t[e+1]};a.push(r)}break;case"case":for(let e=3;e<t.length-1;e+=2){const r={value:x(t[e][2]),color:t[e+1]};a.push(r)}}y(a)},C=()=>{var t,a,o,c;const d=i.current[m-1];if(!d)return;const u=null===(t=b.parameters)||void 0===t?void 0:t.source,p=e.model.getSource(u);if(!p||!p.parameters)return;const h=p.parameters.urls[0];if(h.min=d.stats.minimum,h.max=d.stats.maximum,p.parameters.urls[0]=h,e.model.sharedModel.updateSource(u,p),!b.parameters)return;let g=[];switch(l.current){case"linear":g=["interpolate",["linear"]],g.push(["band",m]),g.push(0,[0,0,0,0]),null===(a=n.current)||void 0===a||a.map((e=>{g.push(I(e.value)),g.push(e.color)}));break;case"discrete":g=["case"],g.push(["==",["band",m],0]),g.push([0,0,0,0]),null===(o=n.current)||void 0===o||o.map((e=>{g.push(["<=",["band",m],I(e.value)]),g.push(e.color)})),g.push([0,0,0]);break;case"exact":g=["case"],g.push(["==",["band",m],0]),g.push([0,0,0,0]),null===(c=n.current)||void 0===c||c.map((e=>{g.push(["==",["band",m],I(e.value)]),g.push(e.color)})),g.push([0,0,0])}b.parameters.color=g,e.model.sharedModel.updateLayer(s,b),r()};a.promise.then((e=>{e.connect(C)}));const x=e=>{const t=S[m-1];return t?e*(t.stats.maximum-t.stats.minimum)/1+t.stats.minimum:e},I=e=>{const t=i.current[m-1];return(1*e-1*t.stats.minimum)/(t.stats.maximum-t.stats.minimum)};return h().createElement("div",{className:"jp-gis-layer-symbology-container"},h().createElement("div",{className:"jp-gis-band-container"},0===S.length?h().createElement(te.g,{icon:ee.z1G}):h().createElement(ie,{index:m-1,bandRow:S[m-1],bandRows:S,setSelectedBand:u,setBandRows:v})),h().createElement("div",{className:"jp-gis-symbology-row"},h().createElement("label",{htmlFor:"function-select"},"Interpolation:"),h().createElement("div",{className:"jp-select-wrapper"},h().createElement("select",{name:"function-select",id:"function-select",className:"jp-mod-styled",value:c,style:{textTransform:"capitalize"},onChange:e=>{d(e.target.value)}},["discrete","linear","exact"].map(((e,t)=>h().createElement("option",{key:e,value:e,style:{textTransform:"capitalize"}},e)))))),h().createElement("div",{className:"jp-gis-stop-container"},h().createElement("div",{className:"jp-gis-stop-labels",style:{display:"flex",gap:6}},h().createElement("span",{style:{flex:"0 0 18%"}},"Value"," ","discrete"===c?"<=":"exact"===c?"=":""),h().createElement("span",null,"Output Value")),g.map(((e,t)=>h().createElement(le,{key:`${t}-${e.color}`,index:t,value:e.value,outputValue:e.color,stopRows:g,setStopRows:y,deleteRow:()=>(e=>{const t=[...g];t.splice(e,1),y(t)})(t)})))),h().createElement("div",{className:"jp-gis-symbology-button-container"},h().createElement(o.Button,{className:"jp-Dialog-button jp-mod-accept jp-mod-styled",onClick:()=>{y([{value:0,color:[0,0,0,1]},...g])}},"Add Stop")))},de=({context:e,state:t,okSignalPromise:a,cancel:r,layerId:o})=>{const[s,n]=(0,p.useState)("Singleband Pseudocolor"),[i,l]=(0,p.useState)(null);let c;return(0,p.useEffect)((()=>{s&&(c="Singleband Pseudocolor"===s?h().createElement(ce,{context:e,state:t,okSignalPromise:a,cancel:r,layerId:o}):h().createElement("div",null,"Render Type Not Implemented (yet)"),l(c))}),[s]),h().createElement(h().Fragment,null,h().createElement("div",{className:"jp-gis-symbology-row"},h().createElement("label",{htmlFor:"render-type-select"},"Render Type:"),h().createElement("select",{name:"render-type-select",id:"render-type-select",value:s,onChange:e=>{n(e.target.value)}},["Singleband Pseudocolor","Multiband Color"].map(((e,t)=>h().createElement("option",{key:e,value:e},e))))),i)},me=({context:e,state:t,okSignalPromise:a,cancel:r})=>{const[o,s]=(0,p.useState)(null),[n,i]=(0,p.useState)(null);let l;return(0,p.useEffect)((()=>{const t=()=>{var t,a;if(!(null===(a=null===(t=e.model.localState)||void 0===t?void 0:t.selected)||void 0===a?void 0:a.value))return;const r=Object.keys(e.model.localState.selected.value)[0];s(r)};return t(),e.model.clientStateChanged.connect(t),()=>{e.model.clientStateChanged.disconnect(t)}}),[]),(0,p.useEffect)((()=>{if(!o)return;const s=e.model.getLayer(o);s&&(l="WebGlLayer"===s.type?h().createElement(de,{context:e,state:t,okSignalPromise:a,cancel:r,layerId:o}):h().createElement("div",null,"Layer Type Not Supported"),i(l))}),[o]),h().createElement(h().Fragment,null,n)};class ue extends r.Dialog{constructor(e){const t=new T.PromiseDelegate;super({title:"Symbology",body:h().createElement(me,{context:e.context,okSignalPromise:t,cancel:()=>{this.resolve(0)},state:e.state})}),this.id="jupytergis::symbologyWidget",this.okSignal=new A.Signal(this),t.resolve(this.okSignal),this.addClass("jp-gis-symbology-dialog")}resolve(e){0===e&&super.resolve(e),1===e&&this.okSignal.emit(null)}}const pe=({context:e,okSignalPromise:t,cancel:a})=>{const r=e.model.getSourcesByType("RasterDemSource"),[o,s]=(0,p.useState)(Object.keys(r)[0]),[n,i]=(0,p.useState)(1),l=(0,p.useRef)(o),c=(0,p.useRef)(n);(0,p.useEffect)((()=>{l.current=o,c.current=n}),[o,n]);const d=()=>{e.model.setTerrain({source:l.current,exaggeration:c.current}),a()};return t.promise.then((e=>{e.connect(d)})),h().createElement("div",{className:"jp-gis-terrain-main"},h().createElement("label",{className:"jp-gis-terrain-label",htmlFor:"source"},"Source:"),h().createElement("select",{id:"source",className:"jp-mod-styled",value:o,onChange:e=>{s(e.target.value)},"aria-label":"Select source"},Object.entries(r).map((([e,t])=>h().createElement("option",{key:e,value:e},t)))),h().createElement("label",{className:"jp-gis-terrain-label",htmlFor:"exaggeration"},"Exaggeration:"),h().createElement("input",{id:"exaggeration",className:"jp-mod-styled",type:"number",min:0,step:.1,value:n,onChange:e=>{i(Number(e.target.value))},placeholder:"Enter an exaggeration value","aria-label":"Enter exaggeration value"}))};class he extends r.Dialog{constructor(e){const t=new T.PromiseDelegate;super({title:"Add New Terrain",body:h().createElement(pe,{context:e.context,okSignalPromise:t,cancel:()=>{this.resolve(0)}})}),this.id="jupytergis::terrain",this.okSignal=new A.Signal(this),t.resolve(this.okSignal)}resolve(e){0===e&&super.resolve(e),1===e&&this.okSignal.emit(null)}}function ge(e,t,a,o,s,n,i){var l;const c=a.load("jupyterlab"),{commands:m}=e;m.addCommand(d.symbology,Object.assign({label:c.__("Edit Symbology"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createSymbologyDialog(t,n)},u.get(d.symbology))),m.addCommand(d.redo,Object.assign({label:c.__("Redo"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:e=>{const a=t.currentWidget;if(a)return a.context.model.sharedModel.redo()}},null===(l=u.get(d.redo))||void 0===l?void 0:l.icon)),m.addCommand(d.undo,Object.assign({label:c.__("Undo"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:e=>{const a=t.currentWidget;if(a)return a.context.model.sharedModel.undo()}},u.get(d.undo))),m.addCommand(d.openLayerBrowser,Object.assign({label:c.__("Open Layer Browser"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createLayerBrowser(t,s,o)},u.get(d.openLayerBrowser))),m.addCommand(d.newRasterEntry,Object.assign({label:c.__("New Raster Layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Raster Layer",createLayer:!0,createSource:!0,sourceData:{minZoom:0,maxZoom:24},layerData:{name:"Custom Raster Layer"},sourceType:"RasterSource",layerType:"RasterLayer"})},u.get(d.newRasterEntry))),m.addCommand(d.newVectorTileEntry,Object.assign({label:c.__("New Vector Tile Layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Vector Tile Layer",createLayer:!0,createSource:!0,sourceData:{minZoom:0,maxZoom:24},layerData:{name:"Custom Vector Tile Layer"},sourceType:"VectorTileSource",layerType:"VectorTileLayer"})},u.get(d.newVectorTileEntry))),m.addCommand(d.newGeoJSONEntry,Object.assign({label:c.__("New GeoJSON layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create GeoJSON Layer",createLayer:!0,createSource:!0,layerData:{name:"Custom GeoJSON Layer"},sourceType:"GeoJSONSource",layerType:"VectorLayer"})},u.get(d.newGeoJSONEntry))),m.addCommand(d.newHillshadeEntry,Object.assign({label:c.__("New Hillshade layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Hillshade Layer",createLayer:!0,createSource:!0,layerData:{name:"Custom Hillshade Layer"},sourceType:"RasterDemSource",layerType:"HillshadeLayer"})},u.get(d.newHillshadeEntry))),m.addCommand(d.newImageEntry,Object.assign({label:c.__("New Image layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Image Layer",createLayer:!0,createSource:!0,sourceData:{name:"Custom Image Source",url:"https://maplibre.org/maplibre-gl-js/docs/assets/radar.gif",coordinates:[[-80.425,46.437],[-71.516,46.437],[-71.516,37.936],[-80.425,37.936]]},layerData:{name:"Custom Image Layer"},sourceType:"ImageSource",layerType:"ImageLayer"})},u.get(d.newImageEntry))),m.addCommand(d.newVideoEntry,Object.assign({label:c.__("New Video layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Video Layer",createLayer:!0,createSource:!0,sourceData:{name:"Custom Video Source",urls:["https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4","https://static-assets.mapbox.com/mapbox-gl-js/drone.webm"],coordinates:[[-122.51596391201019,37.56238816766053],[-122.51467645168304,37.56410183312965],[-122.51309394836426,37.563391708549425],[-122.51423120498657,37.56161849366671]]},layerData:{name:"Custom Video Layer"},sourceType:"VideoSource",layerType:"RasterLayer"})},u.get(d.newVideoEntry))),m.addCommand(d.newShapefileSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Shapefile"):c.__("Add Shapefile Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Shapefile Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Shapefile Source"},sourceType:"ShapefileSource"})},u.get(d.newShapefileSource))),m.addCommand(d.newGeoTiffEntry,Object.assign({label:c.__("New GeoTiff layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create GeoTiff Layer",createLayer:!0,createSource:!0,sourceData:{name:"Custom GeoTiff Source",urls:[{url:"https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/21/H/UB/2021/9/S2B_21HUB_20210915_0_L2A/B04.tif",max:1e4},{url:"https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/21/H/UB/2021/9/S2B_21HUB_20210915_0_L2A/B08.tif",max:1e4}]},layerData:{name:"Custom GeoTiff Layer"},sourceType:"GeoTiffSource",layerType:"WebGlLayer"})},u.get(d.newGeoTiffEntry))),m.addCommand(d.newRasterSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Raster"):c.__("New Raster Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Raster Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Raster Source",minZoom:0,maxZoom:24},sourceType:"RasterSource"})},u.get(d.newRasterSource))),m.addCommand(d.newRasterDemSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Raster DEM"):c.__("New Raster DEM Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Raster Dem Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Raster DEM Source"},sourceType:"RasterDemSource"})},u.get(d.newRasterDemSource))),m.addCommand(d.newVectorSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Vector"):c.__("New Vector Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Vector Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Vector Source",minZoom:0,maxZoom:24},sourceType:"VectorTileSource"})},u.get(d.newVectorSource))),m.addCommand(d.newGeoJSONSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("GeoJSON"):c.__("Add GeoJSON data from file"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create GeoJson Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom GeoJSON Source"},sourceType:"GeoJSONSource"})},u.get(d.newGeoJSONSource))),m.addCommand(d.newImageSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Image"):c.__("Add Image Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Image Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Image Source"},sourceType:"ImageSource"})},u.get(d.newImageSource))),m.addCommand(d.newVideoSource,Object.assign({label:e=>"contextMenu"===e.from?c.__("Video"):c.__("Add Video Source"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Video Source",createLayer:!1,createSource:!0,sourceData:{name:"Custom Video Source"},sourceType:"VideoSource"})},u.get(d.newVideoSource))),m.addCommand(d.newRasterLayer,Object.assign({label:e=>"contextMenu"===e.from?c.__("Raster"):c.__("Add Raster layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Raster Layer",createLayer:!0,createSource:!1,layerData:{name:"Custom Raster Layer"},sourceType:"RasterSource",layerType:"RasterLayer"})},u.get(d.newVectorLayer))),m.addCommand(d.newVectorLayer,Object.assign({label:e=>"contextMenu"===e.from?c.__("Vector"):c.__("Add New Vector layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Vector Layer",createLayer:!0,createSource:!1,layerData:{name:"Custom Vector Layer"},sourceType:"VectorTileSource",layerType:"VectorTileLayer"})},u.get(d.newVectorLayer))),m.addCommand(d.newHillshadeLayer,Object.assign({label:e=>"contextMenu"===e.from?c.__("Hillshade"):c.__("Add Hillshade layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Hillshade Layer",createLayer:!0,createSource:!1,layerData:{name:"Custom Hillshade Layer"},sourceType:"RasterDemSource",layerType:"HillshadeLayer"})},u.get(d.newHillshadeLayer))),m.addCommand(d.newImageLayer,Object.assign({label:e=>"contextMenu"===e.from?c.__("Image"):c.__("Add Image layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Image Layer",createLayer:!0,createSource:!1,layerData:{name:"Custom Image Layer"},sourceType:"ImageSource",layerType:"RasterLayer"})},u.get(d.newImageLayer))),m.addCommand(d.newVideoLayer,Object.assign({label:e=>"contextMenu"===e.from?c.__("Video"):c.__("Add Video layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Video Layer",createLayer:!0,createSource:!1,layerData:{name:"Custom Video Layer"},sourceType:"VideoSource",layerType:"RasterLayer"})},u.get(d.newVideoLayer))),m.addCommand(d.newShapefileLayer,Object.assign({label:c.__("New Shapefile Layer"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createEntry({tracker:t,formSchemaRegistry:o,title:"Create Shapefile Layer",createLayer:!0,createSource:!0,sourceData:{name:"Custom Shapefile Source"},layerData:{name:"Custom Shapefile Layer"},sourceType:"ShapefileSource",layerType:"VectorLayer"})},u.get(d.newShapefileLayer))),m.addCommand(d.renameLayer,{label:c.__("Rename Layer"),execute:async()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;await ye.renameSelectedItem(a,"layer",((e,t)=>{const r=null==a?void 0:a.getLayer(e);r&&(r.name=t,null==a||a.sharedModel.updateLayer(e,r))}))}}),m.addCommand(d.removeLayer,{label:c.__("Remove Layer"),execute:()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;ye.removeSelectedItems(a,"layer",(e=>{null==a||a.removeLayer(e)}))}}),m.addCommand(d.renameGroup,{label:c.__("Rename Group"),execute:async()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;await ye.renameSelectedItem(a,"group",((e,t)=>{null==a||a.renameLayerGroup(e,t)}))}}),m.addCommand(d.removeGroup,{label:c.__("Remove Group"),execute:async()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;ye.removeSelectedItems(a,"group",(e=>{null==a||a.removeLayerGroup(e)}))}}),m.addCommand(d.moveLayersToGroup,{label:e=>e.label?e.label:c.__("Move to Root"),execute:e=>{var a,r,o;const s=null===(a=t.currentWidget)||void 0===a?void 0:a.context.model,n=e.label,i=null===(o=null===(r=null==s?void 0:s.localState)||void 0===r?void 0:r.selected)||void 0===o?void 0:o.value;i&&s.moveItemsToGroup(Object.keys(i),n)}}),m.addCommand(d.moveLayerToNewGroup,{label:c.__("Move Selected Layers to New Group"),execute:async()=>{var e,a,r;const o=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model,s=null===(r=null===(a=null==o?void 0:o.localState)||void 0===a?void 0:a.selected)||void 0===r?void 0:r.value;if(!s)return;const n=await function(){const e=document.createElement("input");e.classList.add("jp-gis-left-panel-input"),e.style.marginLeft="26px";const t=document.getElementById("jp-gis-layer-tree");if(t)return t.appendChild(e),e.focus(),new Promise((a=>{e.addEventListener("blur",(()=>{t.removeChild(e),a(e.value)})),e.addEventListener("keydown",(t=>{("Enter"===t.key||"Escape"===t.key)&&(t.stopPropagation(),t.preventDefault(),e.blur())}))}))}();if(!n)return void console.warn("New name cannot be empty");const i=[];Object.keys(s).forEach((e=>{i.push(e)}));const l={name:n,layers:i};o.addNewLayerGroup(s,l)}}),m.addCommand(d.renameSource,{label:c.__("Rename Source"),execute:async()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;await ye.renameSelectedItem(a,"source",((e,t)=>{const r=null==a?void 0:a.getSource(e);r&&(r.name=t,null==a||a.sharedModel.updateSource(e,r))}))}}),m.addCommand(d.removeSource,{label:c.__("Remove Source"),execute:()=>{var e;const a=null===(e=t.currentWidget)||void 0===e?void 0:e.context.model;ye.removeSelectedItems(a,"source",(e=>{var t;null===(t=null==a?void 0:a.getLayersBySource(e).length)||void 0===t||t?(0,r.showErrorMessage)("Remove source error","The source is used by a layer."):null==a||a.sharedModel.removeSource(e)}))}}),m.addCommand(d.newTerrain,Object.assign({label:c.__("New Terrain"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:ye.createTerrainDialog(t)},u.get(d.newTerrain))),m.addCommand(d.removeTerrain,{label:c.__("Remove Terrain"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:()=>{var e;null===(e=t.currentWidget)||void 0===e||e.context.model.setTerrain({source:"",exaggeration:0})}}),m.addCommand(d.toggleConsole,{label:c.__("Toggle console"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:async()=>await ye.toggleConsole(t)}),m.addCommand(d.executeConsole,{label:c.__("Execute console"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:()=>ye.executeConsole(t)}),m.addCommand(d.removeConsole,{label:c.__("Remove console"),isEnabled:()=>!!t.currentWidget&&t.currentWidget.context.model.sharedModel.editable,execute:()=>ye.removeConsole(t)}),m.addCommand(d.invokeCompleter,{label:c.__("Display the completion helper."),execute:()=>{var e;const a=t.currentWidget;if(!a||!i)return;const r=null===(e=a.content.consolePanel)||void 0===e?void 0:e.id;return r?i.invoke(r):void 0}}),m.addCommand(d.selectCompleter,{label:c.__("Select the completion suggestion."),execute:()=>{var e;const a=t.currentWidget;if(!a||!i)return;const r=null===(e=a.content.consolePanel)||void 0===e?void 0:e.id;return r?i.select(r):void 0}})}var ye;!function(e){e.createLayerBrowser=function(e,t,a){return async()=>{const r=e.currentWidget;if(!r)return;const o=new oe({context:r.context,registry:t.getRegistryLayers(),formSchemaRegistry:a});await o.launch()}},e.createTerrainDialog=function(e){return async()=>{const t=e.currentWidget;if(!t)return;const a=new he({context:t.context});await a.launch()}},e.createSymbologyDialog=function(e,t){return async()=>{const a=e.currentWidget;if(!a)return;const r=new ue({context:a.context,state:t});await r.launch()}},e.createEntry=function({tracker:e,formSchemaRegistry:t,title:a,createLayer:r,createSource:o,sourceData:s,layerData:n,sourceType:i,layerType:l}){return async()=>{const c=e.currentWidget;if(!c)return;const d=new X({context:c.context,title:a,createLayer:r,createSource:o,sourceData:s,sourceType:i,layerData:n,layerType:l,formSchemaRegistry:t});await d.launch()}},e.getUserInputForRename=async function(e,t,a){const r=e.parentElement;return r.replaceChild(t,e),t.value=a,t.select(),t.focus(),new Promise((o=>{t.addEventListener("blur",(()=>{r.replaceChild(e,t),o(t.value)})),t.addEventListener("keydown",(r=>{"Enter"===r.key?(r.stopPropagation(),r.preventDefault(),t.blur()):"Escape"===r.key&&(r.stopPropagation(),r.preventDefault(),t.value=a,t.blur(),e.focus())}))}))},e.removeSelectedItems=function(e,t,a){var r;const o=null===(r=null==e?void 0:e.localState)||void 0===r?void 0:r.selected.value;if(o)for(const e in o)o[e].type===t&&a(e);else console.info("Nothing selected")},e.renameSelectedItem=async function(t,a,r){var o;const s=null===(o=null==t?void 0:t.localState)||void 0===o?void 0:o.selected.value;if(!s)return void console.error(`No ${a} selected`);let n="";for(const e in s)if(s[e].type===a){n=e;break}if(!n)return;const i=s[n].selectedNodeId;if(!i)return;const l=document.getElementById(i);if(!l)return void console.warn(`Node with ID ${i} not found`);const c=document.createElement("input");c.classList.add("jp-gis-left-panel-input");const d=l.innerText,m=await e.getUserInputForRename(l,c,d);m?m!==d&&r(n,m):console.warn("New name cannot be empty")},e.executeConsole=function(e){const t=e.currentWidget;t&&t.content.executeConsole()},e.removeConsole=function(e){const t=e.currentWidget;t&&t.content.removeConsole()},e.toggleConsole=async function(e){const t=e.currentWidget;if(!t)return;const a=t.context.path.split(":");let r="";r=a.length>1?a[1]:a[0],await t.content.toggleConsole(r)}}(ye||(ye={}));var Se=a(10320),ve=a(67936),be=a(95854),fe=a(56952),we=a(39512),_e=a(88436),Ce=a(79178),xe=a(43802),Ie=a(79382),Ee=a(59916),Me=a(12895),je=a(12940),Le=a(28528),Ge=a(61691),Oe=a(83486),Te=a(34633),Ae=a(90693),ke=a(64827),Ne=a(39895),De=a(21590),Re=a(50207),Be=a(78882),Pe=a(58471),ze=a(37056);function Ve(e){return p.createElement("div",{className:"jGIS-Spinner",style:{display:e.loading?"flex":"none"}},p.createElement("div",{className:"jGIS-SpinnerContent"}))}class We extends p.Component{constructor(e){super(e),this.vectorLayerStyleFunc=(e,t)=>{var a;const r=t.parameters,o={">":(e,t)=>e>t,"<":(e,t)=>e<t,">=":(e,t)=>e>=t,"<=":(e,t)=>e<=t,"==":(e,t)=>e===t,"!=":(e,t)=>e!==t},s=new De.A({color:"fill"===r.type||"circle"===r.type?r.color:"#F092DD"}),n=new Re.A({color:"line"===r.type||"circle"===r.type?r.color:"#392F5A",width:2}),i=new Be.Ay({fill:s,stroke:n,image:new Pe.A({radius:5,fill:s,stroke:n})});if(t.filters&&0!==(null===(a=t.filters)||void 0===a?void 0:a.appliedFilters.length)){const a=e.getProperties();let r=!0;switch(t.filters.logicalOp){case"any":r=t.filters.appliedFilters.some((({feature:e,operator:t,value:r})=>o[t](a[e],r)));break;case"all":r=t.filters.appliedFilters.every((({feature:e,operator:t,value:r})=>o[t](a[e],r)))}return r?i:void 0}return i},this.hillshadeMath=()=>{function e(e,t){return["+",["*",65280,["band",1,e,t]],["*",255,["band",2,e,t]],["*",255/256,["band",3,e,t]],-32768]}const t=["*",2,["resolution"]],a=["*",2,e(-1,0)],r=["/",["-",["*",2,e(1,0)],a],t],o=["*",2,e(0,-1)],s=["/",["-",["*",2,e(0,1)],o],t],n=["atan",["sqrt",["+",["^",r,2],["^",s,2]]]],i=["clamp",["atan",["-",0,r],s],-Math.PI,Math.PI],l=["*",Math.PI/180,45];return["*",255,["+",["*",["sin",l],["cos",n]],["*",["cos",l],["sin",n],["cos",["-",["*",Math.PI/180,46],i]]]]]},this._onClientSharedStateChanged=(e,t)=>{},this._handleThemeChange=()=>{const e=M();this.setState((t=>Object.assign(Object.assign({},t),{lightTheme:e})))},this._handleWindowResize=()=>{},this._initializedPosition=!1,this.divRef=p.createRef(),this._ready=!1,this._sourceToLayerMap=new Map,this._mainViewModel=this.props.viewModel,this._mainViewModel.viewSettingChanged.connect(this._onViewChanged,this),this._model=this._mainViewModel.jGISModel,this._model.themeChanged.connect(this._handleThemeChange,this),this._model.sharedOptionsChanged.connect(this._onSharedOptionsChanged,this),this._model.clientStateChanged.connect(this._onClientSharedStateChanged,this),this._model.sharedLayersChanged.connect(this._onLayersChanged,this),this._model.sharedLayerTreeChanged.connect(this._onLayerTreeChange,this),this._model.sharedSourcesChanged.connect(this._onSourcesChange,this),this.state={id:this._mainViewModel.id,lightTheme:M(),loading:!0,firstLoad:!0},this._sources=[]}async componentDidMount(){window.addEventListener("resize",this._handleWindowResize),await this.generateScene(),this._mainViewModel.initSignal()}componentWillUnmount(){window.removeEventListener("resize",this._handleWindowResize),this._mainViewModel.viewSettingChanged.disconnect(this._onViewChanged,this),this._model.themeChanged.disconnect(this._handleThemeChange,this),this._model.sharedOptionsChanged.disconnect(this._onSharedOptionsChanged,this),this._model.clientStateChanged.disconnect(this._onClientSharedStateChanged,this),this._mainViewModel.dispose()}async generateScene(){if(this.divRef.current){this._Map=new ve.A({target:this.divRef.current,layers:[],view:new be.Ay({center:[0,0],zoom:1})});const e=new _e.A({formatConstructors:[fe.A]});if(e.on("addfeatures",(e=>{const t=T.UUID.uuid4(),a={type:"GeoJSONSource",name:"Drag and Drop source",parameters:{path:e.file.name}};this.addSource(t,a),this._model.sharedModel.addSource(t,a);const r={type:"VectorLayer",visible:!0,name:"Drag and Drop layer",parameters:{color:"#FF0000",opacity:1,type:"line",source:t}},o=T.UUID.uuid4();this.addLayer(o,r,this.getLayers().length),this._model.addLayer(o,r)})),this._Map.addInteraction(e),this._Map.on("moveend",(()=>{if(!this._initializedPosition)return;const e=this._model.getOptions(),t=this._Map.getView(),a=t.getCenter()||[0,0],r=t.getZoom()||0,o=t.getProjection(),s=(0,je.WP)(a,o),n=t.getRotation(),i={latitude:s[1],longitude:s[0],bearing:n,projection:o.getCode(),zoom:r};e.extent&&(i.extent=t.calculateExtent()),this._model.setOptions(Object.assign(Object.assign({},e),i))})),0!==Se.JupyterGISModel.getOrderedLayerIds(this._model).length){await this._updateLayersImpl(Se.JupyterGISModel.getOrderedLayerIds(this._model));const e=this._model.getOptions();this.updateOptions(e)}this.setState((e=>Object.assign(Object.assign({},e),{loading:!1})))}}async addSource(e,t){var a,r;let o;switch(t.type){case"RasterSource":{const e=t.parameters,a=e.url.endsWith(".pmtiles"),r=this.computeSourceUrl(t);o=a?new ze.b({attributions:e.attribution,tileSize:256,url:r}):new Ge.A({attributions:e.attribution,minZoom:e.minZoom,maxZoom:e.maxZoom,tileSize:256,url:r});break}case"RasterDemSource":{const e=t.parameters;o=new Oe.A({url:this.computeSourceUrl(t),attributions:e.attribution});break}case"VectorTileSource":{const e=t.parameters,a=e.url.endsWith(".pmtiles"),r=this.computeSourceUrl(t);o=a?new ze.X({attributions:e.attribution,url:r}):new Te.A({attributions:e.attribution,minZoom:e.minZoom,maxZoom:e.maxZoom,url:r,format:new we.A({featureClass:Le.Ay})});break}case"GeoJSONSource":{const e=(null===(a=t.parameters)||void 0===a?void 0:a.data)||await this._model.readGeoJSON(null===(r=t.parameters)||void 0===r?void 0:r.path),s=new fe.A;o=new Ae.A({features:s.readFeatures(e,{dataProjection:"EPSG:4326",featureProjection:this._Map.getView().getProjection()})});break}case"ImageSource":{const e=t.parameters,a=Math.min(...e.coordinates.map((e=>e[0]))),r=Math.min(...e.coordinates.map((e=>e[1]))),s=Math.max(...e.coordinates.map((e=>e[0]))),n=Math.max(...e.coordinates.map((e=>e[1]))),i=(0,je.Rb)([a,n]),l=(0,je.Rb)([s,r]),c=i[0],d=i[1],m=l[0],u=[c,l[1],m,d];o=new Ne.A({imageExtent:u,url:e.url,interpolate:!0,crossOrigin:""});break}case"VideoSource":console.warn("Video Tiles not supported with Open Layers");break;case"GeoTiffSource":{const e=t.parameters;o=new ke.A({sources:e.urls,normalize:e.normalize,wrapX:e.wrapX});break}}o.set("id",e),this._sources[e]=o}computeSourceUrl(e){const t=e.parameters,a=t.urlParameters||{};let r=t.url;for(const e of Object.keys(a))r=r.replace(`{${e}}`,a[e]);return r.includes("{max_zoom}")&&(r=r.replace("{max_zoom}",t.maxZoom.toString())),r.includes("{min_zoom}")&&(r=r.replace("{min_zoom}",t.minZoom.toString())),r}async updateSource(e,t){const a=this._sourceToLayerMap.get(e),r=this.getLayer(a);r&&(this.removeSource(e),this.addSource(e,t),r.setSource(this._sources[e]))}removeSource(e){delete this._sources[e]}updateLayers(e){this._updateLayersImpl(e)}async _updateLayersImpl(e){const t=this.getLayers(),a=e.slice().reverse();for(const r of a){const a=this._model.sharedModel.getLayer(r);if(!a)return void console.log(`Layer id ${r} does not exist`);const o=[...t];let s=o.length;const n=e[e.indexOf(r)+1];void 0!==n&&(s=o.indexOf(n),-1===s&&(s=o.length)),this.getLayer(r)?this.moveLayer(r,s):await this.addLayer(r,a,s);const i=t.indexOf(r);i>-1&&t.splice(i,1)}t.forEach((e=>{this._Map.removeLayer(e)})),this._ready=!0}async addLayer(e,t,a){var r;if(this.getLayer(e))return;const o=null===(r=t.parameters)||void 0===r?void 0:r.source,s=this._model.sharedModel.getSource(o);if(!s)return;let n,i;switch(this._sources[o]||await this.addSource(o,s),t.type){case"RasterLayer":i=t.parameters,n=new Me.A({opacity:i.opacity,visible:t.visible,source:this._sources[i.source]});break;case"VectorLayer":i=t.parameters,n=new Ce.A({opacity:i.opacity,visible:t.visible,source:this._sources[i.source],style:e=>this.vectorLayerStyleFunc(e,t)});break;case"VectorTileLayer":i=t.parameters,n=new xe.A({opacity:i.opacity,source:this._sources[i.source],style:e=>this.vectorLayerStyleFunc(e,t)});break;case"HillshadeLayer":i=t.parameters,n=new Ie.A({opacity:.3,source:this._sources[i.source],style:{color:["color",this.hillshadeMath()]}});break;case"ImageLayer":i=t.parameters,n=new Ee.A({opacity:i.opacity,source:this._sources[i.source]});break;case"WebGlLayer":i=t.parameters,n=new Ie.A({opacity:i.opacity,source:this._sources[i.source],style:{color:i.color}})}n.set("id",e),this._sourceToLayerMap.set(i.source,e),this._Map.getLayers().insertAt(a,n)}moveLayer(e,t){const a=this.getLayers();let r;void 0!==t&&t<a.length&&(r=a[t]);const o=this._Map.getLayers().getArray(),s=this.getLayer(e);if(!s||!t||!r)return;const n=o.indexOf(s);o.splice(n,1);const i=this.getLayer(r);if(!i)return;const l=o.indexOf(i);o.splice(l,0,s),this._Map.setLayers(o)}async updateLayer(e,t,a){var r,o,s,n;const i=null===(r=t.parameters)||void 0===r?void 0:r.source,l=this._model.sharedModel.getSource(i);if(l)switch(this._sources[i]||await this.addSource(i,l),a.setVisible(t.visible),t.type){case"RasterLayer":a.setOpacity((null===(o=t.parameters)||void 0===o?void 0:o.opacity)||1);break;case"VectorLayer":{const e=t.parameters;a.setOpacity(e.opacity||1),a.setStyle((e=>this.vectorLayerStyleFunc(e,t)));break}case"VectorTileLayer":{const e=t.parameters;a.setOpacity(e.opacity||1),a.setStyle((e=>this.vectorLayerStyleFunc(e,t)));break}case"HillshadeLayer":case"ImageLayer":break;case"WebGlLayer":a.setOpacity(null===(s=t.parameters)||void 0===s?void 0:s.opacity),a.setStyle({color:null===(n=null==t?void 0:t.parameters)||void 0===n?void 0:n.color})}}removeLayer(e){const t=this.getLayer(e);t&&this._Map.removeLayer(t)}_onSharedOptionsChanged(e,t){if(!this._initializedPosition){const e=this._model.getOptions();this.updateOptions(e),this._initializedPosition=!0}}updateOptions(e){const t=this._Map.getView();if(e.extent)t.fit(e.extent);else{const t=(0,je.Rb)([e.longitude||0,e.latitude||0],this._Map.getView().getProjection());this._Map.getView().setZoom(e.zoom||0),this._Map.getView().setCenter(t)}t.setRotation(e.bearing||0)}_onViewChanged(e,t){}getLayer(e){return this._Map.getLayers().getArray().find((t=>t.get("id")===e))}getLayers(){return this._Map.getLayers().getArray().map((e=>e.get("id")))}_onLayersChanged(e,t){var a;this._ready&&(null===(a=t.layerChange)||void 0===a||a.forEach((e=>{const t=e.newValue;if(t&&0!==Object.keys(t).length){const a=this.getLayer(e.id);a&&Se.JupyterGISModel.getOrderedLayerIds(this._model).includes(e.id)?this.updateLayer(e.id,t,a):this.updateLayers(Se.JupyterGISModel.getOrderedLayerIds(this._model))}else this.removeLayer(e.id)})))}_onLayerTreeChange(e,t){this._ready=!1,this.updateLayers(Se.JupyterGISModel.getOrderedLayerIds(this._model))}_onSourcesChange(e,t){var a;this._ready&&(null===(a=t.sourceChange)||void 0===a||a.forEach((e=>{if(e.newValue&&0!==Object.keys(e.newValue).length){const t=this._model.getSource(e.id);t&&this.updateSource(e.id,t)}else this.removeSource(e.id)})))}render(){return p.createElement("div",{className:"jGIS-Mainview",style:{border:this.state.remoteUser?`solid 3px ${this.state.remoteUser.color}`:"unset"}},p.createElement(Ve,{loading:this.state.loading}),p.createElement("div",{ref:this.divRef,style:{width:"100%",height:"calc(100%)"}}))}}class Fe extends r.ReactWidget{constructor(e){super(),this._mainViewModel=e.mainViewModel,this.addClass("jp-jupytergis-panel")}render(){return p.createElement(We,{viewModel:this._mainViewModel})}}class Ue{constructor(e){this._isDisposed=!1,this._jGISModel=e.jGISModel,this._viewSetting=e.viewSetting}get isDisposed(){return this._isDisposed}get id(){return this._id}get jGISModel(){return this._jGISModel}get viewSettingChanged(){return this._viewSetting.changed}dispose(){this._isDisposed||(this._jGISModel.sharedLayersChanged.disconnect(this._onsharedLayersChanged,this),this._isDisposed=!0)}initSignal(){this._jGISModel.sharedLayersChanged.connect(this._onsharedLayersChanged,this)}async _onsharedLayersChanged(e,t){t.layerChange}}var He=a(72135),$e=a(59429),Je=a(98032);class Ze extends D.BoxPanel{constructor(e){super({direction:"top-to-bottom"}),this._resize=w((()=>{window.dispatchEvent(new Event("resize"))}),200),this.addClass("jpgis-console");const{manager:t,contentFactory:a,mimeTypeService:r,rendermime:s}=e,n=s.clone();this._consolePanel=new Je.ConsolePanel({manager:t,contentFactory:a,mimeTypeService:r,rendermime:n,kernelPreference:{name:"python3",shutdownOnDispose:!0}}),this._consolePanel.console.node.dataset.jpInteractionMode="notebook",this.addWidget(this._consolePanel),D.BoxPanel.setStretch(this._consolePanel,1),this._consolePanel.toolbar.addItem("spacer",o.Toolbar.createSpacerItem()),this._consolePanel.toolbar.addItem("toggle",new o.CommandToolbarButton({label:"",icon:o.expandIcon,id:"jupytergis:toggleConsole",commands:e.commandRegistry})),this._consolePanel.toolbar.addItem("close",new o.CommandToolbarButton({label:"",icon:o.closeIcon,id:"jupytergis:removeConsole",commands:e.commandRegistry}))}get consolePanel(){return this._consolePanel}dispose(){this.isDisposed||(this._consolePanel.dispose(),super.dispose())}execute(){this._consolePanel.console.execute(!1)}onResize(e){super.onResize(e),this._resize()}}class qe extends He.DocumentWidget{constructor(e){super(e),this.onResize=e=>{window.dispatchEvent(new Event("resize"))}}dispose(){this.content.dispose(),super.dispose()}}class Qe extends D.SplitPanel{constructor(e){super({orientation:"vertical",spacing:0}),this._consoleOpened=!1;const{model:t,consoleTracker:a}=e,r=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]])}return a}(e,["model","consoleTracker"]);this._initModel({model:t}),this._initView(),this._consoleOption=r,this._consoleTracker=a}_initModel(e){this._view=new $e.ObservableMap,this._mainViewModel=new Ue({jGISModel:e.model,viewSetting:this._view})}_initView(){this._jupyterGISMainViewPanel=new Fe({mainViewModel:this._mainViewModel}),this.addWidget(this._jupyterGISMainViewPanel),D.SplitPanel.setStretch(this._jupyterGISMainViewPanel,1)}get jupyterGISMainViewPanel(){return this._jupyterGISMainViewPanel}get viewChanged(){return this._view.changed}dispose(){this.isDisposed||(this._consoleView&&this._consoleView.dispose(),A.Signal.clearData(this),this._mainViewModel.dispose(),super.dispose())}get currentViewModel(){return this._mainViewModel}get consolePanel(){var e;return null===(e=this._consoleView)||void 0===e?void 0:e.consolePanel}executeConsole(){this._consoleView&&this._consoleView.execute()}removeConsole(){this._consoleView&&(this._consoleView.dispose(),this._consoleView=void 0,this._consoleOpened=!1,setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),250))}async toggleConsole(e){if(this._consoleView)this._consoleOpened?(this._consoleOpened=!1,this.setRelativeSizes([1,0])):(this._consoleOpened=!0,this.setRelativeSizes([2,1]));else{const{contentFactory:t,manager:a,mimeTypeService:r,rendermime:o,commandRegistry:s}=this._consoleOption;if(t&&a&&r&&o&&s&&this._consoleTracker){this._consoleView=new Ze({contentFactory:t,manager:a,mimeTypeService:r,rendermime:o,commandRegistry:s});const{consolePanel:n}=this._consoleView;this._consoleTracker.widgetAdded.emit(n),await n.sessionContext.ready,await n.console.inject(`from jupytergis_lab import GISDocument\ndoc = GISDocument("${e}")`),this.addWidget(this._consoleView),this.setRelativeSizes([2,1]),this._consoleOpened=!0,n.console.sessionContext.kernelChanged.connect(((e,t)=>{t.newValue||this.removeConsole()}))}}setTimeout((()=>{window.dispatchEvent(new Event("resize"))}),250)}}class Ye extends D.Widget{constructor(){super({node:Ke()}),this.title.changed.connect((e=>{this.node.textContent=this.title.label}))}}function Ke(){const e=document.createElement("h2");return e.textContent="-",e}const Xe="jp-gis-layerGroup",et="jp-gis-layerGroupHeader",tt="jp-gis-layerGroupCollapser",at="jp-gis-layerItem",rt="jp-gis-layer",ot="jp-gis-layerTitle",st="jp-gis-layerIcon",nt="jp-gis-layerText";class it extends D.Panel{constructor(e){super(),this._onDragOver=e=>{e.stopPropagation(),e.preventDefault(),this.node.appendChild(ut.dragIndicator),ut.dragInfo.dragOverElement=null,ut.dragInfo.dragOverPosition=null},this._onDrop=e=>{if(ut.dragIndicator.style.display="none",void 0===this._model)return;const{jGISModel:t}=this._model,{draggedElement:a,dragOverElement:r,dragOverPosition:o}=ut.dragInfo;if("error"===r)return;if(!a)return;const s=a.dataset.id;if(!s)return;if(null===r)return void(null==t||t.moveItemsToGroup([s],"",0));const n=r.dataset.id;n&&(r.classList.contains(et)&&"below"===o?null==t||t.moveItemsToGroup([s],n):null==t||t.moveItemRelatedTo(s,n,"above"===o))},this._model=e.model,this._onSelect=e.onSelect,this._state=e.state,this.id="jupytergis::layerTree",this.addClass("jp-gis-layerPanel"),this.addWidget(o.ReactWidget.create(h().createElement(lt,{model:this._model,onSelect:this._onSelect,state:this._state}))),this.node.ondragover=this._onDragOver,this.node.ondrop=this._onDrop}}function lt(e){var t,a;const[r,o]=(0,p.useState)(null===(t=e.model)||void 0===t?void 0:t.jGISModel),[s,n]=(0,p.useState)((null==r?void 0:r.getLayerTree())||[]),i=({type:t,item:a,nodeId:r,event:o})=>{e.onSelect({type:t,item:a,nodeId:r,event:o})};return(0,p.useEffect)((()=>{const e=()=>{n((null==r?void 0:r.getLayerTree())||[])};return null==r||r.sharedModel.layersChanged.connect(e),null==r||r.sharedModel.layerTreeChanged.connect(e),()=>{null==r||r.sharedModel.layersChanged.disconnect(e),null==r||r.sharedModel.layerTreeChanged.disconnect(e)}}),[r]),null===(a=e.model)||void 0===a||a.documentChanged.connect(((e,t)=>{var a;o(null==t?void 0:t.context.model),n((null===(a=null==t?void 0:t.context.model)||void 0===a?void 0:a.getLayerTree())||[])})),h().createElement("div",{id:"jp-gis-layer-tree"},s.slice().reverse().map((t=>"string"==typeof t?h().createElement(mt,{key:t,gisModel:r,layerId:t,onClick:i}):h().createElement(ct,{key:t.name,gisModel:r,group:t,onClick:i,state:e.state}))))}function ct(e){var t,a;const{group:s,gisModel:n,onClick:i,state:l}=e;if(void 0===s)return h().createElement(h().Fragment,null);const[c,d]=(0,p.useState)(""),[m,u]=(0,p.useState)(!1),g=null!==(t=null==s?void 0:s.name)&&void 0!==t?t:"Undefined group",y=null!==(a=null==s?void 0:s.layers)&&void 0!==a?a:[],[S,v]=(0,p.useState)(dt(s.name,n));return(0,p.useEffect)((()=>{d(r.DOMUtils.createDomID()),(async()=>{var e;const t=await l.fetch(s.name);u(!!t&&null!==(e=t.expanded)&&void 0!==e&&e)})()}),[]),(0,p.useEffect)((()=>{const e=()=>{v(dt(s.name,n))};return null==n||n.clientStateChanged.connect(e),()=>{null==n||n.clientStateChanged.disconnect(e)}}),[n]),h().createElement("div",{className:`${at} ${Xe}`,draggable:!0,onDragStart:ut.onDragStart,onDragEnd:ut.onDragEnd,"data-id":g},h().createElement("div",{onClick:async()=>{l.save(s.name,{expanded:!m}),u(!m)},onContextMenu:e=>{var t;const a=null===(t=e.currentTarget.children.namedItem(c))||void 0===t?void 0:t.id;i({type:"group",item:g,nodeId:a,event:e})},className:`${et} ${S?" jp-mod-selected":""}`,onDragOver:ut.onDragOver,"data-id":g},h().createElement(o.LabIcon.resolveReact,{icon:o.caretDownIcon,className:tt+(m?" jp-mod-expanded":""),tag:"span"}),h().createElement("span",{id:c,className:nt},g)),m&&h().createElement("div",null,y.slice().reverse().map((t=>"string"==typeof t?h().createElement(mt,{key:t,gisModel:n,layerId:t,onClick:i}):h().createElement(ct,{key:t.name,gisModel:n,group:t,onClick:i,state:e.state})))))}function dt(e,t){var a,r,o,s;return(null===(r=null===(a=null==t?void 0:t.localState)||void 0===a?void 0:a.selected)||void 0===r?void 0:r.value)&&Object.keys(null===(s=null===(o=null==t?void 0:t.localState)||void 0===o?void 0:o.selected)||void 0===s?void 0:s.value).includes(e)||!1}function mt(e){const{layerId:t,gisModel:a,onClick:s}=e,l=null==a?void 0:a.getLayer(t);if(void 0===l)return h().createElement(h().Fragment,null);const[c,d]=(0,p.useState)(""),[m,g]=(0,p.useState)(dt(t,a)),y=l.name;(0,p.useEffect)((()=>{d(r.DOMUtils.createDomID())}),[]),(0,p.useEffect)((()=>{const e=(e,r)=>{g(dt(t,a))};return null==a||a.clientStateChanged.connect(e),()=>{null==a||a.clientStateChanged.disconnect(e)}}),[a]);const S=e=>{var a;const r=null===(a=e.currentTarget.children.namedItem(c))||void 0===a?void 0:a.id;s({type:"layer",item:t,nodeId:r,event:e})};return h().createElement("div",{className:`${at} ${rt}${m?" jp-mod-selected":""}`,draggable:!0,onDragStart:ut.onDragStart,onDragOver:ut.onDragOver,onDragEnd:ut.onDragEnd,"data-id":t},h().createElement("div",{className:ot,onClick:S,onContextMenu:S},u.has(l.type)&&h().createElement(o.LabIcon.resolveReact,Object.assign({},u.get(l.type),{className:st})),h().createElement("span",{id:c,className:nt},y)),h().createElement(o.Button,{title:l.visible?"Hide layer":"Show layer",onClick:()=>{var e;l.visible=!l.visible,null===(e=null==a?void 0:a.sharedModel)||void 0===e||e.updateLayer(t,l)},minimal:!0},h().createElement(o.LabIcon.resolveReact,{icon:l.visible?n:i,className:st,tag:"span"})))}var ut;!function(e){e.dragIndicator=document.createElement("div"),e.dragIndicator.id="jp-drag-indicator",e.dragInfo={draggedElement:null,dragOverElement:null,dragOverPosition:null},e.onDragStart=t=>{e.dragInfo.draggedElement=t.target},e.onDragOver=t=>{var a;t.preventDefault(),t.stopPropagation();const{clientY:r}=t;let o=t.target.closest(`.${et}, .${at}`);if(!o)return;if(null===(a=e.dragInfo.draggedElement)||void 0===a?void 0:a.contains(o))return void(e.dragInfo.dragOverElement="error");e.dragInfo.dragOverElement=o;const s=o.getBoundingClientRect();r-s.top<s.bottom-r?(e.dragInfo.dragOverPosition="above",o.classList.contains(et)&&(o=o.parentNode),o.insertAdjacentElement("beforebegin",e.dragIndicator),e.dragIndicator.style.display="block"):(e.dragInfo.dragOverPosition="below",o.insertAdjacentElement("afterend",e.dragIndicator),e.dragIndicator.style.display="block")},e.onDragEnd=()=>{e.dragIndicator.style.display="none",e.dragInfo.draggedElement=null,e.dragInfo.dragOverElement=null,e.dragInfo.dragOverPosition=null}}(ut||(ut={}));const pt="jp-gis-source",ht="jp-gis-sourceTitle",gt="jp-gis-sourceIcon",yt="jp-gis-sourceText",St="jp-gis-sourceUnused",vt="jp-gis-sourceInfo";class bt extends D.Panel{constructor(e){super(),this._model=e.model,this._onSelect=e.onSelect,this.id="jupytergis::sourcesPanel",this.addClass("jp-gis-sourcePanel"),this.addWidget(o.ReactWidget.create(h().createElement(ft,{model:this._model,onSelect:this._onSelect})))}}function ft(e){var t,a;const[r,o]=(0,p.useState)(null===(t=e.model)||void 0===t?void 0:t.jGISModel),[s,n]=(0,p.useState)(Ct.sortedSourceIds(r)),i=({type:t,item:a,nodeId:r,event:o})=>{e.onSelect({type:t,item:a,nodeId:r,event:o})};return(0,p.useEffect)((()=>{const e=()=>{n([...Ct.sortedSourceIds(r)])};return null==r||r.sharedModel.sourcesChanged.connect(e),null==r||r.clientStateChanged.connect(e),e(),()=>{null==r||r.sharedModel.sourcesChanged.disconnect(e),null==r||r.clientStateChanged.disconnect(e)}}),[r]),null===(a=e.model)||void 0===a||a.documentChanged.connect(((e,t)=>{o(null==t?void 0:t.context.model)})),h().createElement("div",{id:"jp-gis-sources"},s.map((e=>h().createElement(_t,{key:`source-${e}`,gisModel:r,sourceId:e,onClick:i}))))}function wt(e,t){var a,r,o,s;return(null===(r=null===(a=null==t?void 0:t.localState)||void 0===a?void 0:a.selected)||void 0===r?void 0:r.value)&&Object.keys(null===(s=null===(o=null==t?void 0:t.localState)||void 0===o?void 0:o.selected)||void 0===s?void 0:s.value).includes(e)||!1}function _t(e){const{sourceId:t,gisModel:a,onClick:s}=e,n=null==a?void 0:a.getSource(t);if(void 0===n)return h().createElement(h().Fragment,null);const[i,l]=(0,p.useState)(""),[c,d]=(0,p.useState)(wt(t,a)),[m,g]=(0,p.useState)(!1),y=n.name;(0,p.useEffect)((()=>{l(r.DOMUtils.createDomID())}),[]),(0,p.useEffect)((()=>{const e=()=>{const e=null==a?void 0:a.getLayersBySource(t);g(!e||0===e.length)};return null==a||a.sharedLayersChanged.connect(e),e(),()=>{null==a||a.sharedLayersChanged.disconnect(e)}}),[a]),(0,p.useEffect)((()=>{const e=(e,r)=>{d(wt(t,a))};return null==a||a.clientStateChanged.connect(e),()=>{null==a||a.clientStateChanged.disconnect(e)}}),[a]);const S=e=>{var a;const r=null===(a=e.currentTarget.children.namedItem(i))||void 0===a?void 0:a.id;s({type:"source",item:t,nodeId:r,event:e})};let v=pt;return c&&(v=v.concat(" jp-mod-selected")),m&&(v=v.concat(` ${St}`)),h().createElement("div",{className:v},h().createElement("div",{className:ht,onClick:S,onContextMenu:S},u.has(n.type)&&h().createElement(o.LabIcon.resolveReact,Object.assign({},u.get(n.type),{className:gt})),h().createElement("span",{id:i,className:yt},y),m&&h().createElement("span",{className:vt},"(unused)")))}var Ct;!function(e){e.sortedSourceIds=function(e){const t=null==e?void 0:e.getSources();return void 0===t?[]:Object.keys(t).sort(((e,a)=>{const r=t[e].name.toLowerCase(),o=t[a].name.toLowerCase();return r<o?-1:r>o?1:0}))}}(Ct||(Ct={}));class xt extends o.SidePanel{constructor(e){super(),this._onSelect=({type:e,item:t,nodeId:a,event:r})=>{var o,s;if(!this._model||!a)return;const{jGISModel:n}=this._model,i=null===(s=null===(o=null==n?void 0:n.localState)||void 0===o?void 0:o.selected)||void 0===s?void 0:s.value,l=document.getElementById(a);if(l)if(l.tabIndex=0,l.focus(),i){if(r.ctrlKey||2!==r.button||!(t in i))if(r.ctrlKey){if(a){if(!Object.values(i).some((t=>t.type===e)))return void this.resetSelected(e,a,t);const r=Object.assign(Object.assign({},i),{[t]:{type:e,selectedNodeId:a}});this._lastSelectedNodeId=a,n.syncSelected(r,this.id)}}else this.resetSelected(e,a,t)}else this.resetSelected(e,a,t)},this.addClass("jGIS-sidepanel-widget"),this._model=e.model,this._state=e.state;const t=new Ye;this.header.addWidget(t);const a=new bt({model:this._model,onSelect:this._onSelect});a.title.caption="Sources",a.title.label="Sources",this.addWidget(a);const r=new it({model:this._model,state:this._state,onSelect:this._onSelect});r.title.caption="Layer tree",r.title.label="Layers",this.addWidget(r),e.tracker.currentChanged.connect(((e,a)=>{t.title.label=a?a.context.localPath:"-"}))}dispose(){super.dispose()}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("mouseup",this)}onBeforeDetach(e){super.onBeforeDetach(e),this.node.removeEventListener("mouseup",this)}handleEvent(e){"mouseup"===e.type&&this._mouseUpEvent(e)}_mouseUpEvent(e){const t=document.getElementById(this._lastSelectedNodeId);t&&t.focus()}resetSelected(e,t,a){var r,o;const s={};a&&t&&(s[a]={type:e,selectedNodeId:t},this._lastSelectedNodeId=t),null===(o=null===(r=this._model)||void 0===r?void 0:r.jGISModel)||void 0===o||o.syncSelected(s,this.id)}}class It{constructor(e){this._tracker=e.tracker,this._documentChanged=this._tracker.currentChanged}get documentChanged(){return this._documentChanged}get filePath(){var e;return null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.context.localPath}get jGISModel(){var e;return null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.context.model}get sharedModel(){var e;return null===(e=this._tracker.currentWidget)||void 0===e?void 0:e.context.model.sharedModel}disconnect(e){this._tracker.forEach((t=>{t.context.model.sharedLayersChanged.disconnect(e),t.context.model.sharedSourcesChanged.disconnect(e),t.context.model.sharedOptionsChanged.disconnect(e)})),this._tracker.forEach((t=>t.context.model.themeChanged.disconnect(e))),this._tracker.forEach((t=>t.context.model.clientStateChanged.disconnect(e)))}}var Et=a(80185);class Mt extends p.Component{async syncObjectProperties(e,t){e&&this.props.context.model.sharedModel.updateObjectParameters(e,t)}render(){let e,t,a,r,o,s,n;if(this.props.layer){const r=this.props.context.model.getLayer(this.props.layer);if(!r)return;if(t=Z((null==r?void 0:r.type)||"RasterLayer"),a=j((null==r?void 0:r.parameters)||{}),e=j(this.props.formSchemaRegistry.getSchemas().get(r.type)),!e)return void console.error(`Cannot find schema for ${r.type}`)}if(this.props.source){if(n=this.props.context.model.getSource(this.props.source),!n)return;if(o=q((null==n?void 0:n.type)||"RasterSource"),s=j((null==n?void 0:n.parameters)||{}),r=j(this.props.formSchemaRegistry.getSchemas().get(n.type)),!r)return void console.error(`Cannot find schema for ${n.type}`)}return p.createElement("div",null,this.props.layer&&t&&p.createElement("div",null,p.createElement("h3",null,"Layer Properties"),p.createElement(t,{formContext:"create",sourceType:(null==n?void 0:n.type)||"RasterSource",model:this.props.context.model,filePath:`${this.props.context.path}::panel`,schema:e,sourceData:a,syncData:e=>{this.syncObjectProperties(this.props.layer,e)}})),this.props.source&&o&&p.createElement("div",null,p.createElement("h3",null,"Source Properties"),p.createElement(o,{formContext:"create",model:this.props.context.model,filePath:`${this.props.context.path}::panel`,schema:r,sourceData:s,syncData:e=>{this.syncObjectProperties(this.props.source,e)}})))}}class jt extends o.PanelWithToolbar{constructor(e){super(e),this.title.label="Objects Properties";const t=r.ReactWidget.create(p.createElement(Lt,{cpModel:e.controlPanelModel,tracker:e.tracker,formSchemaRegistry:e.formSchemaRegistry}));this.addWidget(t),this.addClass("jGIS-sidebar-propertiespanel")}}class Lt extends p.Component{constructor(e){var t,a,r;super(e),this._sharedJGISModelChanged=()=>{this.forceUpdate()},this._onClientSharedStateChanged=(e,t)=>{var a,r;let o;const s=this.state.clientId,n=s?t.get(s):null;if(n&&(null===(a=n.selected)||void 0===a?void 0:a.emitter)&&n.selected.emitter!==this.state.id&&(null===(r=n.selected)||void 0===r?void 0:r.value)&&(o=n),o){const e=o.selected.value,t=Object.keys(e||{});if(void 0===e||1!==t.length)return void this.setState((e=>Object.assign(Object.assign({},e),{selectedObject:void 0})));const a=t[0];a!==this.state.selectedObject&&this.setState((e=>Object.assign(Object.assign({},e),{selectedObject:a})))}},this.state={context:null===(t=e.tracker.currentWidget)||void 0===t?void 0:t.context,clientId:null,id:(0,Et.A)()},null===(a=this.props.cpModel.jGISModel)||void 0===a||a.sharedLayersChanged.connect(this._sharedJGISModelChanged),null===(r=this.props.cpModel.jGISModel)||void 0===r||r.sharedSourcesChanged.connect(this._sharedJGISModelChanged),this.props.cpModel.documentChanged.connect(((e,t)=>{t?(this.props.cpModel.disconnect(this._sharedJGISModelChanged),this.props.cpModel.disconnect(this._onClientSharedStateChanged),t.context.model.sharedLayersChanged.connect(this._sharedJGISModelChanged),t.context.model.sharedSourcesChanged.connect(this._sharedJGISModelChanged),t.context.model.clientStateChanged.connect(this._onClientSharedStateChanged),this.setState((e=>Object.assign(Object.assign({},e),{context:t.context,filePath:t.context.localPath,clientId:t.context.model.getClientId()})))):this.setState({context:void 0,selectedObject:void 0})}))}render(){var e;const t=this.state.selectedObject;if(!t||!this.state.context)return p.createElement("div",null);let a,r;const o=this.state.context.model.getLayer(t);return o?(a=t,r=null===(e=o.parameters)||void 0===e?void 0:e.source):this.state.context.model.getSource(t)&&(r=t),p.createElement(Mt,{layer:a,source:r,formSchemaRegistry:this.props.formSchemaRegistry,context:this.state.context})}}var Gt=a(45250);const Ot=({index:e,features:t,filterRows:a,setFilterRows:r,deleteRow:s})=>{const[n,i]=(0,p.useState)({}),[l,c]=(0,p.useState)(a[e].feature||Object.keys(t)[0]);(0,p.useEffect)((()=>{c(a[e].feature)}),[a]),(0,p.useEffect)((()=>{const e=Object.keys(t).sort(),a={};for(const r of e){const e=Array.from(t[r]).sort();a[r]=e}i(a)}),[t]),(0,p.useEffect)((()=>{var t;const a=document.getElementById(`jp-gis-value-select-${e}`);if(!a)return;const r=null===(t=a.options[a.selectedIndex])||void 0===t?void 0:t.value;r&&d(r)}),[l]);const d=t=>{const o=[...a],s="number"==typeof n[l][0];o[e].value=s?+t:t,r(o)};return h().createElement("div",{className:"jp-gis-filter-row"},h().createElement("select",{id:`jp-gis-feature-select-${e}`,className:"jp-mod-styled jp-SchemaForm",onChange:t=>{const o=[...a];o[e].feature=t.target.value,c(t.target.value),r(o)}},Object.keys(n).map(((t,r)=>h().createElement("option",{key:r,value:t,selected:t===a[e].feature},t)))),h().createElement("select",{id:`jp-gis-operator-select-${e}`,className:"jp-mod-styled jp-SchemaForm",onChange:t=>{const o=[...a];o[e].operator=t.target.value,r(o)}},["==","!=",">","<",">=","<="].map(((t,r)=>h().createElement("option",{key:r,value:t,selected:t===a[e].operator},t)))),h().createElement("select",{id:`jp-gis-value-select-${e}`,className:"jp-mod-styled jp-SchemaForm",onChange:e=>{d(e.target.value)}},n[l]&&[...n[l]].map(((t,r)=>h().createElement("option",{key:r,value:t,selected:t===a[e].value},t)))),h().createElement(o.Button,{id:`jp-gis-remove-filter-${e}`,className:"jp-Button jp-gis-filter-icon"},h().createElement(te.g,{icon:ee.yLS,onClick:s})))};class Tt extends D.Panel{constructor(e){super(),this._model=e.model,this._tracker=e.tracker,this.id="jupytergis::layerTree",this.addWidget(o.ReactWidget.create(h().createElement(At,{model:this._model,tracker:this._tracker})))}}const At=e=>{var t;const a=(0,p.useRef)({}),[r,s]=(0,p.useState)(""),[n,i]=(0,p.useState)("all"),[l,c]=(0,p.useState)(""),[d,m]=(0,p.useState)(!1),[u,g]=(0,p.useState)([]),[y,S]=(0,p.useState)({}),[v,b]=(0,p.useState)(e.model.jGISModel);null===(t=e.model)||void 0===t||t.documentChanged.connect(((e,t)=>{b(null==t?void 0:t.context.model)})),(0,p.useEffect)((()=>{const t=()=>{var t;(null===(t=e.tracker.currentWidget)||void 0===t?void 0:t.id)!==r&&(e.tracker.currentWidget&&s(e.tracker.currentWidget.id),S({}),g([]),i("all"),c(""))};return e.tracker.currentChanged.connect(t),()=>{e.tracker.currentChanged.disconnect(t)}}),[]),(0,p.useEffect)((()=>{var e,t,a,r;(null===(t=null===(e=null==v?void 0:v.localState)||void 0===e?void 0:e.selected)||void 0===t?void 0:t.value)&&c(Object.keys(null===(r=null===(a=null==v?void 0:v.localState)||void 0===a?void 0:a.selected)||void 0===r?void 0:r.value)[0])}),[r]),(0,p.useEffect)((()=>{const t=()=>{var e,t,a,r;if(!(null===(t=null===(e=null==v?void 0:v.localState)||void 0===e?void 0:e.selected)||void 0===t?void 0:t.value))return;const o=Object.keys(null===(r=null===(a=null==v?void 0:v.localState)||void 0===a?void 0:a.selected)||void 0===r?void 0:r.value)[0];c(o)},a=(t,a)=>{var o,s,n,i,l;if((null===(o=e.tracker.currentWidget)||void 0===o?void 0:o.id)===r&&a.has("zoom")){if(!(null===(n=null===(s=null==v?void 0:v.localState)||void 0===s?void 0:s.selected)||void 0===n?void 0:n.value))return;const e=Object.keys(null===(l=null===(i=null==v?void 0:v.localState)||void 0===i?void 0:i.selected)||void 0===l?void 0:l.value)[0];_(e)}};return null==v||v.clientStateChanged.connect(t),null==v||v.sharedOptionsChanged.connect(a),()=>{null==v||v.clientStateChanged.disconnect(t),null==v||v.sharedOptionsChanged.disconnect(a)}}),[v]),(0,p.useEffect)((()=>{var e,t,a,r;S({});const o=null==v?void 0:v.getLayer(l);o&&"VectorLayer"===o.type?(m(!0),g(null!==(t=null===(e=o.filters)||void 0===e?void 0:e.appliedFilters)&&void 0!==t?t:[]),i(null!==(r=null===(a=o.filters)||void 0===a?void 0:a.logicalOp)&&void 0!==r?r:"all"),f()):m(!1)}),[l]),(0,p.useEffect)((()=>{a.current=y}),[y]);const f=async e=>{var t,r,o,s;if(!v)return;const n=v.getLayer(null!=e?e:l),i=v.getSource(null===(t=null==n?void 0:n.parameters)||void 0===t?void 0:t.source),{latitude:c,longitude:d,extent:m,zoom:u}=v.getOptions();if(!i||!n)return;const p=(0,Gt.cloneDeep)(a.current);switch(n.filters&&n.filters.appliedFilters.map((e=>{e.feature in p||(p[e.feature]=new Set),p[e.feature].add(e.value)})),i.type){case"VectorTileSource":try{const e=(await G(null===(r=null==i?void 0:i.parameters)||void 0===r?void 0:r.url,{latitude:c,longitude:d,extent:m,zoom:u})).layers[null===(o=n.parameters)||void 0===o?void 0:o.sourceLayer];for(let t=0;t<e.length;t++){const a=e.feature(t);C(a.properties,p)}}catch(e){console.warn(`Error fetching tile info: ${e}`)}break;case"GeoJSONSource":{const e=await(null==v?void 0:v.readGeoJSON(null===(s=i.parameters)||void 0===s?void 0:s.path));null==e||e.features.forEach((e=>{e.properties&&C(e.properties,p)}));break}default:console.warn("Source type not supported")}S(p)},_=w(f,500),C=(e,t)=>{Object.entries(e).forEach((([e,a])=>{e in t||(t[e]=new Set),t[e].add(a)}))},x=(e,t)=>{const a=null==v?void 0:v.getLayer(l);a&&(a.filters={logicalOp:null!=t?t:n,appliedFilters:e},null==v||v.sharedModel.updateLayer(l,a))};return h().createElement(h().Fragment,null,d&&h().createElement("div",{className:"jp-gis-filter-main"},h().createElement("div",{id:"filter-container",className:"jp-gis-filter-select-container"},h().createElement("select",{className:"jp-mod-styled jp-SchemaForm jp-gis-logical-select",onChange:e=>{i(e.target.value),x(u,e.target.value)}},h().createElement("option",{key:"all",value:"all",selected:"all"===n},"All"),h().createElement("option",{key:"any",value:"any",selected:"any"===n},"Any")),u.map(((e,t)=>h().createElement(Ot,{key:t,index:t,features:y,filterRows:u,setFilterRows:g,deleteRow:()=>(e=>{const t=[...u];t.splice(e,1),x(t),g(t)})(t)})))),h().createElement("div",{className:"jp-gis-filter-button-container"},h().createElement("div",{style:{justifyContent:"flex-start"}},h().createElement(o.Button,{className:"jp-Dialog-button jp-mod-accept jp-mod-styled",onClick:()=>{g([...u,{feature:Object.keys(y)[0],operator:"==",value:[...Object.values(y)[0]][0]}])}},"Add"),h().createElement(o.Button,{className:"jp-Dialog-button jp-mod-reject jp-mod-styled",onClick:()=>{x([]),g([])}},"Clear")),h().createElement(o.Button,{className:"jp-Dialog-button jp-mod-accept jp-mod-styled",onClick:()=>{x(u)}},"Submit"))))};class kt extends o.SidePanel{constructor(e){super(),this.addClass("jGIS-sidepanel-widget"),this._model=e.model;const t=new Ye;this.header.addWidget(t);const a=new jt({controlPanelModel:this._model,formSchemaRegistry:e.formSchemaRegistry,tracker:e.tracker});this.addWidget(a);const r=new Tt({model:this._model,tracker:e.tracker,formSchemaRegistry:e.formSchemaRegistry});r.title.caption="Filters",r.title.label="Filters",this.addWidget(r),this._model.documentChanged.connect(((e,r)=>{r?r.context.model.sharedModel.editable?(t.title.label=r.context.localPath,a.show()):(t.title.label=`${r.context.localPath} - Read Only`,a.hide()):t.title.label="-"}))}dispose(){super.dispose()}}class Nt extends p.Component{constructor(e){super(e),this.selectUser=e=>{var t;let a;e.userId!==(null===(t=this.state.selectedUser)||void 0===t?void 0:t.userId)&&(a=e),this.setState((e=>Object.assign(Object.assign({},e),{selectedUser:a})),(()=>{this._model.setUserToFollow(null==a?void 0:a.userId)}))},this._model=e.model,this.state={usersList:[]}}componentDidMount(){this.setState((e=>Object.assign(Object.assign({},e),{usersList:this._model.users}))),this._model.userChanged.connect(((e,t)=>{this.setState((e=>Object.assign(Object.assign({},e),{usersList:t})))}))}createUserIcon(e){var t;let a;const{userId:r,userData:o}=e,s=r===(null===(t=this.state.selectedUser)||void 0===t?void 0:t.userId)?"selected":"";return a=o.avatar_url?p.createElement("div",{key:r,title:o.display_name,className:`lm-MenuBar-itemIcon jp-MenuBar-imageIcon ${s}`,onClick:()=>this.selectUser(e)},p.createElement("img",{src:o.avatar_url,alt:""})):p.createElement("div",{key:r,title:o.display_name,className:`lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon ${s}`,style:{backgroundColor:o.color},onClick:()=>this.selectUser(e)},p.createElement("span",null,o.initials)),a}filterDuplicated(e){const t=[],a=new Set;for(const r of e)a.has(r.userData.username)||(a.add(r.userData.username),t.push(r));return t}render(){return p.createElement("div",{className:"jGIS-toolbar-usertoolbar"},this.filterDuplicated(this.state.usersList).map((e=>{if(e.userId!==this._model.currentUserId)return this.createUserIcon(e)})))}}const Dt="jGIS-Toolbar-Separator",Rt="jGIS-Toolbar-GroupName";class Bt extends D.Widget{constructor(){super(),this.addClass(Dt)}}class Pt extends o.Toolbar{constructor(e){if(super(e),this.addClass("jGIS-toolbar-widget"),e.commands){this.addItem("undo",new r.CommandToolbarButton({id:d.undo,label:"",icon:o.undoIcon,commands:e.commands})),this.addItem("redo",new r.CommandToolbarButton({id:d.redo,label:"",icon:o.redoIcon,commands:e.commands})),this.addItem("separator0",new Bt),this.addItem("Toggle console",new r.CommandToolbarButton({id:d.toggleConsole,commands:e.commands,label:"",icon:o.terminalIcon})),this.addItem("separator1",new Bt),this.addItem("openLayerBrowser",new r.CommandToolbarButton({id:d.openLayerBrowser,label:"",commands:e.commands})),this.addItem("newRasterEntry",new r.CommandToolbarButton({id:d.newRasterEntry,label:"",commands:e.commands})),this.addItem("newVectorTileEntry",new r.CommandToolbarButton({id:d.newVectorTileEntry,label:"",commands:e.commands})),this.addItem("separator2",new Bt);const t=new o.ToolbarButton({icon:o.addIcon,actualOnClick:!0,onClick:()=>{if(!e.commands)return;const a=t.node.getBoundingClientRect(),r=new D.Menu({commands:e.commands});r.title.label="New Layer",r.addItem({type:"command",command:d.newHillshadeEntry}),r.addItem({type:"separator"}),r.addItem({type:"command",command:d.newImageEntry}),r.addItem({type:"separator"}),r.addItem({type:"command",command:d.newShapefileLayer}),r.addItem({type:"command",command:d.newGeoTiffEntry}),r.addItem({type:"command",command:d.newGeoJSONEntry}),r.open(a.x,a.bottom)}});this.addItem("New",t),this.addItem("spacer",o.Toolbar.createSpacerItem()),this.addItem("users",o.ReactWidget.create(p.createElement(Nt,{model:e.model})))}}}},74864:(e,t,a)=>{var r={"./Gaode-Normal.png":89279,"./Gaode-Satellite.png":49771,"./NASAGIBS-ASTER_GDEM_Greyscale_Shaded_Relief.png":42255,"./NASAGIBS-ModisAquaBands721CR.png":84035,"./NASAGIBS-ModisAquaTrueColorCR.png":7024,"./NASAGIBS-ModisTerraAOD.png":90806,"./NASAGIBS-ModisTerraBands367CR.png":48225,"./NASAGIBS-ModisTerraBands721CR.png":64739,"./NASAGIBS-ModisTerraChlorophyll.png":80990,"./NASAGIBS-ModisTerraLSTDay.png":53457,"./NASAGIBS-ModisTerraSnowCover.png":43896,"./NASAGIBS-ModisTerraTrueColorCR.png":65104,"./NASAGIBS-ViirsEarthAtNight2012.png":58313,"./NASAGIBS-ViirsTrueColorCR.png":47103,"./OPNVKarte.png":95209,"./OpenRailwayMap.png":42280,"./OpenStreetMap-BZH.png":51655,"./OpenStreetMap-CH.png":17298,"./OpenStreetMap-DE.png":99610,"./OpenStreetMap-France.png":52898,"./OpenStreetMap-HOT.png":68170,"./OpenStreetMap-Mapnik.png":67731,"./OpenTopoMap.png":95995,"./Strava-All.png":25482,"./Strava-Ride.png":93421,"./Strava-Run.png":30052,"./Strava-Water.png":85198,"./Strava-Winter.png":73184,"./USGS-USImagery.png":48348,"./USGS-USImageryTopo.png":44664,"./USGS-USTopo.png":95750,"./WaymarkedTrails-cycling.png":25851,"./WaymarkedTrails-hiking.png":28074,"./WaymarkedTrails-mtb.png":52343,"./WaymarkedTrails-riding.png":42041,"./WaymarkedTrails-skating.png":76491,"./WaymarkedTrails-slopes.png":1718,"./custom_raster.png":62778};function o(e){var t=s(e);return a(t)}function s(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=s,e.exports=o,o.id=74864},89279:(e,t,a)=>{"use strict";e.exports=a.p+"d83457b1b925c1718f6d.png"},49771:(e,t,a)=>{"use strict";e.exports=a.p+"1d440270da19a2f22fee.png"},42255:(e,t,a)=>{"use strict";e.exports=a.p+"32c7a73662cceb5bb1d7.png"},84035:(e,t,a)=>{"use strict";e.exports=a.p+"a35b106d2ed63c9415d8.png"},7024:(e,t,a)=>{"use strict";e.exports=a.p+"c8b81779c65fdb3c3fa5.png"},90806:(e,t,a)=>{"use strict";e.exports=a.p+"c9d6b533d9149f46ebb0.png"},48225:(e,t,a)=>{"use strict";e.exports=a.p+"a1aec2703ff3dd7cad5c.png"},64739:(e,t,a)=>{"use strict";e.exports=a.p+"2bd6cc5cc336dc14664e.png"},80990:(e,t,a)=>{"use strict";e.exports=a.p+"037a7a10572d84466a61.png"},53457:(e,t,a)=>{"use strict";e.exports=a.p+"1a50c2bb32a2f2725468.png"},43896:(e,t,a)=>{"use strict";e.exports=a.p+"dbd44be87657cc8485b9.png"},65104:(e,t,a)=>{"use strict";e.exports=a.p+"a9e04491802b61881be7.png"},58313:(e,t,a)=>{"use strict";e.exports=a.p+"363ca7c5f78deb6fd033.png"},47103:(e,t,a)=>{"use strict";e.exports=a.p+"99cba4f26941e905077c.png"},95209:(e,t,a)=>{"use strict";e.exports=a.p+"aa0d1282df07ef3c385f.png"},42280:(e,t,a)=>{"use strict";e.exports=a.p+"dc7cea97d06a8a3d2814.png"},51655:(e,t,a)=>{"use strict";e.exports=a.p+"3e2abeb6f399328c6ca3.png"},17298:(e,t,a)=>{"use strict";e.exports=a.p+"801d7167d999982b47a6.png"},99610:(e,t,a)=>{"use strict";e.exports=a.p+"fd9328315a97a67c95ab.png"},52898:(e,t,a)=>{"use strict";e.exports=a.p+"32ef1da9016680ad72ad.png"},68170:(e,t,a)=>{"use strict";e.exports=a.p+"9ed013096549f2bf7c22.png"},67731:(e,t,a)=>{"use strict";e.exports=a.p+"f583a55ec54e8fe27ec6.png"},95995:(e,t,a)=>{"use strict";e.exports=a.p+"062a9554f6b4caac9713.png"},25482:(e,t,a)=>{"use strict";e.exports=a.p+"ae2589dc6f6090080a25.png"},93421:(e,t,a)=>{"use strict";e.exports=a.p+"4ed4ae4121d38d85100b.png"},30052:(e,t,a)=>{"use strict";e.exports=a.p+"d0917c2edc1eee1562a2.png"},85198:(e,t,a)=>{"use strict";e.exports=a.p+"d7eb57ad53f788b1fa92.png"},73184:(e,t,a)=>{"use strict";e.exports=a.p+"2b3d42a470b5ce14859a.png"},48348:(e,t,a)=>{"use strict";e.exports=a.p+"064f37cecb8130ad66e8.png"},44664:(e,t,a)=>{"use strict";e.exports=a.p+"bf9c5537f242b3244cfd.png"},95750:(e,t,a)=>{"use strict";e.exports=a.p+"3d48be10ffea86eb15de.png"},25851:(e,t,a)=>{"use strict";e.exports=a.p+"91eea6f15a4d37354193.png"},28074:(e,t,a)=>{"use strict";e.exports=a.p+"5c2774ff9757d8ca7266.png"},52343:(e,t,a)=>{"use strict";e.exports=a.p+"34d618e9103c659742b2.png"},42041:(e,t,a)=>{"use strict";e.exports=a.p+"034e72037478aea1bd04.png"},76491:(e,t,a)=>{"use strict";e.exports=a.p+"4d79d4897dde805afe9a.png"},1718:(e,t,a)=>{"use strict";e.exports=a.p+"31780c7e8d2544c4aef1.png"},62778:(e,t,a)=>{"use strict";e.exports=a.p+"08da2741746ddab81d04.png"},80432:()=>{},85787:()=>{},93907:()=>{}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//! This takes so long, maybe do when adding source instead
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_jupytergis_jupytergis_core=self.webpackChunk_jupytergis_jupytergis_core||[]).push([[618],{20618:(e,r,s)=>{s.r(r),s.d(r,{default:()=>c});var u=s(67341),t=s(74660);class c extends t.A{decodeBlock(e){return(0,u.UD)(new Uint8Array(e)).buffer}}}}]);
|